diff --git a/assets/Script/JiaZai.ts b/assets/Script/JiaZai.ts index 3e4ccea..3202010 100644 --- a/assets/Script/JiaZai.ts +++ b/assets/Script/JiaZai.ts @@ -156,6 +156,13 @@ export default class JiaZai extends cc.Component { this.Stamina.parent.getChildByName("xinshou").active = false; this.winStreakShow = false; 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; @@ -1365,109 +1372,115 @@ export default class JiaZai extends cc.Component { console.error('获取系统信息失败', e); } if (cc.fx.GameConfig.GM_INFO.allOutTradeNo) { - if (cc.fx.GameConfig.GM_INFO.allOutTradeNo.length != 0) { - console.log("有需要补发数据", cc.fx.GameConfig.GM_INFO.allOutTradeNo); + Utils.getShopDouble(res => { + 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) => { - if (index >= cc.fx.GameConfig.GM_INFO.allOutTradeNo.length) { - // 所有订单处理完成,清空数组 - cc.fx.GameConfig.GM_INFO.allOutTradeNo = []; - console.log("补发逻辑全部完成,已清空allOutTradeNo数组"); - return; // 所有订单处理完成 - } + // 递归函数,按顺序处理每个订单 + const processOrder = (index: number) => { + if (index >= cc.fx.GameConfig.GM_INFO.allOutTradeNo.length) { + // 所有订单处理完成,清空数组 + cc.fx.GameConfig.GM_INFO.allOutTradeNo = []; + console.log("补发逻辑全部完成,已清空allOutTradeNo数组"); + 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("需要补发数据", 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); - - // 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(); - // 处理下一个订单 + // 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); + }, order.outTradeNo); + } else { + // 如果当前订单不处理,直接处理下一个订单 processOrder(index + 1); - }, order.outTradeNo); - } else { - // 如果当前订单不处理,直接处理下一个订单 - processOrder(index + 1); - } - }; + } + }; + + // 从第一个订单开始处理 + processOrder(0); + } + } + }) - // 从第一个订单开始处理 - processOrder(0); - } } } diff --git a/assets/Script/Map.ts b/assets/Script/Map.ts index 43e6d82..d482982 100644 --- a/assets/Script/Map.ts +++ b/assets/Script/Map.ts @@ -188,11 +188,11 @@ export default class MapConroler extends cc.Component { onLoad() { //以下为检验关卡 - // console.log("当前关卡", cc.fx.GameConfig.GM_INFO.level); - // setTimeout(() => { - // cc.fx.GameConfig.GM_INFO.level += 1; - // cc.fx.GameConfig.LEVEL_INFO_init(true, 0, false); - // }, 1000); + console.log("当前关卡", cc.fx.GameConfig.GM_INFO.level); + setTimeout(() => { + cc.fx.GameConfig.GM_INFO.level += 1; + cc.fx.GameConfig.LEVEL_INFO_init(true, 0, false); + }, 1000); cc.fx.GameConfig.GM_INFO.sceneValue = "GameScene"; @@ -5171,7 +5171,7 @@ export default class MapConroler extends cc.Component { } 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"); top.getChildByName("shareBtn").active = true; this.node.parent.parent.parent.getChildByName("Pause").getChildByName("share").active = true;