Files
18xchat/assets/Scripts/test/GirlDetailPanel.ts
T

45 lines
1.0 KiB
TypeScript
Raw Normal View History

2025-07-22 16:43:10 +08:00
import { _decorator, Component, Label, Node, Sprite } from "cc";
import { DemoManager } from "./DemoManager";
2025-07-25 15:20:02 +08:00
import {Character, characters} from "db://assets/Scripts/test/cfg/characters";
2025-07-25 18:27:30 +08:00
import li_BaseView from "db://assets/Scripts/Main/Common/li_BaseView";
import {ViewManager} from "db://assets/Scripts/Main/Manager/ViewManager";
2025-07-22 16:43:10 +08:00
const { ccclass, property } = _decorator;
@ccclass("GirlDetailPanel")
2025-07-25 18:27:30 +08:00
export class GirlDetailPanel extends li_BaseView {
2025-07-22 16:43:10 +08:00
@property(Sprite)
avatar: Sprite;
@property(Label)
girlName: Label;
@property(Label)
desc: Label;
@property(Node)
chatBtn: Node;
id = 0;
2025-07-25 15:20:02 +08:00
2025-07-25 18:27:30 +08:00
openUIDataCT(data)
{
this.id = data;
this.refresh(this.id);
}
2025-07-25 15:20:02 +08:00
refresh(index:number)
{
const data = characters[index-1];
this.girlName.string = data.name;
this.desc.string = data.description;
this.id = data.id;
2025-07-22 16:43:10 +08:00
}
OnClickChatBtn() {
DemoManager.getInstance().EnterChat(this.id);
2025-07-25 18:27:30 +08:00
this.onClose();
}
returnBtn()
{
this.onClose();
//ViewManager.I.openBundlesView("GirlListPanel");
2025-07-22 16:43:10 +08:00
}
}