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"; const { ccclass, property } = _decorator; @ccclass("GirlDetailPanel") export class GirlDetailPanel extends li_BaseView { @property(Sprite) avatar: Sprite; @property(Label) girlName: Label; @property(Label) desc: Label; @property(Node) chatBtn: Node; id = 0; openUIDataCT(data) { this.id = data; 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; } OnClickChatBtn() { DemoManager.getInstance().EnterChat(this.id); this.onClose(); } returnBtn() { this.onClose(); //ViewManager.I.openBundlesView("GirlListPanel"); } }