设置页面资源
This commit is contained in:
2025-09-10 18:12:26 +08:00
parent cb2b8e76ea
commit 24c2a946a3
64 changed files with 7534 additions and 1023 deletions
@@ -9,6 +9,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("GirlListPopupPanel")
@@ -18,6 +19,9 @@ export class GirlListPopupPanel extends li_BaseView {
private category: number;
private girlId: number;
private girlName: Label;
private girlTag: Label;
base: GirlListItem;
openUIDataCT(data) {
this.category = data.category;
@@ -26,11 +30,22 @@ export class GirlListPopupPanel extends li_BaseView {
}
onLoadCT() {
Utils.parseNode(this.node, this._nodeTab);
this.girlName = this._nodeTab.Name.getComponent(Label);
this.girlTag = this._nodeTab.Tag.getComponent(Label);
const girlData = DataManager.I.getDataById<GirlData>(DataId.Girl);
// 价格
this.priceLabel = this._nodeTab.Price.getComponent(Label);
this.priceLabel.string = girlData.getGrilOriginalPrice(this.category.toString(), this.girlId).toString();
this.priceLabel.string = girlData
.getGrilOriginalPrice(this.category.toString(), this.girlId)
.toString();
this.registerListener();
this.girlName.string = LanguageUtils.getText(
girlData.getGrilName(this.category.toString(), this.girlId)
);
this.girlTag.string = LanguageUtils.getText(
girlData.getGrilTagKey(this.category.toString(), this.girlId)
);
}
registerListener() {
GButton.BandClick(this._nodeTab.BuyBtn, this.buyCharacter, this);
@@ -58,7 +73,7 @@ export class GirlListPopupPanel extends li_BaseView {
walletData.vipExpire = Number(resData.vipExpire);
// 刷新界面
this.base.refreshBuy(true);
this.close();
this.close();
}
}
}
@@ -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();
}
}
}
+33 -19
View File
@@ -24,7 +24,7 @@ import { ThemeData } from "../../data/ThemeData";
import { GirlData } from "../../data/GirlData";
import { WalletData } from "../../data/WalletData";
import { AccountData } from "../../data/AccountData";
import proto from 'db://assets/Scripts/proto/proto.pb.js';
import proto from "db://assets/Scripts/proto/proto.pb.js";
const { ccclass, property } = _decorator;
@@ -74,9 +74,7 @@ export class ThemePanel extends li_BaseView {
}
}
// 请求主题数据
const reqData = {
};
const reqData = {};
let res = await ThemeService.I.reqHallTheme(reqData);
if (res && res.code === proto.cs.EnmRetCode.SUCCESS) {
// 保存数据
@@ -90,14 +88,12 @@ export class ThemePanel extends li_BaseView {
item.refresh(id);
newNode.active = true;
this.cache.push(item);
this.content.addChild(newNode);
this.content.addChild(newNode);
}
}
// 请求每日推荐
const reqData2 = {
};
const reqData2 = {};
let res2 = await GirlService.I.reqDailyRecommend(reqData2);
if (res2 && res2.code === proto.cs.EnmRetCode.SUCCESS) {
const girlData = DataManager.I.getDataById<GirlData>(DataId.Girl);
@@ -136,10 +132,10 @@ export class ThemePanel extends li_BaseView {
});
Utils.addInnerEL(InnerMsgCode.BalanceChange, this, () => {
this.refreshCoinNum();
});
});
Utils.addInnerEL(InnerMsgCode.VipExpireChange, this, () => {
this.refreshVipExpire();
});
});
}
enterShop() {
@@ -147,7 +143,29 @@ export class ThemePanel extends li_BaseView {
}
chatWithRec() {
NavigationManager.Instance.navigateToChat(this.recId);
const girlData = DataManager.I.getDataById<GirlData>(DataId.Girl);
// 是否已经解锁
const isRelease = girlData.getIsRelease(
girlData.getGrilCategoryById(this.recId).toString(),
this.recId
);
const isFree =
girlData.getGrilPrice(
girlData.getGrilCategoryById(this.recId).toString(),
this.recId
) == 0;
if (isRelease || isFree) {
NavigationManager.Instance.navigateToGirlDetail(this.recId);
ViewManager.I.closeView(this.node);
} else {
//未解锁
ViewManager.I.openBundlesPopupView("GirlListPopupPanel", {
base: this,
category: girlData.getGrilCategoryById(this.recId),
id: this.recId,
});
}
}
openSetting() {
@@ -172,18 +190,14 @@ export class ThemePanel extends li_BaseView {
const leftTime = Utils.formatVipLeftTime(vipExpire);
this.vipLeftTime.string = LanguageUtils.getText(
"purchasepanel.vip_left"
).replace("${leftTime}", leftTime);
}
).replace("${leftTime}", leftTime);
}
onDestroy(): void {
Utils.removeInnerEL(InnerMsgCode.LanguageChange, this, () => {
this.recName.string = LanguageUtils.getText(this.rectNameKey);
});
Utils.removeInnerEL(InnerMsgCode.BalanceChange, this, () => {
});
Utils.removeInnerEL(InnerMsgCode.VipExpireChange, this, () => {
});
Utils.removeInnerEL(InnerMsgCode.BalanceChange, this, () => {});
Utils.removeInnerEL(InnerMsgCode.VipExpireChange, this, () => {});
}
}