Files
18xchat/assets/Scripts/chat18x/ui/panels/PopupGirlDetailPanel.ts
T
2025-09-09 20:57:42 +08:00

53 lines
1.8 KiB
TypeScript

import { _decorator, Component, Node, Label } from "cc";
import li_BaseView from "../../../Main/Common/li_BaseView";
import { GButton } from "../../../Main/Common/GButton";
import Utils from "../../../Main/Common/Utils";
import { DetailImageItem } from "../../uiitems/DetailImageItem";
import { GirlService } from "db://assets/Scripts/chat18x/network/services/GirlService";
import { DataManager, DataId } from "../../data/DataManager";
import { GirlData } from "../../data/GirlData";
import { WalletData } from "../../data/WalletData";
import proto from "db://assets/Scripts/proto/proto.pb.js";
const { ccclass, property } = _decorator;
@ccclass("PopupGirlDetailPanel")
export class PopupGirlDetailPanel extends li_BaseView {
private _nodeTab: any = {};
private priceLabel: Label;
private category: number;
private girlId: number;
private resId: number;
private base: DetailImageItem;
openUIDataCT(data) {
this.category = data.category;
this.resId = data.resId;
this.girlId = data.girlId;
this.base = data.base;
}
onLoadCT() {
Utils.parseNode(this.node, this._nodeTab);
const girlData = DataManager.I.getDataById<GirlData>(DataId.Girl);
// 价格
this.priceLabel = this._nodeTab.Price.getComponent(Label);
this.priceLabel.string = girlData.getGrilPhotoOriginalPrice(this.category.toString(), this.girlId, this.resId).toString();
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 + "---" + this.resId);
const success = true;
if (success) {
this.close();
this.base.refreshVideoBuy(true);
}
}
}