更新支付相关

This commit is contained in:
YZ\249929363 2025-07-15 18:27:19 +08:00
parent 9e627d3b69
commit f646c4a386
10 changed files with 1184 additions and 93 deletions

View File

@ -191,18 +191,21 @@
}, },
{ {
"__id__": 263 "__id__": 263
},
{
"__id__": 268
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 268 "__id__": 277
}, },
{ {
"__id__": 269 "__id__": 278
}, },
{ {
"__id__": 270 "__id__": 279
} }
], ],
"_prefab": null, "_prefab": null,
@ -12677,6 +12680,401 @@
"_N$enableBatch": false, "_N$enableBatch": false,
"_id": "c8qlI72JZCSKV6jXEK7mpe" "_id": "c8qlI72JZCSKV6jXEK7mpe"
}, },
{
"__type__": "cc.Node",
"_name": "Loading",
"_objFlags": 0,
"_parent": {
"__id__": 4
},
"_children": [
{
"__id__": 269
},
{
"__id__": 272
},
{
"__id__": 274
}
],
"_active": false,
"_components": [
{
"__id__": 276
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1080,
"height": 1920
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
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": "4ePjggj8tN46YqiIA+HRsb"
},
{
"__type__": "cc.Node",
"_name": "New Sprite(Splash)",
"_objFlags": 0,
"_parent": {
"__id__": 268
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 270
},
{
"__id__": 271
}
],
"_prefab": null,
"_opacity": 120,
"_color": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 3000,
"height": 3000
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
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": "d4h9nSj9RMM6HnwFOVyjf1"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 269
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "a23235d1-15db-4b95-8439-a2e005bfff91"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "98Iik4j1ZAqqcF9AyC7FLx"
},
{
"__type__": "cc.BlockInputEvents",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 269
},
"_enabled": true,
"_id": "f7VWpZp11LWprv6A8lnYhR"
},
{
"__type__": "cc.Node",
"_name": "load",
"_objFlags": 0,
"_parent": {
"__id__": 268
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 273
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 689,
"height": 656
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
0.5,
0.5,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "eaR6sogyxOcJaWjbE5eSF1"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 272
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "794efc8c-624c-469f-84c0-24ce84022c54"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "5cezb/BW9Fw54XLAdLou49"
},
{
"__type__": "cc.Node",
"_name": "New Label",
"_objFlags": 0,
"_parent": {
"__id__": 268
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 275
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 135,
"height": 56.7
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
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": "c1KHBTOahGpJS93C2sB/lp"
},
{
"__type__": "cc.Label",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 274
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_string": "请稍后",
"_N$string": "请稍后",
"_fontSize": 45,
"_lineHeight": 45,
"_enableWrapText": true,
"_N$file": null,
"_isSystemFontUsed": true,
"_spacingX": 0,
"_batchAsBitmap": false,
"_styleFlags": 0,
"_underlineHeight": 0,
"_N$horizontalAlign": 1,
"_N$verticalAlign": 1,
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$cacheMode": 0,
"_id": "88GNsUUo5Mc6gDnzEvAq40"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 268
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 45,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": "ce9uaZDp9PG6PxkobFhUHt"
},
{ {
"__type__": "cc.Canvas", "__type__": "cc.Canvas",
"_name": "", "_name": "",

View File

@ -215,9 +215,11 @@ export default class GameManager extends cc.Component {
MiniGameSdk.API.shushu_Init(); MiniGameSdk.API.shushu_Init();
Utils.getUserInfo((data) => { Utils.getUserInfo((data) => {
console.log("登陆成功", data); console.log("登陆成功", data);
if (data.outTradeNo.length > 0) { if (data.data.outTradeNo.length > 0) {
console.log("______________________________有未发放奖励"); console.log("设置补发数据", data.data.outTradeNo);
cc.fx.GameConfig.GM_INFO.allOutTradeNo = data.outTradeNo; cc.fx.GameConfig.GM_INFO.allOutTradeNo = [];
cc.fx.GameConfig.GM_INFO.allOutTradeNo = data.data.outTradeNo;
console.log("______________________________有未发放奖励", cc.fx.GameConfig.GM_INFO.allOutTradeNo);
} }
this.load6 = true; this.load6 = true;
}); });

View File

@ -63,7 +63,7 @@ export default class JiaZai extends cc.Component {
onLoad() { onLoad() {
cc.game.setFrameRate(63); cc.game.setFrameRate(63);
LQCollideSystem.is_enable = true; LQCollideSystem.is_enable = true;
// console.log("加载关卡配置2"); // //console.log("加载关卡配置2");
// window.initMgr(); // window.initMgr();
GameManager._instance.Block_Color = this.Block_Color; GameManager._instance.Block_Color = this.Block_Color;
let version = cc.fx.GameTool.getWechatGameVersion(); let version = cc.fx.GameTool.getWechatGameVersion();
@ -95,7 +95,7 @@ export default class JiaZai extends cc.Component {
if (cc.fx.GameConfig.GM_INFO.first) { if (cc.fx.GameConfig.GM_INFO.first) {
console.log("————————准备注册事件", cc.fx.GameConfig.GM_INFO.openid); //console.log("————————准备注册事件", cc.fx.GameConfig.GM_INFO.openid);
const group = cc.fx.GameTool.setWechatGameGroup(2); const group = cc.fx.GameTool.setWechatGameGroup(2);
if (group == 0) { if (group == 0) {
cc.fx.GameConfig.GM_INFO.musicOpen = true; cc.fx.GameConfig.GM_INFO.musicOpen = true;
@ -111,7 +111,7 @@ export default class JiaZai extends cc.Component {
cc.fx.StorageMessage.setStorage("music", audioInfo); cc.fx.StorageMessage.setStorage("music", audioInfo);
if (cc.fx.GameConfig.GM_INFO.openid != "") { if (cc.fx.GameConfig.GM_INFO.openid != "") {
console.log("————————发送注册事件"); //console.log("————————发送注册事件");
const time = cc.fx.GameTool.formatDate(new Date()); const time = cc.fx.GameTool.formatDate(new Date());
let data = { let data = {
register_time: time, // 注册时间 register_time: time, // 注册时间
@ -129,14 +129,16 @@ export default class JiaZai extends cc.Component {
} }
console.log("音乐开关", cc.fx.GameConfig.GM_INFO.musicOpen); //console.log("音乐开关", cc.fx.GameConfig.GM_INFO.musicOpen);
AudioManager._instance.playMusicGame(); AudioManager._instance.playMusicGame();
this.getOrder();
} }
start() { start() {
// console.log("已经进入Home界面"); // //console.log("已经进入Home界面");
// console.log("金币",cc.fx.GameConfig.GM_INFO.coin); // //console.log("金币",cc.fx.GameConfig.GM_INFO.coin);
// console.log("关卡",cc.fx.GameConfig.GM_INFO.level+1); // //console.log("关卡",cc.fx.GameConfig.GM_INFO.level+1);
cc.fx.GameTool.getHealth(null); cc.fx.GameTool.getHealth(null);
// cc.fx.GameConfig.LEVEL_INFO_init(false,0); // cc.fx.GameConfig.LEVEL_INFO_init(false,0);
@ -216,7 +218,7 @@ export default class JiaZai extends cc.Component {
this.stopHeathTimeCutDown(); this.stopHeathTimeCutDown();
let timeTemp = cc.fx.GameTool.getTimeMargin(cc.fx.GameConfig.GM_INFO.min_Time); let timeTemp = cc.fx.GameTool.getTimeMargin(cc.fx.GameConfig.GM_INFO.min_Time);
console.log("健康值倒计时结束,当前时间:", timeTemp, cc.fx.GameConfig.GM_INFO.min_Time); //console.log("健康值倒计时结束,当前时间:", timeTemp, cc.fx.GameConfig.GM_INFO.min_Time);
if (timeLabelNode) { if (timeLabelNode) {
NumberToImage.getTimeMargin(cc.fx.GameConfig.GM_INFO.min_Time, 50, "time_", timeLabelNode); NumberToImage.getTimeMargin(cc.fx.GameConfig.GM_INFO.min_Time, 50, "time_", timeLabelNode);
} }
@ -250,11 +252,14 @@ export default class JiaZai extends cc.Component {
if (this.Stamina && this.Stamina.getChildByName("time")) { if (this.Stamina && this.Stamina.getChildByName("time")) {
this.Stamina.getChildByName("time").getComponent(cc.Label).string = timeTemp; this.Stamina.getChildByName("time").getComponent(cc.Label).string = timeTemp;
} }
MiniGameSdk.API.showToast("恢复一点体力"); if (cc.fx.GameConfig.GM_INFO.hp < 5) {
cc.fx.GameTool.setUserHealth(1, (data) => { MiniGameSdk.API.showToast("恢复一点体力");
cc.fx.GameTool.getHealth(null); cc.fx.GameTool.setUserHealth(1, (data) => {
this.setHealthInfo(); cc.fx.GameTool.getHealth(null);
}) this.setHealthInfo();
})
}
} }
else { else {
cc.fx.GameConfig.GM_INFO.min_Time -= 1; cc.fx.GameConfig.GM_INFO.min_Time -= 1;
@ -363,7 +368,7 @@ export default class JiaZai extends cc.Component {
// 非第一次使用,直接激活节点 // 非第一次使用,直接激活节点
this.shopNode.active = true; this.shopNode.active = true;
} }
// console.log("shopNode parent:", this.shopNode.parent); // //console.log("shopNode parent:", this.shopNode.parent);
} }
// 关闭商店 // 关闭商店
@ -394,9 +399,9 @@ export default class JiaZai extends cc.Component {
openPause() { openPause() {
cc.fx.AudioManager._instance.playEffect("anniu_little", null); cc.fx.AudioManager._instance.playEffect("anniu_little", null);
console.log(cc.fx.GameConfig.GM_INFO); //console.log(cc.fx.GameConfig.GM_INFO);
if (cc.fx.GameConfig.GM_INFO.openid == undefined) { if (cc.fx.GameConfig.GM_INFO.openid == undefined) {
console.log(cc.fx.GameConfig.GM_INFO.openid); //console.log(cc.fx.GameConfig.GM_INFO.openid);
cc.fx.GameConfig.GM_INFO.openid = ""; cc.fx.GameConfig.GM_INFO.openid = "";
} }
this.node.getChildByName("Pause").active = true; this.node.getChildByName("Pause").active = true;
@ -443,9 +448,94 @@ export default class JiaZai extends cc.Component {
} }
updateCoin() { updateCoin() {
console.log("主页更新金币", cc.fx.GameConfig.GM_INFO.coin); //console.log("主页更新金币", cc.fx.GameConfig.GM_INFO.coin);
NumberToImage.numberToImageNodes(cc.fx.GameConfig.GM_INFO.coin, 30, 15, "coin_", this.coin, true); NumberToImage.numberToImageNodes(cc.fx.GameConfig.GM_INFO.coin, 30, 15, "coin_", this.coin, true);
} }
getOrder() {
if (typeof wx !== 'undefined' && wx !== null) {
// 判断设备系统
let systemType = "Android";
try {
//@ts-ignore
const systemInfo = wx.getSystemInfoSync();
if (systemInfo.platform === 'ios') {
systemType = "ios";
}
} catch (e) {
console.error('获取系统信息失败', e);
}
if (cc.fx.GameConfig.GM_INFO.allOutTradeNo.length != 0) {
//console.log("有需要补发数据", cc.fx.GameConfig.GM_INFO.allOutTradeNo);
// 递归函数,按顺序处理每个订单
const processOrder = (index: number) => {
if (index >= cc.fx.GameConfig.GM_INFO.allOutTradeNo.length) {
return; // 所有订单处理完成
}
let order = cc.fx.GameConfig.GM_INFO.allOutTradeNo[index];
console.log("需要补发数据", order);
if (order.itemid == "gold_1" || order.itemid == "gold_2" || order.itemid == "gold_3"
|| order.itemid == "gold_4" || order.itemid == "gold_5" || order.itemid == "gold_6"
) {
this.openLoad();
console.log("补发名称:", order.itemid);
let productId = order.itemid;
Utils.setPayInfo((res) => {
console.log("设置轮训结果:", res);
this.closeLoad();
if (res.code === 1) {
console.log("7.14_________正式发货");
let coinTemp = 0;
if (order.itemid == "gold_1") { coinTemp = 1200; }
else if (order.itemid == "gold_2") { coinTemp = 8000; }
else if (order.itemid == "gold_3") { coinTemp = 16000; }
else if (order.itemid == "gold_4") { coinTemp = 32000; }
else if (order.itemid == "gold_5") { coinTemp = 100000; }
else if (order.itemid == "gold_6") { coinTemp = 240000; }
let title = "充值补发奖励金币:" + coinTemp;
MiniGameSdk.API.showToast(title);
cc.fx.GameTool.shopBuy(productId);
console.log("充值成功获得金币");
} else {
MiniGameSdk.API.showToast("网络异常,充值奖励将在登录后再次发放");
const dataFail4 = {
outTradeNo: Utils.outTradeNo,
price: parseInt(order.goodsPrice),
payment_name: productId,
payment_num: 1,
type: systemType,
fail_reason: "成功付款,但是发货时请求服务器失败,重新进入游戏后轮训发货又失败",
}
cc.fx.GameTool.shushu_Track("payment_fail", dataFail4);
}
NumberToImage.numberToImageNodes(cc.fx.GameConfig.GM_INFO.coin, 30, 15, "coin_", this.coin, true);
this.updateCoin();
// 处理下一个订单
processOrder(index + 1);
}, order.outTradeNo);
} else {
// 如果当前订单不处理,直接处理下一个订单
processOrder(index + 1);
}
};
// 从第一个订单开始处理
processOrder(0);
}
}
}
openLoad() {
this.node.getChildByName("Loading").active = true;
this.node.getChildByName("Loading").getChildByName("load").stopAllActions();
this.node.getChildByName("Loading").getChildByName("load").runAction(cc.rotateTo(2, 1080).repeatForever());
}
closeLoad() {
this.node.getChildByName("Loading").active = false;
}
// update (dt) {} // update (dt) {}
} }

View File

@ -1362,15 +1362,17 @@ export default class MapConroler extends cc.Component {
// alert("游戏成功"); // alert("游戏成功");
MiniGameSdk.API.showToast(cc.fx.GameConfig.GM_INFO.level); MiniGameSdk.API.showToast(cc.fx.GameConfig.GM_INFO.level);
this.gameWin = true; this.gameWin = true;
console.log("恢复一点体力", cc.fx.GameConfig.GM_INFO.level); if (cc.fx.GameConfig.GM_INFO.hp < 5) {
cc.fx.GameTool.setUserHealth(1, (data) => { console.log("恢复一点体力", cc.fx.GameConfig.GM_INFO.level);
}) cc.fx.GameTool.setUserHealth(1, (data) => {
})
}
this.stopTimeCutDown(); this.stopTimeCutDown();
// console.log("即将上报成功________________________:",this.add_Time); // console.log("即将上报成功________________________:",this.add_Time);
// console.log("成功消除一个",this.add_Time); // console.log("成功消除一个",this.add_Time);
cc.fx.GameTool.changeCoin(40); cc.fx.GameTool.changeCoin(40);
const data = { const data = {
change_reason: "闯关成功获得金币", change_reason: "level",
id: (1001 + ""), id: (1001 + ""),
num: 40 num: 40
} }

View File

@ -73,12 +73,12 @@ export default class Utils {
} }
static getPayInfo(callBack) { static getPayInfo(callBack) {
const delays = [1000, 3000, 3000, 3000, 3000]; // 延迟时间数组 const delays = [1000, 3000, 6000, 9000, 12000];// 延迟时间数组
let attempt = 0; // 轮询次数 let attempt = 0; // 轮询次数
const poll = () => { const poll = () => {
if (attempt >= delays.length) { if (attempt >= delays.length) {
MiniGameSdk.API.showToast("网络异常,如充值成功,重进游戏可领取奖励"); MiniGameSdk.API.showToast("网络异常,如付款成功,重进游戏可领取奖励");
callBack({ code: 0, data: { pay_state: -1 }, message: '轮询超时' }); callBack({ code: 0, data: { pay_state: -1 }, message: '轮询超时' });
return; return;
} }
@ -99,8 +99,8 @@ export default class Utils {
poll(); poll();
} }
static setPayInfo(callBack) { static setPayInfo(callBack, order) {
const delays = [1000, 3000, 3000, 3000, 3000];// 延迟时间数组 const delays = [1000, 3000, 6000, 9000, 12000];// 延迟时间数组
let attempt = 0; // 重试次数 let attempt = 0; // 重试次数
const sendRequest = () => { const sendRequest = () => {
if (attempt > delays.length) { if (attempt > delays.length) {
@ -108,13 +108,17 @@ export default class Utils {
callBack({ code: 0, message: '请求失败,已达到最大重试次数' }); callBack({ code: 0, message: '请求失败,已达到最大重试次数' });
return; return;
} }
Utils.POST("wx/getOrderReward", { outTradeNo: Utils.outTradeNo }, res => { let orderTemp = Utils.outTradeNo;
if (order) orderTemp = order;
Utils.POST("wx/getOrderReward", { outTradeNo: orderTemp }, res => {
console.log("告知服务器发货:", res); console.log("告知服务器发货:", res);
if (res.code === 1) { if (res.code === 1) {
console.log("告知服务器发货成功:", res);
// 请求成功,调用回调并返回结果 // 请求成功,调用回调并返回结果
callBack(res); callBack(res);
} else { } else {
// 请求失败,增加重试次数并设置下一次请求的延迟 // 请求失败,增加重试次数并设置下一次请求的延迟
console.log("告知服务器发货失败:", res);
attempt++; attempt++;
if (attempt <= delays.length) { if (attempt <= delays.length) {
setTimeout(sendRequest, delays[attempt - 1]); setTimeout(sendRequest, delays[attempt - 1]);
@ -131,16 +135,24 @@ export default class Utils {
//#region ios支付 //#region ios支付
/**跳转客服*/ /**跳转客服*/
static GoKEFu() { static GoKEFu(iosPayInfo) {
cc.fx.GameConfig.GM_INFO.iosOutTradeNo = null; cc.fx.GameConfig.GM_INFO.iosOutTradeNo = null;
cc.fx.GameConfig.GM_INFO.iosOutTradeNo = `wcx_` + Math.round(Math.random() * 10 ** 13) + Date.now(); cc.fx.GameConfig.GM_INFO.iosOutTradeNo = `wcx_` + Math.round(Math.random() * 10 ** 13) + Date.now();
const data = { const data = {
tpye: "ios", tpye: "ios",
outTradeNo: cc.fx.GameConfig.GM_INFO.iosOutTradeNo, outTradeNo: cc.fx.GameConfig.GM_INFO.iosOutTradeNo,
propName: '金币', propName: iosPayInfo.payment_name,
count: 1, count: iosPayInfo.payment_count,
price: 100,//价格单位是分 price: iosPayInfo.price,//价格单位是分
} }
const shushu_data = {
outTradeNo: cc.fx.GameConfig.GM_INFO.iosOutTradeNo,
price: iosPayInfo.price,
payment_name: iosPayInfo.payment_name,
payment_num: iosPayInfo.payment_count,
type: "ios",
}
cc.fx.GameTool.shushu_Track("init_order", shushu_data);
//@ts-ignore //@ts-ignore
wx.openCustomerServiceConversation({ wx.openCustomerServiceConversation({
sessionFrom: JSON.stringify(data), // 会话来源(可选) sessionFrom: JSON.stringify(data), // 会话来源(可选)
@ -150,28 +162,27 @@ export default class Utils {
} }
}); });
} }
static getIosPayInfo(callBack) { static getIosPayInfo(order, callBack) {
const delays = [1000, 3000, 3000, 3000, 3000]; // 延迟时间数组 const delays = [1000, 3000, 6000, 9000, 12000];// 延迟时间数组
let attempt = 0; // 轮询次数 let attempt = 0; // 轮询次数
const iosOutTradeNo = order;
const poll = () => { const poll = () => {
if (attempt >= delays.length) { if (attempt >= delays.length) {
MiniGameSdk.API.showToast("网络异常,如充值成功,重进游戏可领取奖励"); MiniGameSdk.API.showToast("网络异常,如充值成功,重进游戏可领取奖励");
callBack({ code: 0, data: null, message: '轮询超时' }); callBack({ code: 2, data: null, message: '轮询超时' });
return; return;
} }
console.log("请求uid:" + Utils.uid); console.log("请求uid:" + Utils.uid);
console.log("outTradeNo:" + cc.fx.GameConfig.GM_INFO.iosOutTradeNo); console.log("outTradeNo:" + iosOutTradeNo);
Utils.POST("wx/iosgetPayInfo", { outTradeNo: cc.fx.GameConfig.GM_INFO.iosOutTradeNo }, res => { Utils.POST("wx/iosgetPayInfo", { outTradeNo: iosOutTradeNo }, res => {
console.log("查询字符结果IOS"); console.log("查询字符结果IOS");
console.log(res); console.log(res);
if (res.code === 1) { if (res.code === 1) {
callBack(res); callBack(res);
cc.fx.GameConfig.GM_INFO.iosOutTradeNo = null;
} else if (res.code === 0) { } else if (res.code === 0) {
callBack(res); callBack(res);
cc.fx.GameConfig.GM_INFO.iosOutTradeNo = null;
} }
else { else {
attempt++; attempt++;
@ -183,8 +194,6 @@ export default class Utils {
poll(); poll();
} }
//#endregion //#endregion
//#region 微信云 //#region 微信云
@ -367,9 +376,7 @@ export default class Utils {
if (data == null) { if (data == null) {
data = {}; data = {};
} }
// if(exports.token){//数据中加入安全密匙
// data.token=exports.token;
// }
if (extraUrl == null) { if (extraUrl == null) {
//@ts-ignore //@ts-ignore
if (Utils.isDebug) { if (Utils.isDebug) {

View File

@ -652,17 +652,18 @@ var GameTool = {
cc.fx.GameTool.shushu_Track("resource_cost", dataTemp); cc.fx.GameTool.shushu_Track("resource_cost", dataTemp);
cc.fx.GameTool.setUserProp(propid, num, (data) => { cc.fx.GameTool.setUserProp(propid, num, (data) => {
}) })
const data = {
change_reason: "商城购买道具",
id: (propid + ""),
num: 3
}
cc.fx.GameTool.shushu_Track("resource_get", data);
let _id = ""; let _id = "";
if (propid == 2001) _id = "freeze_in_game"; if (propid == 2001) _id = "freeze_in_game";
else if (propid == 2002) _id = "hammer_in_game"; else if (propid == 2002) _id = "hammer_in_game";
else if (propid == 2003) _id = "wand_in_game"; else if (propid == 2003) _id = "wand_in_game";
const data = {
change_reason: "game",
id: _id,
num: 3
}
cc.fx.GameTool.shushu_Track("resource_get", data);
const buyData = { const buyData = {
item_id: _id, item_id: _id,
item_num: 3, item_num: 3,
@ -875,8 +876,8 @@ var GameTool = {
break; break;
} }
const dataTemp = { const dataTemp = {
change_reason: "商城RMB购买金币", change_reason: "shop",
id: (1001 + ""), id: productId,
num: coin num: coin
} }
cc.fx.GameTool.shushu_Track("resource_get", dataTemp); cc.fx.GameTool.shushu_Track("resource_get", dataTemp);

BIN
assets/shop/img/load.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 121 KiB

View File

@ -0,0 +1,38 @@
{
"ver": "2.3.7",
"uuid": "05d21d52-d94e-49d8-ac95-2d225e80df66",
"importer": "texture",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 1024,
"height": 1024,
"platformSettings": {},
"subMetas": {
"load": {
"ver": "1.0.6",
"uuid": "794efc8c-624c-469f-84c0-24ce84022c54",
"importer": "sprite-frame",
"rawTextureUuid": "05d21d52-d94e-49d8-ac95-2d225e80df66",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": -3.5,
"offsetY": 120,
"trimX": 164,
"trimY": 64,
"width": 689,
"height": 656,
"rawWidth": 1024,
"rawHeight": 1024,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}

View File

@ -34,19 +34,22 @@
}, },
{ {
"__id__": 327 "__id__": 327
},
{
"__id__": 335
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 335 "__id__": 348
}, },
{ {
"__id__": 336 "__id__": 349
} }
], ],
"_prefab": { "_prefab": {
"__id__": 337 "__id__": 350
}, },
"_opacity": 255, "_opacity": 255,
"_color": { "_color": {
@ -12418,6 +12421,453 @@
"fileId": "66oM+CvTZBh6i/lRCAsoRc", "fileId": "66oM+CvTZBh6i/lRCAsoRc",
"sync": false "sync": false
}, },
{
"__type__": "cc.Node",
"_name": "Loading",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [
{
"__id__": 336
},
{
"__id__": 340
},
{
"__id__": 343
}
],
"_active": false,
"_components": [
{
"__id__": 346
}
],
"_prefab": {
"__id__": 347
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 1080,
"height": 1920
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
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": "New Sprite(Splash)",
"_objFlags": 0,
"_parent": {
"__id__": 335
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 337
},
{
"__id__": 338
}
],
"_prefab": {
"__id__": 339
},
"_opacity": 120,
"_color": {
"__type__": "cc.Color",
"r": 0,
"g": 0,
"b": 0,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 3000,
"height": 3000
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
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__": 336
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "a23235d1-15db-4b95-8439-a2e005bfff91"
},
"_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.BlockInputEvents",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 336
},
"_enabled": true,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "47UiHH16RKK6j+4cK469um",
"sync": false
},
{
"__type__": "cc.Node",
"_name": "load",
"_objFlags": 0,
"_parent": {
"__id__": 335
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 341
}
],
"_prefab": {
"__id__": 342
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 689,
"height": 656
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
0,
0,
0,
0,
1,
0.5,
0.5,
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__": 340
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "794efc8c-624c-469f-84c0-24ce84022c54"
},
"_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": "e0njfM7epDhL+otsGYSeCR",
"sync": false
},
{
"__type__": "cc.Node",
"_name": "New Label",
"_objFlags": 0,
"_parent": {
"__id__": 335
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 344
}
],
"_prefab": {
"__id__": 345
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 135,
"height": 56.7
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
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.Label",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 343
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_string": "请稍后",
"_N$string": "请稍后",
"_fontSize": 45,
"_lineHeight": 45,
"_enableWrapText": true,
"_N$file": null,
"_isSystemFontUsed": true,
"_spacingX": 0,
"_batchAsBitmap": false,
"_styleFlags": 0,
"_underlineHeight": 0,
"_N$horizontalAlign": 1,
"_N$verticalAlign": 1,
"_N$fontFamily": "Arial",
"_N$overflow": 0,
"_N$cacheMode": 0,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "fa+8dDqrdLTrl/Ji8K9LMX",
"sync": false
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 335
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 45,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "b50PfruR5P1axiaB0Q563i",
"sync": false
},
{ {
"__type__": "48bfeZuYFZE2qmgxbW2IigB", "__type__": "48bfeZuYFZE2qmgxbW2IigB",
"_name": "", "_name": "",

View File

@ -34,6 +34,12 @@ export default class NewClass extends cc.Component {
@property(cc.Node) @property(cc.Node)
coinAnim: cc.Node = null; coinAnim: cc.Node = null;
private buy: boolean = false; private buy: boolean = false;
private iosPrice: number = 0;
private iosProductId: string = "";
private iosCount: number = 1;
onLoad() { onLoad() {
this.btn_Touch = true; this.btn_Touch = true;
// 检测微信小游戏切到后台 // 检测微信小游戏切到后台
@ -44,12 +50,14 @@ export default class NewClass extends cc.Component {
}; };
//@ts-ignore //@ts-ignore
wx.onShow(this.onShowListener); wx.onShow(this.onShowListener);
} }
} }
start() { start() {
this.btn_Touch = true; this.btn_Touch = true;
this.openShop(); this.openShop();
this.setHealthInfo(); this.setHealthInfo();
} }
//打开商店界面 //打开商店界面
openShop() { openShop() {
@ -139,18 +147,101 @@ export default class NewClass extends cc.Component {
} }
onShow() { onShow() {
if (cc.fx.GameConfig.GM_INFO.iosOutTradeNo != null && cc.fx.GameConfig.GM_INFO.iosOutTradeNo != "") { if (cc.sys.platform === cc.sys.WECHAT_GAME) {
console.log("有苹果订单号,开始轮训"); if (cc.fx.GameConfig.GM_INFO.iosOutTradeNo != null && cc.fx.GameConfig.GM_INFO.iosOutTradeNo != "") {
Utils.getIosPayInfo((data) => { //console.log("有苹果订单号,开始轮训");
console.log("获得轮训结果:", data); const iosOutTradeNo = cc.fx.GameConfig.GM_INFO.iosOutTradeNo;
if (data.code == 1) { cc.fx.GameConfig.GM_INFO.iosOutTradeNo = "";
cc.fx.GameConfig.GM_INFO.iosOutTradeNo = null; Utils.getIosPayInfo(iosOutTradeNo,
MiniGameSdk.API.showToast("购买金币成功"); (data) => {
} console.log("获得轮训结果:", data);
}) if (data.code == 1) {
console.log("购买成功");
const dataSuccess = {
outTradeNo: iosOutTradeNo,
price: this.iosPrice,
payment_name: this.iosProductId,
payment_num: this.iosCount,
type: "ios",
}
cc.fx.GameTool.shushu_Track("payment", dataSuccess);
let name = "购买金币道具:" + this.iosProductId;
MiniGameSdk.API.yinli_Pay(this.iosPrice, iosOutTradeNo, name)
Utils.setPayInfo((res) => {
this.closeLoad();
//console.log("设置轮训结果:", res);
if (res.code === 1) {
console.log("_________正式发货");
MiniGameSdk.API.showToast("充值成功");
cc.fx.GameTool.shopBuy(this.iosProductId);
//console.log("充值成功获得金币");
}
else {
MiniGameSdk.API.showToast("网络异常,充值奖励将在登录后再次发放");
const dataFail4 = {
outTradeNo: iosOutTradeNo,
price: this.iosPrice,
payment_name: this.iosProductId,
payment_num: this.iosCount,
type: "ios",
fail_reason: "成功付款,但是发货时请求服务器失败,充值成功未发货",
}
cc.fx.GameTool.shushu_Track("payment_fail", dataFail4);
}
NumberToImage.numberToImageNodes(cc.fx.GameConfig.GM_INFO.coin, 30, 15, "coin_", this.coin, true);
if (this.node.parent.getComponent("JiaZai"))
this.node.parent.getComponent("JiaZai").updateCoin();
else if (this.node.parent.getComponent("SceneManager")) {
this.node.parent.getComponent("SceneManager").updateCoin();
}
}, null)
}
else if (data.code == 0) {
console.log("用户自己取消充值");
MiniGameSdk.API.showToast("充值失败");
this.closeLoad();
const dataFail = {
outTradeNo: iosOutTradeNo,
price: this.iosPrice,
payment_name: this.iosProductId,
payment_num: this.iosCount,
type: "ios",
fail_reason: "用户取消充值",
}
cc.fx.GameTool.shushu_Track("payment_fail", dataFail);
}
else if (data.code == 2) {
this.closeLoad();
console.log("轮训超时");
MiniGameSdk.API.showToast("订单已关闭");
const dataFail = {
outTradeNo: iosOutTradeNo,
price: this.iosPrice,
payment_name: this.iosProductId,
payment_num: this.iosCount,
type: "ios",
fail_reason: "用户充值后,轮训结果超时",
}
cc.fx.GameTool.shushu_Track("payment_fail", dataFail);
}
this.btn_Touch = true;
cc.fx.GameConfig.GM_INFO.iosOutTradeNo = null;
})
}
} }
} }
openLoad() {
this.node.getChildByName("Loading").active = true;
this.node.getChildByName("Loading").getChildByName("load").stopAllActions();
this.node.getChildByName("Loading").getChildByName("load").runAction(cc.rotateTo(2, 1080).repeatForever());
}
closeLoad() {
this.node.getChildByName("Loading").active = false;
}
setHealthInfo() { setHealthInfo() {
if (cc.fx.GameConfig.GM_INFO.hp >= 5) { if (cc.fx.GameConfig.GM_INFO.hp >= 5) {
@ -239,7 +330,7 @@ export default class NewClass extends cc.Component {
price = 64800; price = 64800;
break; break;
} }
console.log("获得商品id:", id, count, price); //console.log("获得商品id:", id, count, price);
// 判断设备系统 // 判断设备系统
let systemType = "Android"; let systemType = "Android";
try { try {
@ -256,7 +347,16 @@ export default class NewClass extends cc.Component {
if (systemType == "ios") { if (systemType == "ios") {
// MiniGameSdk.API.showToast("IOS系统暂不支持支付"); // MiniGameSdk.API.showToast("IOS系统暂不支持支付");
// this.btn_Touch = true; // this.btn_Touch = true;
Utils.GoKEFu(); this.openLoad();
let iosPayInfo = {
price: price,
payment_name: productId,
payment_count: 1,
}
this.iosPrice = price;
this.iosProductId = productId;
this.iosCount = 1;
Utils.GoKEFu(iosPayInfo);
} }
else { else {
const data = { const data = {
@ -267,9 +367,10 @@ export default class NewClass extends cc.Component {
type: systemType, type: systemType,
} }
cc.fx.GameTool.shushu_Track("init_order", data); cc.fx.GameTool.shushu_Track("init_order", data);
console.log("7.14_____________________", "调用充值接口"); this.openLoad();
//console.log("7.14_____________________", "调用充值接口");
Utils.buyProp(id, count, price, (res) => { Utils.buyProp(id, count, price, (res) => {
console.log("获得充值结果", res); //console.log("获得充值结果", res);
if (res == null) { if (res == null) {
MiniGameSdk.API.showToast("充值失败"); MiniGameSdk.API.showToast("充值失败");
this.btn_Touch = true; this.btn_Touch = true;
@ -282,11 +383,12 @@ export default class NewClass extends cc.Component {
fail_reason: "网络异常,没有拉起支付", fail_reason: "网络异常,没有拉起支付",
} }
cc.fx.GameTool.shushu_Track("payment_fail", dataFail); cc.fx.GameTool.shushu_Track("payment_fail", dataFail);
this.closeLoad();
return; return;
} }
else if (res.err) { else if (res.err) {
MiniGameSdk.API.showToast("充值失败"); MiniGameSdk.API.showToast("充值失败");
console.log(res); //console.log(res);
this.btn_Touch = true; this.btn_Touch = true;
let name = "支付拉起失败"; let name = "支付拉起失败";
if (res.errCode == -2) { if (res.errCode == -2) {
@ -301,12 +403,14 @@ export default class NewClass extends cc.Component {
fail_reason: name, fail_reason: name,
} }
cc.fx.GameTool.shushu_Track("payment_fail", dataFail); cc.fx.GameTool.shushu_Track("payment_fail", dataFail);
this.closeLoad();
return; return;
} }
else { else {
Utils.getPayInfo((data) => { Utils.getPayInfo((data) => {
console.log("7.14_______________充值成功,准备轮训"); //console.log("7.14_______________充值成功,准备轮训");
console.log("获得轮训结果:", data); //console.log("获得轮训结果:", data);
this.closeLoad();
if (data.data.pay_state == 1) { if (data.data.pay_state == 1) {
this.btn_Touch = true; this.btn_Touch = true;
MiniGameSdk.API.showToast("取消充值"); MiniGameSdk.API.showToast("取消充值");
@ -322,24 +426,24 @@ export default class NewClass extends cc.Component {
} }
else if (data.data.pay_state == 2) { else if (data.data.pay_state == 2) {
this.btn_Touch = true; this.btn_Touch = true;
console.log("7.14_______________充值成功,轮训成功,准备发货"); const dataSuccess = {
Utils.setPayInfo((data) => { outTradeNo: Utils.outTradeNo,
console.log("设置轮训结果:", data); price: price,
if (data.code === 1) { payment_name: productId,
console.log("7.14_________正式发货"); payment_num: 1,
type: systemType,
}
cc.fx.GameTool.shushu_Track("payment", dataSuccess);
let name = "购买金币道具:" + productId;
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("充值成功"); MiniGameSdk.API.showToast("充值成功");
cc.fx.GameTool.shopBuy(productId); cc.fx.GameTool.shopBuy(productId);
console.log("充值成功获得金币"); //console.log("充值成功获得金币");
const dataSuccess = {
outTradeNo: Utils.outTradeNo,
price: price,
payment_name: productId,
payment_num: 1,
type: systemType,
}
cc.fx.GameTool.shushu_Track("payment", dataSuccess);
let name = "购买金币道具:" + productId;
MiniGameSdk.API.yinli_Pay(price, Utils.outTradeNo, name)
} }
else { else {
MiniGameSdk.API.showToast("网络异常,充值奖励将在登录后再次发放"); MiniGameSdk.API.showToast("网络异常,充值奖励将在登录后再次发放");
@ -359,8 +463,7 @@ export default class NewClass extends cc.Component {
else if (this.node.parent.getComponent("SceneManager")) { else if (this.node.parent.getComponent("SceneManager")) {
this.node.parent.getComponent("SceneManager").updateCoin(); this.node.parent.getComponent("SceneManager").updateCoin();
} }
}, null)
})
} }
else { else {
NumberToImage.numberToImageNodes(cc.fx.GameConfig.GM_INFO.coin, 30, 15, "coin_", this.coin, true); NumberToImage.numberToImageNodes(cc.fx.GameConfig.GM_INFO.coin, 30, 15, "coin_", this.coin, true);