修改 未解锁也能进入详情页,详情页增加购买弹窗
This commit is contained in:
@@ -182,7 +182,7 @@ export class ChatPanel extends li_BaseView implements IChatPanelCallback {
|
||||
);
|
||||
if (!isFree && !isRelease) {
|
||||
//未解锁
|
||||
NavigationManager.Instance.openPopupPanel("GirlListPopupPanel", {
|
||||
NavigationManager.Instance.openPopupPanel("GirlListPopupPanel-Fix", {
|
||||
base: this,
|
||||
category: this.categoryId,
|
||||
id: this.id,
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -243,9 +243,13 @@ export class PurchasePanel extends li_BaseView {
|
||||
const walletData = DataManager.I.getDataById<WalletData>(DataId.Wallet);
|
||||
const vipExpire = walletData.vipExpire;
|
||||
const leftTime = Utils.formatVipLeftTime(vipExpire);
|
||||
this.vipLeftTime.string = LanguageUtils.getText(
|
||||
"purchasepanel.vip_left"
|
||||
).replace("${leftTime}", leftTime);
|
||||
if (leftTime == null) {
|
||||
LanguageUtils.getText("purchasepanel.notvip");
|
||||
} else {
|
||||
this.vipLeftTime.string = LanguageUtils.getText(
|
||||
"purchasepanel.vip_left"
|
||||
).replace("${leftTime}", leftTime);
|
||||
}
|
||||
}
|
||||
|
||||
// 使用余额购买商品
|
||||
|
||||
@@ -357,9 +357,14 @@ export class ThemePanel extends li_BaseView {
|
||||
const vipExpire = walletData.vipExpire;
|
||||
|
||||
const leftTime = Utils.formatVipLeftTime(vipExpire);
|
||||
this.vipLeftTime.string = LanguageUtils.getText(
|
||||
"purchasepanel.vip_left"
|
||||
).replace("${leftTime}", leftTime);
|
||||
|
||||
if (leftTime == null) {
|
||||
LanguageUtils.getText("purchasepanel.notvip");
|
||||
} else {
|
||||
this.vipLeftTime.string = LanguageUtils.getText(
|
||||
"purchasepanel.vip_left"
|
||||
).replace("${leftTime}", leftTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user