update
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import { _decorator, Component, Label, Node, Sprite } from "cc";
|
||||
import { DemoManager } from "./DemoManager";
|
||||
import {Character, characters} from "db://assets/Scripts/test/cfg/characters";
|
||||
import li_BaseView from "db://assets/Scripts/Main/Common/li_BaseView";
|
||||
import {ViewManager} from "db://assets/Scripts/Main/Manager/ViewManager";
|
||||
import {characters, girlDetailInfo} from "db://assets/Scripts/Main/Config/cfg/characters";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass("GirlDetailPanel")
|
||||
@@ -11,6 +11,17 @@ export class GirlDetailPanel extends li_BaseView {
|
||||
avatar: Sprite;
|
||||
@property(Label)
|
||||
girlName: Label;
|
||||
|
||||
@property(Node)
|
||||
starParent: Node;
|
||||
|
||||
@property(Label)
|
||||
tags: Label;
|
||||
|
||||
@property(Label)
|
||||
descName: Label;
|
||||
@property(Label)
|
||||
descAge: Label;
|
||||
@property(Label)
|
||||
desc: Label;
|
||||
|
||||
@@ -21,15 +32,32 @@ export class GirlDetailPanel extends li_BaseView {
|
||||
openUIDataCT(data)
|
||||
{
|
||||
this.id = data;
|
||||
}
|
||||
|
||||
onLoadCT() {
|
||||
super.onLoadCT();
|
||||
this.refresh(this.id);
|
||||
|
||||
}
|
||||
|
||||
refresh(index:number)
|
||||
{
|
||||
const data = characters[index-1];
|
||||
this.girlName.string = data.name;
|
||||
this.desc.string = data.description;
|
||||
this.id = data.id;
|
||||
console.log(index);
|
||||
const data = girlDetailInfo.find(v=>v.baseInfo.id === index);
|
||||
this.girlName.string=this.descName.string = data.baseInfo.name;
|
||||
this.desc.string = data.detailDesc;
|
||||
let desc = '';
|
||||
for (let i = 0; i < data.baseInfo.tag.length; i++) {
|
||||
desc += data.baseInfo.tag[i]+"/";
|
||||
}
|
||||
this.tags.string = desc;
|
||||
for (let i = 0; i <5; i++) {
|
||||
this.starParent.children[i].active =(i<data.baseInfo.starCount);
|
||||
}
|
||||
this.descAge.string = data.baseInfo.age.toString();
|
||||
this.desc.string = data.detailDesc;
|
||||
|
||||
this.id = data.baseInfo.id;
|
||||
}
|
||||
OnClickChatBtn() {
|
||||
DemoManager.getInstance().EnterChat(this.id);
|
||||
|
||||
Reference in New Issue
Block a user