更新每日任务领取优化, 更新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": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
"width": 135, "width": 172.51,
"height": 56.7 "height": 56.7
}, },
"_anchorPoint": { "_anchorPoint": {
@ -9626,8 +9626,8 @@
], ],
"_srcBlendFactor": 770, "_srcBlendFactor": 770,
"_dstBlendFactor": 771, "_dstBlendFactor": 771,
"_string": "请稍后", "_string": "请稍后...",
"_N$string": "请稍后", "_N$string": "请稍后...",
"_fontSize": 45, "_fontSize": 45,
"_lineHeight": 45, "_lineHeight": 45,
"_enableWrapText": true, "_enableWrapText": true,

View File

@ -264,6 +264,8 @@ export default class DailyQuests extends cc.Component {
} }
} }
} }
// console.log("领取结果:", res.code, "关闭加载1");
this.closeLoad();
} }
setReward(id) { setReward(id) {
@ -283,13 +285,14 @@ export default class DailyQuests extends cc.Component {
} }
openLoad() { openLoad() {
console.log("每日任务打开加载"); console.log("每日任务打开加载2");
this.node.getChildByName("Loading").active = true; this.node.getChildByName("Loading").active = true;
this.node.getChildByName("Loading").getChildByName("load").stopAllActions(); this.node.getChildByName("Loading").getChildByName("load").stopAllActions();
this.node.getChildByName("Loading").getChildByName("load").runAction(cc.rotateTo(2, 1080).repeatForever()); this.node.getChildByName("Loading").getChildByName("load").runAction(cc.rotateTo(2, 1080).repeatForever());
} }
openConfirmBox() { openConfirmBox() {
console.log("每日任务打开确认框,关闭加载");
this.closeLoad(); this.closeLoad();
this.node.getChildByName("ConfirmBox").active = true; this.node.getChildByName("ConfirmBox").active = true;
} }
@ -298,14 +301,16 @@ export default class DailyQuests extends cc.Component {
} }
closeLoad() { closeLoad() {
console.log("每日任务关闭加载"); this.node.getChildByName("Loading").getChildByName("load").stopAllActions();
this.node.getChildByName("Loading").active = false; this.node.getChildByName("Loading").active = false;
console.log("每日任务关闭加载", this.node.getChildByName("Loading").active);
} }
//点击去完成 //点击去完成
clickBtn(event, data) { clickBtn(event, data) {
this.closeDailyQuests();
if (data == "useProp" || data == "levelPass" || "useEnergy" == data) { if (data == "useProp" || data == "levelPass" || "useEnergy" == data) {
this.closeDailyQuests();
const jiazaiNode = cc.find("Canvas"); // 假设 JiaZai 挂在 Canvas 节点 const jiazaiNode = cc.find("Canvas"); // 假设 JiaZai 挂在 Canvas 节点
const jiazaiComp = jiazaiNode.getComponent(JiaZai); const jiazaiComp = jiazaiNode.getComponent(JiaZai);
if (jiazaiComp) { if (jiazaiComp) {
@ -313,6 +318,12 @@ export default class DailyQuests extends cc.Component {
} }
} }
else if (data == "share") { 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 = [ let iphoneArr = [
"https://mmocgame.qpic.cn/wechatgame/Lf3SBqy9XpNkakoIZygRzXqww3HTibq6VyibazqmicwibjCS3YpgqbZtkdyABm4Y1wAr/0", "https://mmocgame.qpic.cn/wechatgame/Lf3SBqy9XpNkakoIZygRzXqww3HTibq6VyibazqmicwibjCS3YpgqbZtkdyABm4Y1wAr/0",
"https://mmocgame.qpic.cn/wechatgame/TWKuFxnCn7ksT3KXfhCC4yOfZeD4b0hrptDSJ2DFmwz02Yc8SppcwyPAOoS1MsMr/0", "https://mmocgame.qpic.cn/wechatgame/TWKuFxnCn7ksT3KXfhCC4yOfZeD4b0hrptDSJ2DFmwz02Yc8SppcwyPAOoS1MsMr/0",
@ -330,13 +341,6 @@ export default class DailyQuests extends cc.Component {
}; };
// 调用微信分享 API // 调用微信分享 API
if (cc.sys.platform === cc.sys.WECHAT_GAME) { 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 //@ts-ignore
wx.shareAppMessage(shareParams); wx.shareAppMessage(shareParams);
@ -351,14 +355,15 @@ export default class DailyQuests extends cc.Component {
this.touchStart = false; this.touchStart = false;
this.reward = true; this.reward = true;
let shuju = [data]; let shuju = [data];
console.log("领取奖励", data, "打开加载1");
this.openLoad(); this.openLoad();
console.log("领取奖励", data); let jg = false;
let self = this; let self = this;
Utils.getDailyQuestReward(shuju, (res) => { Utils.getDailyQuestReward(shuju, (res) => {
this.touchStart = true; this.touchStart = true;
this.reward = false; this.reward = false;
self.closeLoad(); jg = true;
console.log("领取结果:", res.code);
if (res.code == 1) { if (res.code == 1) {
let dataNode = null; let dataNode = null;
for (let i = 0; i < this.content.children.length; i++) { for (let i = 0; i < this.content.children.length; i++) {
@ -381,19 +386,20 @@ export default class DailyQuests extends cc.Component {
} }
else { else {
MiniGameSdk.API.showToast("网络异常,领取奖励失败"); MiniGameSdk.API.showToast("网络异常,领取奖励失败");
self.closeLoad();
} }
}) })
if (data != "share") { if (data != "share") {
setTimeout(() => { setTimeout(() => {
if (this.node) { if (this.node) {
this.node.getChildByName("Loading").active = true if (jg == true && this.touchStart == false && this.node.getChildByName("Loading").active == true) {
if (this.reward == true && this.touchStart == false && this.node.getChildByName("Loading").active == true) {
this.touchStart = true; this.touchStart = true;
console.log("网络异常5秒后关闭加载", data, "关闭加载3");
this.closeLoad(); this.closeLoad();
MiniGameSdk.API.showToast("网络异常,领取奖励失败"); MiniGameSdk.API.showToast("网络异常,领取奖励失败");
} }
} }
}, 5000); }, 8000);
} }
} }

View File

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