From fe660408e201017aad614d4cad305624dba9a4fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?computer=5C=E5=B0=BC=E5=8D=A1?= <203267346@qq.com> Date: Thu, 31 Jul 2025 18:25:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=B6=E9=97=B4=20=20=E9=BB=91=E5=BD=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/Scene/HomeScene.fire | 10 +++++----- assets/Script/monthlyCard.ts | 13 ++++++++++--- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/assets/Scene/HomeScene.fire b/assets/Scene/HomeScene.fire index 0fa8ea7..4741083 100644 --- a/assets/Scene/HomeScene.fire +++ b/assets/Scene/HomeScene.fire @@ -15018,7 +15018,7 @@ }, "_contentSize": { "__type__": "cc.Size", - "width": 1080, + "width": 1180, "height": 2340 }, "_anchorPoint": { @@ -15098,8 +15098,8 @@ "alignMode": 1, "_target": null, "_alignFlags": 45, - "_left": 0, - "_right": 0, + "_left": -50, + "_right": -50, "_top": -210, "_bottom": -210, "_verticalCenter": 0, @@ -15288,8 +15288,8 @@ 0, 0, 1, - 2, - 2, + 1, + 1, 1 ] }, diff --git a/assets/Script/monthlyCard.ts b/assets/Script/monthlyCard.ts index c28f0f5..fd31ef8 100644 --- a/assets/Script/monthlyCard.ts +++ b/assets/Script/monthlyCard.ts @@ -78,7 +78,7 @@ export default class NewClass extends cc.Component { if (res.code === 1) { console.log("_________正式发货"); MiniGameSdk.API.showToast("充值成功"); - + if (this.iosProductId == "month_Card") { this.buyMonthCard(this.iosProductId); } @@ -155,6 +155,13 @@ export default class NewClass extends cc.Component { } init() { this.btn_Touch = true; + const jiazaiNode = cc.find("Canvas"); // 假设 JiaZai 挂在 Canvas 节点 + const jiazaiComp = jiazaiNode.getComponent(JiaZai); + if (jiazaiComp) { + setTimeout(() => { + jiazaiComp.getMonthlyCardValidityDays(); + }, 300); + } Utils.getMonthlyCard((data) => { if (data.msg == "不在有效期") { this.monthCardBtn.active = true; @@ -175,7 +182,7 @@ export default class NewClass extends cc.Component { // let rewardData = [ // { type: "coin", count: 6000 }, // ] - cc.fx.GameTool.shopBuy(id, false); + cc.fx.GameTool.shopBuy(id, false); cc.fx.GameConfig.GM_INFO.hp_Max = 7; cc.fx.GameConfig.GM_INFO.hp = 7; // cc.fx.GameTool.changeCoin(6000); @@ -414,7 +421,7 @@ export default class NewClass extends cc.Component { if (res.code === 1) { console.log("7.14_________正式发货"); MiniGameSdk.API.showToast("充值成功"); - + if (productId == "month_Card") { this.buyMonthCard(productId); }