fix
设置页面资源
This commit is contained in:
@@ -8,6 +8,7 @@ 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";
|
||||
import LanguageUtils from "../../../Main/Common/LanguageUtils";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass("PopupGirlDetailPanel")
|
||||
@@ -19,6 +20,8 @@ export class PopupGirlDetailPanel extends li_BaseView {
|
||||
private resId: number;
|
||||
private type: proto.cs.EnmResType;
|
||||
private base: DetailImageItem;
|
||||
|
||||
private desc: Label;
|
||||
openUIDataCT(data) {
|
||||
this.category = data.category;
|
||||
this.resId = data.resId;
|
||||
@@ -28,16 +31,35 @@ export class PopupGirlDetailPanel extends li_BaseView {
|
||||
}
|
||||
onLoadCT() {
|
||||
Utils.parseNode(this.node, this._nodeTab);
|
||||
this.desc = this._nodeTab.content.getComponent(Label);
|
||||
|
||||
let descText = LanguageUtils.getText("popupgirldetailpanel.content");
|
||||
|
||||
const girlData = DataManager.I.getDataById<GirlData>(DataId.Girl);
|
||||
// 价格
|
||||
this.priceLabel = this._nodeTab.Price.getComponent(Label);
|
||||
if (this.type === proto.cs.EnmResType.ERT_Image) {
|
||||
// 图片
|
||||
this.priceLabel.string = girlData.getGrilPhotoOriginalPrice(this.category.toString(), this.girlId, this.resId).toString();
|
||||
this.priceLabel.string = girlData
|
||||
.getGrilPhotoOriginalPrice(
|
||||
this.category.toString(),
|
||||
this.girlId,
|
||||
this.resId
|
||||
)
|
||||
.toString();
|
||||
} else if (this.type === proto.cs.EnmResType.ERT_Video) {
|
||||
// 视频
|
||||
this.priceLabel.string = girlData.getGrilVideoOriginalPrice(this.category.toString(), this.girlId, this.resId).toString();
|
||||
this.priceLabel.string = girlData
|
||||
.getGrilVideoOriginalPrice(
|
||||
this.category.toString(),
|
||||
this.girlId,
|
||||
this.resId
|
||||
)
|
||||
.toString();
|
||||
}
|
||||
|
||||
this.desc.string = descText.replace("{price}", this.priceLabel.string);
|
||||
|
||||
this.registerListener();
|
||||
}
|
||||
registerListener() {
|
||||
@@ -75,7 +97,7 @@ export class PopupGirlDetailPanel extends li_BaseView {
|
||||
walletData.vipExpire = Number(resData.vipExpire);
|
||||
// 刷新界面
|
||||
this.base.refreshVideoBuy(true);
|
||||
this.close();
|
||||
this.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user