更新每日任务领取优化, 更新1050关卡上限

This commit is contained in:
COMPUTER\EDY 2026-01-27 18:08:14 +08:00
parent da7d89eb6f
commit 108a4fcc74
3 changed files with 27 additions and 21 deletions

View File

@ -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,

View File

@ -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);
}
}

View File

@ -8,8 +8,8 @@
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 720,
"height": 784,
"width": 787,
"height": 782,
"platformSettings": {},
"subMetas": {
"daoju18": {