import { _decorator, Button, Component, Node } from "cc"; import li_BaseView from "../../../Main/Common/li_BaseView"; import Utils from "../../../Main/Common/Utils"; import { GButton } from "../../../Main/Common/GButton"; import { PopupGirlDetailPanel } from "./PopupGirlDetailPanel"; import { GirlListItem } from "../../uiitems/GirlListItem"; const { ccclass, property } = _decorator; @ccclass("GirlListPopupPanel") export class GirlListPopupPanel extends li_BaseView { private _nodeTab: any = {}; private girlId: number; base: GirlListItem; openUIDataCT(data) { this.girlId = data.id; this.base = data.base; } onLoadCT() { Utils.parseNode(this.node, this._nodeTab); this.registerListener(); } registerListener() { GButton.BandClick(this._nodeTab.BuyBtn, this.buyCharacter, this); GButton.BandClick(this._nodeTab.CloseBtn, this.Close, this); } Close() { this.close(); } buyCharacter() { // 购买id为girlId的女生 console.log(this.girlId); if (true) { this.base.refreshBuy(true); this.close(); } } }