修改 未解锁也能进入详情页,详情页增加购买弹窗

This commit is contained in:
2025-09-22 11:59:38 +08:00
parent fe534cacaf
commit 0aaf5b9c08
16 changed files with 6344 additions and 2287 deletions
@@ -77,6 +77,10 @@ export class GirlDetailPanel extends li_BaseView {
imgsLayout: Node;
videoAreaPos: Vec3;
@property(Label)
girlPrice: Label;
@property(Node)
sendMsgText: Node;
protected onEnable(): void {
this.refresh();
@@ -85,8 +89,6 @@ export class GirlDetailPanel extends li_BaseView {
onLoadCT() {
super.onLoadCT();
//this.refresh();
DetailImageItemPool.Instance.setTemplate(this.imgItemInst.node);
Utils.addInnerEL(InnerMsgCode.LanguageChange, this, () => {
@@ -168,6 +170,22 @@ export class GirlDetailPanel extends li_BaseView {
}
const girlData = DataManager.I.getDataById<GirlData>(DataId.Girl);
const isRelease = girlData.getIsRelease(this.category.toString(), this.id);
const isFree = girlData.isGirlFreeType(this.category.toString(), this.id);
if (isRelease || isFree) {
// 先设置选中的角色ID
this.girlPrice.node.active = false;
this.sendMsgText.active = true;
} else {
this.girlPrice.node.active = true;
this.sendMsgText.active = false;
this.girlPrice.string = girlData
.getGrilOriginalPrice(this.category.toString(), this.id)
.toString();
}
// 请求详细数据
const reqData = {
id: this.id,
@@ -315,18 +333,31 @@ export class GirlDetailPanel extends li_BaseView {
}
OnClickChatBtn() {
// 使用带过渡动画的导航方法
NavigationManager.Instance.switchToPanel(
PanelType.PAST_GIRL_LIST,
false,
(base) => {
const chatData = { girlId: this.id, base: base };
NavigationManager.Instance.openSubPanel("ChatPanel", base, chatData, {
openAnimation: PageTransitionType.SLIDE_LEFT,
closeAnimation: PageTransitionType.SLIDE_RIGHT,
});
}
);
const girlData = DataManager.I.getDataById<GirlData>(DataId.Girl);
const isRelease = girlData.getIsRelease(this.category.toString(), this.id);
const isFree = girlData.isGirlFreeType(this.category.toString(), this.id);
if (isRelease || isFree) {
// 使用带过渡动画的导航方法
NavigationManager.Instance.switchToPanel(
PanelType.PAST_GIRL_LIST,
false,
(base) => {
const chatData = { girlId: this.id, base: base };
NavigationManager.Instance.openSubPanel("ChatPanel", base, chatData, {
openAnimation: PageTransitionType.SLIDE_LEFT,
closeAnimation: PageTransitionType.SLIDE_RIGHT,
});
}
);
} else {
//未解锁
NavigationManager.Instance.openPopupPanel("GirlListPopupPanel", {
base: this,
category: this.category,
id: this.id,
});
}
}
returnBtn() {