diff --git a/assets/Script/JiaZai.ts b/assets/Script/JiaZai.ts index bb0b65ff..1fe18499 100644 --- a/assets/Script/JiaZai.ts +++ b/assets/Script/JiaZai.ts @@ -12,6 +12,7 @@ import { MiniGameSdk } from "./Sdk/MiniGameSdk"; import { LQCollideSystem } from "./lq_collide_system/lq_collide_system"; import AudioManager from "./module/Music/AudioManager"; import Utils from "./module/Pay/Utils"; +import { applyStarterPackStatus, starterPackRemaining, starterPackTimeText, starterPackDay, starterPackPopupKey, starterPackReward } from "./module/Config/StarterPack"; import { initProvinceLocator } from "./module/Position/GetPosition"; import LoadingCatAnimation from "./LoadingCatAnimation"; import BlockAssetManager from "./module/Tool/BlockAssetManager"; @@ -78,6 +79,8 @@ export default class JiaZai extends cc.Component { private jungleSettlementRequestTimeout: any = null; private pendingJungleSettlement: any = null; private starterPackDefaultPosition: cc.Vec2 = null; + private starterPackOpening = false; + private starterPackChecking = false; // 缓存 reward 预制体 private static cachedRewardPrefab: cc.Prefab | null = null; @@ -413,7 +416,7 @@ export default class JiaZai extends cc.Component { this.checkShare(); this.queueHomeAutomaticTask("首页头像", () => this.closeAvatar()); this.setShareInfo(); - this.checkTasks(); + // this.checkTasks();//TODO:恢复 if (!cc.fx.GameTool.maxLevel()) { this.specialLevelShow(); } @@ -2621,10 +2624,12 @@ export default class JiaZai extends cc.Component { 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; + coinTemp = starterPackReward().coin; + cc.fx.GameConfig.GM_INFO.starterPackPurchased = true; + if (canUpdateHome()) { + this.newbieGift = false; + this.startStarter_pack(); + } } else if (order.itemid == "battlepass") { // 通行证订单 this.reissuePaaCheck(); @@ -2632,7 +2637,7 @@ export default class JiaZai extends cc.Component { let title = "充值补发奖励金币:" + coinTemp; // MiniGameSdk.API.showToast(title); if (order.itemid != "month_Card") - cc.fx.GameTool.shopBuy(productId, true); + cc.fx.GameTool.shopBuy(productId, true, productId === "starter_pack" ? { outTradeNo: order.outTradeNo } : null); // console.log("充值成功获得金币"); let price = parseInt(order.goodsPrice) || 0; // const dataSuccess = { @@ -2817,79 +2822,47 @@ export default class JiaZai extends cc.Component { // ============================================ // 打开通行证弹窗 openStarter_pack(event?: cc.Event, customEventData?: string) { - if (!this.isHomeRuntimeAlive() || cc.fx.GameConfig.isGameplayEntryPreparing()) return; + if (!this.isHomeRuntimeAlive() || cc.fx.GameConfig.isGameplayEntryPreparing() + || starterPackRemaining() <= 0 || this.starterPackOpening) return; this.vibrateButtonClick(event); - - if (!JiaZai.cachedActionPrefab) { - let eventName = ""; - let btnName = "" - if (customEventData !== undefined) { - btnName = customEventData; - eventName = "click" - } else { - btnName = "xinshouBtn"; - eventName = "auto"; + const show = () => { + this.starterPackOpening = false; + if (!this.isHomeRuntimeAlive() || cc.fx.GameConfig.isGameplayEntryPreparing() + || starterPackRemaining() <= 0) return; + const first = !this.actionpNode; + if (first) { + this.actionpNode = cc.instantiate(JiaZai.cachedActionPrefab); + this.node.addChild(this.actionpNode); + this.actionpNode.zIndex = 2; } - let dataInfo = { - interface_id: "NewbieGift", // 界面名称 - reason: eventName, // 事件名称 - is_first_exposure: false, // 是否首次曝光 - entry_point: btnName, // 按钮名称 - } - cc.fx.GameTool.shushu_Track("interface_exposure", dataInfo); - - // cc.error('Action prefab is not loaded yet.'); - this.loadHomeBundleWithDependencies("action_bundle", 5, (err: Error, bundle: cc.AssetManager.Bundle) => { - if (err) { - cc.error(err.message || err); - return; - } - if (!this.isHomeRuntimeAlive() || cc.fx.GameConfig.isGameplayEntryPreparing()) return; - bundle.load('prefab/newbieGift', cc.Prefab, (err: Error, prefab: cc.Prefab) => { - if (err) { - cc.error(err.message || err); - return; - } - JiaZai.cachedActionPrefab = prefab; - if (!this.isHomeRuntimeAlive() || cc.fx.GameConfig.isGameplayEntryPreparing()) return; - if (!this.actionpNode) { - // 第一次使用,创建节点 - this.actionpNode = cc.instantiate(JiaZai.cachedActionPrefab); - if (this.node && this.actionpNode) - this.node.addChild(this.actionpNode); - this.actionpNode.zIndex = 2; - this.actionpNode.getComponent("NewbieGift").init(true); - this.actionpNode.getChildByName("time").active = false; - } else { - // 非第一次使用,直接激活节点 - this.actionpNode.active = true; - this.actionpNode.getComponent("NewbieGift").init(false); - this.actionpNode.getChildByName("time").active = false; - } - }); + this.actionpNode.active = true; + this.actionpNode.getComponent("NewbieGift").init(first); + // Count only a displayed popup, including the initial activation and + // manual opens. Failed loads must not consume today's reminder. + cc.fx.StorageMessage.setStorage(starterPackPopupKey(), starterPackDay()); + this.newbieGift = false; + cc.fx.GameTool.shushu_Track("interface_exposure", { + interface_id: "NewbieGift", reason: event ? "click" : "auto", + is_first_exposure: first, entry_point: customEventData || "xinshouBtn", }); + }; + if (JiaZai.cachedActionPrefab) { + show(); return; } - - if (!this.actionpNode) { - // 第一次使用,创建节点 - this.actionpNode = cc.instantiate(JiaZai.cachedActionPrefab); - if (this.node && this.actionpNode) - this.node.addChild(this.actionpNode); - this.actionpNode.zIndex = 2; - this.actionpNode.getComponent("NewbieGift").init(true); - } else { - // 非第一次使用,直接激活节点 - this.actionpNode.active = true; - this.actionpNode.getComponent("NewbieGift").init(false); - } - //@ts-ignore - if (typeof wx !== 'undefined') { - //@ts-ignore - wx.offShow(this.onShowListener); - //@ts-ignore - wx.offHide(this.onHideListener); - } + this.starterPackOpening = true; + this.loadHomeBundleWithDependencies("action_bundle", 5, (err: Error, bundle: cc.AssetManager.Bundle) => { + if (err) { this.starterPackOpening = false; cc.error(err); return; } + if (!this.isHomeRuntimeAlive() || cc.fx.GameConfig.isGameplayEntryPreparing()) { + this.starterPackOpening = false; + return; + } + bundle.load('prefab/newbieGift', cc.Prefab, (loadError: Error, prefab: cc.Prefab) => { + if (loadError) { this.starterPackOpening = false; cc.error(loadError); return; } + JiaZai.cachedActionPrefab = prefab; + show(); + }); + }); } // ============================================ // 关闭通行证方法 @@ -3777,44 +3750,24 @@ export default class JiaZai extends cc.Component { startStarter_pack() { this.stopStarter_pack(); - if (this.scheduleCallback3) { - this.unschedule(this.scheduleCallback3); - } - this.scheduleCallback3 = function () { - let nowTime = Math.floor(Date.now() / 1000); - if (cc.fx.GameConfig.GM_INFO.starter_packTime < nowTime) { - this.stopStarter_pack(); - this.setStarterPackHomeButtonVisible(false); - return; + this.scheduleCallback3 = () => { + const time = starterPackRemaining(); + const button = this.getStarterPackHomeButton(); + if (button) { + const label = button.getChildByName("time").getComponent(cc.Label); + label.string = time > 0 ? starterPackTimeText(time) : "已结束"; + } + if (this.actionpNode && cc.isValid(this.actionpNode)) { + this.actionpNode.getComponent("NewbieGift").refreshCountdown(); } - - let time = cc.fx.GameConfig.GM_INFO.starter_packTime - nowTime; if (time <= 0) { - time = 0; - this.stopStarter_pack(); + this.newbieGift = false; this.setStarterPackHomeButtonVisible(false); + this.stopStarter_pack(); } - else { - var timeTemp = cc.fx.GameTool.getTimeMargin2(time); - // 计算小时数 - let hours = Math.floor(Math.floor(time) / 3600); - if (hours >= 24) { - let days = Math.floor(hours / 24); - let remainingHours = hours % 24; - timeTemp = days + "天" + remainingHours + "小时"; - } - this.Stamina.parent.getChildByName("xinshou").getChildByName("time").getComponent(cc.Label) - .string = timeTemp; - if (this.actionpNode) { - this.actionpNode.getChildByName("time").getComponent(cc.Label). - string = timeTemp; - - - } - // 同步显示 - } - }.bind(this); + }; this.schedule(this.scheduleCallback3, 1); + this.scheduleCallback3(); } // ============================================ // 停止通行证倒计时方法 @@ -4033,108 +3986,32 @@ export default class JiaZai extends cc.Component { // 主要功能:使用缓存控制每天只弹一次 // ============================================ checkStarter_pack() { - if (this.deferHomePopupWhileTransfer("starterPack", () => this.checkStarter_pack())) { - return; - } - // return; - //如果没有充值新手礼包,每天弹一次新手礼包 - if (cc.fx.GameConfig.GM_INFO.level < 15 || !cc.fx.GameConfig.GM_INFO.canIos) { - return; - } - const timestamp = Date.now(); - Utils.getStarter_pack((data) => { - if (data.code == 1) { - if (data.data.starter_pack == 0) { - // console.log("用户没有触发新手礼包,准备触发,并且给弹窗"); - this.winStreakShow = false; - Utils.setStarter_pack((res) => { - if (res.code == 1) { - this.newbieGift = true; - // let top = this.node.getChildByName("Load").getChildByName("Top"); - // top.getChildByName("yicon").active = false; - if (this.Stamina) - this.setStarterPackHomeButtonVisible(true); - cc.fx.GameConfig.GM_INFO.starter_packTime = res.data.starter_pack / 1000; - if (!this.actionpNode) this.openStarter_pack(); - // console.log("打开新手礼包"); - const nowTime = Math.floor(Date.now() / 1000); - let time = cc.fx.GameConfig.GM_INFO.starter_packTime - nowTime; - if (time > 0) { - this.startStarter_pack(); - time = cc.fx.GameTool.getTimeMargin2(time); - if (this.Stamina) - this.Stamina.parent.getChildByName("xinshou").getChildByName("time").getComponent(cc.Label) - .string = time + ""; - - } - - } - }) - } - else if (data.data.starter_pack < timestamp) { - this.winStreakShow = true; - // console.log("用户新手礼包已经过期,不触发"); - this.newbieGift = false; - if (this.Stamina) - this.setStarterPackHomeButtonVisible(false); - } - else if (data.data.starter_packState == 1) { - this.winStreakShow = true; - // console.log("用户已经购买过新手礼包,不触发"); - this.newbieGift = false; - if (this.Stamina) - this.setStarterPackHomeButtonVisible(false); - } - else { - // console.log("用户在新手礼包时间范围内,给弹窗"); - cc.fx.GameConfig.GM_INFO.starter_packTime = data.data.starter_pack / 1000; - const nowTime = Math.floor(Date.now() / 1000); - let time = cc.fx.GameConfig.GM_INFO.starter_packTime - nowTime; - if (time > 0) { - this.startStarter_pack(); - time = cc.fx.GameTool.getTimeMargin2(time); - if (this.Stamina) - this.Stamina.parent.getChildByName("xinshou").getChildByName("time").getComponent(cc.Label) - .string = time + ""; - } - let date = new Date(); - let day = date.getDate() + 1; // 当前日期(1-31) - let month = date.getMonth(); // 当前月份(1-12) - let year = date.getFullYear(); // 当前年份 - let dateStr = `${year}-${String(month).padStart(2, '0')}-${String(day).padStart(2, '0')}`; // 格式化为 YYYY-MM-DD - // 从缓存中获取上次弹窗的日期 - let cachedDateStr = cc.fx.StorageMessage.getStorage("Starter_pack"); - // 如果缓存中的日期和当前日期不一致 - if (cachedDateStr !== dateStr) { - // 更新缓存 - this.newbieGift = true; - // let top = this.node.getChildByName("Load").getChildByName("Top"); - // top.getChildByName("yicon").active = false; - if (this.Stamina) - this.setStarterPackHomeButtonVisible(true); - cc.fx.StorageMessage.setStorage("Starter_pack", dateStr); - if (!this.actionpNode) this.openStarter_pack(); - // console.log("打开新手礼包"); - this.winStreakShow = false; - } - else { - this.winStreakShow = true; - this.newbieGift = false; - if (this.Stamina) - this.setStarterPackHomeButtonVisible(true); - // console.log("当天已经给过,不再弹窗新手礼包"); - } - } - } - else { + if (this.deferHomePopupWhileTransfer("starterPack", () => this.checkStarter_pack())) return; + if (cc.fx.GameConfig.GM_INFO.level < 15 || !cc.fx.GameConfig.GM_INFO.canIos || this.starterPackChecking) return; + this.starterPackChecking = true; + const apply = (res) => { + this.starterPackChecking = false; + if (!this.isHomeRuntimeAlive()) return; + if (!res || res.code !== 1) { this.newbieGift = false; - if (this.Stamina) - this.setStarterPackHomeButtonVisible(false); + this.setStarterPackHomeButtonVisible(false); + return; } - }) + applyStarterPackStatus(res.data); + const available = starterPackRemaining() > 0; + this.setStarterPackHomeButtonVisible(available); + this.startStarter_pack(); + this.newbieGift = available && cc.fx.StorageMessage.getStorage(starterPackPopupKey()) !== starterPackDay(); + this.winStreakShow = !this.newbieGift; + if (this.newbieGift) this.openStarter_pack(); + }; + Utils.getStarter_pack(res => { + if (res && res.code === 1 && Number(res.data.starter_pack) === 0 && Number(res.data.starter_packState) !== 1) { + Utils.setStarter_pack(apply); + } else apply(res); + }); } - // ============================================ // 获取分享信息方法 // 功能:从微信启动参数中获取分享人的关卡和UID @@ -5973,7 +5850,7 @@ export default class JiaZai extends cc.Component { // 主要功能:检测新手礼包弹窗是否显示,隐藏月卡弹窗 // ============================================ update(dt) { - if (this.newbieGift && this.monthlyCardNode) { + if (this.monthlyCardNode) { if (this.actionpNode) { if (this.monthlyCardNode.active == true && this.actionpNode.active == true) { this.monthlyCardNode.active = false; diff --git a/assets/Script/module/Config/GameConfig.ts b/assets/Script/module/Config/GameConfig.ts index ba61c913..17eef711 100644 --- a/assets/Script/module/Config/GameConfig.ts +++ b/assets/Script/module/Config/GameConfig.ts @@ -474,7 +474,9 @@ export class GameConfig { iosReviveOrder: string; //ios订单号复活 iosStarterOrder: string; //ios订单号新手 iosPassCheckOrder: string; // ios通行证订单 - starter_packTime: number; //新手礼包活动时间 + starter_packTime: number; // 新手礼包截止时间,秒 + starterPackServerOffset: number; // 服务端时间与本地时间差,毫秒 + starterPackPurchased: boolean; wxFriend: boolean; //微信好友信息授权 wxUserInfo: boolean; //微信用户信息授权 winState: boolean; //是否延续连胜状态 @@ -685,7 +687,9 @@ export class GameConfig { iosReviveOrder: "", //ios订单号复活 iosStarterOrder: "", //ios订单号新手 iosPassCheckOrder: "", // ios通行证订单 - starter_packTime: 0, //新手礼包活动时间 + starter_packTime: 0, // 新手礼包截止时间 + starterPackServerOffset: 0, + starterPackPurchased: false, wxFriend: false, //微信好友信息授权 wxUserInfo: false, //微信用户信息授权 winState: false, //是否延续连胜状态 diff --git a/assets/Script/module/Config/StarterPack.ts b/assets/Script/module/Config/StarterPack.ts new file mode 100644 index 00000000..7665a52e --- /dev/null +++ b/assets/Script/module/Config/StarterPack.ts @@ -0,0 +1,37 @@ +/** Purchases and login compensation use the same client-owned reward. */ +export function starterPackReward() { + return { coin: 8000, hammer: 8, freeze: 8, magic_wand: 8 }; +} + +export function starterPackNow(): number { + return Date.now() + (cc.fx.GameConfig.GM_INFO.starterPackServerOffset || 0); +} + +export function starterPackRemaining(): number { + if (cc.fx.GameConfig.GM_INFO.starterPackPurchased) return 0; + return Math.max(0, Math.ceil(cc.fx.GameConfig.GM_INFO.starter_packTime - starterPackNow() / 1000)); +} + +export function starterPackTimeText(seconds: number): string { + const value = Math.max(0, Math.floor(seconds)); + return [Math.floor(value / 3600), Math.floor(value / 60) % 60, value % 60] + .map(part => String(part).padStart(2, '0')).join(':'); +} + +export function applyStarterPackStatus(data: any): void { + const info = cc.fx.GameConfig.GM_INFO; + info.starter_packTime = (Number(data.starter_pack) || 0) / 1000; + // A late status response cannot undo a purchase confirmed in this session. + info.starterPackPurchased = info.starterPackPurchased || Number(data.starter_packState) === 1; + if (Number(data.serverTime) > 0) info.starterPackServerOffset = Number(data.serverTime) - Date.now(); +} + +export function starterPackDay(): string { + // Keep the existing local calendar-day policy, using server-corrected time. + const date = new Date(starterPackNow()); + return `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, '0')}-${String(date.getDate()).padStart(2, '0')}`; +} + +export function starterPackPopupKey(): string { + return 'Starter_pack_' + cc.fx.GameConfig.GM_INFO.uid; +} diff --git a/assets/Script/module/Config/StarterPack.ts.meta b/assets/Script/module/Config/StarterPack.ts.meta new file mode 100644 index 00000000..3cf3f9db --- /dev/null +++ b/assets/Script/module/Config/StarterPack.ts.meta @@ -0,0 +1,10 @@ +{ + "ver": "1.1.0", + "uuid": "bf11bdec-ae45-4d49-ba7d-d23281e8c91e", + "importer": "typescript", + "isPlugin": false, + "loadPluginInWeb": true, + "loadPluginInNative": true, + "loadPluginInEditor": false, + "subMetas": {} +} \ No newline at end of file diff --git a/assets/Script/module/Pay/Utils.ts b/assets/Script/module/Pay/Utils.ts index a72865f3..cf51888e 100644 --- a/assets/Script/module/Pay/Utils.ts +++ b/assets/Script/module/Pay/Utils.ts @@ -9,8 +9,8 @@ export default class Utils { static outTradeNo: string = ""; // static httpip: string = `https://laf.nika4games.com/`; //五彩消消乐 static httpip: string = `https://q6rvwvtnga.sealoshzh.site/`; //消消王者 - // static testHttpip: string = `https://sor779u2w8.sealoshzh.site/`; //测试服务器 - static testHttpip: string = `https://q6rvwvtnga.sealoshzh.site/`; //消消王者测试服暂替 + static testHttpip: string = `https://sor779u2w8.sealoshzh.site/`; //测试服务器 + // static testHttpip: string = `https://q6rvwvtnga.sealoshzh.site/`; //消消王者测试服暂替 //#region 安卓支付 /**获取用户信息*/ static getUserInfo(callBack, from?: string) { @@ -118,6 +118,7 @@ export default class Utils { // console.error('支付请求超时'); // callBack("请求支付超时"); // }, timeoutDuration); + const orderNumber = res.data.outTradeNo; //@ts-ignore wx.requestMidasPaymentGameItem({ signData: res.data.signData, @@ -126,7 +127,7 @@ export default class Utils { success(res, errCode) { // clearTimeout(timeoutId); // 清除超时定时器 //console.log('成功', res, errCode); - callBack(res); + callBack({ ...res, outTradeNo: orderNumber }); }, fail({ errMsg, errCode }) { // clearTimeout(timeoutId); // 清除超时定时器 @@ -140,6 +141,8 @@ export default class Utils { callBack(data); } }) + } else { + callBack({ err: "创建订单失败", errCode: -1, errMsg: res.msg || "创建订单失败,请重试" }); } }); @@ -147,7 +150,8 @@ export default class Utils { //#region 安卓获取支付结果 /** 安卓获取支付结果 */ - static getPayInfo(callBack) { + static getPayInfo(callBack, order: string = Utils.outTradeNo, + options?: { timeoutMs: number; onProgress?: (response: any) => void }) { // 延迟时间数组,按照 1 秒 3 次、2 秒 5 次、5 秒 6 次、15 秒 5 次的规则生成 const delays = [ ...Array(3).fill(3000), @@ -156,23 +160,42 @@ export default class Utils { ...Array(5).fill(15000) ]; let attempt = 0; // 轮询次数 + let completed = false; + let retryTimer = null; + let deadlineTimer = null; + const finish = (response) => { + if (completed) return; + completed = true; + clearTimeout(retryTimer); + clearTimeout(deadlineTimer); + callBack(response); + }; + const timeout = () => { + if (completed) return; + MiniGameSdk.API.showToast(options + ? "支付结果尚未确认,请稍后重新领取" + : "网络异常,如付款成功,重进游戏可领取奖励"); + finish({ code: 0, data: { pay_state: -1 }, message: '轮询超时' }); + }; + if (options?.timeoutMs > 0) deadlineTimer = setTimeout(timeout, options.timeoutMs); const poll = () => { + if (completed) return; if (attempt >= delays.length) { - MiniGameSdk.API.showToast("网络异常,如付款成功,重进游戏可领取奖励"); - callBack({ code: 0, data: { pay_state: -1 }, message: '轮询超时' }); + timeout(); return; } //console.log("请求uid:", Utils.uid); //console.log("outTradeNo:", Utils.outTradeNo); - Utils.POST("wx/getPayInfo", { uid: Utils.uid, outTradeNo: Utils.outTradeNo }, res => { - //console.log("查询字符结果:", res); - if (res.code === 1 && (res.data.pay_state === 1 || res.data.pay_state === 2)) { - callBack(res); + Utils.POST("wx/getPayInfo", { uid: Utils.uid, outTradeNo: order }, res => { + if (completed) return; + if (options?.onProgress) options.onProgress(res); + if (res?.code === 1 && (res.data?.pay_state === 1 || res.data?.pay_state === 2)) { + finish(res); } else { attempt++; - setTimeout(poll, delays[attempt - 1]); + retryTimer = setTimeout(poll, delays[attempt - 1]); } }); }; @@ -193,7 +216,7 @@ export default class Utils { let orderTemp = Utils.outTradeNo; if (order) orderTemp = order; //console.log("告知服务器发货的订单号:", orderTemp); - Utils.POST("wx/getOrderReward", { outTradeNo: orderTemp }, res => { + Utils.POST("wx/getOrderReward", { outTradeNo: orderTemp, uid: cc.fx.GameConfig.GM_INFO.uid }, res => { //console.log("告知服务器发货:", res); if (res.code === 1) { console.log("告知服务器发货成功:", res); @@ -334,6 +357,16 @@ export default class Utils { public static POST(url, param: object | any, callback) { var xhr = cc.loader.getXMLHttpRequest(); xhr.timeout = 5000;//超时时间 + let completed = false; + const finish = (response) => { + if (completed) return; + completed = true; + callback(response); + }; + const networkFailure = () => finish({ code: 0, data: null, msg: "网络请求失败,请重试" }); + xhr.onerror = networkFailure; + xhr.ontimeout = networkFailure; + xhr.onabort = networkFailure; let dataStr = ''; let isDebug = false; param.token = cc.fx.GameConfig.GM_INFO.token; @@ -370,27 +403,27 @@ export default class Utils { xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xhr.onreadystatechange = function () { if (xhr && xhr.readyState) { - if (xhr.readyState === 4 && xhr.responseText) { + if (xhr.readyState === 4) { let response: any = xhr.responseText; if (xhr.status >= 200 && xhr.status < 300) { // callback(true, JSON.parse(response)); try { response = JSON.parse(response); } catch { - response = { data: "数据有误", code: 0 }; + response = { data: null, code: 0, msg: "数据有误" }; } if (response.code == 0) { - if (response.msg.toString() == "token校验失败") { + if (response.msg === "token校验失败") { if (MiniGameSdk) { MiniGameSdk.API.showToast("游戏已更新,请关闭游戏重新进入"); } } } - callback(response); + finish(response); } else { - callback({ data: "网络请求失败,请检查网络连接", code: 0 }); + networkFailure(); } } } diff --git a/assets/Script/module/Tool/GameTool.ts b/assets/Script/module/Tool/GameTool.ts index c9ca125e..76729ebb 100644 --- a/assets/Script/module/Tool/GameTool.ts +++ b/assets/Script/module/Tool/GameTool.ts @@ -5,6 +5,7 @@ import Freeze from "../../prop/Freeze"; import SceneManager from "../../SceneManager"; import { MiniGameSdk } from "../../Sdk/MiniGameSdk"; import Utils from "../Pay/Utils"; +import { starterPackReward } from "../Config/StarterPack"; //@ts-ignore //最大工具类 各种公共方法,以及处理上传,获取后端接口数据 var GameTool = { @@ -924,7 +925,10 @@ var GameTool = { }, //商城购买 - shopBuy(productId, compensate) { + shopBuy(productId, compensate, orderContext: any = null) { + const starterOrderKey = productId === "starter_pack" && orderContext?.outTradeNo + ? "StarterPackGranted_" + cc.fx.GameConfig.GM_INFO.uid + "_" + orderContext.outTradeNo : ""; + if (starterOrderKey && cc.fx.StorageMessage.getStorage(starterOrderKey)) return; let coin = 0; let price = 0; let getCoin = 0; @@ -1174,24 +1178,23 @@ var GameTool = { } this.getShopProp(propData3, compensate); break; - case "starter_pack": - cc.fx.GameTool.changeCoin(3000); - coin = 3000; + case "starter_pack": { + const reward = starterPackReward(); + coin = reward.coin; price = 300; - let propData4 = { - "freeze": 5, - "hammer": 5, - "magic_wand": 5, - "price": price - } - this.getShopProp(propData4, compensate); + cc.fx.GameTool.changeCoin(coin); + this.getShopProp({ freeze: reward.freeze, hammer: reward.hammer, + magic_wand: reward.magic_wand, price }, compensate); rewardData = [ { type: "coin", count: coin }, - { type: "freeze", count: 5 }, - { type: "hammer", count: 5 }, - { type: "magic", count: 5 } - ] + { type: "freeze", count: reward.freeze }, + { type: "hammer", count: reward.hammer }, + { type: "magic", count: reward.magic_wand }, + ]; + cc.fx.GameConfig.GM_INFO.starterPackPurchased = true; + if (starterOrderKey) cc.fx.StorageMessage.setStorage(starterOrderKey, true); break; + } } diff --git a/assets/gacha_bundle/img/cat.meta b/assets/action_bundle/img/newbieGift.meta similarity index 81% rename from assets/gacha_bundle/img/cat.meta rename to assets/action_bundle/img/newbieGift.meta index b9b84be5..4a6381da 100644 --- a/assets/gacha_bundle/img/cat.meta +++ b/assets/action_bundle/img/newbieGift.meta @@ -1,6 +1,6 @@ { "ver": "1.1.3", - "uuid": "98e24c51-14ad-4467-8071-506d787492ac", + "uuid": "c8889cf7-1db7-4299-935a-9a4da43eadd8", "importer": "folder", "isBundle": false, "bundleName": "", diff --git a/assets/action_bundle/img/newbieGift/anniu.png b/assets/action_bundle/img/newbieGift/anniu.png new file mode 100644 index 00000000..8ea549c4 Binary files /dev/null and b/assets/action_bundle/img/newbieGift/anniu.png differ diff --git a/assets/action_bundle/img/newbieGift/anniu.png.meta b/assets/action_bundle/img/newbieGift/anniu.png.meta new file mode 100644 index 00000000..635bfe09 --- /dev/null +++ b/assets/action_bundle/img/newbieGift/anniu.png.meta @@ -0,0 +1,38 @@ +{ + "ver": "2.3.7", + "uuid": "22e11a98-bcc4-4ee8-8093-aa594cc59700", + "importer": "texture", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "premultiplyAlpha": false, + "genMipmaps": false, + "packable": true, + "width": 522, + "height": 160, + "platformSettings": {}, + "subMetas": { + "anniu": { + "ver": "1.0.6", + "uuid": "0e7cba08-d69b-474a-be54-44829e930882", + "importer": "sprite-frame", + "rawTextureUuid": "22e11a98-bcc4-4ee8-8093-aa594cc59700", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": 0, + "offsetY": 0, + "trimX": 0, + "trimY": 0, + "width": 522, + "height": 160, + "rawWidth": 522, + "rawHeight": 160, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/assets/action_bundle/img/newbieGift/biaoqian.png b/assets/action_bundle/img/newbieGift/biaoqian.png new file mode 100644 index 00000000..bd1c32ae Binary files /dev/null and b/assets/action_bundle/img/newbieGift/biaoqian.png differ diff --git a/assets/action_bundle/img/newbieGift/biaoqian.png.meta b/assets/action_bundle/img/newbieGift/biaoqian.png.meta new file mode 100644 index 00000000..17c0fb4a --- /dev/null +++ b/assets/action_bundle/img/newbieGift/biaoqian.png.meta @@ -0,0 +1,38 @@ +{ + "ver": "2.3.7", + "uuid": "8d46c3f9-0c21-4eb5-ab75-b5fa014bbb4f", + "importer": "texture", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "premultiplyAlpha": false, + "genMipmaps": false, + "packable": true, + "width": 215, + "height": 218, + "platformSettings": {}, + "subMetas": { + "biaoqian": { + "ver": "1.0.6", + "uuid": "5929a056-ea3a-4f52-853d-0af7d354dd2a", + "importer": "sprite-frame", + "rawTextureUuid": "8d46c3f9-0c21-4eb5-ab75-b5fa014bbb4f", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": 0, + "offsetY": -0.5, + "trimX": 0, + "trimY": 1, + "width": 215, + "height": 217, + "rawWidth": 215, + "rawHeight": 218, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/assets/action_bundle/img/newbieGift/datubk.png b/assets/action_bundle/img/newbieGift/datubk.png new file mode 100644 index 00000000..5a0cb4a2 Binary files /dev/null and b/assets/action_bundle/img/newbieGift/datubk.png differ diff --git a/assets/action_bundle/img/newbieGift/datubk.png.meta b/assets/action_bundle/img/newbieGift/datubk.png.meta new file mode 100644 index 00000000..d4d64923 --- /dev/null +++ b/assets/action_bundle/img/newbieGift/datubk.png.meta @@ -0,0 +1,38 @@ +{ + "ver": "2.3.7", + "uuid": "6c502370-f618-42bc-8e02-ce35eda51bcf", + "importer": "texture", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "premultiplyAlpha": false, + "genMipmaps": false, + "packable": true, + "width": 361, + "height": 361, + "platformSettings": {}, + "subMetas": { + "datubk": { + "ver": "1.0.6", + "uuid": "ac2e6007-e35e-4173-9435-7df44e95c236", + "importer": "sprite-frame", + "rawTextureUuid": "6c502370-f618-42bc-8e02-ce35eda51bcf", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": 0, + "offsetY": 0, + "trimX": 0, + "trimY": 0, + "width": 361, + "height": 361, + "rawWidth": 361, + "rawHeight": 361, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/assets/action_bundle/img/newbieGift/ditu.png b/assets/action_bundle/img/newbieGift/ditu.png new file mode 100644 index 00000000..e9207b6f Binary files /dev/null and b/assets/action_bundle/img/newbieGift/ditu.png differ diff --git a/assets/action_bundle/img/newbieGift/ditu.png.meta b/assets/action_bundle/img/newbieGift/ditu.png.meta new file mode 100644 index 00000000..b00d48d6 --- /dev/null +++ b/assets/action_bundle/img/newbieGift/ditu.png.meta @@ -0,0 +1,38 @@ +{ + "ver": "2.3.7", + "uuid": "c85ab49b-4a1f-4e74-b7c2-65adec9e22c9", + "importer": "texture", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "premultiplyAlpha": false, + "genMipmaps": false, + "packable": true, + "width": 1052, + "height": 1147, + "platformSettings": {}, + "subMetas": { + "ditu": { + "ver": "1.0.6", + "uuid": "df980649-d0e1-4acc-87fd-84699e8d7646", + "importer": "sprite-frame", + "rawTextureUuid": "c85ab49b-4a1f-4e74-b7c2-65adec9e22c9", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": 0.5, + "offsetY": -0.5, + "trimX": 1, + "trimY": 1, + "width": 1051, + "height": 1146, + "rawWidth": 1052, + "rawHeight": 1147, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/assets/action_bundle/img/newbieGift/huaidaozi.png b/assets/action_bundle/img/newbieGift/huaidaozi.png new file mode 100644 index 00000000..b714db86 Binary files /dev/null and b/assets/action_bundle/img/newbieGift/huaidaozi.png differ diff --git a/assets/action_bundle/img/newbieGift/huaidaozi.png.meta b/assets/action_bundle/img/newbieGift/huaidaozi.png.meta new file mode 100644 index 00000000..5972d0a2 --- /dev/null +++ b/assets/action_bundle/img/newbieGift/huaidaozi.png.meta @@ -0,0 +1,38 @@ +{ + "ver": "2.3.7", + "uuid": "ea5148dc-3783-4ca8-83d3-8c7af744386c", + "importer": "texture", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "premultiplyAlpha": false, + "genMipmaps": false, + "packable": true, + "width": 204, + "height": 46, + "platformSettings": {}, + "subMetas": { + "huaidaozi": { + "ver": "1.0.6", + "uuid": "a858d8d9-da83-4425-a067-ffe9b921678c", + "importer": "sprite-frame", + "rawTextureUuid": "ea5148dc-3783-4ca8-83d3-8c7af744386c", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": 0, + "offsetY": 0, + "trimX": 0, + "trimY": 0, + "width": 204, + "height": 46, + "rawWidth": 204, + "rawHeight": 46, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/assets/action_bundle/img/newbieGift/jinbitu.png b/assets/action_bundle/img/newbieGift/jinbitu.png new file mode 100644 index 00000000..648bbedb Binary files /dev/null and b/assets/action_bundle/img/newbieGift/jinbitu.png differ diff --git a/assets/action_bundle/img/newbieGift/jinbitu.png.meta b/assets/action_bundle/img/newbieGift/jinbitu.png.meta new file mode 100644 index 00000000..34f6d707 --- /dev/null +++ b/assets/action_bundle/img/newbieGift/jinbitu.png.meta @@ -0,0 +1,38 @@ +{ + "ver": "2.3.7", + "uuid": "034cf4fe-e6e5-4959-bd12-2bd865a60636", + "importer": "texture", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "premultiplyAlpha": false, + "genMipmaps": false, + "packable": true, + "width": 358, + "height": 360, + "platformSettings": {}, + "subMetas": { + "jinbitu": { + "ver": "1.0.6", + "uuid": "a853dcbb-0772-495a-8bdd-0d1d73631ce7", + "importer": "sprite-frame", + "rawTextureUuid": "034cf4fe-e6e5-4959-bd12-2bd865a60636", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": 0, + "offsetY": 1, + "trimX": 2, + "trimY": 0, + "width": 354, + "height": 358, + "rawWidth": 358, + "rawHeight": 360, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/assets/action_bundle/img/newbieGift/san.png b/assets/action_bundle/img/newbieGift/san.png new file mode 100644 index 00000000..749e9890 Binary files /dev/null and b/assets/action_bundle/img/newbieGift/san.png differ diff --git a/assets/action_bundle/img/newbieGift/san.png.meta b/assets/action_bundle/img/newbieGift/san.png.meta new file mode 100644 index 00000000..ee0ccf5d --- /dev/null +++ b/assets/action_bundle/img/newbieGift/san.png.meta @@ -0,0 +1,38 @@ +{ + "ver": "2.3.7", + "uuid": "397cd7d6-5e95-49f3-89cc-c289bb285749", + "importer": "texture", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "premultiplyAlpha": false, + "genMipmaps": false, + "packable": true, + "width": 620, + "height": 875, + "platformSettings": {}, + "subMetas": { + "san": { + "ver": "1.0.6", + "uuid": "525c8132-16d4-444f-a8c7-b9e706563cf5", + "importer": "sprite-frame", + "rawTextureUuid": "397cd7d6-5e95-49f3-89cc-c289bb285749", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": 0, + "offsetY": 0, + "trimX": 0, + "trimY": 0, + "width": 620, + "height": 875, + "rawWidth": 620, + "rawHeight": 875, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/assets/action_bundle/img/newbieGift/sanyuan.png b/assets/action_bundle/img/newbieGift/sanyuan.png new file mode 100644 index 00000000..a2413b00 Binary files /dev/null and b/assets/action_bundle/img/newbieGift/sanyuan.png differ diff --git a/assets/action_bundle/img/newbieGift/sanyuan.png.meta b/assets/action_bundle/img/newbieGift/sanyuan.png.meta new file mode 100644 index 00000000..2a7ebcf7 --- /dev/null +++ b/assets/action_bundle/img/newbieGift/sanyuan.png.meta @@ -0,0 +1,38 @@ +{ + "ver": "2.3.7", + "uuid": "cfbee0d1-515a-4f6d-abeb-dcb44a56c76d", + "importer": "texture", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "premultiplyAlpha": false, + "genMipmaps": false, + "packable": true, + "width": 125, + "height": 61, + "platformSettings": {}, + "subMetas": { + "sanyuan": { + "ver": "1.0.6", + "uuid": "c6ac892b-3180-4f5f-a4be-863cde6b7b4a", + "importer": "sprite-frame", + "rawTextureUuid": "cfbee0d1-515a-4f6d-abeb-dcb44a56c76d", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": 0, + "offsetY": 0, + "trimX": 0, + "trimY": 0, + "width": 125, + "height": 61, + "rawWidth": 125, + "rawHeight": 61, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/assets/action_bundle/img/newbieGift/shijiandik.png b/assets/action_bundle/img/newbieGift/shijiandik.png new file mode 100644 index 00000000..31f6917e Binary files /dev/null and b/assets/action_bundle/img/newbieGift/shijiandik.png differ diff --git a/assets/action_bundle/img/newbieGift/shijiandik.png.meta b/assets/action_bundle/img/newbieGift/shijiandik.png.meta new file mode 100644 index 00000000..86b2cc91 --- /dev/null +++ b/assets/action_bundle/img/newbieGift/shijiandik.png.meta @@ -0,0 +1,38 @@ +{ + "ver": "2.3.7", + "uuid": "0ad79f66-4374-4eff-907c-c1e69a86446e", + "importer": "texture", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "premultiplyAlpha": false, + "genMipmaps": false, + "packable": true, + "width": 283, + "height": 56, + "platformSettings": {}, + "subMetas": { + "shijiandik": { + "ver": "1.0.6", + "uuid": "5acbf4a6-9b8d-46fb-8375-f39bfe75c861", + "importer": "sprite-frame", + "rawTextureUuid": "0ad79f66-4374-4eff-907c-c1e69a86446e", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": 0, + "offsetY": 0, + "trimX": 0, + "trimY": 0, + "width": 283, + "height": 56, + "rawWidth": 283, + "rawHeight": 56, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/assets/action_bundle/img/newbieGift/shouhuith.png b/assets/action_bundle/img/newbieGift/shouhuith.png new file mode 100644 index 00000000..488148c9 Binary files /dev/null and b/assets/action_bundle/img/newbieGift/shouhuith.png differ diff --git a/assets/action_bundle/img/newbieGift/shouhuith.png.meta b/assets/action_bundle/img/newbieGift/shouhuith.png.meta new file mode 100644 index 00000000..b1932e7f --- /dev/null +++ b/assets/action_bundle/img/newbieGift/shouhuith.png.meta @@ -0,0 +1,38 @@ +{ + "ver": "2.3.7", + "uuid": "aeb9e0aa-816f-4d6f-8329-4d2c57264093", + "importer": "texture", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "premultiplyAlpha": false, + "genMipmaps": false, + "packable": true, + "width": 176, + "height": 170, + "platformSettings": {}, + "subMetas": { + "shouhuith": { + "ver": "1.0.6", + "uuid": "3001ab9d-5f8a-461f-8589-ebf835c1f81b", + "importer": "sprite-frame", + "rawTextureUuid": "aeb9e0aa-816f-4d6f-8329-4d2c57264093", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": 0, + "offsetY": 0, + "trimX": 0, + "trimY": 0, + "width": 176, + "height": 170, + "rawWidth": 176, + "rawHeight": 170, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/assets/action_bundle/img/newbieGift/title.png b/assets/action_bundle/img/newbieGift/title.png new file mode 100644 index 00000000..343c1833 Binary files /dev/null and b/assets/action_bundle/img/newbieGift/title.png differ diff --git a/assets/action_bundle/img/newbieGift/title.png.meta b/assets/action_bundle/img/newbieGift/title.png.meta new file mode 100644 index 00000000..6688d4fa --- /dev/null +++ b/assets/action_bundle/img/newbieGift/title.png.meta @@ -0,0 +1,38 @@ +{ + "ver": "2.3.7", + "uuid": "a2d1b099-b13f-454b-923b-d233367afb39", + "importer": "texture", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "premultiplyAlpha": false, + "genMipmaps": false, + "packable": true, + "width": 642, + "height": 250, + "platformSettings": {}, + "subMetas": { + "title": { + "ver": "1.0.6", + "uuid": "68d51f3e-a440-4ef0-a746-7fbfd12bbf6b", + "importer": "sprite-frame", + "rawTextureUuid": "a2d1b099-b13f-454b-923b-d233367afb39", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": 0, + "offsetY": 0, + "trimX": 0, + "trimY": 0, + "width": 642, + "height": 250, + "rawWidth": 642, + "rawHeight": 250, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/assets/action_bundle/img/newbieGift/tubiaodik.png b/assets/action_bundle/img/newbieGift/tubiaodik.png new file mode 100644 index 00000000..16891732 Binary files /dev/null and b/assets/action_bundle/img/newbieGift/tubiaodik.png differ diff --git a/assets/action_bundle/img/newbieGift/tubiaodik.png.meta b/assets/action_bundle/img/newbieGift/tubiaodik.png.meta new file mode 100644 index 00000000..f971814b --- /dev/null +++ b/assets/action_bundle/img/newbieGift/tubiaodik.png.meta @@ -0,0 +1,38 @@ +{ + "ver": "2.3.7", + "uuid": "6fd9e9df-07ea-4f9f-aff5-a16c2fcc13c3", + "importer": "texture", + "type": "sprite", + "wrapMode": "clamp", + "filterMode": "bilinear", + "premultiplyAlpha": false, + "genMipmaps": false, + "packable": true, + "width": 240, + "height": 240, + "platformSettings": {}, + "subMetas": { + "tubiaodik": { + "ver": "1.0.6", + "uuid": "9c90a7d7-605b-4333-876b-e70704f1f604", + "importer": "sprite-frame", + "rawTextureUuid": "6fd9e9df-07ea-4f9f-aff5-a16c2fcc13c3", + "trimType": "auto", + "trimThreshold": 1, + "rotated": false, + "offsetX": 0, + "offsetY": 0, + "trimX": 0, + "trimY": 0, + "width": 240, + "height": 240, + "rawWidth": 240, + "rawHeight": 240, + "borderTop": 0, + "borderBottom": 0, + "borderLeft": 0, + "borderRight": 0, + "subMetas": {} + } + } +} \ No newline at end of file diff --git a/assets/action_bundle/prefab/newbieGift.prefab b/assets/action_bundle/prefab/newbieGift.prefab index 21d4083f..60690311 100644 --- a/assets/action_bundle/prefab/newbieGift.prefab +++ b/assets/action_bundle/prefab/newbieGift.prefab @@ -33,59 +33,47 @@ "__id__": 18 }, { - "__id__": 27 + "__id__": 21 }, { - "__id__": 36 + "__id__": 24 }, { - "__id__": 45 + "__id__": 32 }, { - "__id__": 48 + "__id__": 35 }, { - "__id__": 51 + "__id__": 38 }, { "__id__": 54 }, - { - "__id__": 59 - }, - { - "__id__": 62 - }, - { - "__id__": 65 - }, { "__id__": 68 }, { - "__id__": 71 + "__id__": 82 }, { - "__id__": 74 + "__id__": 96 }, { - "__id__": 77 - }, - { - "__id__": 114 + "__id__": 133 } ], "_active": true, "_components": [ { - "__id__": 138 + "__id__": 157 }, { - "__id__": 139 + "__id__": 158 } ], "_prefab": { - "__id__": 140 + "__id__": 159 }, "_opacity": 255, "_color": { @@ -292,7 +280,7 @@ "__id__": 1 }, "_children": [], - "_active": true, + "_active": false, "_components": [ { "__id__": 8 @@ -423,8 +411,8 @@ }, "_contentSize": { "__type__": "cc.Size", - "width": 96, - "height": 102 + "width": 103, + "height": 112 }, "_anchorPoint": { "__type__": "cc.Vec2", @@ -435,7 +423,7 @@ "__type__": "TypedArray", "ctor": "Float64Array", "array": [ - 329.002, + 390.549, 577.235, 0, 0, @@ -476,7 +464,7 @@ "_srcBlendFactor": 770, "_dstBlendFactor": 771, "_spriteFrame": { - "__uuid__": "225f5c55-2992-4244-88ee-d6186f8099ec" + "__uuid__": "4eb76a13-bdd5-44cb-975d-32fd4900be79" }, "_type": 0, "_sizeMode": 1, @@ -489,9 +477,7 @@ "_fillStart": 0, "_fillRange": 0, "_isTrimmedMode": true, - "_atlas": { - "__uuid__": "88f4116d-72c2-46cc-9f06-d164a85a9275" - }, + "_atlas": null, "_id": "" }, { @@ -589,7 +575,7 @@ }, { "__type__": "cc.Node", - "_name": "double", + "_name": "bg", "_objFlags": 0, "_parent": { "__id__": 1 @@ -614,8 +600,8 @@ }, "_contentSize": { "__type__": "cc.Size", - "width": 211, - "height": 211 + "width": 1052, + "height": 1147 }, "_anchorPoint": { "__type__": "cc.Vec2", @@ -626,8 +612,8 @@ "__type__": "TypedArray", "ctor": "Float64Array", "array": [ - -282.376, - 327.8, + 6.889, + -120.558, 0, 0, 0, @@ -667,7 +653,7 @@ "_srcBlendFactor": 770, "_dstBlendFactor": 771, "_spriteFrame": { - "__uuid__": "4df0b7a9-ae26-4420-87f7-332dcaadc354" + "__uuid__": "df980649-d0e1-4acc-87fd-84699e8d7646" }, "_type": 0, "_sizeMode": 1, @@ -680,9 +666,7 @@ "_fillStart": 0, "_fillRange": 0, "_isTrimmedMode": true, - "_atlas": { - "__uuid__": "f5f8c4fd-b672-46fe-85a4-79bd8b1b0eb9" - }, + "_atlas": null, "_id": "" }, { @@ -693,34 +677,134 @@ "asset": { "__id__": 0 }, - "fileId": "dfzTntYBxNIZyksyHTKAMx", + "fileId": "cafMbma8RBcpLThA2OUX3V", "sync": false }, { "__type__": "cc.Node", - "_name": "propBg1", + "_name": "san", "_objFlags": 0, "_parent": { "__id__": 1 }, - "_children": [ + "_children": [], + "_active": true, + "_components": [ { "__id__": 19 - }, + } + ], + "_prefab": { + "__id__": 20 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 620, + "height": 875 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 240.008, + 65.087, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1 + ] + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "_groupIndex": 0, + "groupIndex": 0, + "_id": "" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 18 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "525c8132-16d4-444f-a8c7-b9e706563cf5" + }, + "_type": 0, + "_sizeMode": 1, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_atlas": null, + "_id": "" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "9cXmUTbaZIw65988YVB0EP", + "sync": false + }, + { + "__type__": "cc.Node", + "_name": "title", + "_objFlags": 0, + "_parent": { + "__id__": 1 + }, + "_children": [], + "_active": true, + "_components": [ { "__id__": 22 } ], - "_active": true, - "_components": [ - { - "__id__": 25 - } - ], "_prefab": { - "__id__": 26 + "__id__": 23 }, - "_opacity": 0, + "_opacity": 255, "_color": { "__type__": "cc.Color", "r": 255, @@ -730,8 +814,8 @@ }, "_contentSize": { "__type__": "cc.Size", - "width": 168, - "height": 168 + "width": 642, + "height": 250 }, "_anchorPoint": { "__type__": "cc.Vec2", @@ -742,8 +826,8 @@ "__type__": "TypedArray", "ctor": "Float64Array", "array": [ - 238.225, - 229.97, + -59.18, + 544.481, 0, 0, 0, @@ -768,76 +852,12 @@ "_id": "" }, { - "__type__": "cc.Node", - "_name": "chuizi", + "__type__": "cc.Sprite", + "_name": "", "_objFlags": 0, - "_parent": { - "__id__": 18 - }, - "_children": [], - "_active": true, - "_components": [ - { - "__id__": 20 - } - ], - "_prefab": { + "node": { "__id__": 21 }, - "_opacity": 255, - "_color": { - "__type__": "cc.Color", - "r": 255, - "g": 255, - "b": 255, - "a": 255 - }, - "_contentSize": { - "__type__": "cc.Size", - "width": 306, - "height": 316 - }, - "_anchorPoint": { - "__type__": "cc.Vec2", - "x": 0.5, - "y": 0.5 - }, - "_trs": { - "__type__": "TypedArray", - "ctor": "Float64Array", - "array": [ - -9.435, - 3.538, - 0, - 0, - 0, - 0, - 1, - 0.4, - 0.4, - 0.4 - ] - }, - "_eulerAngles": { - "__type__": "cc.Vec3", - "x": 0, - "y": 0, - "z": 0 - }, - "_skewX": 0, - "_skewY": 0, - "_is3DNode": false, - "_groupIndex": 0, - "groupIndex": 0, - "_id": "" - }, - { - "__type__": "cc.Sprite", - "_name": "", - "_objFlags": 0, - "node": { - "__id__": 19 - }, "_enabled": true, "_materials": [ { @@ -847,7 +867,7 @@ "_srcBlendFactor": 770, "_dstBlendFactor": 771, "_spriteFrame": { - "__uuid__": "f383b277-ace5-445f-8863-a2c943b718f2" + "__uuid__": "68d51f3e-a440-4ef0-a746-7fbfd12bbf6b" }, "_type": 0, "_sizeMode": 1, @@ -860,9 +880,7 @@ "_fillStart": 0, "_fillRange": 0, "_isTrimmedMode": true, - "_atlas": { - "__uuid__": "f5f8c4fd-b672-46fe-85a4-79bd8b1b0eb9" - }, + "_atlas": null, "_id": "" }, { @@ -873,522 +891,30 @@ "asset": { "__id__": 0 }, - "fileId": "c8DyxR+4dGc5RMbQF7J43Z", + "fileId": "8cYyv71u9NForMDkOMm6+t", "sync": false }, { "__type__": "cc.Node", - "_name": "prop5", - "_objFlags": 0, - "_parent": { - "__id__": 18 - }, - "_children": [], - "_active": true, - "_components": [ - { - "__id__": 23 - } - ], - "_prefab": { - "__id__": 24 - }, - "_opacity": 255, - "_color": { - "__type__": "cc.Color", - "r": 255, - "g": 255, - "b": 255, - "a": 255 - }, - "_contentSize": { - "__type__": "cc.Size", - "width": 73, - "height": 43 - }, - "_anchorPoint": { - "__type__": "cc.Vec2", - "x": 0.5, - "y": 0.5 - }, - "_trs": { - "__type__": "TypedArray", - "ctor": "Float64Array", - "array": [ - -0.249, - -66.378, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1 - ] - }, - "_eulerAngles": { - "__type__": "cc.Vec3", - "x": 0, - "y": 0, - "z": 0 - }, - "_skewX": 0, - "_skewY": 0, - "_is3DNode": false, - "_groupIndex": 0, - "groupIndex": 0, - "_id": "" - }, - { - "__type__": "cc.Sprite", - "_name": "", - "_objFlags": 0, - "node": { - "__id__": 22 - }, - "_enabled": true, - "_materials": [ - { - "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" - } - ], - "_srcBlendFactor": 770, - "_dstBlendFactor": 771, - "_spriteFrame": { - "__uuid__": "2691a41c-d54e-4eb3-8b6b-5e336752e542" - }, - "_type": 0, - "_sizeMode": 1, - "_fillType": 0, - "_fillCenter": { - "__type__": "cc.Vec2", - "x": 0, - "y": 0 - }, - "_fillStart": 0, - "_fillRange": 0, - "_isTrimmedMode": true, - "_atlas": { - "__uuid__": "f5f8c4fd-b672-46fe-85a4-79bd8b1b0eb9" - }, - "_id": "" - }, - { - "__type__": "cc.PrefabInfo", - "root": { - "__id__": 1 - }, - "asset": { - "__id__": 0 - }, - "fileId": "01mKgQLURE2LtPgBUKheMW", - "sync": false - }, - { - "__type__": "cc.Sprite", - "_name": "", - "_objFlags": 0, - "node": { - "__id__": 18 - }, - "_enabled": true, - "_materials": [ - { - "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" - } - ], - "_srcBlendFactor": 770, - "_dstBlendFactor": 771, - "_spriteFrame": { - "__uuid__": "7586472c-63d3-40cc-82d6-8052b3109aa6" - }, - "_type": 0, - "_sizeMode": 1, - "_fillType": 0, - "_fillCenter": { - "__type__": "cc.Vec2", - "x": 0, - "y": 0 - }, - "_fillStart": 0, - "_fillRange": 0, - "_isTrimmedMode": true, - "_atlas": { - "__uuid__": "f5f8c4fd-b672-46fe-85a4-79bd8b1b0eb9" - }, - "_id": "" - }, - { - "__type__": "cc.PrefabInfo", - "root": { - "__id__": 1 - }, - "asset": { - "__id__": 0 - }, - "fileId": "30cCccc8JNL6qhtqTsV9K2", - "sync": false - }, - { - "__type__": "cc.Node", - "_name": "propBg2", + "_name": "timeContainer", "_objFlags": 0, "_parent": { "__id__": 1 }, "_children": [ + { + "__id__": 25 + }, { "__id__": 28 - }, - { - "__id__": 31 } ], "_active": true, - "_components": [ - { - "__id__": 34 - } - ], + "_components": [], "_prefab": { - "__id__": 35 - }, - "_opacity": 0, - "_color": { - "__type__": "cc.Color", - "r": 255, - "g": 255, - "b": 255, - "a": 255 - }, - "_contentSize": { - "__type__": "cc.Size", - "width": 168, - "height": 168 - }, - "_anchorPoint": { - "__type__": "cc.Vec2", - "x": 0.5, - "y": 0.5 - }, - "_trs": { - "__type__": "TypedArray", - "ctor": "Float64Array", - "array": [ - 326.675, - 49.532, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1 - ] - }, - "_eulerAngles": { - "__type__": "cc.Vec3", - "x": 0, - "y": 0, - "z": 0 - }, - "_skewX": 0, - "_skewY": 0, - "_is3DNode": false, - "_groupIndex": 0, - "groupIndex": 0, - "_id": "" - }, - { - "__type__": "cc.Node", - "_name": "iceb", - "_objFlags": 0, - "_parent": { - "__id__": 27 - }, - "_children": [], - "_active": true, - "_components": [ - { - "__id__": 29 - } - ], - "_prefab": { - "__id__": 30 - }, - "_opacity": 255, - "_color": { - "__type__": "cc.Color", - "r": 255, - "g": 255, - "b": 255, - "a": 255 - }, - "_contentSize": { - "__type__": "cc.Size", - "width": 242, - "height": 294 - }, - "_anchorPoint": { - "__type__": "cc.Vec2", - "x": 0.5, - "y": 0.5 - }, - "_trs": { - "__type__": "TypedArray", - "ctor": "Float64Array", - "array": [ - 4.192, - 1.052, - 0, - 0, - 0, - 0, - 1, - 0.45, - 0.45, - 0.45 - ] - }, - "_eulerAngles": { - "__type__": "cc.Vec3", - "x": 0, - "y": 0, - "z": 0 - }, - "_skewX": 0, - "_skewY": 0, - "_is3DNode": false, - "_groupIndex": 0, - "groupIndex": 0, - "_id": "" - }, - { - "__type__": "cc.Sprite", - "_name": "", - "_objFlags": 0, - "node": { - "__id__": 28 - }, - "_enabled": true, - "_materials": [ - { - "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" - } - ], - "_srcBlendFactor": 770, - "_dstBlendFactor": 771, - "_spriteFrame": { - "__uuid__": "9b0584fc-efbf-4e13-b1c0-26d8d47c5971" - }, - "_type": 0, - "_sizeMode": 1, - "_fillType": 0, - "_fillCenter": { - "__type__": "cc.Vec2", - "x": 0, - "y": 0 - }, - "_fillStart": 0, - "_fillRange": 0, - "_isTrimmedMode": true, - "_atlas": { - "__uuid__": "f5f8c4fd-b672-46fe-85a4-79bd8b1b0eb9" - }, - "_id": "" - }, - { - "__type__": "cc.PrefabInfo", - "root": { - "__id__": 1 - }, - "asset": { - "__id__": 0 - }, - "fileId": "a9d6PNqCZOb4jl00UGRj0r", - "sync": false - }, - { - "__type__": "cc.Node", - "_name": "prop5", - "_objFlags": 0, - "_parent": { - "__id__": 27 - }, - "_children": [], - "_active": true, - "_components": [ - { - "__id__": 32 - } - ], - "_prefab": { - "__id__": 33 - }, - "_opacity": 255, - "_color": { - "__type__": "cc.Color", - "r": 255, - "g": 255, - "b": 255, - "a": 255 - }, - "_contentSize": { - "__type__": "cc.Size", - "width": 73, - "height": 43 - }, - "_anchorPoint": { - "__type__": "cc.Vec2", - "x": 0.5, - "y": 0.5 - }, - "_trs": { - "__type__": "TypedArray", - "ctor": "Float64Array", - "array": [ - 7.518, - -61.879, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1 - ] - }, - "_eulerAngles": { - "__type__": "cc.Vec3", - "x": 0, - "y": 0, - "z": 0 - }, - "_skewX": 0, - "_skewY": 0, - "_is3DNode": false, - "_groupIndex": 0, - "groupIndex": 0, - "_id": "" - }, - { - "__type__": "cc.Sprite", - "_name": "", - "_objFlags": 0, - "node": { "__id__": 31 }, - "_enabled": true, - "_materials": [ - { - "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" - } - ], - "_srcBlendFactor": 770, - "_dstBlendFactor": 771, - "_spriteFrame": { - "__uuid__": "2691a41c-d54e-4eb3-8b6b-5e336752e542" - }, - "_type": 0, - "_sizeMode": 1, - "_fillType": 0, - "_fillCenter": { - "__type__": "cc.Vec2", - "x": 0, - "y": 0 - }, - "_fillStart": 0, - "_fillRange": 0, - "_isTrimmedMode": true, - "_atlas": { - "__uuid__": "f5f8c4fd-b672-46fe-85a4-79bd8b1b0eb9" - }, - "_id": "" - }, - { - "__type__": "cc.PrefabInfo", - "root": { - "__id__": 1 - }, - "asset": { - "__id__": 0 - }, - "fileId": "abOPWurxxNN4Nkd+C6w2eB", - "sync": false - }, - { - "__type__": "cc.Sprite", - "_name": "", - "_objFlags": 0, - "node": { - "__id__": 27 - }, - "_enabled": true, - "_materials": [ - { - "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" - } - ], - "_srcBlendFactor": 770, - "_dstBlendFactor": 771, - "_spriteFrame": { - "__uuid__": "7586472c-63d3-40cc-82d6-8052b3109aa6" - }, - "_type": 0, - "_sizeMode": 1, - "_fillType": 0, - "_fillCenter": { - "__type__": "cc.Vec2", - "x": 0, - "y": 0 - }, - "_fillStart": 0, - "_fillRange": 0, - "_isTrimmedMode": true, - "_atlas": { - "__uuid__": "f5f8c4fd-b672-46fe-85a4-79bd8b1b0eb9" - }, - "_id": "" - }, - { - "__type__": "cc.PrefabInfo", - "root": { - "__id__": 1 - }, - "asset": { - "__id__": 0 - }, - "fileId": "e3R+SRuuRPGLIvDGK1tdUW", - "sync": false - }, - { - "__type__": "cc.Node", - "_name": "propBg3", - "_objFlags": 0, - "_parent": { - "__id__": 1 - }, - "_children": [ - { - "__id__": 37 - }, - { - "__id__": 40 - } - ], - "_active": true, - "_components": [ - { - "__id__": 43 - } - ], - "_prefab": { - "__id__": 44 - }, - "_opacity": 0, + "_opacity": 255, "_color": { "__type__": "cc.Color", "r": 255, @@ -1398,8 +924,8 @@ }, "_contentSize": { "__type__": "cc.Size", - "width": 168, - "height": 168 + "width": 0, + "height": 0 }, "_anchorPoint": { "__type__": "cc.Vec2", @@ -1410,8 +936,8 @@ "__type__": "TypedArray", "ctor": "Float64Array", "array": [ - 224.073, - -127.368, + -4.068, + 659.005, 0, 0, 0, @@ -1435,285 +961,22 @@ "groupIndex": 0, "_id": "" }, - { - "__type__": "cc.Node", - "_name": "starb", - "_objFlags": 0, - "_parent": { - "__id__": 36 - }, - "_children": [], - "_active": true, - "_components": [ - { - "__id__": 38 - } - ], - "_prefab": { - "__id__": 39 - }, - "_opacity": 255, - "_color": { - "__type__": "cc.Color", - "r": 255, - "g": 255, - "b": 255, - "a": 255 - }, - "_contentSize": { - "__type__": "cc.Size", - "width": 286, - "height": 300 - }, - "_anchorPoint": { - "__type__": "cc.Vec2", - "x": 0.5, - "y": 0.5 - }, - "_trs": { - "__type__": "TypedArray", - "ctor": "Float64Array", - "array": [ - 3.182, - -7.335, - 0, - 0, - 0, - 0, - 1, - 0.4, - 0.4, - 0.4 - ] - }, - "_eulerAngles": { - "__type__": "cc.Vec3", - "x": 0, - "y": 0, - "z": 0 - }, - "_skewX": 0, - "_skewY": 0, - "_is3DNode": false, - "_groupIndex": 0, - "groupIndex": 0, - "_id": "" - }, - { - "__type__": "cc.Sprite", - "_name": "", - "_objFlags": 0, - "node": { - "__id__": 37 - }, - "_enabled": true, - "_materials": [ - { - "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" - } - ], - "_srcBlendFactor": 770, - "_dstBlendFactor": 771, - "_spriteFrame": { - "__uuid__": "a8b13964-f98b-455d-8833-39389969a45b" - }, - "_type": 0, - "_sizeMode": 1, - "_fillType": 0, - "_fillCenter": { - "__type__": "cc.Vec2", - "x": 0, - "y": 0 - }, - "_fillStart": 0, - "_fillRange": 0, - "_isTrimmedMode": true, - "_atlas": { - "__uuid__": "f5f8c4fd-b672-46fe-85a4-79bd8b1b0eb9" - }, - "_id": "" - }, - { - "__type__": "cc.PrefabInfo", - "root": { - "__id__": 1 - }, - "asset": { - "__id__": 0 - }, - "fileId": "04Hf1Gx11K/LVp+b4PAneM", - "sync": false - }, - { - "__type__": "cc.Node", - "_name": "prop5", - "_objFlags": 0, - "_parent": { - "__id__": 36 - }, - "_children": [], - "_active": true, - "_components": [ - { - "__id__": 41 - } - ], - "_prefab": { - "__id__": 42 - }, - "_opacity": 255, - "_color": { - "__type__": "cc.Color", - "r": 255, - "g": 255, - "b": 255, - "a": 255 - }, - "_contentSize": { - "__type__": "cc.Size", - "width": 73, - "height": 43 - }, - "_anchorPoint": { - "__type__": "cc.Vec2", - "x": 0.5, - "y": 0.5 - }, - "_trs": { - "__type__": "TypedArray", - "ctor": "Float64Array", - "array": [ - 3.823, - -62.751, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1 - ] - }, - "_eulerAngles": { - "__type__": "cc.Vec3", - "x": 0, - "y": 0, - "z": 0 - }, - "_skewX": 0, - "_skewY": 0, - "_is3DNode": false, - "_groupIndex": 0, - "groupIndex": 0, - "_id": "" - }, - { - "__type__": "cc.Sprite", - "_name": "", - "_objFlags": 0, - "node": { - "__id__": 40 - }, - "_enabled": true, - "_materials": [ - { - "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" - } - ], - "_srcBlendFactor": 770, - "_dstBlendFactor": 771, - "_spriteFrame": { - "__uuid__": "2691a41c-d54e-4eb3-8b6b-5e336752e542" - }, - "_type": 0, - "_sizeMode": 1, - "_fillType": 0, - "_fillCenter": { - "__type__": "cc.Vec2", - "x": 0, - "y": 0 - }, - "_fillStart": 0, - "_fillRange": 0, - "_isTrimmedMode": true, - "_atlas": { - "__uuid__": "f5f8c4fd-b672-46fe-85a4-79bd8b1b0eb9" - }, - "_id": "" - }, - { - "__type__": "cc.PrefabInfo", - "root": { - "__id__": 1 - }, - "asset": { - "__id__": 0 - }, - "fileId": "91W3MeJdNNVoaZLdcqSjq8", - "sync": false - }, - { - "__type__": "cc.Sprite", - "_name": "", - "_objFlags": 0, - "node": { - "__id__": 36 - }, - "_enabled": true, - "_materials": [ - { - "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" - } - ], - "_srcBlendFactor": 770, - "_dstBlendFactor": 771, - "_spriteFrame": { - "__uuid__": "7586472c-63d3-40cc-82d6-8052b3109aa6" - }, - "_type": 0, - "_sizeMode": 1, - "_fillType": 0, - "_fillCenter": { - "__type__": "cc.Vec2", - "x": 0, - "y": 0 - }, - "_fillStart": 0, - "_fillRange": 0, - "_isTrimmedMode": true, - "_atlas": { - "__uuid__": "f5f8c4fd-b672-46fe-85a4-79bd8b1b0eb9" - }, - "_id": "" - }, - { - "__type__": "cc.PrefabInfo", - "root": { - "__id__": 1 - }, - "asset": { - "__id__": 0 - }, - "fileId": "6algTZ2eVM1ISxTAFQWZhu", - "sync": false - }, { "__type__": "cc.Node", "_name": "timeBg", "_objFlags": 0, "_parent": { - "__id__": 1 + "__id__": 24 }, "_children": [], "_active": true, "_components": [ { - "__id__": 46 + "__id__": 26 } ], "_prefab": { - "__id__": 47 + "__id__": 27 }, "_opacity": 255, "_color": { @@ -1725,8 +988,8 @@ }, "_contentSize": { "__type__": "cc.Size", - "width": 172, - "height": 50 + "width": 283, + "height": 56 }, "_anchorPoint": { "__type__": "cc.Vec2", @@ -1767,7 +1030,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 45 + "__id__": 25 }, "_enabled": true, "_materials": [ @@ -1778,7 +1041,7 @@ "_srcBlendFactor": 770, "_dstBlendFactor": 771, "_spriteFrame": { - "__uuid__": "a0c93d5a-f639-4d84-a47e-a427c4cc593b" + "__uuid__": "5acbf4a6-9b8d-46fb-8375-f39bfe75c861" }, "_type": 0, "_sizeMode": 1, @@ -1791,9 +1054,7 @@ "_fillStart": 0, "_fillRange": 0, "_isTrimmedMode": true, - "_atlas": { - "__uuid__": "f5f8c4fd-b672-46fe-85a4-79bd8b1b0eb9" - }, + "_atlas": null, "_id": "" }, { @@ -1804,116 +1065,7 @@ "asset": { "__id__": 0 }, - "fileId": "b57KP7QYBDrLnU9/ZUG04z", - "sync": false - }, - { - "__type__": "cc.Node", - "_name": "timeIcon", - "_objFlags": 0, - "_parent": { - "__id__": 1 - }, - "_children": [], - "_active": true, - "_components": [ - { - "__id__": 49 - } - ], - "_prefab": { - "__id__": 50 - }, - "_opacity": 255, - "_color": { - "__type__": "cc.Color", - "r": 255, - "g": 255, - "b": 255, - "a": 255 - }, - "_contentSize": { - "__type__": "cc.Size", - "width": 48, - "height": 48 - }, - "_anchorPoint": { - "__type__": "cc.Vec2", - "x": 0.5, - "y": 0.5 - }, - "_trs": { - "__type__": "TypedArray", - "ctor": "Float64Array", - "array": [ - -70.695, - -271.689, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1 - ] - }, - "_eulerAngles": { - "__type__": "cc.Vec3", - "x": 0, - "y": 0, - "z": 0 - }, - "_skewX": 0, - "_skewY": 0, - "_is3DNode": false, - "_groupIndex": 0, - "groupIndex": 0, - "_id": "" - }, - { - "__type__": "cc.Sprite", - "_name": "", - "_objFlags": 0, - "node": { - "__id__": 48 - }, - "_enabled": true, - "_materials": [ - { - "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" - } - ], - "_srcBlendFactor": 770, - "_dstBlendFactor": 771, - "_spriteFrame": { - "__uuid__": "18d65e4a-9a87-4fdf-8fe5-e0334c8e6cd5" - }, - "_type": 0, - "_sizeMode": 1, - "_fillType": 0, - "_fillCenter": { - "__type__": "cc.Vec2", - "x": 0, - "y": 0 - }, - "_fillStart": 0, - "_fillRange": 0, - "_isTrimmedMode": true, - "_atlas": { - "__uuid__": "f5f8c4fd-b672-46fe-85a4-79bd8b1b0eb9" - }, - "_id": "" - }, - { - "__type__": "cc.PrefabInfo", - "root": { - "__id__": 1 - }, - "asset": { - "__id__": 0 - }, - "fileId": "f8q5cadwhA4LnLQcOtztri", + "fileId": "b3FtMUkNlP95hmcGp3AeJ0", "sync": false }, { @@ -1921,17 +1073,17 @@ "_name": "time", "_objFlags": 0, "_parent": { - "__id__": 1 + "__id__": 24 }, "_children": [], "_active": true, "_components": [ { - "__id__": 52 + "__id__": 29 } ], "_prefab": { - "__id__": 53 + "__id__": 30 }, "_opacity": 255, "_color": { @@ -1985,7 +1137,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 51 + "__id__": 28 }, "_enabled": true, "_materials": [ @@ -2021,12 +1173,23 @@ "asset": { "__id__": 0 }, - "fileId": "c5R9GArXVKRo8G/avfSJ72", + "fileId": "8ej9sEJZNGhoHnCrEgkvL5", + "sync": false + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "43Pz6NuGdNIZNETwvI/8iW", "sync": false }, { "__type__": "cc.Node", - "_name": "btn", + "_name": "double", "_objFlags": 0, "_parent": { "__id__": 1 @@ -2035,14 +1198,11 @@ "_active": true, "_components": [ { - "__id__": 55 - }, - { - "__id__": 56 + "__id__": 33 } ], "_prefab": { - "__id__": 58 + "__id__": 34 }, "_opacity": 255, "_color": { @@ -2054,8 +1214,298 @@ }, "_contentSize": { "__type__": "cc.Size", - "width": 516, - "height": 164 + "width": 215, + "height": 218 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + -285.821, + 303.688, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1 + ] + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "_groupIndex": 0, + "groupIndex": 0, + "_id": "" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 32 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "5929a056-ea3a-4f52-853d-0af7d354dd2a" + }, + "_type": 0, + "_sizeMode": 1, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_atlas": null, + "_id": "" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "dfzTntYBxNIZyksyHTKAMx", + "sync": false + }, + { + "__type__": "cc.Node", + "_name": "gold", + "_objFlags": 0, + "_parent": { + "__id__": 1 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 36 + } + ], + "_prefab": { + "__id__": 37 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 358, + "height": 360 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + -262.643, + -84.634, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1 + ] + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "_groupIndex": 0, + "groupIndex": 0, + "_id": "" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 35 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "a853dcbb-0772-495a-8bdd-0d1d73631ce7" + }, + "_type": 0, + "_sizeMode": 1, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_atlas": null, + "_id": "" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "556lTt4YhFvZjdpYjUphcB", + "sync": false + }, + { + "__type__": "cc.Node", + "_name": "btnContainer", + "_objFlags": 0, + "_parent": { + "__id__": 1 + }, + "_children": [ + { + "__id__": 39 + }, + { + "__id__": 44 + }, + { + "__id__": 47 + }, + { + "__id__": 50 + } + ], + "_active": true, + "_components": [], + "_prefab": { + "__id__": 53 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 0, + "height": 0 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 0, + -300, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1 + ] + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "_groupIndex": 0, + "groupIndex": 0, + "_id": "" + }, + { + "__type__": "cc.Node", + "_name": "btn", + "_objFlags": 0, + "_parent": { + "__id__": 38 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 40 + }, + { + "__id__": 41 + } + ], + "_prefab": { + "__id__": 43 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 522, + "height": 160 }, "_anchorPoint": { "__type__": "cc.Vec2", @@ -2096,7 +1546,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 54 + "__id__": 39 }, "_enabled": true, "_materials": [ @@ -2107,7 +1557,7 @@ "_srcBlendFactor": 770, "_dstBlendFactor": 771, "_spriteFrame": { - "__uuid__": "89786947-942f-48c2-b97a-240a02af167e" + "__uuid__": "0e7cba08-d69b-474a-be54-44829e930882" }, "_type": 0, "_sizeMode": 1, @@ -2120,9 +1570,7 @@ "_fillStart": 0, "_fillRange": 0, "_isTrimmedMode": true, - "_atlas": { - "__uuid__": "f5f8c4fd-b672-46fe-85a4-79bd8b1b0eb9" - }, + "_atlas": null, "_id": "" }, { @@ -2130,7 +1578,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 54 + "__id__": 39 }, "_enabled": true, "_normalMaterial": null, @@ -2139,7 +1587,7 @@ "zoomScale": 1.1, "clickEvents": [ { - "__id__": 57 + "__id__": 42 } ], "_N$interactable": true, @@ -2195,7 +1643,7 @@ "hoverSprite": null, "_N$disabledSprite": null, "_N$target": { - "__id__": 54 + "__id__": 39 }, "_id": "" }, @@ -2217,25 +1665,25 @@ "asset": { "__id__": 0 }, - "fileId": "3cE5FGqrNPirX4p+FbPLJF", + "fileId": "a2DHgc0QBNBqKipKLp3Pgo", "sync": false }, { "__type__": "cc.Node", - "_name": "gold_1", + "_name": "sanyuan", "_objFlags": 0, "_parent": { - "__id__": 1 + "__id__": 38 }, "_children": [], "_active": true, "_components": [ { - "__id__": 60 + "__id__": 45 } ], "_prefab": { - "__id__": 61 + "__id__": 46 }, "_opacity": 255, "_color": { @@ -2247,8 +1695,8 @@ }, "_contentSize": { "__type__": "cc.Size", - "width": 362.22, - "height": 111.27 + "width": 125, + "height": 61 }, "_anchorPoint": { "__type__": "cc.Vec2", @@ -2259,8 +1707,8 @@ "__type__": "TypedArray", "ctor": "Float64Array", "array": [ - -53.224, - 214.34, + 0, + -451.889, 0, 0, 0, @@ -2285,45 +1733,35 @@ "_id": "" }, { - "__type__": "sp.Skeleton", + "__type__": "cc.Sprite", "_name": "", "_objFlags": 0, "node": { - "__id__": 59 + "__id__": 44 }, "_enabled": true, "_materials": [ { - "__uuid__": "7afd064b-113f-480e-b793-8817d19f63c3" + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" } ], - "paused": false, - "defaultSkin": "default", - "defaultAnimation": "", - "_preCacheMode": 0, - "_cacheMode": 0, - "loop": false, - "premultipliedAlpha": false, - "timeScale": 1, - "_accTime": 0, - "_playCount": 0, - "_frameCache": null, - "_curFrame": null, - "_skeletonCache": null, - "_animationName": "animation", - "_animationQueue": [], - "_headAniInfo": null, - "_playTimes": 0, - "_isAniComplete": true, - "_N$skeletonData": { - "__uuid__": "d30ec525-71c7-430d-bdf6-053a4f682e6c" + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "c6ac892b-3180-4f5f-a4be-863cde6b7b4a" }, - "_N$_defaultCacheMode": 0, - "_N$debugSlots": false, - "_N$debugBones": false, - "_N$debugMesh": false, - "_N$useTint": false, - "_N$enableBatch": false, + "_type": 0, + "_sizeMode": 0, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_atlas": null, "_id": "" }, { @@ -2334,25 +1772,25 @@ "asset": { "__id__": 0 }, - "fileId": "60jUUjWChLQ6YCdDr8eWdT", + "fileId": "6aQ11SIQVAe4IySzkesH9A", "sync": false }, { "__type__": "cc.Node", - "_name": "gold_2", + "_name": "shouhuith", "_objFlags": 0, "_parent": { - "__id__": 1 + "__id__": 38 }, "_children": [], - "_active": false, + "_active": true, "_components": [ { - "__id__": 63 + "__id__": 48 } ], "_prefab": { - "__id__": 64 + "__id__": 49 }, "_opacity": 255, "_color": { @@ -2364,8 +1802,8 @@ }, "_contentSize": { "__type__": "cc.Size", - "width": 361, - "height": 110 + "width": 176, + "height": 170 }, "_anchorPoint": { "__type__": "cc.Vec2", @@ -2376,8 +1814,8 @@ "__type__": "TypedArray", "ctor": "Float64Array", "array": [ - -51.855, - 212.288, + 248.144, + -391.548, 0, 0, 0, @@ -2402,45 +1840,35 @@ "_id": "" }, { - "__type__": "sp.Skeleton", + "__type__": "cc.Sprite", "_name": "", "_objFlags": 0, "node": { - "__id__": 62 + "__id__": 47 }, "_enabled": true, "_materials": [ { - "__uuid__": "7afd064b-113f-480e-b793-8817d19f63c3" + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" } ], - "paused": false, - "defaultSkin": "default", - "defaultAnimation": "animation", - "_preCacheMode": 0, - "_cacheMode": 0, - "loop": true, - "premultipliedAlpha": false, - "timeScale": 1, - "_accTime": 0, - "_playCount": 0, - "_frameCache": null, - "_curFrame": null, - "_skeletonCache": null, - "_animationName": "animation", - "_animationQueue": [], - "_headAniInfo": null, - "_playTimes": 0, - "_isAniComplete": true, - "_N$skeletonData": { - "__uuid__": "0a95c171-f3ba-466e-a146-9abea117bd06" + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "3001ab9d-5f8a-461f-8589-ebf835c1f81b" }, - "_N$_defaultCacheMode": 0, - "_N$debugSlots": false, - "_N$debugBones": false, - "_N$debugMesh": false, - "_N$useTint": false, - "_N$enableBatch": false, + "_type": 0, + "_sizeMode": 1, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_atlas": null, "_id": "" }, { @@ -2451,23 +1879,150 @@ "asset": { "__id__": 0 }, - "fileId": "7edS4kBk1FsIegGMaRFhmX", + "fileId": "41ePOzJOdH06JUd6JL1ihl", "sync": false }, { "__type__": "cc.Node", - "_name": "baoxiang", + "_name": "huaidaozi", + "_objFlags": 0, + "_parent": { + "__id__": 38 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 51 + } + ], + "_prefab": { + "__id__": 52 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 204, + "height": 46 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 0, + -509, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1 + ] + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "_groupIndex": 0, + "groupIndex": 0, + "_id": "" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 50 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "a858d8d9-da83-4425-a067-ffe9b921678c" + }, + "_type": 0, + "_sizeMode": 0, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_atlas": null, + "_id": "" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "50nquTLsxDtbOFb+GYLffN", + "sync": false + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "2dHXgGBDNA35REUifiPPwO", + "sync": false + }, + { + "__type__": "cc.Node", + "_name": "daoju1", "_objFlags": 0, "_parent": { "__id__": 1 }, - "_children": [], - "_active": false, - "_components": [ + "_children": [ { - "__id__": 66 + "__id__": 55 + }, + { + "__id__": 58 + }, + { + "__id__": 61 + }, + { + "__id__": 64 } ], + "_active": true, + "_components": [], "_prefab": { "__id__": 67 }, @@ -2481,8 +2036,8 @@ }, "_contentSize": { "__type__": "cc.Size", - "width": 411.39, - "height": 372.32 + "width": 0, + "height": 0 }, "_anchorPoint": { "__type__": "cc.Vec2", @@ -2493,8 +2048,8 @@ "__type__": "TypedArray", "ctor": "Float64Array", "array": [ - -92.061, - -13.094, + 0, + 0, 0, 0, 0, @@ -2519,45 +2074,99 @@ "_id": "" }, { - "__type__": "sp.Skeleton", + "__type__": "cc.Node", + "_name": "bg", + "_objFlags": 0, + "_parent": { + "__id__": 54 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 56 + } + ], + "_prefab": { + "__id__": 57 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 180, + "height": 180 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + -351.339, + -368.562, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1 + ] + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "_groupIndex": 0, + "groupIndex": 0, + "_id": "" + }, + { + "__type__": "cc.Sprite", "_name": "", "_objFlags": 0, "node": { - "__id__": 65 + "__id__": 55 }, "_enabled": true, "_materials": [ { - "__uuid__": "7afd064b-113f-480e-b793-8817d19f63c3" + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" } ], - "paused": false, - "defaultSkin": "default", - "defaultAnimation": "animation", - "_preCacheMode": 0, - "_cacheMode": 0, - "loop": true, - "premultipliedAlpha": false, - "timeScale": 1, - "_accTime": 0, - "_playCount": 0, - "_frameCache": null, - "_curFrame": null, - "_skeletonCache": null, - "_animationName": "animation", - "_animationQueue": [], - "_headAniInfo": null, - "_playTimes": 0, - "_isAniComplete": true, - "_N$skeletonData": { - "__uuid__": "f743f1be-be36-45be-9bd4-846e1b84e50e" + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "ac2e6007-e35e-4173-9435-7df44e95c236" }, - "_N$_defaultCacheMode": 0, - "_N$debugSlots": false, - "_N$debugBones": false, - "_N$debugMesh": false, - "_N$useTint": false, - "_N$enableBatch": false, + "_type": 0, + "_sizeMode": 0, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_atlas": null, "_id": "" }, { @@ -2568,142 +2177,372 @@ "asset": { "__id__": 0 }, - "fileId": "4egBgRhNRL/LT4ILLp/S1N", + "fileId": "2anU5o2HRPW43At5qgEO6w", "sync": false }, { "__type__": "cc.Node", - "_name": "qipao1", + "_name": "chui", + "_objFlags": 0, + "_parent": { + "__id__": 54 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 59 + } + ], + "_prefab": { + "__id__": 60 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 120, + "height": 124 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + -349.34, + -351.784, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1 + ] + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "_groupIndex": 0, + "groupIndex": 0, + "_id": "" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 58 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "f383b277-ace5-445f-8863-a2c943b718f2" + }, + "_type": 0, + "_sizeMode": 0, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_atlas": { + "__uuid__": "f5f8c4fd-b672-46fe-85a4-79bd8b1b0eb9" + }, + "_id": "" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "93o0++uvlLhqhMaWzvuGsT", + "sync": false + }, + { + "__type__": "cc.Node", + "_name": "chuiziX", + "_objFlags": 0, + "_parent": { + "__id__": 54 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 62 + } + ], + "_prefab": { + "__id__": 63 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 46, + "height": 52 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + -344.45, + -417.913, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1 + ] + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "_groupIndex": 0, + "groupIndex": 0, + "_id": "" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 61 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "28f18aec-023b-4382-b48d-91e25044bd39" + }, + "_type": 0, + "_sizeMode": 1, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_atlas": { + "__uuid__": "fa9a438e-1f24-47fe-bbcd-b75abcff2ea8" + }, + "_id": "" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "86q5h4hdJEIa9h6MJ/sF3P", + "sync": false + }, + { + "__type__": "cc.Node", + "_name": "chuiziCount", + "_objFlags": 0, + "_parent": { + "__id__": 54 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 65 + } + ], + "_prefab": { + "__id__": 66 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 31, + "height": 32 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + -383.001, + -417.913, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1 + ] + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "_groupIndex": 0, + "groupIndex": 0, + "_id": "" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 64 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "3487845b-9e45-4ba7-b513-e9b50b3468f0" + }, + "_type": 0, + "_sizeMode": 1, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_atlas": { + "__uuid__": "fa9a438e-1f24-47fe-bbcd-b75abcff2ea8" + }, + "_id": "" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "f2waFQK3NOSLoDYdtpT7I3", + "sync": false + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "67bT3cfutNoqcK0V9JQMI0", + "sync": false + }, + { + "__type__": "cc.Node", + "_name": "daoju2", "_objFlags": 0, "_parent": { "__id__": 1 }, - "_children": [], - "_active": false, - "_components": [ + "_children": [ { "__id__": 69 - } - ], - "_prefab": { - "__id__": 70 - }, - "_opacity": 255, - "_color": { - "__type__": "cc.Color", - "r": 255, - "g": 255, - "b": 255, - "a": 255 - }, - "_contentSize": { - "__type__": "cc.Size", - "width": 401, - "height": 402 - }, - "_anchorPoint": { - "__type__": "cc.Vec2", - "x": 0.5, - "y": 0.5 - }, - "_trs": { - "__type__": "TypedArray", - "ctor": "Float64Array", - "array": [ - 231.245, - -105.29, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - 1 - ] - }, - "_eulerAngles": { - "__type__": "cc.Vec3", - "x": 0, - "y": 0, - "z": 0 - }, - "_skewX": 0, - "_skewY": 0, - "_is3DNode": false, - "_groupIndex": 0, - "groupIndex": 0, - "_id": "" - }, - { - "__type__": "sp.Skeleton", - "_name": "", - "_objFlags": 0, - "node": { - "__id__": 68 - }, - "_enabled": true, - "_materials": [ - { - "__uuid__": "7afd064b-113f-480e-b793-8817d19f63c3" - } - ], - "paused": false, - "defaultSkin": "default", - "defaultAnimation": "animation", - "_preCacheMode": 0, - "_cacheMode": 0, - "loop": false, - "premultipliedAlpha": false, - "timeScale": 1, - "_accTime": 0, - "_playCount": 0, - "_frameCache": null, - "_curFrame": null, - "_skeletonCache": null, - "_animationName": "animation", - "_animationQueue": [], - "_headAniInfo": null, - "_playTimes": 1, - "_isAniComplete": true, - "_N$skeletonData": { - "__uuid__": "2e4d1973-21a9-41b6-abbb-260192e7134d" - }, - "_N$_defaultCacheMode": 0, - "_N$debugSlots": false, - "_N$debugBones": false, - "_N$debugMesh": false, - "_N$useTint": false, - "_N$enableBatch": false, - "_id": "" - }, - { - "__type__": "cc.PrefabInfo", - "root": { - "__id__": 1 - }, - "asset": { - "__id__": 0 - }, - "fileId": "72XFxJ1khB1LT1DSQiGcJ9", - "sync": false - }, - { - "__type__": "cc.Node", - "_name": "qipao2", - "_objFlags": 0, - "_parent": { - "__id__": 1 - }, - "_children": [], - "_active": false, - "_components": [ + }, { "__id__": 72 + }, + { + "__id__": 75 + }, + { + "__id__": 78 } ], + "_active": true, + "_components": [], "_prefab": { - "__id__": 73 + "__id__": 81 }, "_opacity": 255, "_color": { @@ -2715,8 +2554,8 @@ }, "_contentSize": { "__type__": "cc.Size", - "width": 401, - "height": 402 + "width": 0, + "height": 0 }, "_anchorPoint": { "__type__": "cc.Vec2", @@ -2727,8 +2566,8 @@ "__type__": "TypedArray", "ctor": "Float64Array", "array": [ - 330.211, - 67.9, + 168.781, + -117.113, 0, 0, 0, @@ -2753,45 +2592,99 @@ "_id": "" }, { - "__type__": "sp.Skeleton", + "__type__": "cc.Node", + "_name": "bg", + "_objFlags": 0, + "_parent": { + "__id__": 68 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 70 + } + ], + "_prefab": { + "__id__": 71 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 180, + "height": 180 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + -351.339, + -369.562, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1 + ] + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "_groupIndex": 0, + "groupIndex": 0, + "_id": "" + }, + { + "__type__": "cc.Sprite", "_name": "", "_objFlags": 0, "node": { - "__id__": 71 + "__id__": 69 }, "_enabled": true, "_materials": [ { - "__uuid__": "7afd064b-113f-480e-b793-8817d19f63c3" + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" } ], - "paused": false, - "defaultSkin": "default", - "defaultAnimation": "animation", - "_preCacheMode": 0, - "_cacheMode": 0, - "loop": false, - "premultipliedAlpha": false, - "timeScale": 1, - "_accTime": 0, - "_playCount": 0, - "_frameCache": null, - "_curFrame": null, - "_skeletonCache": null, - "_animationName": "animation", - "_animationQueue": [], - "_headAniInfo": null, - "_playTimes": 1, - "_isAniComplete": true, - "_N$skeletonData": { - "__uuid__": "2e4d1973-21a9-41b6-abbb-260192e7134d" + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "ac2e6007-e35e-4173-9435-7df44e95c236" }, - "_N$_defaultCacheMode": 0, - "_N$debugSlots": false, - "_N$debugBones": false, - "_N$debugMesh": false, - "_N$useTint": false, - "_N$enableBatch": false, + "_type": 0, + "_sizeMode": 0, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_atlas": null, "_id": "" }, { @@ -2802,25 +2695,25 @@ "asset": { "__id__": 0 }, - "fileId": "98qkthXupEvpsHNUVEQ0mc", + "fileId": "acOs72ZlBHvo1bkkAW2Jc5", "sync": false }, { "__type__": "cc.Node", - "_name": "qipao3", + "_name": "ice", "_objFlags": 0, "_parent": { - "__id__": 1 + "__id__": 68 }, "_children": [], - "_active": false, + "_active": true, "_components": [ { - "__id__": 75 + "__id__": 73 } ], "_prefab": { - "__id__": 76 + "__id__": 74 }, "_opacity": 255, "_color": { @@ -2832,8 +2725,8 @@ }, "_contentSize": { "__type__": "cc.Size", - "width": 401, - "height": 402 + "width": 120, + "height": 124 }, "_anchorPoint": { "__type__": "cc.Vec2", @@ -2844,8 +2737,8 @@ "__type__": "TypedArray", "ctor": "Float64Array", "array": [ - 244.991, - 254.836, + -350.18, + -350.583, 0, 0, 0, @@ -2870,45 +2763,37 @@ "_id": "" }, { - "__type__": "sp.Skeleton", + "__type__": "cc.Sprite", "_name": "", "_objFlags": 0, "node": { - "__id__": 74 + "__id__": 72 }, "_enabled": true, "_materials": [ { - "__uuid__": "7afd064b-113f-480e-b793-8817d19f63c3" + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" } ], - "paused": false, - "defaultSkin": "default", - "defaultAnimation": "animation", - "_preCacheMode": 0, - "_cacheMode": 0, - "loop": false, - "premultipliedAlpha": false, - "timeScale": 1, - "_accTime": 0, - "_playCount": 0, - "_frameCache": null, - "_curFrame": null, - "_skeletonCache": null, - "_animationName": "animation", - "_animationQueue": [], - "_headAniInfo": null, - "_playTimes": 1, - "_isAniComplete": true, - "_N$skeletonData": { - "__uuid__": "2e4d1973-21a9-41b6-abbb-260192e7134d" + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "9b0584fc-efbf-4e13-b1c0-26d8d47c5971" + }, + "_type": 0, + "_sizeMode": 0, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_atlas": { + "__uuid__": "f5f8c4fd-b672-46fe-85a4-79bd8b1b0eb9" }, - "_N$_defaultCacheMode": 0, - "_N$debugSlots": false, - "_N$debugBones": false, - "_N$debugMesh": false, - "_N$useTint": false, - "_N$enableBatch": false, "_id": "" }, { @@ -2919,7 +2804,754 @@ "asset": { "__id__": 0 }, - "fileId": "2do2Gbp+NN94pZccvQ0VlW", + "fileId": "7c+qajhBFJSaju+EzZVhNC", + "sync": false + }, + { + "__type__": "cc.Node", + "_name": "iceX", + "_objFlags": 0, + "_parent": { + "__id__": 68 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 76 + } + ], + "_prefab": { + "__id__": 77 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 31, + "height": 32 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + -381.66, + -424.747, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1 + ] + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "_groupIndex": 0, + "groupIndex": 0, + "_id": "" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 75 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "3487845b-9e45-4ba7-b513-e9b50b3468f0" + }, + "_type": 0, + "_sizeMode": 1, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_atlas": { + "__uuid__": "fa9a438e-1f24-47fe-bbcd-b75abcff2ea8" + }, + "_id": "" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "12W2IulfJJsrGgB6jQSoMC", + "sync": false + }, + { + "__type__": "cc.Node", + "_name": "iceCount", + "_objFlags": 0, + "_parent": { + "__id__": 68 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 79 + } + ], + "_prefab": { + "__id__": 80 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 46, + "height": 52 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + -342.466, + -425.602, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1 + ] + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "_groupIndex": 0, + "groupIndex": 0, + "_id": "" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 78 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "28f18aec-023b-4382-b48d-91e25044bd39" + }, + "_type": 0, + "_sizeMode": 1, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_atlas": { + "__uuid__": "fa9a438e-1f24-47fe-bbcd-b75abcff2ea8" + }, + "_id": "" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "40nFH3AftOII6DlFd760r+", + "sync": false + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "47cH2hH9lFurC/iyB4Vui+", + "sync": false + }, + { + "__type__": "cc.Node", + "_name": "daoju3", + "_objFlags": 0, + "_parent": { + "__id__": 1 + }, + "_children": [ + { + "__id__": 83 + }, + { + "__id__": 86 + }, + { + "__id__": 89 + }, + { + "__id__": 92 + } + ], + "_active": true, + "_components": [], + "_prefab": { + "__id__": 95 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 0, + "height": 0 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + 351.339, + -213.559, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1 + ] + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "_groupIndex": 0, + "groupIndex": 0, + "_id": "" + }, + { + "__type__": "cc.Node", + "_name": "bg", + "_objFlags": 0, + "_parent": { + "__id__": 82 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 84 + } + ], + "_prefab": { + "__id__": 85 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 180, + "height": 180 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + -351.339, + -368.562, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1 + ] + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "_groupIndex": 0, + "groupIndex": 0, + "_id": "" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 83 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "ac2e6007-e35e-4173-9435-7df44e95c236" + }, + "_type": 0, + "_sizeMode": 0, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_atlas": null, + "_id": "" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "3aSMqnHspJQ4PNHgE0qjWU", + "sync": false + }, + { + "__type__": "cc.Node", + "_name": "bang", + "_objFlags": 0, + "_parent": { + "__id__": 82 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 87 + } + ], + "_prefab": { + "__id__": 88 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 120, + "height": 124 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + -343.34, + -352.784, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1 + ] + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "_groupIndex": 0, + "groupIndex": 0, + "_id": "" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 86 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "a8b13964-f98b-455d-8833-39389969a45b" + }, + "_type": 0, + "_sizeMode": 0, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_atlas": { + "__uuid__": "f5f8c4fd-b672-46fe-85a4-79bd8b1b0eb9" + }, + "_id": "" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "51PJnHKb9Gb71WJxqsr8n6", + "sync": false + }, + { + "__type__": "cc.Node", + "_name": "bangX", + "_objFlags": 0, + "_parent": { + "__id__": 82 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 90 + } + ], + "_prefab": { + "__id__": 91 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 31, + "height": 32 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + -382.406, + -421.356, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1 + ] + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "_groupIndex": 0, + "groupIndex": 0, + "_id": "" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 89 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "3487845b-9e45-4ba7-b513-e9b50b3468f0" + }, + "_type": 0, + "_sizeMode": 1, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_atlas": { + "__uuid__": "fa9a438e-1f24-47fe-bbcd-b75abcff2ea8" + }, + "_id": "" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "aaVa5UcPtBeZka3TRM0eeT", + "sync": false + }, + { + "__type__": "cc.Node", + "_name": "bangCount", + "_objFlags": 0, + "_parent": { + "__id__": 82 + }, + "_children": [], + "_active": true, + "_components": [ + { + "__id__": 93 + } + ], + "_prefab": { + "__id__": 94 + }, + "_opacity": 255, + "_color": { + "__type__": "cc.Color", + "r": 255, + "g": 255, + "b": 255, + "a": 255 + }, + "_contentSize": { + "__type__": "cc.Size", + "width": 46, + "height": 52 + }, + "_anchorPoint": { + "__type__": "cc.Vec2", + "x": 0.5, + "y": 0.5 + }, + "_trs": { + "__type__": "TypedArray", + "ctor": "Float64Array", + "array": [ + -343.458, + -421.633, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1 + ] + }, + "_eulerAngles": { + "__type__": "cc.Vec3", + "x": 0, + "y": 0, + "z": 0 + }, + "_skewX": 0, + "_skewY": 0, + "_is3DNode": false, + "_groupIndex": 0, + "groupIndex": 0, + "_id": "" + }, + { + "__type__": "cc.Sprite", + "_name": "", + "_objFlags": 0, + "node": { + "__id__": 92 + }, + "_enabled": true, + "_materials": [ + { + "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432" + } + ], + "_srcBlendFactor": 770, + "_dstBlendFactor": 771, + "_spriteFrame": { + "__uuid__": "28f18aec-023b-4382-b48d-91e25044bd39" + }, + "_type": 0, + "_sizeMode": 1, + "_fillType": 0, + "_fillCenter": { + "__type__": "cc.Vec2", + "x": 0, + "y": 0 + }, + "_fillStart": 0, + "_fillRange": 0, + "_isTrimmedMode": true, + "_atlas": { + "__uuid__": "fa9a438e-1f24-47fe-bbcd-b75abcff2ea8" + }, + "_id": "" + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "cczV9pxZpItqOZESNUBqcD", + "sync": false + }, + { + "__type__": "cc.PrefabInfo", + "root": { + "__id__": 1 + }, + "asset": { + "__id__": 0 + }, + "fileId": "56LzntfE1PrbU7lvV2F2Fu", "sync": false }, { @@ -2930,36 +3562,36 @@ "__id__": 1 }, "_children": [ - { - "__id__": 78 - }, - { - "__id__": 82 - }, - { - "__id__": 85 - }, - { - "__id__": 91 - }, { "__id__": 97 }, { - "__id__": 103 + "__id__": 101 }, { - "__id__": 109 + "__id__": 104 + }, + { + "__id__": 110 + }, + { + "__id__": 116 + }, + { + "__id__": 122 + }, + { + "__id__": 128 } ], "_active": false, "_components": [ { - "__id__": 112 + "__id__": 131 } ], "_prefab": { - "__id__": 113 + "__id__": 132 }, "_opacity": 255, "_color": { @@ -3013,20 +3645,20 @@ "_name": "New Sprite(Splash)", "_objFlags": 0, "_parent": { - "__id__": 77 + "__id__": 96 }, "_children": [], "_active": true, "_components": [ { - "__id__": 79 + "__id__": 98 }, { - "__id__": 80 + "__id__": 99 } ], "_prefab": { - "__id__": 81 + "__id__": 100 }, "_opacity": 200, "_color": { @@ -3080,7 +3712,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 78 + "__id__": 97 }, "_enabled": true, "_materials": [ @@ -3112,7 +3744,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 78 + "__id__": 97 }, "_enabled": true, "_id": "" @@ -3133,17 +3765,17 @@ "_name": "New Label", "_objFlags": 0, "_parent": { - "__id__": 77 + "__id__": 96 }, "_children": [], "_active": true, "_components": [ { - "__id__": 83 + "__id__": 102 } ], "_prefab": { - "__id__": 84 + "__id__": 103 }, "_opacity": 255, "_color": { @@ -3197,7 +3829,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 82 + "__id__": 101 }, "_enabled": true, "_materials": [ @@ -3241,21 +3873,21 @@ "_name": "block1", "_objFlags": 0, "_parent": { - "__id__": 77 + "__id__": 96 }, "_children": [ { - "__id__": 86 + "__id__": 105 } ], "_active": true, "_components": [ { - "__id__": 89 + "__id__": 108 } ], "_prefab": { - "__id__": 90 + "__id__": 109 }, "_opacity": 255, "_color": { @@ -3309,17 +3941,17 @@ "_name": "light", "_objFlags": 0, "_parent": { - "__id__": 85 + "__id__": 104 }, "_children": [], "_active": true, "_components": [ { - "__id__": 87 + "__id__": 106 } ], "_prefab": { - "__id__": 88 + "__id__": 107 }, "_opacity": 0, "_color": { @@ -3373,7 +4005,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 86 + "__id__": 105 }, "_enabled": true, "_materials": [ @@ -3416,7 +4048,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 85 + "__id__": 104 }, "_enabled": true, "_materials": [ @@ -3459,21 +4091,21 @@ "_name": "block2", "_objFlags": 0, "_parent": { - "__id__": 77 + "__id__": 96 }, "_children": [ { - "__id__": 92 + "__id__": 111 } ], "_active": true, "_components": [ { - "__id__": 95 + "__id__": 114 } ], "_prefab": { - "__id__": 96 + "__id__": 115 }, "_opacity": 255, "_color": { @@ -3527,17 +4159,17 @@ "_name": "light", "_objFlags": 0, "_parent": { - "__id__": 91 + "__id__": 110 }, "_children": [], "_active": true, "_components": [ { - "__id__": 93 + "__id__": 112 } ], "_prefab": { - "__id__": 94 + "__id__": 113 }, "_opacity": 0, "_color": { @@ -3591,7 +4223,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 92 + "__id__": 111 }, "_enabled": true, "_materials": [ @@ -3634,7 +4266,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 91 + "__id__": 110 }, "_enabled": true, "_materials": [ @@ -3677,21 +4309,21 @@ "_name": "block3", "_objFlags": 0, "_parent": { - "__id__": 77 + "__id__": 96 }, "_children": [ { - "__id__": 98 + "__id__": 117 } ], "_active": true, "_components": [ { - "__id__": 101 + "__id__": 120 } ], "_prefab": { - "__id__": 102 + "__id__": 121 }, "_opacity": 255, "_color": { @@ -3745,17 +4377,17 @@ "_name": "light", "_objFlags": 0, "_parent": { - "__id__": 97 + "__id__": 116 }, "_children": [], "_active": true, "_components": [ { - "__id__": 99 + "__id__": 118 } ], "_prefab": { - "__id__": 100 + "__id__": 119 }, "_opacity": 0, "_color": { @@ -3809,7 +4441,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 98 + "__id__": 117 }, "_enabled": true, "_materials": [ @@ -3852,7 +4484,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 97 + "__id__": 116 }, "_enabled": true, "_materials": [ @@ -3895,21 +4527,21 @@ "_name": "block4", "_objFlags": 0, "_parent": { - "__id__": 77 + "__id__": 96 }, "_children": [ { - "__id__": 104 + "__id__": 123 } ], "_active": true, "_components": [ { - "__id__": 107 + "__id__": 126 } ], "_prefab": { - "__id__": 108 + "__id__": 127 }, "_opacity": 0, "_color": { @@ -3963,17 +4595,17 @@ "_name": "light", "_objFlags": 0, "_parent": { - "__id__": 103 + "__id__": 122 }, "_children": [], "_active": true, "_components": [ { - "__id__": 105 + "__id__": 124 } ], "_prefab": { - "__id__": 106 + "__id__": 125 }, "_opacity": 0, "_color": { @@ -4027,7 +4659,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 104 + "__id__": 123 }, "_enabled": true, "_materials": [ @@ -4070,7 +4702,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 103 + "__id__": 122 }, "_enabled": true, "_materials": [ @@ -4113,17 +4745,17 @@ "_name": "cat", "_objFlags": 0, "_parent": { - "__id__": 77 + "__id__": 96 }, "_children": [], "_active": true, "_components": [ { - "__id__": 110 + "__id__": 129 } ], "_prefab": { - "__id__": 111 + "__id__": 130 }, "_opacity": 255, "_color": { @@ -4177,7 +4809,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 109 + "__id__": 128 }, "_enabled": true, "_materials": [ @@ -4220,7 +4852,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 77 + "__id__": 96 }, "_enabled": true, "alignMode": 1, @@ -4262,29 +4894,29 @@ }, "_children": [ { - "__id__": 115 + "__id__": 134 }, { - "__id__": 119 + "__id__": 138 }, { - "__id__": 122 + "__id__": 141 }, { - "__id__": 125 + "__id__": 144 }, { - "__id__": 128 + "__id__": 147 } ], "_active": false, "_components": [ { - "__id__": 136 + "__id__": 155 } ], "_prefab": { - "__id__": 137 + "__id__": 156 }, "_opacity": 255, "_color": { @@ -4338,20 +4970,20 @@ "_name": "New Sprite(Splash)", "_objFlags": 0, "_parent": { - "__id__": 114 + "__id__": 133 }, "_children": [], "_active": true, "_components": [ { - "__id__": 116 + "__id__": 135 }, { - "__id__": 117 + "__id__": 136 } ], "_prefab": { - "__id__": 118 + "__id__": 137 }, "_opacity": 120, "_color": { @@ -4405,7 +5037,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 115 + "__id__": 134 }, "_enabled": true, "_materials": [ @@ -4437,7 +5069,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 115 + "__id__": 134 }, "_enabled": true, "_id": "" @@ -4445,7 +5077,7 @@ { "__type__": "cc.PrefabInfo", "root": { - "__id__": 114 + "__id__": 133 }, "asset": { "__uuid__": "9fdc6671-8422-410b-b9af-36dab20f1488" @@ -4458,17 +5090,17 @@ "_name": "bg", "_objFlags": 0, "_parent": { - "__id__": 114 + "__id__": 133 }, "_children": [], "_active": true, "_components": [ { - "__id__": 120 + "__id__": 139 } ], "_prefab": { - "__id__": 121 + "__id__": 140 }, "_opacity": 255, "_color": { @@ -4522,7 +5154,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 119 + "__id__": 138 }, "_enabled": true, "_materials": [ @@ -4552,7 +5184,7 @@ { "__type__": "cc.PrefabInfo", "root": { - "__id__": 114 + "__id__": 133 }, "asset": { "__uuid__": "9fdc6671-8422-410b-b9af-36dab20f1488" @@ -4565,17 +5197,17 @@ "_name": "title", "_objFlags": 0, "_parent": { - "__id__": 114 + "__id__": 133 }, "_children": [], "_active": true, "_components": [ { - "__id__": 123 + "__id__": 142 } ], "_prefab": { - "__id__": 124 + "__id__": 143 }, "_opacity": 255, "_color": { @@ -4629,7 +5261,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 122 + "__id__": 141 }, "_enabled": true, "_materials": [ @@ -4660,7 +5292,7 @@ { "__type__": "cc.PrefabInfo", "root": { - "__id__": 114 + "__id__": 133 }, "asset": { "__uuid__": "9fdc6671-8422-410b-b9af-36dab20f1488" @@ -4673,17 +5305,17 @@ "_name": "New Label", "_objFlags": 0, "_parent": { - "__id__": 114 + "__id__": 133 }, "_children": [], "_active": true, "_components": [ { - "__id__": 126 + "__id__": 145 } ], "_prefab": { - "__id__": 127 + "__id__": 146 }, "_opacity": 255, "_color": { @@ -4737,7 +5369,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 125 + "__id__": 144 }, "_enabled": true, "_materials": [ @@ -4768,7 +5400,7 @@ { "__type__": "cc.PrefabInfo", "root": { - "__id__": 114 + "__id__": 133 }, "asset": { "__uuid__": "9fdc6671-8422-410b-b9af-36dab20f1488" @@ -4781,24 +5413,24 @@ "_name": "New Sprite", "_objFlags": 0, "_parent": { - "__id__": 114 + "__id__": 133 }, "_children": [ { - "__id__": 129 + "__id__": 148 } ], "_active": true, "_components": [ { - "__id__": 132 + "__id__": 151 }, { - "__id__": 133 + "__id__": 152 } ], "_prefab": { - "__id__": 135 + "__id__": 154 }, "_opacity": 255, "_color": { @@ -4852,17 +5484,17 @@ "_name": "New Label", "_objFlags": 0, "_parent": { - "__id__": 128 + "__id__": 147 }, "_children": [], "_active": true, "_components": [ { - "__id__": 130 + "__id__": 149 } ], "_prefab": { - "__id__": 131 + "__id__": 150 }, "_opacity": 255, "_color": { @@ -4916,7 +5548,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 129 + "__id__": 148 }, "_enabled": true, "_materials": [ @@ -4947,7 +5579,7 @@ { "__type__": "cc.PrefabInfo", "root": { - "__id__": 114 + "__id__": 133 }, "asset": { "__uuid__": "9fdc6671-8422-410b-b9af-36dab20f1488" @@ -4960,7 +5592,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 128 + "__id__": 147 }, "_enabled": true, "_materials": [ @@ -4992,7 +5624,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 128 + "__id__": 147 }, "_enabled": true, "_normalMaterial": null, @@ -5001,7 +5633,7 @@ "zoomScale": 1.1, "clickEvents": [ { - "__id__": 134 + "__id__": 153 } ], "_N$interactable": true, @@ -5057,7 +5689,7 @@ "hoverSprite": null, "_N$disabledSprite": null, "_N$target": { - "__id__": 128 + "__id__": 147 }, "_id": "" }, @@ -5074,7 +5706,7 @@ { "__type__": "cc.PrefabInfo", "root": { - "__id__": 114 + "__id__": 133 }, "asset": { "__uuid__": "9fdc6671-8422-410b-b9af-36dab20f1488" @@ -5087,7 +5719,7 @@ "_name": "", "_objFlags": 0, "node": { - "__id__": 114 + "__id__": 133 }, "_enabled": true, "alignMode": 1, @@ -5112,7 +5744,7 @@ { "__type__": "cc.PrefabInfo", "root": { - "__id__": 114 + "__id__": 133 }, "asset": { "__uuid__": "9fdc6671-8422-410b-b9af-36dab20f1488" diff --git a/assets/action_bundle/script/NewbieGift.ts b/assets/action_bundle/script/NewbieGift.ts index 62931f57..57c82889 100644 --- a/assets/action_bundle/script/NewbieGift.ts +++ b/assets/action_bundle/script/NewbieGift.ts @@ -1,48 +1,105 @@ -// Learn TypeScript: -// - https://docs.cocos.com/creator/2.4/manual/en/scripting/typescript.html -// Learn Attribute: -// - https://docs.cocos.com/creator/2.4/manual/en/scripting/reference/attributes.html -// Learn life-cycle callbacks: -// - https://docs.cocos.com/creator/2.4/manual/en/scripting/life-cycle-callbacks.html - import JiaZai from "../../Script/JiaZai"; import LoadingCatAnimation from "../../Script/LoadingCatAnimation"; import Utils from "../../Script/module/Pay/Utils"; -import NumberToImage from "../../Script/NumberToImage"; import { MiniGameSdk } from "../../Script/Sdk/MiniGameSdk"; - -// import JiaZai from "./JiaZai"; -// import Utils from "./module/Pay/Utils"; -// import NumberToImage from "./NumberToImage"; -// import { MiniGameSdk } from "./Sdk/MiniGameSdk"; +import { applyStarterPackStatus, starterPackRemaining, starterPackTimeText } from "../../Script/module/Config/StarterPack"; const { ccclass, property } = cc._decorator; +declare const wx: any; @ccclass export default class NewbieGift extends cc.Component { + // Retain the unused serialized properties in the existing prefab. + @property(cc.Node) monthCardTime: cc.Node = null; + @property(cc.Node) monthCardBtn: cc.Node = null; + @property(cc.Node) monthCardBtn2: cc.Node = null; + btn_Touch = true; + private paying = false; + private polling = false; + private onShowListener: () => void = null; + private pendingOrder = ""; + private confirmedOrder = ""; - @property(cc.Node) - monthCardTime: cc.Node = null; - //月卡按钮切换 - @property(cc.Node) - monthCardBtn: cc.Node = null; - //月卡按钮 - @property(cc.Node) - monthCardBtn2: cc.Node = null; - public juwai = false; - btn_Touch: boolean = false; + init(first: boolean) { + this.node.opacity = 255; + this.closeConfirmBox(); + if (!this.paying) this.closeLoad(); + const title = cc.find("ConfirmBox/title", this.node); + if (title) title.getComponent(cc.Label).string = "幸运礼包充值"; + // The old Spine/propBg nodes stay disabled. Preserve the authored layout. + this.unschedule(this.refreshCountdown); + this.schedule(this.refreshCountdown, 1); + this.refreshCountdown(); + if (typeof wx !== "undefined" && !this.onShowListener) { + this.onShowListener = () => this.onShow(); + wx.onShow(this.onShowListener); + } + this.onShow(); + } - // LIFE-CYCLE CALLBACKS: - private onShowListener: () => void; - private iosPrice: number = 0; - private iosProductId: string = ""; - private iosCount: number = 1; - public home: number = 0; + refreshCountdown() { + if (!cc.isValid(this)) return; + const seconds = starterPackRemaining(); + const label = cc.find("timeContainer/time", this.node).getComponent(cc.Label); + label.string = seconds > 0 ? starterPackTimeText(seconds) : "已结束"; + this.btn_Touch = seconds > 0 && !this.paying; + cc.find("btnContainer/btn", this.node).getComponent(cc.Button).interactable = this.btn_Touch; + } - onLoad() { - this.btn_Touch = true; - // 检测微信小游戏切到后台 - this.home = 0; + onShow() { + // wx.onShow and the payment callback may arrive together. Only one query + // chain owns the order; refreshing activity data is not reward delivery. + if (this.polling) return; + Utils.getStarter_pack(res => { + if (res && res.code === 1) applyStarterPackStatus(res.data); + this.refreshCountdown(); + }); + const order = this.pendingOrder || cc.fx.GameConfig.GM_INFO.iosStarterOrder; + if (!order) return; + this.polling = true; + this.paying = true; + this.openLoad(); + // Retry only the delivery acknowledgement after payment was confirmed. + if (this.confirmedOrder === order) { + this.finishOrder(order); + return; + } + const directPayment = !!this.pendingOrder; + const version = cc.fx.GameTool.getWechatGameVersion(); + this.logPayment("开始查单", order, { + channel: directPayment ? "直购" : "iOS客服", version, + server: version === "开发版" || version === "体验版" ? Utils.testHttpip : Utils.httpip, + }); + const done = (data) => { + if (directPayment && data?.code === 1 && data.data?.pay_state === 2) { + this.confirmedOrder = order; + this.finishOrder(order); + } else if (!directPayment && data?.code === 1 && data.data?.payment_name === "starter_pack") { + // The original customer-service API already completes the order. + this.completeOrder(order); + } else if ((directPayment && data?.code === 1 && data.data?.pay_state === 1) + || (!directPayment && data?.code === 0 && data.msg === "已经获取到奖励")) { + // A completed legacy order is not a new grant; clear stale UI state. + this.completeOrder(order, false); + } else { + this.logPayment("等待确认,保留订单供重试", order, { + code: data?.code, pay_state: data?.data?.pay_state, msg: data?.msg || data?.message, + }); + this.polling = false; + this.paying = false; + this.closeLoad(); + this.refreshCountdown(); + // Keep the order for retry, including after the offer expires. + this.openConfirmBox(); + } + }; + if (this.pendingOrder) Utils.getPayInfo(done, order, { + timeoutMs: 30000, + onProgress: res => this.logPayment("查单返回", order, { + code: res?.code, pay_state: res?.data?.pay_state, msg: res?.msg || res?.message, + }), + }); + else Utils.getIosPayInfo(order, done); } againGet() { @@ -50,497 +107,150 @@ export default class NewbieGift extends cc.Component { this.onShow(); } - onShow() { - if (cc.sys.platform === cc.sys.WECHAT_GAME || cc.sys.platform === cc.sys.BYTEDANCE_GAME) { - console.log("从后台进入前台订单号:", cc.fx.GameConfig.GM_INFO.iosStarterOrder); - if (cc.fx.GameConfig.GM_INFO.iosStarterOrder != null && cc.fx.GameConfig.GM_INFO.iosStarterOrder != "") { - console.log("有苹果订单号,开始轮训"); - const iosStarterOrder = cc.fx.GameConfig.GM_INFO.iosStarterOrder; - this.openLoad(); - this.btn_Touch = true; - Utils.getIosPayInfo(iosStarterOrder, - (data) => { - console.log("获得轮训结果:", data); - const iosID = data.data?.payment_name || this.iosProductId; - let iosAmount = data.data?.goodsPrice || this.iosPrice; - iosAmount = parseInt(iosAmount); - if (data.code == 1) { - console.log("购买成功"); - let name = "购买金币道具:" + iosID; - console.log("引力付费透传", iosAmount, iosStarterOrder, name); - MiniGameSdk.API.yinli_Pay(iosAmount, iosStarterOrder, name) - this.closeLoad(); - this.btn_Touch = true; - console.log("_________正式发货"); - MiniGameSdk.API.showToast("充值成功"); - cc.fx.GameTool.shopBuy(iosID, false); - this.buyStarter_pack(iosID); - - cc.fx.GameConfig.GM_INFO.iosStarterOrder = null; - //console.log("充值成功获得金币"); - } - else if (data.code == 0) { - console.log("用户自己取消充值"); - MiniGameSdk.API.showToast("充值失败"); - this.closeLoad(); - this.btn_Touch = true; - const dataFail = { - outTradeNo: iosStarterOrder, - pay_amount: iosAmount, - payment_name: iosID, - payment_num: this.iosCount, - type: "ios", - fail_reason: "用户取消充值", - } - if (iosID != undefined && iosID != "" && iosID != null) { - cc.fx.GameTool.shushu_Track("payment_fail", dataFail); - } - cc.fx.GameConfig.GM_INFO.iosStarterOrder = null; - } - else if (data.code == 2) { - this.closeLoad(); - this.btn_Touch = true; - console.log("轮训超时"); - - MiniGameSdk.API.showToast("请检查网络链接后, 再次领取奖励", 4); - const dataFail = { - outTradeNo: iosStarterOrder, - pay_amount: iosAmount, - payment_name: iosID, - payment_num: this.iosCount, - type: "ios", - fail_reason: "用户充值后,轮训结果超时", - } - cc.fx.GameTool.shushu_Track("payment_fail", dataFail); - this.openConfirmBox(); - } - this.btn_Touch = true; - if (this.node && this.node.parent) { - if (this.node.parent.getComponent("JiaZai")) - this.node.parent.getComponent("JiaZai").updateCoin(); - } - - }) - } + buyProduct(event?: cc.Event, customData?: string) { + if (this.pendingOrder || cc.fx.GameConfig.GM_INFO.iosStarterOrder) { + this.onShow(); + return; } - } - - start() { - // this.init(); - } - init(first) { - if (cc.sys.platform === cc.sys.WECHAT_GAME || cc.sys.platform === cc.sys.BYTEDANCE_GAME) { - // 定义监听函数 - this.onShowListener = () => { - console.log("微信小游戏切到前台,monthCard"); + this.refreshCountdown(); + if (!this.btn_Touch) return; + this.paying = true; + this.refreshCountdown(); + this.openLoad(); + // Fetch the server deadline; purchase eligibility is enforced by this UI. + Utils.getStarter_pack(res => { + if (!res || res.code !== 1) { + this.failPayment("礼包状态获取失败,请重试"); + return; + } + applyStarterPackStatus(res.data); + if (starterPackRemaining() <= 0) { + this.failPayment("礼包已结束或已购买"); + return; + } + let systemType = "Android"; + if (typeof wx !== "undefined" && wx.getSystemInfoSync().platform === "ios") systemType = "ios"; + if (systemType === "ios" && !cc.fx.GameConfig.GM_INFO.iosCanPay) { + this.iosOldPay(); + return; + } + Utils.buyProp("starter_pack", 1, 300, systemType, "starter_pack", result => { + if (!result || result.err) { + if (result && result.errCode === 16) { + this.iosOldPay(); + return; + } + this.failPayment(result?.errMsg || "充值未完成"); + return; + } + if (!result.outTradeNo) { + this.failPayment("支付订单号缺失,请重进游戏检查补单"); + return; + } + this.pendingOrder = result.outTradeNo; + this.logPayment("微信支付回调成功,等待服务端确认", this.pendingOrder); this.onShow(); - }; - //@ts-ignore - wx.onShow(this.onShowListener); - } - let nowTime = Math.floor(Date.now() / 1000); - let time = cc.fx.GameConfig.GM_INFO.starter_packTime - nowTime; - var timeTemp = cc.fx.GameTool.getTimeMargin2(time); - this.node.getChildByName("time").active = true; - this.node.getChildByName("time").getComponent(cc.Label). - string = timeTemp; - this.node.getChildByName("propBg1").opacity = 0; - this.node.getChildByName("propBg2").opacity = 0; - this.node.getChildByName("propBg3").opacity = 0; - this.node.getChildByName("gold_2").active = false; - this.node.getChildByName("baoxiang").active = false; - if (first) { - this.node.opacity = 255; - this.node.scale = 1; - this.node.getChildByName("ditu").active = true; - this.node.getChildByName("close").active = true; - this.btn_Touch = true; - this.setAction(); - } - else { - cc.tween(this.node) - .to(0.2, { opacity: 255, scale: 1, position: cc.v3(0, 0, 0) }) - .call(() => { - this.node.getChildByName("ditu").active = true; - this.node.getChildByName("close").active = true; - this.btn_Touch = true; - this.setAction(); - }) - .start(); - } - - } - //入场动画 - setAction() { - this.node.getChildByName("gold_1").getComponent(sp.Skeleton).setAnimation(0, "animation", false); - setTimeout(() => { - // this.node.getChildByName("gold_2").active = true; - this.node.getChildByName("qipao3").active = true; - this.node.getChildByName("qipao3").getComponent(sp.Skeleton).setAnimation(0, "animation", false); - cc.tween(this.node.getChildByName("propBg1")) - .delay(0.1) - .to(0.2, { opacity: 255 }) - .start(); - }, 400); - setTimeout(() => { - - this.node.getChildByName("qipao2").active = true; - this.node.getChildByName("qipao2").getComponent(sp.Skeleton).setAnimation(0, "animation", false); - cc.tween(this.node.getChildByName("propBg2")) - .delay(0.1) - .to(0.2, { opacity: 255 }) - .start(); - }, 600); - setTimeout(() => { - this.node.getChildByName("gold_2").active = true; - this.node.getChildByName("qipao1").active = true; - this.node.getChildByName("qipao1").getComponent(sp.Skeleton).setAnimation(0, "animation", false); - cc.tween(this.node.getChildByName("propBg3")) - .delay(0.1) - .to(0.2, { opacity: 255 }) - .start(); - }, 800); - setTimeout(() => { - // this.node.getChildByName("gold_2").active = true; - this.node.getChildByName("baoxiang").active = true; - }, 1000); - } - - //购买月卡 - buyStarter_pack(id) { - console.log("购买新手礼包成功!"); - const jiazaiNode = cc.find("Canvas"); // 假设 JiaZai 挂在 Canvas 节点 - const jiazaiComp = jiazaiNode.getComponent(JiaZai); - if (jiazaiComp) { - if (jiazaiComp.Stamina) - jiazaiComp.Stamina.parent.getChildByName("xinshou").active = false; - jiazaiComp.updateCoin(); - } - this.closeStarter_pack(); - // Utils.setMonthlyCard(0, (data) => { - // console.log("购买月卡", data.code); - // if (data.code == 1) { - // this.setReward(id); - // // let rewardData = [ - // // { type: "coin", count: 6000 }, - // // ] - - // } - // }) - // update (dt) {} - } - - setReward(id) { - cc.fx.GameConfig.GM_INFO.iosMonthOrder = null; - this.closeLoad(); - this.btn_Touch = true; - cc.fx.GameTool.shopBuy(id, false); - cc.fx.GameConfig.GM_INFO.hp_Max = 7; - cc.fx.GameConfig.GM_INFO.hp = 7; - cc.fx.GameConfig.GM_INFO.doubleCoin = 2; - this.home = 1; - cc.fx.GameTool.getMonthlyCardValidityDays().then(days => { - cc.fx.GameConfig.GM_INFO.monthTime = days.days; - //本地储存当前服务器时间 - let dateStr = new Date(days.time); - cc.fx.StorageMessage.setStorage("mCardDate", dateStr); - NumberToImage.numberToImageNodes(days.days, 35, 20, "month_", this.monthCardTime, true); - + }); }); - // cc.fx.GameTool.changeCoin(6000); - const jiazaiNode = cc.find("Canvas"); // 假设 JiaZai 挂在 Canvas 节点 - const jiazaiComp = jiazaiNode.getComponent(JiaZai); - if (jiazaiComp) { - console.log("获取到JiaZai组件", jiazaiComp); - setTimeout(() => { - jiazaiComp.setHealthInfo(false); - jiazaiComp.startTimeCutDown(); - jiazaiComp.updateCoin(); + } - }, 300); - } else { - console.log("无法获取JiaZai组件"); - } - - this.monthCardBtn.active = false; - this.monthCardBtn2.active = true; - this.monthCardTime.active = true; - cc.fx.GameTool.setUserHealth(0, (data) => { - cc.fx.GameTool.getHealth(null); - }) - let shop = cc.find("Canvas/shop"); - if (shop) { - let shopComp = shop.getComponent("shop"); - if (shopComp) { - shopComp.openShop(); + private finishOrder(order: string) { + this.logPayment("支付已确认,开始领取确认", order); + this.paying = true; + this.openLoad(); + Utils.setPayInfo(res => { + this.logPayment("领取确认返回", order, { code: res?.code, msg: res?.msg || res?.message }); + this.polling = false; + if (!res || res.code !== 1) { + this.paying = false; + this.openConfirmBox(); + this.refreshCountdown(); + return; } - } + this.completeOrder(order); + }, order); + } + private completeOrder(order: string, grant = true) { + if (grant) { + this.logPayment("开始前端发奖", order); + // The legacy acknowledgement returns data: "ok", not order metadata. + cc.fx.GameTool.shopBuy("starter_pack", false, { outTradeNo: order }); + this.logPayment("前端发奖调用完成", order); + MiniGameSdk.API.yinli_Pay(300, order, "购买金币道具:starter_pack"); + MiniGameSdk.API.showToast("充值成功"); + } + this.pendingOrder = ""; + this.confirmedOrder = ""; + cc.fx.GameConfig.GM_INFO.iosStarterOrder = ""; + cc.fx.GameConfig.GM_INFO.starterPackPurchased = true; + this.polling = false; + this.paying = false; + this.buyStarter_pack(); + } + + private logPayment(stage: string, order: string, details: any = {}) { + console.log("[新手礼包支付] " + stage, { orderSuffix: String(order).slice(-6), ...details }); + } + + buyStarter_pack() { + const canvas = cc.find("Canvas"); + const home = canvas && canvas.getComponent(JiaZai); + if (home) { + home.newbieGift = false; + home.startStarter_pack(); + home.updateCoin(); + } + this.closeLoad(); + if (cc.isValid(this)) this.closeStarter_pack(); + } + + private failPayment(message: string) { + this.paying = false; + this.closeLoad(); + this.refreshCountdown(); + MiniGameSdk.API.showToast(message); + cc.fx.GameTool.shushu_Track("payment_fail", { + outTradeNo: this.pendingOrder || cc.fx.GameConfig.GM_INFO.iosStarterOrder || "", + pay_amount: 300, payment_name: "starter_pack", payment_num: 1, + fail_reason: message, + }); + } + + iosOldPay() { + Utils.GoKEFu({ price: 300, payment_name: "starter_pack", payment_count: 1 }, result => { + this.paying = false; + this.closeLoad(); + this.refreshCountdown(); + if (result !== "success") { + cc.fx.GameConfig.GM_INFO.iosStarterOrder = ""; + MiniGameSdk.API.showToast("未能打开支付,请重试"); + } + }); } closeStarter_pack() { - // this.init(); - // 移除 wx.onShow 监听器 - this.node.getChildByName("ditu").active = false; - this.node.getChildByName("close").active = false; - this.node.getChildByName("gold_2").active = false; - - if ((cc.sys.platform === cc.sys.WECHAT_GAME || cc.sys.platform === cc.sys.BYTEDANCE_GAME) && this.onShowListener) { - console.log("月卡关闭监听"); - //@ts-ignore - wx.offShow(this.onShowListener); - - } - let posX = 0; - let posY = 0; - //jiazai - const jiazaiNode = cc.find("Canvas"); // 假设 JiaZai 挂在 Canvas 节点 - const jiazaiComp = jiazaiNode.getComponent(JiaZai); - if (jiazaiComp) { - if (jiazaiComp.Stamina) { - let top = jiazaiComp.Stamina.parent; - posX = top.x + top.getChildByName("xinshou").x; - posY = top.y + top.getChildByName("xinshou").y; - } - - } - // let isExpired = cc.fx.GameTool.checkExpiration(); - // if (jiazaiComp && this.home == 1 && isExpired) { - // this.home = 0; - // jiazaiComp.rewarded(); - // console.log("123iiiii222") - // } - // if (jiazaiComp) { - // console.log("22222222") - // jiazaiComp.onGames(); - // } - cc.tween(this.node) - .to(0.2, { opacity: 0, scale: 0.1, position: cc.v3(posX, posY, 0) }) - .call(() => { - if (this.node) - this.node.active = false; - }) - .start(); - } - - buyProduct(event, customData) { - if (!this.btn_Touch) { - return; - } - this.btn_Touch = false; - const productId = customData; - let id = "starter_pack"; - let price = 100; - let count = 1; - id = productId; - switch (productId) { - case "starter_pack": - price = 300; - break; - } - console.log("获得商品id:", id, count, price); - // 判断设备系统 - let systemType = "Android"; - try { - //@ts-ignore - const systemInfo = wx.getSystemInfoSync(); - if (systemInfo.platform === 'ios') { - systemType = "ios"; - } - } catch (e) { - console.error('获取系统信息失败', e); - } - - if (systemType == "ios" && !cc.fx.GameConfig.GM_INFO.iosCanPay) { - // MiniGameSdk.API.showToast("IOS系统暂不支持支付"); - // this.btn_Touch = true; - this.openLoad(); - this.btn_Touch = true; - this.iosOldPay(price, productId); - } - else { - // MiniGameSdk.API.showToast("充值成功"); - // cc.fx.GameTool.shopBuy(productId, false); - // setTimeout(() => { - // if (productId == "unlimited_health_bundle_1" || - // productId == "unlimited_health_bundle_2" || - // productId == "unlimited_health_bundle_3" - // ) { - // console.log("触发————————updatePower"); - // this.updatePower(); - // } - // }, 500); - - this.openLoad(); - this.btn_Touch = true; - //console.log("7.14_____________________", "调用充值接口"); - Utils.buyProp(id, count, price, systemType, productId, (res) => { - //console.log("获得充值结果", res); - if (res == null) { - MiniGameSdk.API.showToast("充值失败"); - this.btn_Touch = true; - const dataFail = { - outTradeNo: Utils.outTradeNo, - pay_amount: price, - payment_name: productId, - payment_num: 1, - type: systemType, - fail_reason: "网络异常,没有拉起支付", - } - cc.fx.GameTool.shushu_Track("payment_fail", dataFail); - this.closeLoad(); - return; - } - else if (res.err) { - console.log("错误原因:", res.errMsg); - if (res.errCode == 16) { - // console.log("走ios旧支付"); - this.iosOldPay(price, productId); - return; - } - MiniGameSdk.API.showToast("充值失败"); - //console.log(res); - this.btn_Touch = true; - let name = "支付拉起失败"; - if (res.errCode == -2) { - name = "用户取消充值"; - } - const dataFail = { - outTradeNo: Utils.outTradeNo, - pay_amount: price, - payment_name: productId, - payment_num: 1, - type: systemType, - fail_reason: name, - } - cc.fx.GameTool.shushu_Track("payment_fail", dataFail); - this.closeLoad(); - return; - } - else { - Utils.getPayInfo((data) => { - //console.log("7.14_______________充值成功,准备轮训"); - //console.log("获得轮训结果:", data); - this.closeLoad(); - if (data.data.pay_state == 1) { - this.btn_Touch = true; - MiniGameSdk.API.showToast("取消充值"); - const dataFail2 = { - outTradeNo: Utils.outTradeNo, - pay_amount: price, - payment_name: productId, - payment_num: 1, - type: systemType, - fail_reason: "用户取消支付", - } - cc.fx.GameTool.shushu_Track("payment_fail", dataFail2); - } - else if (data.data.pay_state == 2) { - this.btn_Touch = true; - // const dataSuccess = { - // outTradeNo: Utils.outTradeNo, - // pay_amount: price, - // payment_name: productId, - // payment_num: 1, - // type: systemType, - // } - // cc.fx.GameTool.shushu_Track("payment", dataSuccess); - let name = "购买金币道具:" + productId; - console.log("引力付费透传", price, Utils.outTradeNo, name); - MiniGameSdk.API.yinli_Pay(price, Utils.outTradeNo, name); - console.log("7.14_______________充值成功,轮训成功,准备发货"); - Utils.setPayInfo( - (res) => { - console.log("设置轮训结果:", res); - if (res.code === 1) { - console.log("7.14_________正式发货"); - MiniGameSdk.API.showToast("充值成功"); - cc.fx.GameTool.shopBuy(productId, false); - if (productId == "starter_pack") { - this.buyStarter_pack(productId); - } - //console.log("充值成功获得金币"); - } - else { - MiniGameSdk.API.showToast("网络异常,充值奖励将在登录后再次发放"); - const dataFail4 = { - outTradeNo: Utils.outTradeNo, - pay_amount: price, - payment_name: productId, - payment_num: 1, - type: systemType, - fail_reason: "成功付款,但是发货时请求服务器失败,充值成功未发货", - } - cc.fx.GameTool.shushu_Track("payment_fail", dataFail4); - } - if (this.node && this.node.parent) { - if (this.node.parent.getComponent("JiaZai")) - this.node.parent.getComponent("JiaZai").updateCoin(); - } - }, Utils.outTradeNo) - } - else { - - const dataFail3 = { - outTradeNo: Utils.outTradeNo, - pay_amount: price, - payment_name: productId, - payment_num: 1, - type: systemType, - fail_reason: "拉起支付后,付款时网络异常付款失败", - } - cc.fx.GameTool.shushu_Track("payment_fail", dataFail3); - this.btn_Touch = true; - if (this.node && this.node.parent) { - if (this.node.parent.getComponent("JiaZai")) - this.node.parent.getComponent("JiaZai").updateCoin(); - } - } - }) - } - }); - } + this.node.active = false; } openLoad() { - LoadingCatAnimation.play(this.node.getChildByName("Loading")); + if (cc.isValid(this)) LoadingCatAnimation.play(this.node.getChildByName("Loading")); + } + closeLoad() { + if (cc.isValid(this)) LoadingCatAnimation.stop(this.node.getChildByName("Loading")); } - openConfirmBox() { this.closeLoad(); - this.node.getChildByName("ConfirmBox").active = true; + if (cc.isValid(this)) this.node.getChildByName("ConfirmBox").active = true; } closeConfirmBox() { - this.node.getChildByName("ConfirmBox").active = false; + if (cc.isValid(this)) this.node.getChildByName("ConfirmBox").active = false; } - - closeLoad() { - LoadingCatAnimation.stop(this.node.getChildByName("Loading")); + onDisable() { + this.unschedule(this.refreshCountdown); + if (typeof wx !== "undefined" && this.onShowListener) wx.offShow(this.onShowListener); + this.onShowListener = null; } - onDestroy() { - - } - - iosOldPay(price, productId) { - // 旧版本ios支付 - let iosPayInfo = { - price: price, - payment_name: productId, - payment_count: 1, - } - this.iosPrice = price; - this.iosProductId = productId; - this.iosCount = 1; - console.log("准备跳客服回话:", iosPayInfo); - console.log(this.iosProductId); - Utils.GoKEFu(iosPayInfo, (res) => { - if (res == "success") { - console.log("客服回话成功"); - } - else { - console.log("客服回话失败"); - this.closeLoad(); - } - }); + this.onDisable(); } } diff --git a/assets/libs/dn-sdk-minigame.meta b/assets/libs/dn-sdk-minigame.meta deleted file mode 100644 index 7cedb056..00000000 --- a/assets/libs/dn-sdk-minigame.meta +++ /dev/null @@ -1,13 +0,0 @@ -{ - "ver": "1.1.3", - "uuid": "703537c8-6926-4995-9a30-d6ce343e5c63", - "importer": "folder", - "isBundle": false, - "bundleName": "", - "priority": 1, - "compressionType": {}, - "optimizeHotUpdate": {}, - "inlineSpriteFrames": {}, - "isRemoteBundle": {}, - "subMetas": {} -} \ No newline at end of file diff --git a/assets/pause/texture.meta b/assets/pause/texture.meta deleted file mode 100644 index b732d0dc..00000000 --- a/assets/pause/texture.meta +++ /dev/null @@ -1,13 +0,0 @@ -{ - "ver": "1.1.3", - "uuid": "9d9d5f8f-add9-4d2b-a1e4-4729e81a8ce8", - "importer": "folder", - "isBundle": false, - "bundleName": "", - "priority": 1, - "compressionType": {}, - "optimizeHotUpdate": {}, - "inlineSpriteFrames": {}, - "isRemoteBundle": {}, - "subMetas": {} -} \ No newline at end of file diff --git a/docs/starter-pack-v2.md b/docs/starter-pack-v2.md new file mode 100644 index 00000000..2e6fc334 --- /dev/null +++ b/docs/starter-pack-v2.md @@ -0,0 +1,60 @@ +# 新手礼包逻辑接入 + +沿用用户搭建的 `assets/action_bundle/prefab/newbieGift.prefab`,本次代码不创建、删除或重新布局 UI 节点。 + +`NewbieGift` 使用 `timeContainer/time` 显示 `HH:MM:SS`,使用 `btnContainer/btn` 处理购买;保留 `closeStarter_pack`、`buyProduct`、`againGet` 按钮绑定。脚本不依赖旧宝箱/气泡 Spine 和 propBg 节点,兼容在编辑器中删除这些旧节点。`Loading`、`ConfirmBox` 沿用现有节点,确认框标题为“幸运礼包充值”。到期后显示“已结束”,禁用购买按钮并隐藏首页入口。 + +## 当前职责划分 + +按最新确认方案,后端仅管理 48 小时活动期限及旧期限迁移,支付、查单、领取确认恢复原有接口行为。后端实现只位于同级独立 `../server` 仓库;MatchMaster 内的 `server` 目录未修改。 + +前端按 3 元购买,统一发放 8000 金币、锤子/冻结/魔法棒各 8 个。奖励配置位于 `assets/Script/module/Config/StarterPack.ts`。正常购买和登录补单共用该配置,不读取订单奖励版本或快照;改版前创建但尚未发放的订单,由新版客户端补发时也采用新版奖励。已经发过的订单不会因此自动补差额。 + +首页开启门槛不变:通关第 15 关后(内部 level 为 15),满足原支付入口条件。首次触发立即弹出并记入当前账号当天记录,以后每天首次进入首页提醒一次,关闭后保留入口。加载失败不消耗提醒次数。 + +## 与原支付接口衔接 + +- 购买前读取活动截止时间和购买状态,在前端检查是否仍可购买;不要求活动接口或订单接口返回奖励版本。 +- 直购订单查询返回 `pay_state=2` 表示已支付待领取,随后调用原 `getOrderReward`;收到 `code=1, data="ok"` 即按前端配置发奖。 +- 直购领取确认失败时,本次会话保存已经确认支付的订单号,重试领取确认,避免重新查单被当成已完成。 +- 旧 iOS 客服查单成功时,接口已完成订单;前端直接发奖,不再调用一次领取确认。 +- 直购查询返回已领取,或旧 iOS 接口返回“已经获取到奖励”时,清除过期的待支付界面状态,不再次发奖。 +- 正常购买与补单都显式传递原始订单号,在本地按账号和订单号去重;原领取接口不返回订单元数据。补发不修改月卡倍率或体力。 + +## 真机支付排查 + +“获得新手礼包数据”来自 `limitedTimeEvent` 活动查询,不是发奖日志。微信支付成功回调和回到前台可能各触发一次查询;查单进行中不会再次开启并发查询链。 + +新手礼包直购每轮查单最长 30 秒,超时显示重新领取确认框,保留原订单,不新建订单、不把微信客户端成功回调当作服务端已支付。晚到的查询响应不会继续触发已经超时的一轮处理。领取确认失败后继续使用已经确认支付的订单重试。 + +日志前缀为 `[新手礼包支付]`,依次包含微信回调成功、查单目标服务器、每次查单返回、领取确认和前端发奖。日志只输出订单号末 6 位,不输出 token 或微信支付凭证。 + +体验版和开发版当前连接测试服 `sor779u2w8.sealoshzh.site`,正式版连接 `q6rvwvtnga.sealoshzh.site`。直购签名的支付环境仍为 `env=0`。真机支付成功但查单超时时,需要按同一订单核对微信支付发货回调的实际地址、目标云函数日志和订单库:`state=0` 尚未记录支付,`state=1` 已支付待领取,`state=2` 已确认领取。当前代码无法证明微信后台实际配置了哪个回调地址,不应仅凭前端成功日志手动发奖。 + +## 有效期与限制 + +首次触发从服务器当前时间起计 48 小时。未购买且仍有效的旧 24 小时礼包在读取时增加 24 小时,并标记已迁移;已购买或已过期不重新开放。用户上的 `starterPackVersion` 仅作为期限迁移标记,客户端发奖不使用它。 + +到期前已创建的有效订单可继续走原支付流程。因后端下单接口恢复原逻辑,到期禁购由前端入口和购买前检查控制,不再保证请求到达服务端时仍未过期,也无法阻止旧客户端或直接请求在到期后下单。前端发奖保留原有跨设备去重及中断恢复方面的限制;旧 iOS 查单将订单置为完成后若客户端未收到成功结果,不能仅靠重试保证补发。 + +## 本地验证与发布 + +### 恢复真实支付(2026-09-09) + +前端发奖经体验版验证后,已撤销非正式版跳过支付的临时逻辑。开发版、体验版、正式版均恢复原有下单、支付、查单、领取确认和前端发奖流程。此前的本地测试领取标记不再参与礼包资格判断,已发放的测试资源不会回滚。 + +独立 server 仓库的订单分流提交 0030b5a 保留,尚未部署。部署环境变量、三个函数和发布顺序见该仓库的 laf-cloud/paymentRouting.README.md;其中描述客户端测试旁路的段落是撤销前状态,以本文为准。生产分流上线前,测试服真实支付仍可能遇到回调落在生产服、测试订单保持 state=0 的问题。 + +```sh +node --test tools/test-starter-pack.cjs tools/test-first-game-entry.cjs tools/test-career-loading.cjs +``` + +测试读取实际预制体,覆盖节点绑定、首次/次日提醒、到期按钮、原接口返回格式、旧 iOS 直接发奖、领取确认重试、登录补单、统一奖励和本地去重。客户端测试不再依赖同级 server 仓库。 + +上次有效期简化验证:客户端 104 项、后端 14 项测试通过。客户端 134 个 TypeScript 文件在补充运行时 `cc.fx` 声明后与 HEAD 对比,均有 17 条既有类型诊断,没有新增类型诊断;这不等于项目全量编译通过。 + +本次真机查单问题回归:客户端 108 项测试通过,新增支付回调成功但服务端未确认、30 秒后保留原单重试、超时后晚到响应、异常查询数据和缺失订单号场景。后端未修改。 + +随后根据云端 `function starterPackConfig not found` 日志,已将时间规则合并到独立 server 仓库的 `limitedTimeEvent.ts`。活动接口修复只需替换并发布该完整文件,不再依赖额外的 `starterPackConfig` 云函数。该错误属于活动接口,不能代替 `wx/payCallBack` 的调用记录来判断支付是否确认。 + +后端测试和部署范围见独立仓库的 `laf-cloud/starterPack.README.md`。若之前已发布带订单版本校验的后端,需要配套恢复原支付函数,否则不带版本的新请求会被旧校验拒绝。未进行真实设备支付验收,也未推送或部署云函数。 diff --git a/tools/test-first-game-entry.cjs b/tools/test-first-game-entry.cjs index b4d3c50a..d295fff0 100644 --- a/tools/test-first-game-entry.cjs +++ b/tools/test-first-game-entry.cjs @@ -726,6 +726,7 @@ test('Home dependency traversal handles repeated and cyclic bundle references', for (const stage of ['dependency', 'prefab']) { test(`newbie gift callback at ${stage} cannot create nodes after Home destruction`, () => { const f = homeFixture(); + f.globals.starterPackRemaining = () => 3600; f.state.bundleDependencies = { action_bundle: ['shop'] }; f.state.delayedBundles.add('shop'); f.cc.instantiate = () => assert.fail('late gift created a node'); f.Home.prototype.openStarter_pack.call(f.home); diff --git a/tools/test-starter-pack.cjs b/tools/test-starter-pack.cjs new file mode 100644 index 00000000..25442a7b --- /dev/null +++ b/tools/test-starter-pack.cjs @@ -0,0 +1,381 @@ +// Run with TypeScript 4.9+ available through NODE_PATH (or TYPESCRIPT_PATH). +const test = require('node:test'); +const assert = require('node:assert/strict'); +const fs = require('node:fs'); +const path = require('node:path'); +const vm = require('node:vm'); +const ts = require(process.env.TYPESCRIPT_PATH || 'typescript'); +const root = path.resolve(__dirname, '..'); +const configPath = 'assets/Script/module/Config/StarterPack.ts'; +const giftPath = 'assets/action_bundle/script/NewbieGift.ts'; +const homePath = 'assets/Script/JiaZai.ts'; +const utilsPath = 'assets/Script/module/Pay/Utils.ts'; +const source = file => ts.createSourceFile(file, fs.readFileSync(path.join(root, file), 'utf8'), ts.ScriptTarget.Latest, true); +function compile(code, globals) { + return vm.runInNewContext(ts.transpileModule(code, { compilerOptions: { + target: ts.ScriptTarget.ES2017, module: ts.ModuleKind.CommonJS, experimentalDecorators: true, + } }).outputText, globals); +} +function moduleFrom(file, globals, imports = {}) { + const exports = {}; + compile(fs.readFileSync(path.join(root, file), 'utf8'), { ...globals, exports, require(name) { + if (!(name in imports)) throw new Error('Unmocked import: ' + name); + return imports[name]; + } }); + return exports; +} +function methods(file, names, globals) { + const ast = source(file), cls = ast.statements.find(ts.isClassDeclaration); + const parts = names.map(name => { + const member = cls.members.find(m => m.name?.getText(ast) === name); + assert.ok(member, name); return member.getText(ast); + }); + return compile(`class ${cls.name.text} { ${parts.join('\n')} }\n${cls.name.text};`, globals); +} +function fixture() { + let now = 1800000000000; + const timers = [], storage = new Map(), events = [], calls = []; + const info = { uid: 'u1', level: 15, canIos: true, iosCanPay: true, starter_packTime: (now + 172800000) / 1000, + starterPackPurchased: false, starterPackServerOffset: 0, iosStarterOrder: '' }; + class TestDate extends Date { constructor(...args) { super(...(args.length ? args : [now])); } static now() { return now; } } + const cc = { + Node: class {}, Label: 'Label', Button: 'Button', Prefab: 'Prefab', + Component: class { schedule() {} unschedule() {} }, + _decorator: { ccclass: x => x, property: () => () => {} }, + isValid: value => !!value && !value.destroyed, + fx: { GameConfig: { GM_INFO: info, isGameplayEntryPreparing: () => false }, + StorageMessage: { getStorage: k => storage.get(k), setStorage: (k,v) => storage.set(k,v) }, + GameTool: { shushu_Track() {}, getWechatGameVersion: () => '体验版' } }, + find: (name, node) => node ? name.split('/').reduce((n, part) => n?.children.find(c => c.name === part), node) : null, + error() {}, sys: { platform: 'web' }, + }; + const globals = { cc, console: { log() {}, warn() {}, error() {} }, Date: TestDate, + setTimeout: fn => { timers.push(fn); return timers.length; }, clearTimeout() {} }; + const rules = moduleFrom(configPath, globals); + Object.assign(globals, rules); + const SDK = { API: { showToast: text => events.push(text), yinli_Pay() {}, shushu_SetSuperProperties() {} } }; + const api = { getStarter_pack: done => done({ code: 1, data: { starter_pack: info.starter_packTime * 1000, + starter_packState: info.starterPackPurchased ? 1 : 0, serverTime: now } }) }; + globals.Utils = api; globals.MiniGameSdk = SDK; + // Instantiate the actual authored prefab hierarchy and component bindings. + const prefab = JSON.parse(fs.readFileSync(path.join(root, 'assets/action_bundle/prefab/newbieGift.prefab'))); + function makeNode(id) { + const raw = prefab[id]; + const node = { name: raw._name, active: raw._active, opacity: raw._opacity, children: [], components: {}, + getChildByName(name) { return this.children.find(c => c.name === name); }, + getComponent(type) { return this.components[type]; } }; + for (const ref of raw._components || []) { + const comp = prefab[ref.__id__]; + if (comp.__type__ === 'cc.Label') node.components.Label = { string: comp._string }; + if (comp.__type__ === 'cc.Button') node.components.Button = { interactable: true, clickEvents: comp.clickEvents.map(e => prefab[e.__id__]) }; + } + node.children = (raw._children || []).map(c => makeNode(c.__id__)); + return node; + } + const Gift = moduleFrom(giftPath, globals, { + '../../Script/JiaZai': { default: class {} }, + '../../Script/LoadingCatAnimation': { default: { play() {}, stop() {} } }, + '../../Script/module/Pay/Utils': { default: api }, + '../../Script/Sdk/MiniGameSdk': { MiniGameSdk: SDK }, + '../../Script/module/Config/StarterPack': rules, + }).default; + const gift = new Gift(); gift.node = makeNode(1); + return { cc, info, globals, rules, gift, api, storage, timers, events, calls, setNow: value => { now = value; }, getNow: () => now }; +} + +test('authored prefab wiring initializes without old Spine or root-level time nodes', () => { + const f = fixture(); f.gift.init(true); + const time = f.cc.find('timeContainer/time', f.gift.node).getComponent('Label'); + assert.equal(time.string, '48:00:00'); + const button = f.cc.find('btnContainer/btn', f.gift.node).getComponent('Button'); + assert.equal(button.clickEvents[0].handler, 'buyProduct'); + assert.equal(button.clickEvents[0].customEventData, 'starter_pack'); + assert.notEqual(f.gift.node.getChildByName('gold_1')?.active, true); + assert.notEqual(f.gift.node.getChildByName('propBg1')?.active, true); + f.gift.closeStarter_pack(); assert.equal(f.gift.node.active, false); + f.gift.node.active = true; f.gift.init(false); assert.equal(button.interactable, true); +}); +test('countdown remains HH:MM:SS below one hour and ends at zero without a new order', () => { + const f = fixture(); f.setNow(f.info.starter_packTime * 1000 - 3599000); f.gift.refreshCountdown(); + assert.equal(f.cc.find('timeContainer/time', f.gift.node).components.Label.string, '00:59:59'); + f.setNow(f.info.starter_packTime * 1000); f.gift.refreshCountdown(); + assert.equal(f.cc.find('timeContainer/time', f.gift.node).components.Label.string, '已结束'); + assert.equal(f.cc.find('btnContainer/btn', f.gift.node).components.Button.interactable, false); + f.api.buyProp = () => assert.fail('expired order created'); f.gift.buyProduct(); +}); +test('server clock correction and confirmed purchase win over stale local status', () => { + const f = fixture(); + f.rules.applyStarterPackStatus({ starter_pack: f.getNow() + 10000, serverTime: f.getNow() + 5000, starter_packState: 0 }); + assert.equal(f.rules.starterPackRemaining(), 5); + f.info.starterPackPurchased = true; + f.rules.applyStarterPackStatus({ starter_pack: f.getNow() + 10000, starter_packState: 0 }); + assert.equal(f.rules.starterPackRemaining(), 0); +}); +function homeFixture() { + const f = fixture(); + const Home = methods(homePath, ['checkStarter_pack', 'openStarter_pack', 'startStarter_pack', 'stopStarter_pack'], f.globals); + const h = new Home(); h.node = { addChild() {} }; h.newbieGift = false; + h.isHomeRuntimeAlive = () => true; h.deferHomePopupWhileTransfer = () => false; + h.vibrateButtonClick = () => {}; h.schedule = () => {}; h.unschedule = () => {}; + const button = { getChildByName: () => ({ getComponent: () => ({}) }) }; + h.getStarterPackHomeButton = () => button; + h.setStarterPackHomeButtonVisible = v => { h.visible = v; }; + let opens = 0; + f.cc.instantiate = () => ({ active: false, getComponent: () => ({ init() { opens++; }, refreshCountdown() {} }) }); + Home.cachedActionPrefab = {}; + return { ...f, Home, h, opens: () => opens }; +} +test('first activation counts today; same-day reentry does not popup; next day does', () => { + const f = homeFixture(); + f.api.getStarter_pack = done => done({ code: 1, data: { starter_pack: 0, starter_packState: 0 } }); + f.api.setStarter_pack = done => done({ code: 1, data: { starter_pack: f.info.starter_packTime * 1000, starter_packState: 0 } }); + f.h.checkStarter_pack(); assert.equal(f.opens(), 1); + assert.equal(f.storage.get(f.rules.starterPackPopupKey()), f.rules.starterPackDay()); + f.api.getStarter_pack = f.api.setStarter_pack; + f.h.actionpNode.active = false; f.h.checkStarter_pack(); assert.equal(f.opens(), 1); + assert.equal(f.h.visible, true); + f.setNow(f.getNow() + 86400000); f.h.checkStarter_pack(); assert.equal(f.opens(), 2); +}); +test('failed prefab load does not consume daily reminder; account keys differ', () => { + const f = homeFixture(); f.Home.cachedActionPrefab = null; + f.h.loadHomeBundleWithDependencies = (name, priority, done) => done(new Error('offline')); + f.h.checkStarter_pack(); assert.equal(f.storage.size, 0); + const key = f.rules.starterPackPopupKey(); f.info.uid = 'other'; assert.notEqual(f.rules.starterPackPopupKey(), key); +}); +test('eligible level, paid flag and expiry gate automatic popup and homepage entry', () => { + for (const patch of [{ level: 14 }, { canIos: false }, { starterPackPurchased: true }, { starter_packTime: 0.1 }]) { + const f = homeFixture(); Object.assign(f.info, patch); + f.h.checkStarter_pack(); assert.equal(f.opens(), 0); + } +}); +test('one successful payment carries its original order id through polling and claim', () => { + const f = fixture(); const requests = []; + f.api.buyProp = (id, count, price, platform, name, done) => { requests.push([id,count,price]); done({ outTradeNo: 'new-order' }); }; + f.api.getPayInfo = (done, order) => { assert.equal(order, 'new-order'); done({ code: 1, data: { pay_state: 2 } }); }; + f.api.setPayInfo = (done, order) => { assert.equal(order, 'new-order'); done({ code: 1, data: 'ok' }); }; + f.cc.fx.GameTool.shopBuy = (id, compensate, data) => requests.push(data.outTradeNo); + f.gift.buyProduct(); + assert.deepEqual(requests, [['starter_pack',1,300],'new-order']); assert.equal(f.info.starterPackPurchased,true); +}); +test('pending order still completes after expiry while a fresh order is forbidden', () => { + const f = fixture(); f.gift.pendingOrder = 'late'; f.info.starter_packTime = f.getNow()/1000 - 1; + f.api.buyProp = () => assert.fail('created new order'); + f.api.getPayInfo = (done, order) => { assert.equal(order, 'late'); done({ code: 1, data: { pay_state: 2 } }); }; + f.api.setPayInfo = (done, order) => done({ code: 1, data: 'ok' }); + let grantedOrder; f.cc.fx.GameTool.shopBuy = (id, comp, data) => { grantedOrder = data.outTradeNo; }; + f.gift.onShow(); assert.equal(grantedOrder, 'late'); assert.equal(f.gift.node.active, false); +}); +test('client grants 8000/8 for purchases and compensation, ignoring old snapshots and deduplicating order ids', () => { + const f = fixture(); + const ast = source('assets/Script/module/Tool/GameTool.ts'); + const obj = ast.statements.find(n => ts.isVariableStatement(n) && n.declarationList.declarations.some(d => d.name.getText(ast) === 'GameTool')); + const method = obj.declarationList.declarations.find(d => d.name.getText(ast) === 'GameTool').initializer.properties.find(m => m.name?.getText(ast) === 'shopBuy'); + const tool = compile(`const tool = { ${method.getText(ast)} }; tool;`, { ...f.globals, MapConroler: { _instance: null } }); + const coins = [], props = []; + f.cc.fx.GameTool.changeCoin = n => coins.push(n); tool.getShopProp = data => props.push(data); + tool.shopBuy('starter_pack', false, { outTradeNo: 'old', starterPackVersion: 1, starterPackRewards: { coin: 3000, hammer: 5, freeze: 5, magic_wand: 5 } }); + tool.shopBuy('starter_pack', true, { outTradeNo: 'new', starterPackVersion: 2 }); + tool.shopBuy('starter_pack', false, { outTradeNo: 'new', starterPackVersion: 2 }); + assert.deepEqual(coins, [8000,8000]); + assert.deepEqual(props.map(p => [p.hammer,p.freeze,p.magic_wand]), [[8,8,8],[8,8,8]]); +}); +test('HTTP timeout or empty response terminates once, allowing payment UI to recover', () => { + const f = fixture(), xhr = { open() {}, setRequestHeader() {}, send() {} }; + f.cc.loader = { getXMLHttpRequest: () => xhr }; + f.cc.fx.GameTool.getWechatGameVersion = () => '开发版'; + const Utils = methods(utilsPath, ['POST'], f.globals); Utils.testHttpip = 'https://test.invalid/'; + const responses = []; + Utils.POST('limitedTimeEvent', {}, res => responses.push(res)); + xhr.ontimeout(); xhr.onerror(); xhr.readyState=4; xhr.status=0; xhr.responseText=''; xhr.onreadystatechange(); + assert.equal(responses.length,1); assert.equal(responses[0].code,0); +}); +test('visible gift still suppresses monthly popup after its daily reminder is recorded', () => { + const f = fixture(), Home = methods(homePath, ['update'], f.globals); + const h = new Home(); h.newbieGift = false; + h.actionpNode = { active: true }; h.monthlyCardNode = { active: true }; + h.update(0); assert.equal(h.monthlyCardNode.active, false); +}); +test('time-only activity response can create a 3 yuan order without reward version', () => { + const f = fixture(); + f.api.getStarter_pack = done => done({ code: 1, data: { starter_pack: f.info.starter_packTime * 1000, starter_packState: 0 } }); + let requested = false; + f.api.buyProp = (id, count, price, platform, name, done) => { + requested = true; assert.equal(price, 300); assert.equal(count, 1); + done({ err: true, errMsg: 'cancelled' }); + }; + f.gift.buyProduct(); assert.equal(requested, true); assert.equal(f.gift.paying, false); + assert.equal(f.events.includes('礼包正在更新,请稍后重试'), false); +}); +test('failed customer-service launch clears the unusable pending order for retry', () => { + const f = fixture(); + f.api.GoKEFu = (info, done) => { f.info.iosStarterOrder = 'never-created'; done('fail'); }; + f.gift.iosOldPay(); assert.equal(f.info.iosStarterOrder, ''); + assert.equal(f.gift.paying, false); +}); +test('foreground events during reward confirmation do not start a second claim', () => { + const f = fixture(); f.gift.pendingOrder = 'one-order'; + let confirmations = 0, finish; + f.api.getPayInfo = done => done({ code: 1, data: { pay_state: 2 } }); + f.api.setPayInfo = done => { confirmations++; finish = done; }; + f.cc.fx.GameTool.shopBuy = () => {}; + f.gift.onShow(); f.gift.onShow(); assert.equal(confirmations, 1); + finish({ code: 1, data: 'ok' }); +}); + +test('legacy iOS success after expiry grants immediately without another acknowledgement', () => { + const f = fixture(); f.info.iosStarterOrder = 'ios-order'; f.info.starter_packTime = 0.1; + f.api.getIosPayInfo = (order, done) => { + assert.equal(order, 'ios-order'); + done({ code: 1, data: { goodsPrice: 300, payment_name: 'starter_pack' } }); + }; + f.api.setPayInfo = () => assert.fail('iOS order already completed by payment query'); + let granted; + f.cc.fx.GameTool.shopBuy = (id, compensate, context) => { granted = context.outTradeNo; }; + f.gift.onShow(); + assert.equal(granted, 'ios-order'); assert.equal(f.info.iosStarterOrder, ''); + assert.equal(f.gift.node.active, false); +}); + +test('completed legacy orders clear pending UI without granting again', () => { + for (const direct of [true, false]) { + const f = fixture(); + if (direct) f.gift.pendingOrder = 'completed'; else f.info.iosStarterOrder = 'completed'; + f.api.getPayInfo = done => done({ code: 1, data: { pay_state: 1 }, msg: '已领取奖励' }); + f.api.getIosPayInfo = (order, done) => done({ code: 0, data: null, msg: '已经获取到奖励' }); + f.api.setPayInfo = () => assert.fail('completed order acknowledged again'); + f.cc.fx.GameTool.shopBuy = () => assert.fail('completed order granted again'); + f.gift.onShow(); + assert.equal(f.gift.pendingOrder, ''); assert.equal(f.info.iosStarterOrder, ''); + assert.equal(f.gift.polling, false); assert.equal(f.info.starterPackPurchased, true); + } +}); + +test('acknowledgement retry retains confirmed order even if the server has completed it', () => { + const f = fixture(); f.gift.pendingOrder = 'retry-order'; + let polls = 0, confirms = 0, grants = 0; + f.api.getPayInfo = done => { polls++; done({ code: 1, data: { pay_state: 2 } }); }; + f.api.setPayInfo = (done, order) => { + assert.equal(order, 'retry-order'); confirms++; + done(confirms === 1 ? { code: 0 } : { code: 1, data: 'ok' }); + }; + f.cc.fx.GameTool.shopBuy = () => { grants++; }; + f.gift.onShow(); assert.equal(grants, 0); + f.gift.againGet(); + assert.equal(polls, 1); assert.equal(confirms, 2); assert.equal(grants, 1); +}); + +test('deadline passing during preflight prevents the client from requesting an order', () => { + const f = fixture(); + f.api.getStarter_pack = done => done({ code: 1, data: { starter_pack: f.getNow(), starter_packState: 0 } }); + f.api.buyProp = () => assert.fail('client created expired order'); + f.gift.buyProduct(); assert.equal(f.gift.paying, false); + assert.equal(f.cc.find('btnContainer/btn', f.gift.node).components.Button.interactable, false); +}); + +test('login compensation accepts legacy ok response and keeps original order id without changing health', () => { + const f = fixture(); f.globals.wx = {}; + f.info.allOutTradeNo = [{ itemid: 'starter_pack', outTradeNo: 'old-login-order', goodsPrice: 300 }]; + Object.assign(f.info, { hp: 7, hp_Max: 7, doubleCoin: 2 }); + f.api.getShopDouble = done => done({ code: 1, data: { shopDouble: {} } }); + f.api.setPayInfo = (done, order) => { + assert.equal(order, 'old-login-order'); done({ code: 1, data: 'ok' }); + }; + let context; + f.cc.fx.GameTool.shopBuy = (id, compensate, data) => { + assert.equal(compensate, true); context = data; + }; + const Home = methods(homePath, ['getOrder'], f.globals), h = new Home(); + h.deferHomePopupWhileTransfer = () => false; h.isHomeRuntimeAlive = () => false; + h.getOrder(); + assert.deepEqual(JSON.parse(JSON.stringify(context)), { outTradeNo: 'old-login-order' }); + assert.equal(f.info.allOutTradeNo.length, 0); + assert.deepEqual([f.info.hp, f.info.hp_Max, f.info.doubleCoin], [7,7,2]); +}); + +function pollingFixture() { + const f = fixture(), timers = new Map(); let nextId = 0; + const globals = { ...f.globals, + setTimeout(fn, delay) { const id = ++nextId; timers.set(id, { fn, at: f.getNow() + delay }); return id; }, + clearTimeout(id) { timers.delete(id); }, + }; + const Payment = methods(utilsPath, ['getPayInfo'], globals); Payment.uid = f.info.uid; + f.api.getPayInfo = Payment.getPayInfo.bind(Payment); + const advance = ms => { + const end = f.getNow() + ms; + while (timers.size) { + const [id, timer] = [...timers].sort((a,b) => a[1].at - b[1].at)[0]; + if (timer.at > end) break; + timers.delete(id); f.setNow(timer.at); timer.fn(); + } + f.setNow(end); + }; + return { ...f, Payment, advance, timers }; +} + +test('WeChat success with backend still unpaid times out in 30 seconds, preserves order and later grants once', () => { + const f = pollingFixture(); let paid = false, polls = 0, grants = 0, claims = 0, created = 0; + f.api.buyProp = (id, count, price, platform, name, done) => { + created++; done({ errMsg: 'requestPayment:ok', outTradeNo: 'paid-on-phone' }); + }; + f.Payment.POST = (url, body, done) => { + polls++; assert.equal(body.outTradeNo, 'paid-on-phone'); + done(paid ? { code: 1, data: { pay_state: 2 } } : { code: 0, data: { pay_state: 1 }, msg: '充值未成功' }); + }; + f.api.setPayInfo = done => { claims++; done({ code: 1, data: 'ok' }); }; + f.cc.fx.GameTool.shopBuy = () => { grants++; }; + f.gift.buyProduct(); f.gift.onShow(); assert.equal(polls, 1); + f.advance(30000); + assert.equal(grants, 0); assert.equal(claims, 0); + assert.equal(f.gift.paying, false); assert.equal(f.gift.polling, false); + assert.equal(f.gift.pendingOrder, 'paid-on-phone'); + assert.equal(f.gift.node.getChildByName('ConfirmBox').active, true); + const stoppedPolls = polls; f.advance(60000); assert.equal(polls, stoppedPolls); + paid = true; f.gift.againGet(); f.gift.onShow(); + assert.equal(created, 1); assert.equal(claims, 1); assert.equal(grants, 1); + assert.equal(f.gift.pendingOrder, ''); assert.equal(f.timers.size, 0); +}); + +test('payment poll deadline completes once and ignores a late successful response', () => { + const f = pollingFixture(), results = []; let respond; + f.Payment.POST = (url, body, done) => { respond = done; }; + f.Payment.getPayInfo(res => results.push(res), 'slow-order', { timeoutMs: 30000 }); + f.advance(30000); assert.equal(results.length, 1); assert.equal(results[0].code, 0); + respond({ code: 1, data: { pay_state: 2 } }); f.advance(60000); + assert.equal(results.length, 1); assert.equal(f.timers.size, 0); +}); + +test('malformed poll response does not throw or leave the payment UI locked forever', () => { + const f = pollingFixture(); f.gift.pendingOrder = 'bad-response'; + f.Payment.POST = (url, body, done) => done({ code: 1, data: null }); + f.cc.fx.GameTool.shopBuy = () => assert.fail('malformed response granted rewards'); + assert.doesNotThrow(() => f.gift.onShow()); f.advance(30000); + assert.equal(f.gift.paying, false); assert.equal(f.gift.polling, false); + assert.equal(f.gift.pendingOrder, 'bad-response'); +}); + +test('payment callback without an order id releases the loading state instead of silently stopping', () => { + const f = fixture(); f.api.buyProp = (id, count, price, platform, name, done) => done({ errMsg: 'requestPayment:ok' }); + f.cc.fx.GameTool.shopBuy = () => assert.fail('missing order id granted rewards'); + f.gift.buyProduct(); assert.equal(f.gift.paying, false); + assert.ok(f.events.includes('支付订单号缺失,请重进游戏检查补单')); +}); + +for (const version of ['开发版','体验版','正式版']) { + test(version + ' requires real payment confirmation and ignores old local test grant records', () => { + const f = fixture(); let paid = false, created = 0, grants = 0, claims = 0; + f.cc.fx.GameTool.getWechatGameVersion = () => version; + f.storage.set('StarterPackGranted_' + f.info.uid + '_starter_test_' + f.info.starter_packTime, true); + f.api.buyProp = (id, count, price, platform, name, done) => { + created++; assert.equal(price,300); done({outTradeNo:'real-order'}); + }; + f.api.getPayInfo = done => done(paid ? {code:1,data:{pay_state:2}} : {code:0}); + f.api.setPayInfo = (done,order) => {claims++; assert.equal(order,'real-order'); done({code:1,data:'ok'});}; + f.cc.fx.GameTool.shopBuy = (id,compensate,context) => {grants++; assert.equal(context.outTradeNo,'real-order');}; + f.gift.buyProduct(); + assert.equal(created,1); assert.equal(grants,0); assert.equal(claims,0); + assert.equal(f.info.starterPackPurchased,false); assert.equal(f.gift.pendingOrder,'real-order'); + paid=true; f.gift.againGet(); + assert.equal(created,1); assert.equal(claims,1); assert.equal(grants,1); + assert.equal(f.info.starterPackPurchased,true); assert.ok(f.events.includes('充值成功')); + }); +}