修复一个小问题

This commit is contained in:
COMPUTER\EDY 2026-01-13 19:22:49 +08:00
parent b6fa95e3a2
commit 667c1c6863
2 changed files with 118 additions and 105 deletions

View File

@ -156,6 +156,13 @@ export default class JiaZai extends cc.Component {
this.Stamina.parent.getChildByName("xinshou").active = false; this.Stamina.parent.getChildByName("xinshou").active = false;
this.winStreakShow = false; this.winStreakShow = false;
this.checkStarter_pack(); this.checkStarter_pack();
// Utils.getShopDouble(res => {
// if (res.code === 1) {
// console.log("获取到的shopDouble", res.data.shopDouble);
// cc.fx.GameConfig.GM_INFO.shopDouble = res.data.shopDouble;
// }
// })
//每日任务 //每日任务
this.dailyQuestsShow = false; this.dailyQuestsShow = false;
@ -1365,109 +1372,115 @@ export default class JiaZai extends cc.Component {
console.error('获取系统信息失败', e); console.error('获取系统信息失败', e);
} }
if (cc.fx.GameConfig.GM_INFO.allOutTradeNo) { if (cc.fx.GameConfig.GM_INFO.allOutTradeNo) {
if (cc.fx.GameConfig.GM_INFO.allOutTradeNo.length != 0) { Utils.getShopDouble(res => {
console.log("有需要补发数据", cc.fx.GameConfig.GM_INFO.allOutTradeNo); if (res.code === 1) {
console.log("获取到的shopDouble", res.data.shopDouble);
cc.fx.GameConfig.GM_INFO.shopDouble = res.data.shopDouble;
if (cc.fx.GameConfig.GM_INFO.allOutTradeNo.length != 0) {
console.log("有需要补发数据", cc.fx.GameConfig.GM_INFO.allOutTradeNo);
// 递归函数,按顺序处理每个订单 // 递归函数,按顺序处理每个订单
const processOrder = (index: number) => { const processOrder = (index: number) => {
if (index >= cc.fx.GameConfig.GM_INFO.allOutTradeNo.length) { if (index >= cc.fx.GameConfig.GM_INFO.allOutTradeNo.length) {
// 所有订单处理完成,清空数组 // 所有订单处理完成,清空数组
cc.fx.GameConfig.GM_INFO.allOutTradeNo = []; cc.fx.GameConfig.GM_INFO.allOutTradeNo = [];
console.log("补发逻辑全部完成已清空allOutTradeNo数组"); console.log("补发逻辑全部完成已清空allOutTradeNo数组");
return; // 所有订单处理完成 return; // 所有订单处理完成
} }
let order = cc.fx.GameConfig.GM_INFO.allOutTradeNo[index];
console.log("需要补发数据", order);
if (order.itemid == "gold_1" || order.itemid == "gold_2" || order.itemid == "gold_3"
|| order.itemid == "gold_4" || order.itemid == "gold_5" || order.itemid == "gold_6"
|| order.itemid == "unlimited_health_bundle_10" || order.itemid == "unlimited_health_bundle_20"
|| order.itemid == "unlimited_health_bundle_30" || order.itemid == "month_Card" || "reborn_Gift"
|| order.itemid == "starter_pack" || order.itemid == "battlepass"
) {
this.openLoad();
console.log("补发名称:", order.itemid);
let productId = order.itemid;
Utils.setPayInfo(
(res) => {
console.log("设置轮训结果:", res);
this.closeLoad();
if (res.code === 1) {
console.log("7.14_________正式发货");
let coinTemp = 0;
if (order.itemid == "gold_1") { coinTemp = 1200; }
else if (order.itemid == "gold_2") { coinTemp = 8000; }
else if (order.itemid == "gold_3") { coinTemp = 16000; }
else if (order.itemid == "gold_4") { coinTemp = 32000; }
else if (order.itemid == "gold_5") { coinTemp = 100000; }
else if (order.itemid == "gold_6") { coinTemp = 240000; }
else if (order.itemid == "unlimited_health_bundle_10") { coinTemp = 2500; }
else if (order.itemid == "unlimited_health_bundle_20") { coinTemp = 5000; }
else if (order.itemid == "unlimited_health_bundle_30") { coinTemp = 7500; }
else if (order.itemid == "month_Card") {
coinTemp = 6000;
cc.fx.GameConfig.GM_INFO.doubleCoin = 2;
cc.fx.GameConfig.GM_INFO.hp_Max = 7;
cc.fx.GameConfig.GM_INFO.hp = 7;
this.openLoad();
this.buyMonthCard(productId);
}
else if (order.itemid == "reborn_Gift") {
coinTemp = 1000;
}
else if (order.itemid == "starter_pack") {
coinTemp = 3000;
cc.fx.GameConfig.GM_INFO.doubleCoin = 5;
cc.fx.GameConfig.GM_INFO.hp_Max = 5;
cc.fx.GameConfig.GM_INFO.hp = 5;
} else if (order.itemid == "battlepass") {
// 通行证订单
this.reissuePaaCheck();
}
let title = "充值补发奖励金币:" + coinTemp;
// MiniGameSdk.API.showToast(title);
if (order.itemid != "month_Card") cc.fx.GameTool.shopBuy(productId, true);
console.log("充值成功获得金币");
let price = parseInt(order.goodsPrice) || 0;
// const dataSuccess = {
// outTradeNo: order.outTradeNo,
// pay_amount: price,
// payment_name: productId,
// payment_num: 1,
// type: systemType,
// }
let name = "补发充值成功" + productId;
// cc.fx.GameTool.shushu_Track("payment", dataSuccess);
let order = cc.fx.GameConfig.GM_INFO.allOutTradeNo[index]; // console.log("引力付费透传", price, order.outTradeNo, name);
console.log("需要补发数据", order); MiniGameSdk.API.yinli_Pay(price, order.outTradeNo, name);
if (order.itemid == "gold_1" || order.itemid == "gold_2" || order.itemid == "gold_3" }
|| order.itemid == "gold_4" || order.itemid == "gold_5" || order.itemid == "gold_6" else {
|| order.itemid == "unlimited_health_bundle_10" || order.itemid == "unlimited_health_bundle_20" MiniGameSdk.API.showToast("网络异常,充值奖励将在登录后再次发放");
|| order.itemid == "unlimited_health_bundle_30" || order.itemid == "month_Card" || "reborn_Gift" const dataFail4 = {
|| order.itemid == "starter_pack" || order.itemid == "battlepass" outTradeNo: order.outTradeNo,
) { pay_amount: parseInt(order.goodsPrice) || 0,
this.openLoad(); payment_name: productId,
console.log("补发名称:", order.itemid); payment_num: 1,
let productId = order.itemid; type: systemType,
Utils.setPayInfo( fail_reason: "成功付款,但是发货时请求服务器失败,重新进入游戏后轮训发货又失败",
(res) => { }
console.log("设置轮训结果:", res); cc.fx.GameTool.shushu_Track("payment_fail", dataFail4);
this.closeLoad(); }
if (res.code === 1) { NumberToImage.numberToImageNodes5(cc.fx.GameConfig.GM_INFO.coin, 30, 15, "Black", this.coin, true);
console.log("7.14_________正式发货"); this.updateCoin();
let coinTemp = 0; // 处理下一个订单
if (order.itemid == "gold_1") { coinTemp = 1200; } processOrder(index + 1);
else if (order.itemid == "gold_2") { coinTemp = 8000; } }, order.outTradeNo);
else if (order.itemid == "gold_3") { coinTemp = 16000; } } else {
else if (order.itemid == "gold_4") { coinTemp = 32000; } // 如果当前订单不处理,直接处理下一个订单
else if (order.itemid == "gold_5") { coinTemp = 100000; }
else if (order.itemid == "gold_6") { coinTemp = 240000; }
else if (order.itemid == "unlimited_health_bundle_10") { coinTemp = 2500; }
else if (order.itemid == "unlimited_health_bundle_20") { coinTemp = 5000; }
else if (order.itemid == "unlimited_health_bundle_30") { coinTemp = 7500; }
else if (order.itemid == "month_Card") {
coinTemp = 6000;
cc.fx.GameConfig.GM_INFO.doubleCoin = 2;
cc.fx.GameConfig.GM_INFO.hp_Max = 7;
cc.fx.GameConfig.GM_INFO.hp = 7;
this.openLoad();
this.buyMonthCard(productId);
}
else if (order.itemid == "reborn_Gift") {
coinTemp = 1000;
}
else if (order.itemid == "starter_pack") {
coinTemp = 3000;
cc.fx.GameConfig.GM_INFO.doubleCoin = 5;
cc.fx.GameConfig.GM_INFO.hp_Max = 5;
cc.fx.GameConfig.GM_INFO.hp = 5;
} else if (order.itemid == "battlepass") {
// 通行证订单
this.reissuePaaCheck();
}
let title = "充值补发奖励金币:" + coinTemp;
// MiniGameSdk.API.showToast(title);
if (order.itemid != "month_Card") cc.fx.GameTool.shopBuy(productId, true);
console.log("充值成功获得金币");
let price = parseInt(order.goodsPrice) || 0;
// const dataSuccess = {
// outTradeNo: order.outTradeNo,
// pay_amount: price,
// payment_name: productId,
// payment_num: 1,
// type: systemType,
// }
let name = "补发充值成功" + productId;
// cc.fx.GameTool.shushu_Track("payment", dataSuccess);
// console.log("引力付费透传", price, order.outTradeNo, name);
MiniGameSdk.API.yinli_Pay(price, order.outTradeNo, name);
}
else {
MiniGameSdk.API.showToast("网络异常,充值奖励将在登录后再次发放");
const dataFail4 = {
outTradeNo: order.outTradeNo,
pay_amount: parseInt(order.goodsPrice) || 0,
payment_name: productId,
payment_num: 1,
type: systemType,
fail_reason: "成功付款,但是发货时请求服务器失败,重新进入游戏后轮训发货又失败",
}
cc.fx.GameTool.shushu_Track("payment_fail", dataFail4);
}
NumberToImage.numberToImageNodes5(cc.fx.GameConfig.GM_INFO.coin, 30, 15, "Black", this.coin, true);
this.updateCoin();
// 处理下一个订单
processOrder(index + 1); processOrder(index + 1);
}, order.outTradeNo); }
} else { };
// 如果当前订单不处理,直接处理下一个订单
processOrder(index + 1); // 从第一个订单开始处理
} processOrder(0);
}; }
}
})
// 从第一个订单开始处理
processOrder(0);
}
} }
} }

View File

@ -188,11 +188,11 @@ export default class MapConroler extends cc.Component {
onLoad() { onLoad() {
//以下为检验关卡 //以下为检验关卡
// console.log("当前关卡", cc.fx.GameConfig.GM_INFO.level); console.log("当前关卡", cc.fx.GameConfig.GM_INFO.level);
// setTimeout(() => { setTimeout(() => {
// cc.fx.GameConfig.GM_INFO.level += 1; cc.fx.GameConfig.GM_INFO.level += 1;
// cc.fx.GameConfig.LEVEL_INFO_init(true, 0, false); cc.fx.GameConfig.LEVEL_INFO_init(true, 0, false);
// }, 1000); }, 1000);
cc.fx.GameConfig.GM_INFO.sceneValue = "GameScene"; cc.fx.GameConfig.GM_INFO.sceneValue = "GameScene";
@ -5171,7 +5171,7 @@ export default class MapConroler extends cc.Component {
} }
endlessLevelShow() { endlessLevelShow() {
console.log("刷新关卡等级", cc.fx.GameTool.maxLevel(), cc.fx.GameConfig.GM_INFO.endLevelNum); // console.log("刷新关卡等级", cc.fx.GameTool.maxLevel(), cc.fx.GameConfig.GM_INFO.endLevelNum);
let top = this.node.parent.getChildByName("Top"); let top = this.node.parent.getChildByName("Top");
top.getChildByName("shareBtn").active = true; top.getChildByName("shareBtn").active = true;
this.node.parent.parent.parent.getChildByName("Pause").getChildByName("share").active = true; this.node.parent.parent.parent.getChildByName("Pause").getChildByName("share").active = true;