From 108a4fcc746aad69f7c0352929433eeadccb58c6 Mon Sep 17 00:00:00 2001 From: "COMPUTER\\EDY" <249929363@qq.com> Date: Tue, 27 Jan 2026 18:08:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=AF=8F=E6=97=A5=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E9=A2=86=E5=8F=96=E4=BC=98=E5=8C=96=EF=BC=8C=20?= =?UTF-8?q?=E6=9B=B4=E6=96=B01050=E5=85=B3=E5=8D=A1=E4=B8=8A=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../action_bundle/prefab/dailyQuests.prefab | 6 +-- assets/action_bundle/script/DailyQuests.ts | 38 +++++++++++-------- assets/resources/Window_Prop/daoju18.png.meta | 4 +- 3 files changed, 27 insertions(+), 21 deletions(-) diff --git a/assets/action_bundle/prefab/dailyQuests.prefab b/assets/action_bundle/prefab/dailyQuests.prefab index ea125ae..4dd89dd 100644 --- a/assets/action_bundle/prefab/dailyQuests.prefab +++ b/assets/action_bundle/prefab/dailyQuests.prefab @@ -9574,7 +9574,7 @@ }, "_contentSize": { "__type__": "cc.Size", - "width": 135, + "width": 172.51, "height": 56.7 }, "_anchorPoint": { @@ -9626,8 +9626,8 @@ ], "_srcBlendFactor": 770, "_dstBlendFactor": 771, - "_string": "请稍后", - "_N$string": "请稍后", + "_string": "请稍后...", + "_N$string": "请稍后...", "_fontSize": 45, "_lineHeight": 45, "_enableWrapText": true, diff --git a/assets/action_bundle/script/DailyQuests.ts b/assets/action_bundle/script/DailyQuests.ts index f73ac98..f7b26df 100644 --- a/assets/action_bundle/script/DailyQuests.ts +++ b/assets/action_bundle/script/DailyQuests.ts @@ -264,6 +264,8 @@ export default class DailyQuests extends cc.Component { } } } + // console.log("领取结果:", res.code, "关闭加载1"); + this.closeLoad(); } setReward(id) { @@ -283,13 +285,14 @@ export default class DailyQuests extends cc.Component { } openLoad() { - console.log("每日任务打开加载"); + console.log("每日任务打开加载2"); this.node.getChildByName("Loading").active = true; this.node.getChildByName("Loading").getChildByName("load").stopAllActions(); this.node.getChildByName("Loading").getChildByName("load").runAction(cc.rotateTo(2, 1080).repeatForever()); } openConfirmBox() { + console.log("每日任务打开确认框,关闭加载"); this.closeLoad(); this.node.getChildByName("ConfirmBox").active = true; } @@ -298,14 +301,16 @@ export default class DailyQuests extends cc.Component { } closeLoad() { - console.log("每日任务关闭加载"); + this.node.getChildByName("Loading").getChildByName("load").stopAllActions(); this.node.getChildByName("Loading").active = false; + console.log("每日任务关闭加载", this.node.getChildByName("Loading").active); + } //点击去完成 clickBtn(event, data) { + this.closeDailyQuests(); if (data == "useProp" || data == "levelPass" || "useEnergy" == data) { - this.closeDailyQuests(); const jiazaiNode = cc.find("Canvas"); // 假设 JiaZai 挂在 Canvas 节点 const jiazaiComp = jiazaiNode.getComponent(JiaZai); if (jiazaiComp) { @@ -313,6 +318,12 @@ export default class DailyQuests extends cc.Component { } } else if (data == "share") { + const jiazaiNode = cc.find("Canvas"); // 假设 JiaZai 挂在 Canvas 节点 + const jiazaiComp = jiazaiNode.getComponent(JiaZai); + if (jiazaiComp) { + jiazaiComp.shareIng = true; + jiazaiComp.shareTime = Math.floor(Date.now() / 1000); + } let iphoneArr = [ "https://mmocgame.qpic.cn/wechatgame/Lf3SBqy9XpNkakoIZygRzXqww3HTibq6VyibazqmicwibjCS3YpgqbZtkdyABm4Y1wAr/0", "https://mmocgame.qpic.cn/wechatgame/TWKuFxnCn7ksT3KXfhCC4yOfZeD4b0hrptDSJ2DFmwz02Yc8SppcwyPAOoS1MsMr/0", @@ -330,13 +341,6 @@ export default class DailyQuests extends cc.Component { }; // 调用微信分享 API if (cc.sys.platform === cc.sys.WECHAT_GAME) { - const jiazaiNode = cc.find("Canvas"); // 假设 JiaZai 挂在 Canvas 节点 - const jiazaiComp = jiazaiNode.getComponent(JiaZai); - this.closeDailyQuests(); - if (jiazaiComp) { - jiazaiComp.shareIng = true; - jiazaiComp.shareTime = Math.floor(Date.now() / 1000); - } //@ts-ignore wx.shareAppMessage(shareParams); @@ -351,14 +355,15 @@ export default class DailyQuests extends cc.Component { this.touchStart = false; this.reward = true; let shuju = [data]; + console.log("领取奖励", data, "打开加载1"); this.openLoad(); - console.log("领取奖励", data); + let jg = false; let self = this; Utils.getDailyQuestReward(shuju, (res) => { this.touchStart = true; this.reward = false; - self.closeLoad(); - console.log("领取结果:", res.code); + jg = true; + if (res.code == 1) { let dataNode = null; for (let i = 0; i < this.content.children.length; i++) { @@ -381,19 +386,20 @@ export default class DailyQuests extends cc.Component { } else { MiniGameSdk.API.showToast("网络异常,领取奖励失败"); + self.closeLoad(); } }) if (data != "share") { setTimeout(() => { if (this.node) { - this.node.getChildByName("Loading").active = true - if (this.reward == true && this.touchStart == false && this.node.getChildByName("Loading").active == true) { + if (jg == true && this.touchStart == false && this.node.getChildByName("Loading").active == true) { this.touchStart = true; + console.log("网络异常5秒后关闭加载", data, "关闭加载3"); this.closeLoad(); MiniGameSdk.API.showToast("网络异常,领取奖励失败"); } } - }, 5000); + }, 8000); } } diff --git a/assets/resources/Window_Prop/daoju18.png.meta b/assets/resources/Window_Prop/daoju18.png.meta index 3d537c9..0662f97 100644 --- a/assets/resources/Window_Prop/daoju18.png.meta +++ b/assets/resources/Window_Prop/daoju18.png.meta @@ -8,8 +8,8 @@ "premultiplyAlpha": false, "genMipmaps": false, "packable": true, - "width": 720, - "height": 784, + "width": 787, + "height": 782, "platformSettings": {}, "subMetas": { "daoju18": {