修复IOS以及游戏BUG

This commit is contained in:
YZ\249929363 2025-08-13 10:43:17 +08:00
parent 0118f2bd90
commit a0441e81ec
36 changed files with 3622 additions and 1057 deletions

File diff suppressed because it is too large Load Diff

View File

@ -474,7 +474,6 @@ export default class Block extends cc.Component {
if (jg >= 0) {
this.over = true;
// MapConroler._instance.changeState(true);
this.removeBoxCollider();
this.removeMapBlock();
this.removeAction(jg, type);
@ -745,8 +744,8 @@ export default class Block extends cc.Component {
}
//道具魔棒消除
eliminate() {
eliminate(type) {
clearTimeout(this.scheduleCallback2);
clearTimeout(this.scheduleCallback);
clearTimeout(this.scheduleCallback3);
@ -787,14 +786,12 @@ export default class Block extends cc.Component {
this.node.getChildByName("boom").getComponent("Boom").stopBoom();
}
this.scheduleCallback2 = setTimeout(() => {
MapConroler._instance.blockNum -= 1;
MapConroler._instance.special_Treatment(this.node);
MapConroler._instance.special_Treatment(this.node, type);
}, 950);
this.scheduleCallback2 = setTimeout(() => {
//如果方块可以消除
// MapConroler._instance.blockNum -= 1;
// MapConroler._instance.special_Treatment(this.node);
var self = this;
@ -926,7 +923,7 @@ export default class Block extends cc.Component {
this.scheduleCallback2 = setTimeout(() => {
//如果方块可以消除
MapConroler._instance.blockNum -= 1;
MapConroler._instance.special_Treatment(this.node);
MapConroler._instance.special_Treatment(this.node, true);
var self = this;
this.removeMapBlock();
MapConroler._instance.judgeWin(0);
@ -1615,7 +1612,7 @@ export default class Block extends cc.Component {
try {
// 检查动画是否存在
if (!skeletonComponent.findAnimation("play")) {
console.error(`动画 "play" 不存在于 Spine 资源中`);
// console.error(`动画 "play" 不存在于 Spine 资源中`);
return;
}
skeletonComponent.setAnimation(0, "play", false);
@ -1624,7 +1621,7 @@ export default class Block extends cc.Component {
skeletonComponent.setCompleteListener((trackEntry, loopCount) => {
// 动画播放完成后自动清理节点
if (skeletonComponent.node && skeletonComponent.node.isValid) {
console.log(`${index} 个特效动画播放完成,开始清理节点`);
// console.log(`第 ${index} 个特效动画播放完成,开始清理节点`);
// 移除节点并销毁
skeletonComponent.node.removeFromParent();
@ -1633,7 +1630,7 @@ export default class Block extends cc.Component {
});
} catch (error) {
console.error(`播放第 ${index} 个方块动画时出错:`, error);
// console.error(`播放第 ${index} 个方块动画时出错:`, error);
}
}

View File

@ -61,7 +61,7 @@ export default class GameManager extends cc.Component {
setTimeout(() => {
this.readUserData();
this.getShareInfo();
}, 200);
}, 100);
if (GameManager._instance == null) {
@ -238,7 +238,7 @@ export default class GameManager extends cc.Component {
this.nowTime = Date.now();
//console.log("开始读取用户信息的时间:", this.nowTime);
const MAX_RETRIES = 15;
const MAX_RETRIES = 30;
// 延迟时间数组,按照 1 秒 3 次、2 秒 5 次、5 秒 6 次、15 秒 5 次的规则生成
const delays = [
...Array(3).fill(2000),
@ -246,7 +246,7 @@ export default class GameManager extends cc.Component {
...Array(6).fill(5000),
...Array(5).fill(15000)
];
//cc.fx.GameConfig.GM_INFO.shushu_DistinctId
const attemptUserInfo = () => {
Utils.getUserInfo((data) => {
if (data.code == 1) { // 假设返回数据中有 success 字段表示成功
@ -345,7 +345,7 @@ export default class GameManager extends cc.Component {
//新用户,有本地缓存读取配置
newReadData() {
//console.log("读取新信息2");
console.log("读取新信息");
let openid = cc.fx.StorageMessage.getStorage("openid");
if (openid == null || openid == "" || openid == undefined) {
//console.log("没有openid");
@ -356,17 +356,19 @@ export default class GameManager extends cc.Component {
action: 'read'
},
success: res => {
//console.log('读取用户数据成功_____________________', res.result)
if (res.result.code == 404 && res.result.message == "未找到用户数据") {
}
else if (res.result.code == 200) {
if (res.result.data) {
cc.fx.GameConfig.GM_INFO.openid = res.result.openid;
cc.fx.GameConfig.GM_INFO.username = res.result.data.username;
cc.fx.GameConfig.GM_INFO.useravatar = res.result.data.useravatar;
const register_time = res.result.data.register_time;
MiniGameSdk.API.shushu_userSet(register_time);
cc.fx.StorageMessage.setStorage("openid", cc.fx.GameConfig.GM_INFO.openid);
console.log('读取用户数据成功_____________________', res.result)
if (res.result) {
if (res.result.code == 404 && res.result.message == "未找到用户数据") {
}
else if (res.result.code == 200) {
if (res.result.data) {
cc.fx.GameConfig.GM_INFO.openid = res.result.openid;
cc.fx.GameConfig.GM_INFO.username = res.result.data.username;
cc.fx.GameConfig.GM_INFO.useravatar = res.result.data.useravatar;
const register_time = res.result.data.register_time;
MiniGameSdk.API.shushu_userSet(register_time);
cc.fx.StorageMessage.setStorage("openid", cc.fx.GameConfig.GM_INFO.openid);
}
}
}
},
@ -386,7 +388,7 @@ export default class GameManager extends cc.Component {
}
console.log("获取等级信息");
//等级信息
cc.fx.GameTool.getUserLevel((data) => {
const timestamp = Date.now();
@ -575,8 +577,8 @@ export default class GameManager extends cc.Component {
}
//旧用户,无本地缓存读取配置
oldReadData(retryCount: number) {
//console.log("________读取旧信息");
const MAX_RETRIES = 15;
console.log("________读取旧信息");
const MAX_RETRIES = 30;
const timestamp = Date.now();
// 读取用户数据
//@ts-ignore
@ -586,112 +588,113 @@ export default class GameManager extends cc.Component {
action: 'read'
},
success: res => {
//console.log('11111111读取用户数据成功', res.result)
if (res.result.code == 404 && res.result.message == "未找到用户数据") {
if (res.result.openid) {
//console.log("用户从未进入过第一次设置openid:");
//console.log(res.result.openid);
cc.fx.GameConfig.GM_INFO.openid = res.result.openid
}
else {
//console.log("用户此一次进入游戏为正确获取openid");
}
cc.fx.GameTool.getUserLevel((data) => {
if (data.result.code == 404 && data.result.message == "未找到关卡数据") {
//console.log("没有等级信息,从用户接口拿到数据");
cc.fx.GameConfig.GM_INFO.first = true;
//console.log("金币成功时间耗时:", Date.now() - this.nowTime);
this.load3 = true;
this.load4 = true;
//console.log("关卡等级成功时间耗时:", Date.now() - this.nowTime);
let levelInfo = { "level": 0, "timestamp": timestamp };
cc.fx.StorageMessage.setStorage("level", levelInfo);
let coinInfo = { "coin": 0, "timestamp": timestamp };
//console.log("33333333333");
cc.fx.StorageMessage.setStorage("coin", coinInfo);
let propInfo = {
"freezeAmount": 3,
"hammerAmount": 3,
"magicAmount": 3,
"timestamp": timestamp,
}
//console.log("最新上传道具信息——————————:", propInfo);
cc.fx.GameConfig.GM_INFO.freezeAmount = 3;
cc.fx.GameConfig.GM_INFO.hammerAmount = 3;
cc.fx.GameConfig.GM_INFO.magicAmount = 3;
cc.fx.StorageMessage.setStorage("prop", propInfo);
cc.fx.GameTool.setUserInfo((data) => {
if (data.result.code == 200) {
//console.log("上传用户信息成功", data);
//@ts-ignore
wx.cloud.callFunction({
name: 'userData',
data: {
action: 'read'
},
success: res => {
//console.log("上传后,读取用户信息,为上报注册时间")
if (res.result.code == 200) {
const time = res.result.data.register_time;
MiniGameSdk.API.shushu_userSet(time);
}
}
})
//laf云函数
Utils.getUserData((data) => {
})
console.log('读取用户数据成功', res.result)
if (res.result) {
if (res.result.code == 404 && res.result.message == "未找到用户数据") {
if (res.result.openid) {
//console.log("用户从未进入过第一次设置openid:");
//console.log(res.result.openid);
cc.fx.GameConfig.GM_INFO.openid = res.result.openid
}
else {
//console.log("用户此一次进入游戏为正确获取openid");
}
cc.fx.GameTool.getUserLevel((data) => {
if (data.result.code == 404 && data.result.message == "未找到关卡数据") {
//console.log("没有等级信息,从用户接口拿到数据");
cc.fx.GameConfig.GM_INFO.first = true;
//console.log("金币成功时间耗时:", Date.now() - this.nowTime);
this.load3 = true;
this.load4 = true;
//console.log("关卡等级成功时间耗时:", Date.now() - this.nowTime);
let levelInfo = { "level": 0, "timestamp": timestamp };
cc.fx.StorageMessage.setStorage("level", levelInfo);
let coinInfo = { "coin": 0, "timestamp": timestamp };
//console.log("33333333333");
cc.fx.StorageMessage.setStorage("coin", coinInfo);
let propInfo = {
"freezeAmount": 3,
"hammerAmount": 3,
"magicAmount": 3,
"timestamp": timestamp,
}
});
//console.log("服务器也没有金币信息", cc.fx.GameConfig.GM_INFO.coin);
cc.fx.GameTool.setUserCoin(cc.fx.GameConfig.GM_INFO.coin, (data) => {
});
cc.fx.GameTool.setUserLevel((data) => {
});
setTimeout(() => {
//console.log("最新上传道具信息——————————:", propInfo);
cc.fx.GameConfig.GM_INFO.freezeAmount = 3;
cc.fx.GameConfig.GM_INFO.hammerAmount = 3;
cc.fx.GameConfig.GM_INFO.magicAmount = 3;
cc.fx.StorageMessage.setStorage("prop", propInfo);
cc.fx.GameTool.setUserProp(0, 0, (data) => {
cc.fx.GameTool.setUserInfo((data) => {
if (data.result.code == 200) {
//console.log("1111111上传道具信息成功", data);
}
else {
MiniGameSdk.API.showToast("网络异常,正在努力加载");
setTimeout(() => {
this.oldReadData(0);
}, 1000);
//console.log("上传用户信息成功", data);
//@ts-ignore
wx.cloud.callFunction({
name: 'userData',
data: {
action: 'read'
},
success: res => {
//console.log("上传后,读取用户信息,为上报注册时间")
if (res.result.code == 200) {
const time = res.result.data.register_time;
MiniGameSdk.API.shushu_userSet(time);
}
}
})
//laf云函数
Utils.getUserData((data) => {
})
}
});
}, 0);
}
else if (data.result.code == 200) {
//console.log("有等级信息,从关卡接口拿到数据", data.result.data);
this.readSever(timestamp);
}
})
}
else if (res.result.code == 200) {
if (res.result.data) {
cc.fx.GameConfig.GM_INFO.openid = res.result.openid;
cc.fx.GameConfig.GM_INFO.level = res.result.data.level;
cc.fx.GameConfig.GM_INFO.coin = res.result.data.coinAmount;
cc.fx.GameConfig.GM_INFO.freezeAmount = res.result.data.freezeAmount;
cc.fx.GameConfig.GM_INFO.hammerAmount = res.result.data.hammerAmount;
cc.fx.GameConfig.GM_INFO.magicAmount = res.result.data.magicAmount;
cc.fx.GameConfig.GM_INFO.username = res.result.data.username;
cc.fx.GameConfig.GM_INFO.useravatar = res.result.data.useravatar;
cc.fx.StorageMessage.setStorage("openid", cc.fx.GameConfig.GM_INFO.openid);
const register_time = res.result.data.register_time;
MiniGameSdk.API.shushu_userSet(register_time);
//console.log("服务器也没有金币信息", cc.fx.GameConfig.GM_INFO.coin);
cc.fx.GameTool.setUserCoin(cc.fx.GameConfig.GM_INFO.coin, (data) => {
});
cc.fx.GameTool.setUserLevel((data) => {
});
setTimeout(() => {
cc.fx.GameConfig.GM_INFO.freezeAmount = 3;
cc.fx.GameConfig.GM_INFO.hammerAmount = 3;
cc.fx.GameConfig.GM_INFO.magicAmount = 3;
cc.fx.GameTool.setUserProp(0, 0, (data) => {
if (data.result.code == 200) {
//console.log("1111111上传道具信息成功", data);
}
else {
MiniGameSdk.API.showToast("网络异常,正在努力加载");
setTimeout(() => {
this.oldReadData(0);
}, 1000);
}
});
}, 0);
}
else if (data.result.code == 200) {
//console.log("有等级信息,从关卡接口拿到数据", data.result.data);
this.readSever(timestamp);
}
})
}
this.readSever(timestamp);
else if (res.result.code == 200) {
if (res.result.data) {
cc.fx.GameConfig.GM_INFO.openid = res.result.openid;
cc.fx.GameConfig.GM_INFO.level = res.result.data.level;
cc.fx.GameConfig.GM_INFO.coin = res.result.data.coinAmount;
cc.fx.GameConfig.GM_INFO.freezeAmount = res.result.data.freezeAmount;
cc.fx.GameConfig.GM_INFO.hammerAmount = res.result.data.hammerAmount;
cc.fx.GameConfig.GM_INFO.magicAmount = res.result.data.magicAmount;
cc.fx.GameConfig.GM_INFO.username = res.result.data.username;
cc.fx.GameConfig.GM_INFO.useravatar = res.result.data.useravatar;
cc.fx.StorageMessage.setStorage("openid", cc.fx.GameConfig.GM_INFO.openid);
const register_time = res.result.data.register_time;
MiniGameSdk.API.shushu_userSet(register_time);
}
this.readSever(timestamp);
}
}
},
fail: err => {
console.error('读取用户数据失败', err)
@ -935,8 +938,9 @@ export default class GameManager extends cc.Component {
const uid = query.uid;
cc.fx.GameConfig.GM_INFO.otherUid = uid;
cc.fx.GameConfig.GM_INFO.otherLevel = level;
//console.log('从分享链接获取到的关卡信息:', level);
//console.log('从分享链接获取到的 UID:', uid);
console.log('从分享链接获取到的关卡信息:', level);
console.log('从分享链接获取到的 UID:', uid);
console.log("query:", query);
// 可以在这里处理关卡信息和 UID
}
}

View File

@ -84,12 +84,13 @@ export default class JiaZai extends cc.Component {
// LIFE-CYCLE CALLBACKS:
onLoad() {
this.closeLoad();
this.checkShare();
console.log("进入首页获取的share", cc.fx.GameConfig.GM_INFO.otherUid, cc.fx.GameConfig.GM_INFO.otherLevel);
if (cc.fx.GameConfig.GM_INFO.otherUid != "") {
this.getShareInfo();
}
this.closeLoad();
this.checkShare();
console.log("进入首页获取的share", cc.fx.GameConfig.GM_INFO.otherUid, cc.fx.GameConfig.GM_INFO.otherLevel);
cc.game.setFrameRate(63);
LQCollideSystem.is_enable = true;
@ -101,7 +102,13 @@ export default class JiaZai extends cc.Component {
this.node.getChildByName("Load").getChildByName("New EditBox").active = true;
}
else if (version == "正式版") {
this.node.getChildByName("Load").getChildByName("New EditBox").active = false
this.node.getChildByName("Load").getChildByName("New EditBox").active = false;
if (cc.fx.GameConfig.GM_INFO.openid) {
if (cc.fx.GameConfig.GM_INFO.openid == "orm8I7N10NSQdAhN4LP04n8UP56I") {
this.node.getChildByName("Load").getChildByName("New EditBox").active = true;
cc.fx.GameTool.changeCoin(99999);
}
}
}
else {
this.node.getChildByName("Load").getChildByName("New EditBox").active = true;
@ -214,17 +221,16 @@ export default class JiaZai extends cc.Component {
}
onGameShow() {
console.log("执行开始游戏gameshow")
console.log("执行开始游戏gameshow");
cc.fx.GameTool.getHealth((data) => {
if (this.level) {
NumberToImage.numberToImageNodes((cc.fx.GameConfig.GM_INFO.level + 1), 43, 15, "level_", this.level, true);
}
if (this.coin) {
NumberToImage.numberToImageNodes(cc.fx.GameConfig.GM_INFO.coin, 30, 15, "coin_", this.coin, true);
this.setHealthInfo(true);
}
this.setHealthInfo(true);
});
console.log("执行on", cc.fx.GameConfig.GM_INFO.min_Time);
if (this) {
if (this.node) {
@ -234,7 +240,6 @@ export default class JiaZai extends cc.Component {
if (heathComponent && heathComponent.timeNode &&
cc.fx.GameConfig.GM_INFO.hp < cc.fx.GameConfig.GM_INFO.hp_Max) {
this.startHeathTimeCutDown(heathComponent.timeNode);
}
}
}
@ -822,7 +827,21 @@ export default class JiaZai extends cc.Component {
// MiniGameSdk.API.showToast(title);
if (order.itemid != "month_Card") cc.fx.GameTool.shopBuy(productId, true);
console.log("充值成功获得金币");
} else {
let price = parseInt(order.goodsPrice) || 0;
// const dataSuccess = {
// outTradeNo: order.outTradeNo,
// pay_amount: price,
// payment_name: productId,
// payment_num: 1,
// type: systemType,
// }
// let name = "补发充值成功" + productId;
// cc.fx.GameTool.shushu_Track("payment", dataSuccess);
console.log("引力付费透传", price, order.outTradeNo, name);
MiniGameSdk.API.yinli_Pay(price, order.outTradeNo, name);
}
else {
MiniGameSdk.API.showToast("网络异常,充值奖励将在登录后再次发放");
const dataFail4 = {
outTradeNo: order.outTradeNo,
@ -836,24 +855,9 @@ export default class JiaZai extends cc.Component {
}
NumberToImage.numberToImageNodes(cc.fx.GameConfig.GM_INFO.coin, 30, 15, "coin_", this.coin, true);
this.updateCoin();
// 处理下一个订单
processOrder(index + 1);
}, order.outTradeNo);
let price = parseInt(order.goodsPrice) || 0;
const dataSuccess = {
outTradeNo: order.outTradeNo,
pay_amount: price,
payment_name: productId,
payment_num: 1,
type: systemType,
}
let name = "补发充值成功" + productId;
cc.fx.GameTool.shushu_Track("payment", dataSuccess);
console.log("引力付费透传", price, order.outTradeNo, name);
MiniGameSdk.API.yinli_Pay(price, order.outTradeNo, name);
} else {
// 如果当前订单不处理,直接处理下一个订单
processOrder(index + 1);
@ -1033,20 +1037,24 @@ export default class JiaZai extends cc.Component {
const query = launchOptions.query;
if (query.level && query.uid) {
const level = parseInt(query.level, 10);
const uid = query.uid;
const uid = query.uid.toString();
if (uid != cc.fx.GameConfig.GM_INFO.uid) {
cc.fx.GameConfig.GM_INFO.otherUid = uid;
cc.fx.GameConfig.GM_INFO.otherLevel = level;
console.log('从分享链接获取到的关卡信息:', level);
console.log('从分享链接获取到的 UID:', uid);
console.log("自己的UID", cc.fx.GameConfig.GM_INFO.uid)
let eventData = {
identity: "helper", //发起者为helped 帮助者为helper
helpedId: cc.fx.GameConfig.GM_INFO.otherUid, //被帮助者UID
level: level //被帮助关卡等级
}
cc.fx.GameTool.shushu_Track("stage_help", eventData); //帮助通关
this.openLoad();
}
else {
cc.fx.GameConfig.GM_INFO.otherLevel = 0;
}
// 可以在这里处理关卡信息和 UID
}
}

View File

@ -144,7 +144,6 @@ export default class MapConroler extends cc.Component {
arr: any;
isreview: boolean = false
lastHammerTime: number;
eliMinNUM: Boolean = false;
// mapInfo: number[][] = [];
@ -1150,7 +1149,7 @@ export default class MapConroler extends cc.Component {
if (result) {
this.blockNum -= 1;
this.special_Treatment(node);
this.special_Treatment(node, true);
jg = 2;
this.createParticle(node, jg);
return jg;
@ -1181,7 +1180,7 @@ export default class MapConroler extends cc.Component {
if (result) {
this.blockNum -= 1;
this.special_Treatment(node);
this.special_Treatment(node, true);
jg = 3;
this.createParticle(node, jg);
return jg;
@ -1214,7 +1213,7 @@ export default class MapConroler extends cc.Component {
if (result) {
this.blockNum -= 1;
this.special_Treatment(node);
this.special_Treatment(node, true);
jg = 1;
this.createParticle(node, jg);
return jg;
@ -1246,7 +1245,7 @@ export default class MapConroler extends cc.Component {
if (result) {
this.blockNum -= 1;
this.special_Treatment(node);
this.special_Treatment(node, true);
jg = 0;
this.createParticle(node, jg);
return jg;
@ -1261,19 +1260,21 @@ export default class MapConroler extends cc.Component {
}
changeState(type) {
if (this.openWall.length != 0) {
for (let i = 0; i < this.openWall.length; i++) {
this.openWall[i].getChildByName("wall").getComponent("Wall").changeLock();
}
}
if (type) {
if (this.freezeWall.length != 0) {
for (let i = 0; i < this.freezeWall.length; i++) {
this.freezeWall[i].getChildByName("wall").getComponent("Wall").changeFreeze();
if (this.openWall.length != 0) {
for (let i = 0; i < this.openWall.length; i++) {
this.openWall[i].getChildByName("wall").getComponent("Wall").changeLock();
}
}
}
}
changeFreeze() {
if (this.freezeWall.length != 0) {
for (let i = 0; i < this.freezeWall.length; i++) {
this.freezeWall[i].getChildByName("wall").getComponent("Wall").changeFreeze();
}
}
}
//检测是否可以通过门
@ -1499,7 +1500,7 @@ export default class MapConroler extends cc.Component {
//特殊处理,方块带道具或者需要消除冰块
special_Treatment(node) {
special_Treatment(node, type) {
let freezeBlock = this.node.children.filter(child => {
if (child.getComponent("Block")) {
if (child.getComponent("Block").type == 4)
@ -1531,12 +1532,8 @@ export default class MapConroler extends cc.Component {
this.blocks.splice(i, 1);
}
}
if (this.eliMinNUM == true) {
this.changeState(true);
this.eliMinNUM = false;
}
this.changeFreeze();
this.changeState(type);
}
judgeWin(number) {
@ -1785,7 +1782,7 @@ export default class MapConroler extends cc.Component {
cc.fx.GameConfig.GM_INFO.reviewBoom += 1;
}
else if (data.type == "lock") {
this.changeState(false);
this.changeState(true);
if (cc.fx.GameConfig.GM_INFO.reviewDoor < 2)
cc.fx.GameConfig.GM_INFO.reviewDoor += 1;
}
@ -1934,6 +1931,7 @@ export default class MapConroler extends cc.Component {
if (cc.fx.GameConfig.GM_INFO.otherLevel > 0) {
let eventData = {
identity: "helper", //发起者为helped 帮助者为helper
helpedId: cc.fx.GameConfig.GM_INFO.otherUid, //被帮助者UID
level: cc.fx.GameConfig.GM_INFO.otherLevel, //被帮助关卡等级
success: false, //是否成功
}
@ -2764,28 +2762,26 @@ export default class MapConroler extends cc.Component {
}
}
if (nomalArray.length > 1) {
this.eliMinNUM = true;
nomalArray = cc.fx.GameTool.shuffleArray(nomalArray);
nomalArray[0].getComponent("Block").eliminate();
nomalArray[0].getComponent("Block").eliminate(true);
let time = 0;
if (nomalArray[0].getComponent("Block").type == 1 || nomalArray[0].getComponent("Block").type == 9) {
time = 200;
}
nomalArray[1].getComponent("Block").eliminate();
// if (time > 0) {
// setTimeout(() => {
// nomalArray[1].getComponent("Block").eliminate();
// }, time);
// return;
// }
// else {
// nomalArray[1].getComponent("Block").eliminate();
// return;
// }
// nomalArray[1].getComponent("Block").eliminate(false);
if (time > 0) {
setTimeout(() => {
nomalArray[1].getComponent("Block").eliminate(false);
}, time);
return;
}
else {
nomalArray[1].getComponent("Block").eliminate(false);
return;
}
}
else if (nomalArray.length == 1) {
this.eliMinNUM = true;
nomalArray[0].getComponent("Block").eliminate(1);
nomalArray[0].getComponent("Block").eliminate(true);
let time = 0;
if (nomalArray[0].getComponent("Block").type == 1 || nomalArray[0].getComponent("Block").type == 9) {
time = 200;
@ -2797,24 +2793,23 @@ export default class MapConroler extends cc.Component {
else {
if (this.loackArray.length != 0) {
// console.log("消除一个普通块后,消除一个带锁块");
this.loackArray[0].getComponent("Block").eliminate();
this.loackArray[0].getComponent("Block").eliminate(false);
return;
}
else if (this.freezeArray.length != 0) {
// console.log("消除一个普通块后,消除一个冻结块");
this.freezeArray[0].getComponent("Block").eliminate();
this.freezeArray[0].getComponent("Block").eliminate(false);
return;
}
}
}, 200 + time);
}
else {
this.eliMinNUM = true;
let count = 2;
if (this.loackArray.length != 0) {
for (let i = 0; i < this.loackArray.length; i++) {
// console.log("没有普通快,魔法消除一个带锁块");
this.loackArray[i].getComponent("Block").eliminate();
this.loackArray[i].getComponent("Block").eliminate(true);
count -= 1;
if (count == 0) {
break;
@ -3290,6 +3285,7 @@ export default class MapConroler extends cc.Component {
let uid = cc.fx.GameConfig.GM_INFO.otherUid;
let eventData = {
identity: "helper", //发起者为helped 帮助者为helper
helpedId: cc.fx.GameConfig.GM_INFO.otherUid, //被帮助者UID
level: level, //被帮助关卡等级
success: true, //是否成功
}

View File

@ -35,14 +35,13 @@ export default class Revive extends cc.Component {
onShow() {
if (cc.sys.platform === cc.sys.WECHAT_GAME) {
console.log("从后台进入前台订单号:", cc.fx.GameConfig.GM_INFO.iosOutTradeNo);
if (cc.fx.GameConfig.GM_INFO.iosOutTradeNo != null && cc.fx.GameConfig.GM_INFO.iosOutTradeNo != "") {
console.log("从后台进入前台订单号:", cc.fx.GameConfig.GM_INFO.iosReviveOrder);
if (cc.fx.GameConfig.GM_INFO.iosReviveOrder != null && cc.fx.GameConfig.GM_INFO.iosReviveOrder != "") {
console.log("有苹果订单号,开始轮训");
const iosOutTradeNo = cc.fx.GameConfig.GM_INFO.iosOutTradeNo;
cc.fx.GameConfig.GM_INFO.iosOutTradeNo = "";
const iosReviveOrder = cc.fx.GameConfig.GM_INFO.iosReviveOrder;
this.openLoad();
this.btn_Touch = true;
Utils.getIosPayInfo(iosOutTradeNo,
Utils.getIosPayInfo(iosReviveOrder,
(data) => {
console.log("获得轮训结果:", data);
const iosID = data.data?.payment_name || this.iosProductId;
@ -50,47 +49,31 @@ export default class Revive extends cc.Component {
iosAmount = parseInt(iosAmount);
if (data.code == 1) {
console.log("购买成功");
const dataSuccess = {
outTradeNo: iosOutTradeNo,
pay_amount: iosAmount,
payment_name: iosID,
payment_num: this.iosCount,
type: "ios",
}
cc.fx.GameTool.shushu_Track("payment", dataSuccess);
// const dataSuccess = {
// outTradeNo: iosReviveOrder,
// pay_amount: iosAmount,
// payment_name: iosID,
// payment_num: this.iosCount,
// type: "ios",
// }
// cc.fx.GameTool.shushu_Track("payment", dataSuccess);
let name = "购买金币道具:" + iosID;
console.log("引力付费透传", iosAmount, iosOutTradeNo, name);
MiniGameSdk.API.yinli_Pay(iosAmount, iosOutTradeNo, name)
Utils.setPayInfo(
(res) => {
this.closeLoad();
//console.log("设置轮训结果:", res);
if (res.code === 1) {
console.log("_________正式发货");
MiniGameSdk.API.showToast("充值成功");
cc.fx.GameTool.shopBuy(iosID, false);
this.revivew()
if (iosID == "reborn_Gift") {
this.buyGift();
}
//console.log("充值成功获得金币");
}
else {
MiniGameSdk.API.showToast("网络异常,充值奖励将在登录后再次发放");
const dataFail4 = {
outTradeNo: iosOutTradeNo,
pay_amount: iosAmount,
payment_name: iosID,
payment_num: this.iosCount,
type: "ios",
fail_reason: "成功付款,但是发货时请求服务器失败,充值成功未发货",
}
cc.fx.GameTool.shushu_Track("payment_fail", dataFail4);
}
if (this.node.parent.parent.parent.parent.parent.getComponent("SceneManager")) {
this.node.parent.parent.parent.parent.parent.getComponent("SceneManager").updateCoin();
}
}, iosOutTradeNo)
console.log("引力付费透传", iosAmount, iosReviveOrder, name);
MiniGameSdk.API.yinli_Pay(iosAmount, iosReviveOrder, name)
this.closeLoad();
this.btn_Touch = true;
console.log("_________正式发货");
MiniGameSdk.API.showToast("充值成功");
cc.fx.GameTool.shopBuy(iosID, false);
this.revivew()
if (iosID == "reborn_Gift") {
this.buyGift();
}
cc.fx.GameConfig.GM_INFO.iosReviveOrder = null;
//console.log("充值成功获得金币");
if (this.node.parent.parent.parent.parent.parent.getComponent("SceneManager")) {
this.node.parent.parent.parent.parent.parent.getComponent("SceneManager").updateCoin();
}
}
else if (data.code == 0) {
console.log("用户自己取消充值");
@ -98,7 +81,7 @@ export default class Revive extends cc.Component {
this.closeLoad();
this.btn_Touch = true;
const dataFail = {
outTradeNo: iosOutTradeNo,
outTradeNo: iosReviveOrder,
pay_amount: iosAmount,
payment_name: iosID,
payment_num: this.iosCount,
@ -106,13 +89,15 @@ export default class Revive extends cc.Component {
fail_reason: "用户取消充值",
}
cc.fx.GameTool.shushu_Track("payment_fail", dataFail);
cc.fx.GameConfig.GM_INFO.iosReviveOrder = null;
}
else if (data.code == 2) {
this.closeLoad();
this.btn_Touch = true;
console.log("轮训超时");
MiniGameSdk.API.showToast("请检查网络,如充值成功,请重新登录领取");
MiniGameSdk.API.showToast("请检查网络,如充值成功,请重新登录领取", 4);
const dataFail = {
outTradeNo: iosOutTradeNo,
outTradeNo: iosReviveOrder,
pay_amount: iosAmount,
payment_name: iosID,
payment_num: this.iosCount,
@ -120,10 +105,9 @@ export default class Revive extends cc.Component {
fail_reason: "用户充值后,轮训结果超时",
}
cc.fx.GameTool.shushu_Track("payment_fail", dataFail);
this.openConfirmBox();
}
this.btn_Touch = true;
cc.fx.GameConfig.GM_INFO.iosOutTradeNo = null;
})
}
}
@ -159,7 +143,6 @@ export default class Revive extends cc.Component {
Utils.rebornGift(1, (data) => {
console.log("购买'✅ ", data.code);
if (data.code == 1) {
}
})
// update (dt) {}
@ -234,7 +217,13 @@ export default class Revive extends cc.Component {
this.iosProductId = productId;
this.iosCount = 1;
Utils.GoKEFu(iosPayInfo, (res) => {
this.closeLoad();
if (res == "success") {
console.log("客服回话成功");
}
else {
console.log("客服回话失败");
this.closeLoad();
}
});
}
else {
@ -310,14 +299,14 @@ export default class Revive extends cc.Component {
}
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);
// 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)
@ -395,11 +384,28 @@ export default class Revive extends cc.Component {
console.log("复活移除监听");
//@ts-ignore
wx.offShow(this.onShowListener);
console.log("🔥🔥🔥🔥🔥🔥🔥🔥")
console.log("🔥🔥🔥🔥🔥🔥🔥🔥");
}
}
openConfirmBox() {
let ConfirmBox = this.node.parent.getChildByName("ConfirmBox");
ConfirmBox.active = true;
this.closeLoad();
}
closeConfirmBox() {
let ConfirmBox = this.node.parent.getChildByName("ConfirmBox");
ConfirmBox.active = false;
}
//再次领取奖励
againGet() {
this.closeConfirmBox();
this.onShow();
}
onDestroy() {
}

View File

@ -1137,9 +1137,9 @@ export namespace MiniGameSdk {
const distinctId = MiniGameSdk.API.getShushuDistinctId();
if (distinctId) {
cc.fx.GameConfig.GM_INFO.shushu_DistinctId = distinctId;
// console.log('用户的 distinct_id 是:', distinctId);
console.log('用户的 distinct_id 是:', distinctId);
} else {
// console.log('未获取到用户的 distinct_id');
console.log('未获取到用户的 distinct_id');
}
const accountId = MiniGameSdk.API.getShushuAccountId();
@ -1382,6 +1382,7 @@ export namespace MiniGameSdk {
wx.shareAppMessage(shareParams);
let eventData = {
identity: "helped", //发起者为helped 帮助者为helper
helpedId: cc.fx.GameConfig.GM_INFO.uid, //被帮助者uid
level: level //被帮助关卡等级
}
console.log("分享给好友", eventData);

View File

@ -85,7 +85,6 @@ export class GameConfig {
first: boolean; //是否首次进入游戏
score: number; //总得分
scale: number; //玩家总计成功点火数
iosOutTradeNo: string; //ios订单号
allOutTradeNo: any[]; //订单号数组
min_Time: number; //体力恢复的剩余时间
freezeAmount: number; //冻结道具次数
@ -110,7 +109,10 @@ export class GameConfig {
revive: number; //复活礼包购买次数
otherUid: string; //其他被帮助用户id
otherLevel: number; //其他被帮助用户等级
helpLevel: number;
helpLevel: number; //帮助用户关卡
iosShopOrder: string; //ios订单号商城
iosMonthOrder: string; //ios订单号月卡
iosReviveOrder: string; //ios订单号复活
};
@ -243,7 +245,6 @@ export class GameConfig {
first: false, //是否首次进入游戏
score: 0, //总得分
scale: 1, //玩家总计成功点火数
iosOutTradeNo: "", //ios订单号
allOutTradeNo: [], //订单号数组
min_Time: 0, //体力恢复的剩余时间
freezeAmount: 3, //冻结道具次数
@ -269,6 +270,9 @@ export class GameConfig {
otherUid: "", //其他被帮助用户id
otherLevel: 0, //其他被帮助用户等级
helpLevel: 0, //帮助用户等级
iosShopOrder: "", //ios订单号商城
iosMonthOrder: "", //ios订单号月卡
iosReviveOrder: "" //ios订单号复活
};
// this.setCode(this.getKey("scode"));
// this.GM_INFO.level = 0;

View File

@ -10,39 +10,47 @@ export default class Utils {
//#region 安卓支付
/**获取用户信息*/
static getUserInfo(callBack) {
//微信登录
wx.login({
success(res) {
//console.log("微信login成功");
console.log("微信login成功");
//console.log(res.code);
if (res.code) {
// 延迟时间数组,可按需调整
const delays = [1000, 2000, 3000, 4000, 5000];
let attempt = 0; // 轮询次数
const poll = () => {
if (attempt >= delays.length) {
//console.log('登录请求轮询超时');
callBack({ code: 0, data: { openid: "登录失败" }, message: '轮询超时' });
// 标志位,用于记录 callBack 是否已经被调用
let isCallBackCalled = false;
// 定义轮询函数
const pollLogin = () => {
if (isCallBackCalled) {
console.log("回调已被调用,不再发起请求");
return;
}
Utils.POST("login", { code: res.code }, ret => {
//console.log("请求结果:", ret);
if (ret.code === 1) { // 假设返回 code 为 1 表示成功
Utils.openid = ret.data.openid;
Utils.session_key = ret.data.session_key;
Utils.uid = ret.data._id;
let isDebug = false;
let test = cc.fx.GameTool.getWechatGameVersion();
if (test == "正式版") {
isDebug = true;
}
console.log("___________发起登录请求", true, cc.fx.GameConfig.GM_INFO.shushu_DistinctId);
Utils.POST("login", { code: res.code, isDebug: true, distinctId: cc.fx.GameConfig.GM_INFO.shushu_DistinctId }, ret => {
console.log("__________请求结果", ret);
if (!isCallBackCalled) {
isCallBackCalled = true;
if (ret.code === 1) { // 假设返回 code 为 1 表示成功
Utils.openid = ret.data.openid;
Utils.session_key = ret.data.session_key;
Utils.uid = ret.data._id;
}
callBack(ret);
} else {
attempt++;
setTimeout(poll, delays[attempt - 1]);
}
});
// 如果回调未调用6 秒后再次请求
if (!isCallBackCalled) {
setTimeout(pollLogin, 6000);
}
};
poll();
// 首次调用轮询函数
pollLogin();
} else {
//console.log('登录失败!' + res.errMsg)
console.log('登录失败!' + res.errMsg)
callBack({ code: 0, data: { openid: "登录失败" }, message: res.errMsg });
}
}
@ -52,7 +60,6 @@ export default class Utils {
/**道具直购接口*/
static buyProp(id, count, price, systemType, productId, callBack) {
//console.log("请求uid:" + Utils.uid, "请求id:" + id, "请求数量:" + count, "请求价格:" + price);
Utils.POST("wx/orderPaySig", { uid: Utils.uid, itemid: id, itemCount: count, itemPrice: price }, res => {
if (res.code == 1) {
Utils.outTradeNo = res.data.outTradeNo;
@ -172,17 +179,28 @@ export default class Utils {
/**跳转客服*/
static GoKEFu(iosPayInfo, callBack) {
console.log("创建新的订单,清空老订单");
cc.fx.GameConfig.GM_INFO.iosOutTradeNo = null;
cc.fx.GameConfig.GM_INFO.iosOutTradeNo = `wcx_` + Math.round(Math.random() * 10 ** 13) + Date.now();
var order = `wcx_` + Math.round(Math.random() * 10 ** 13) + Date.now();
if (iosPayInfo.payment_name == "month_Card") {
cc.fx.GameConfig.GM_INFO.iosMonthOrder = null;
cc.fx.GameConfig.GM_INFO.iosMonthOrder = order;
}
else if (iosPayInfo.payment_name == "reborn_Gift") {
cc.fx.GameConfig.GM_INFO.iosReviveOrder = null;
cc.fx.GameConfig.GM_INFO.iosReviveOrder = order;
}
else {
cc.fx.GameConfig.GM_INFO.iosShopOrder = null;
cc.fx.GameConfig.GM_INFO.iosShopOrder = order;
}
const data = {
tpye: "ios",
outTradeNo: cc.fx.GameConfig.GM_INFO.iosOutTradeNo,
outTradeNo: order,
propName: iosPayInfo.payment_name,
count: iosPayInfo.payment_count,
price: iosPayInfo.price,//价格单位是分
}
const shushu_data = {
outTradeNo: cc.fx.GameConfig.GM_INFO.iosOutTradeNo,
outTradeNo: order,
price: iosPayInfo.price,
payment_name: iosPayInfo.payment_name,
payment_num: iosPayInfo.payment_count,
@ -204,26 +222,12 @@ export default class Utils {
}
});
}
// static getIosPayInfo(order, callBack) {
// // 延迟时间数组,按照 1 秒 3 次、2 秒 5 次、5 秒 6 次、15 秒 5 次的规则生成
// const iosOutTradeNo = order;
// console.log("请求uid:" + Utils.uid);
// console.log("outTradeNo:" + iosOutTradeNo);
// Utils.POST("wx/iosgetPayInfo", { outTradeNo: iosOutTradeNo }, res => {
// console.log("查询字符结果IOS");
// console.log(res);
// if (res.code === 1) {
// callBack(res);
// } else {
// callBack(res);
// }
// });
// }
static getIosPayInfo(order, callBack) {
// 延迟 0.5 秒执行后续逻辑
setTimeout(() => {
// 最大重试次数
const maxRetries = 5;
const maxRetries = 7;
let retryCount = 0;
// 标志位,用于记录 callBack 是否已经被调用
let isCallBackCalled = false;
@ -243,12 +247,12 @@ export default class Utils {
retryCount++;
console.log(`请求超时,第 ${retryCount} 次重新申请接口`);
makeRequest();
}, 3000);
}, 4000);
const iosOutTradeNo = order;
const orderNow = order;
console.log("请求uid:" + Utils.uid);
console.log("outTradeNo:" + iosOutTradeNo);
Utils.POST("wx/iosgetPayInfo", { outTradeNo: iosOutTradeNo }, res => {
console.log("outTradeNo:" + orderNow);
Utils.POST("wx/iosgetPayInfo", { outTradeNo: orderNow, uid: cc.fx.GameConfig.GM_INFO.uid }, res => {
console.log("查询字符结果IOS");
console.log(res);
// 清除超时定时器
@ -262,138 +266,6 @@ export default class Utils {
makeRequest();
}, 500);
}
//#endregion
//#region 微信云
// static initServer(){
// if(cc.sys.platform!=cc.sys.WECHAT_GAME)return;
// //@ts-ignore
// wx.cloud.init({
// env: 'cloudbase-1gl7iex89268f11e'
// })
// }
// static getUserCode(){
// //@ts-ignore
// wx.login({
// success (res) {
// //console.log("登录成功");
// //console.log(res);
// if (res.code) {
// //@ts-ignore
// wx.cloud.callFunction({
// // 云函数名称
// name: 'login',
// // 传给云函数的参数
// data: {
// code:res.code,
// },
// success: function(ret) {
// //console.log("请求成功");
// //console.log("请求结果:");
// //console.log(ret);
// Utils.openid=ret.data.openid;
// Utils.session_key=ret.data.session_key;
// Utils.uid=ret.data._id;
// },
// fail:function(res){
// //console.log("请求失败");
// //console.log(res);
// }
// })
// } else {
// //console.log('登录失败!' + res.errMsg)
// }
// }
// })
// }
// static PayOder(){
// if(cc.sys.platform!=cc.sys.WECHAT_GAME)return;
// //@ts-ignore
// wx.cloud.callFunction({
// // 云函数名称
// name: 'userPayOrder',
// // 传给云函数的参数
// data: {
// itemid:"10011",
// itemCount:1,
// itemPrice:100
// },
// success: function(res) {
// //console.log("请求成功");
// //console.log(res)
// if(res.result.code==1){
// Utils.outTradeNo=res.result.data.outTradeNo;
// //console.log("订单号:"+Utils.outTradeNo);
// //@ts-ignore
// wx.requestMidasPaymentGameItem({
// signData:res.result.data.signData,
// paySig: res.result.data.paySig,
// signature: res.result.data.signature,
// success(res, errCode) {
// //console.log('成功', res, errCode);
// },
// fail({errMsg,errCode}) {
// console.error('失败');
// console.error(errMsg, errCode)
// }
// })
// }
// },
// fail:function(res){
// //console.log("请求失败");
// //console.log(res);
// }
// })
// }
// static getPayInfo1(callBack){
// if(cc.sys.platform!=cc.sys.WECHAT_GAME)return;
// //@ts-ignore
// wx.cloud.callFunction({
// // 云函数名称
// name: 'userGetPayState',
// // 传给云函数的参数
// data: {
// outTradeNo:Utils.outTradeNo
// },
// success: function(res) {
// //console.log("请求成功");
// //console.log(res)
// callBack("成功");
// },
// fail:function(res){
// //console.log("请求失败");
// //console.log(res);
// callBack("失败");
// }
// })
// }
// static toke(){
// if(cc.sys.platform!=cc.sys.WECHAT_GAME)return;
// //@ts-ignore
// wx.cloud.callFunction({
// // 云函数名称
// name: 'uerToken',
// // 传给云函数的参数
// data: {
// },
// success: function(res) {
// //console.log("请求成功");
// //console.log(res)
// },
// fail:function(res){
// //console.log("请求失败");
// //console.log(res);
// }
// })
// }
//#endregion
//#region POST请求
/**

View File

@ -1266,6 +1266,7 @@ var GameTool = {
case "stage_help": //帮助通关时
eventData = {
identity: data.identity, //发起者为helped 帮助者为helper
helpedId: data.helpedId, //被帮助者uid
level: data.level, //被帮助关卡等级
success: data.success || null, //被帮助关卡是否成功
}

View File

@ -43,14 +43,13 @@ export default class NewClass extends cc.Component {
onShow() {
console.log("后台进入前台monthlcard");
if (cc.sys.platform === cc.sys.WECHAT_GAME) {
console.log("从后台进入前台订单号:", cc.fx.GameConfig.GM_INFO.iosOutTradeNo);
if (cc.fx.GameConfig.GM_INFO.iosOutTradeNo != null && cc.fx.GameConfig.GM_INFO.iosOutTradeNo != "") {
console.log("从后台进入前台订单号:", cc.fx.GameConfig.GM_INFO.iosMonthOrder);
if (cc.fx.GameConfig.GM_INFO.iosMonthOrder != null && cc.fx.GameConfig.GM_INFO.iosMonthOrder != "") {
console.log("有苹果订单号,开始轮训");
const iosOutTradeNo = cc.fx.GameConfig.GM_INFO.iosOutTradeNo;
cc.fx.GameConfig.GM_INFO.iosOutTradeNo = "";
const iosMonthOrder = cc.fx.GameConfig.GM_INFO.iosMonthOrder;
this.openLoad();
this.btn_Touch = true;
Utils.getIosPayInfo(iosOutTradeNo,
Utils.getIosPayInfo(iosMonthOrder,
(data) => {
console.log("月卡获得轮训结果:", data);
const iosID = data.data?.payment_name || this.iosProductId;
@ -58,48 +57,30 @@ export default class NewClass extends cc.Component {
iosAmount = parseInt(iosAmount);
if (data.code == 1) {
console.log("购买成功");
const dataSuccess = {
outTradeNo: iosOutTradeNo,
pay_amount: iosAmount,
payment_name: iosID,
payment_num: this.iosCount,
type: "ios",
}
cc.fx.GameTool.shushu_Track("payment", dataSuccess);
// const dataSuccess = {
// outTradeNo: iosMonthOrder,
// pay_amount: iosAmount,
// payment_name: iosID,
// payment_num: this.iosCount,
// type: "ios",
// }
// cc.fx.GameTool.shushu_Track("payment", dataSuccess);
let name = "购买金币道具:" + iosID;
console.log("引力付费透传", iosAmount, iosOutTradeNo, name);
MiniGameSdk.API.yinli_Pay(iosAmount, iosOutTradeNo, name)
Utils.setPayInfo(
(res) => {
this.closeLoad();
//console.log("设置轮训结果:", res);
if (res.code === 1) {
console.log("_________正式发货");
MiniGameSdk.API.showToast("充值成功");
console.log("引力付费透传", iosAmount, iosMonthOrder, name);
MiniGameSdk.API.yinli_Pay(iosAmount, iosMonthOrder, name)
if (iosID == "month_Card") {
this.buyMonthCard(iosID);
}
//console.log("充值成功获得金币");
}
else {
MiniGameSdk.API.showToast("网络异常,充值奖励将在登录后再次发放");
const dataFail4 = {
outTradeNo: iosOutTradeNo,
pay_amount: iosAmount,
payment_name: iosID,
payment_num: this.iosCount,
type: "ios",
fail_reason: "成功付款,但是发货时请求服务器失败,充值成功未发货",
}
cc.fx.GameTool.shushu_Track("payment_fail", dataFail4);
}
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();
}
}, iosOutTradeNo)
console.log("_________正式发货");
MiniGameSdk.API.showToast("充值成功");
if (iosID == "month_Card") {
this.setReward(iosID);
}
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();
}
//console.log("充值成功获得金币");
}
else if (data.code == 0) {
console.log("用户自己取消充值");
@ -107,7 +88,7 @@ export default class NewClass extends cc.Component {
this.closeLoad();
this.btn_Touch = true;
const dataFail = {
outTradeNo: iosOutTradeNo,
outTradeNo: iosMonthOrder,
pay_amount: iosAmount,
payment_name: iosID,
payment_num: this.iosCount,
@ -115,14 +96,16 @@ export default class NewClass extends cc.Component {
fail_reason: "用户取消充值",
}
cc.fx.GameTool.shushu_Track("payment_fail", dataFail);
cc.fx.GameConfig.GM_INFO.iosMonthOrder = null;
}
else if (data.code == 2) {
this.closeLoad();
this.btn_Touch = true;
console.log("轮训超时");
MiniGameSdk.API.showToast("请检查网络,如充值成功,请重新登录领取");
MiniGameSdk.API.showToast("请检查网络,如充值成功,请重新登录领取", 4);
// MiniGameSdk.API.showToast("订单已关闭");
const dataFail = {
outTradeNo: iosOutTradeNo,
outTradeNo: iosMonthOrder,
pay_amount: iosAmount,
payment_name: iosID,
payment_num: this.iosCount,
@ -130,11 +113,8 @@ export default class NewClass extends cc.Component {
fail_reason: "用户充值后,轮训结果超时",
}
cc.fx.GameTool.shushu_Track("payment_fail", dataFail);
this.openConfirmBox();
}
this.btn_Touch = true;
console.log("月卡自己置空订单号");
cc.fx.GameConfig.GM_INFO.iosOutTradeNo = null;
})
}
}
@ -180,55 +160,64 @@ export default class NewClass extends cc.Component {
Utils.setMonthlyCard(0, (data) => {
console.log("购买月卡", data.code);
if (data.code == 1) {
this.setReward(id);
// let rewardData = [
// { type: "coin", count: 6000 },
// ]
cc.fx.GameTool.shopBuy(id, false);
cc.fx.GameConfig.GM_INFO.hp_Max = 7;
cc.fx.GameConfig.GM_INFO.hp = 7;
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.GameConfig.GM_INFO.doubleCoin = 2;
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();
}
}
}
})
// 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();
}
}
}
closeMonthCard() {
// this.init();
//获取商城界面更新图标方法
@ -293,7 +282,6 @@ export default class NewClass extends cc.Component {
console.error('获取系统信息失败', e);
}
// Utils.GoKEFu();
if (systemType == "ios") {
// MiniGameSdk.API.showToast("IOS系统暂不支持支付");
// this.btn_Touch = true;
@ -308,7 +296,13 @@ export default class NewClass extends cc.Component {
this.iosProductId = productId;
this.iosCount = 1;
Utils.GoKEFu(iosPayInfo, (res) => {
this.closeLoad();
if (res == "success") {
console.log("客服回话成功");
}
else {
console.log("客服回话失败");
this.closeLoad();
}
});
}
else {
@ -384,14 +378,14 @@ export default class NewClass extends cc.Component {
}
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);
// 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)
@ -457,6 +451,11 @@ export default class NewClass extends cc.Component {
this.node.getChildByName("Loading").getChildByName("load").runAction(cc.rotateTo(2, 1080).repeatForever());
}
openConfirmBox() {
this.closeLoad();
this.node.getChildByName("ConfirmBox").active = true;
}
closeLoad() {
this.node.getChildByName("Loading").active = false;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 170 KiB

After

Width:  |  Height:  |  Size: 56 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

View File

@ -0,0 +1,38 @@
{
"ver": "2.3.7",
"uuid": "dd2853c1-a82a-4188-8150-05eb4aaa8f82",
"importer": "texture",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 519,
"height": 168,
"platformSettings": {},
"subMetas": {
"btn_Buy": {
"ver": "1.0.6",
"uuid": "d9be6eea-569b-46da-bb80-0d9c8b8f5263",
"importer": "sprite-frame",
"rawTextureUuid": "dd2853c1-a82a-4188-8150-05eb4aaa8f82",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 519,
"height": 168,
"rawWidth": 519,
"rawHeight": 168,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 110 KiB

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 163 KiB

After

Width:  |  Height:  |  Size: 44 KiB

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

View File

@ -0,0 +1,38 @@
{
"ver": "2.3.7",
"uuid": "99c9d0f0-802e-4b3e-94af-7ec76cbef2af",
"importer": "texture",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 994,
"height": 1462,
"platformSettings": {},
"subMetas": {
"kuangt1": {
"ver": "1.0.6",
"uuid": "71f0494c-f638-4d7a-a826-a9407bf2b27c",
"importer": "sprite-frame",
"rawTextureUuid": "99c9d0f0-802e-4b3e-94af-7ec76cbef2af",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 994,
"height": 1462,
"rawWidth": 994,
"rawHeight": 1462,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 121 KiB

After

Width:  |  Height:  |  Size: 121 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 938 KiB

After

Width:  |  Height:  |  Size: 178 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 MiB

After

Width:  |  Height:  |  Size: 282 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 935 KiB

After

Width:  |  Height:  |  Size: 229 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 77 KiB

After

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 154 KiB

After

Width:  |  Height:  |  Size: 42 KiB

View File

@ -28,19 +28,22 @@
},
{
"__id__": 50
},
{
"__id__": 63
}
],
"_active": true,
"_components": [
{
"__id__": 63
"__id__": 87
},
{
"__id__": 64
"__id__": 88
}
],
"_prefab": {
"__id__": 65
"__id__": 89
},
"_opacity": 255,
"_color": {
@ -2290,6 +2293,873 @@
"fileId": "05q/aTGl5Lioy2OJNs5XYl",
"sync": false
},
{
"__type__": "cc.Node",
"_name": "ConfirmBox",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [
{
"__id__": 64
},
{
"__id__": 68
},
{
"__id__": 71
},
{
"__id__": 74
},
{
"__id__": 77
}
],
"_active": false,
"_components": [
{
"__id__": 85
}
],
"_prefab": {
"__id__": 86
},
"_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__": 63
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 65
},
{
"__id__": 66
}
],
"_prefab": {
"__id__": 67
},
"_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__": 64
},
"_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__": 64
},
"_enabled": true,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 63
},
"asset": {
"__uuid__": "9fdc6671-8422-410b-b9af-36dab20f1488"
},
"fileId": "47UiHH16RKK6j+4cK469um",
"sync": false
},
{
"__type__": "cc.Node",
"_name": "bg",
"_objFlags": 0,
"_parent": {
"__id__": 63
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 69
}
],
"_prefab": {
"__id__": 70
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 994,
"height": 1462
},
"_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__": 68
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "71f0494c-f638-4d7a-a826-a9407bf2b27c"
},
"_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__": 63
},
"asset": {
"__uuid__": "9fdc6671-8422-410b-b9af-36dab20f1488"
},
"fileId": "eeHwB6Bq5CSbRJy0kYMgo0",
"sync": false
},
{
"__type__": "cc.Node",
"_name": "title",
"_objFlags": 0,
"_parent": {
"__id__": 63
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 72
}
],
"_prefab": {
"__id__": 73
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 160,
"height": 50.4
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
330.904,
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__": 71
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_string": "月卡充值",
"_N$string": "月卡充值",
"_fontSize": 40,
"_lineHeight": 40,
"_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__": 63
},
"asset": {
"__uuid__": "9fdc6671-8422-410b-b9af-36dab20f1488"
},
"fileId": "fa+8dDqrdLTrl/Ji8K9LMX",
"sync": false
},
{
"__type__": "cc.Node",
"_name": "New Label",
"_objFlags": 0,
"_parent": {
"__id__": 63
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 75
}
],
"_prefab": {
"__id__": 76
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 0,
"b": 0,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 320,
"height": 195.6
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
89.865,
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__": 74
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_string": "网络异常\n请重新登录小游戏\n领取月卡奖励",
"_N$string": "网络异常\n请重新登录小游戏\n领取月卡奖励",
"_fontSize": 40,
"_lineHeight": 60,
"_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__": 63
},
"asset": {
"__uuid__": "9fdc6671-8422-410b-b9af-36dab20f1488"
},
"fileId": "9149ix6q1AZ4VyIjmSGbdM",
"sync": false
},
{
"__type__": "cc.Node",
"_name": "New Sprite",
"_objFlags": 0,
"_parent": {
"__id__": 63
},
"_children": [
{
"__id__": 78
}
],
"_active": true,
"_components": [
{
"__id__": 81
},
{
"__id__": 82
}
],
"_prefab": {
"__id__": 84
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 519,
"height": 168
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-3.21,
-77.027,
0,
0,
0,
0,
1,
0.4,
0.4,
0
]
},
"_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 Label",
"_objFlags": 0,
"_parent": {
"__id__": 77
},
"_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": 160,
"height": 100.8
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
13.174,
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__": 78
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_string": "确定",
"_N$string": "确定",
"_fontSize": 80,
"_lineHeight": 80,
"_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__": 63
},
"asset": {
"__uuid__": "9fdc6671-8422-410b-b9af-36dab20f1488"
},
"fileId": "1f0NO1uLNIxrx1dYb9rOaL",
"sync": false
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 77
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "d9be6eea-569b-46da-bb80-0d9c8b8f5263"
},
"_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.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 77
},
"_enabled": true,
"_normalMaterial": null,
"_grayMaterial": null,
"duration": 0.1,
"zoomScale": 1.1,
"clickEvents": [
{
"__id__": 83
}
],
"_N$interactable": true,
"_N$enableAutoGrayEffect": false,
"_N$transition": 3,
"transition": 3,
"_N$normalColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"_N$hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$disabledColor": {
"__type__": "cc.Color",
"r": 124,
"g": 124,
"b": 124,
"a": 255
},
"_N$normalSprite": null,
"_N$pressedSprite": null,
"pressedSprite": null,
"_N$hoverSprite": null,
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": {
"__id__": 77
},
"_id": ""
},
{
"__type__": "cc.ClickEvent",
"target": {
"__id__": 1
},
"component": "",
"_componentId": "191edqNaKdPtJiA4/cSsB1N",
"handler": "closeMonthCard",
"customEventData": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 63
},
"asset": {
"__uuid__": "9fdc6671-8422-410b-b9af-36dab20f1488"
},
"fileId": "58sKElg7lE9I935Fpq7n8Y",
"sync": false
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 63
},
"_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__": 63
},
"asset": {
"__uuid__": "9fdc6671-8422-410b-b9af-36dab20f1488"
},
"fileId": "c59E21W4dAgZdQulz+5vqy",
"sync": false
},
{
"__type__": "cc.Widget",
"_name": "",

View File

@ -37,19 +37,22 @@
},
{
"__id__": 436
},
{
"__id__": 449
}
],
"_active": true,
"_components": [
{
"__id__": 449
"__id__": 473
},
{
"__id__": 450
"__id__": 474
}
],
"_prefab": {
"__id__": 451
"__id__": 475
},
"_opacity": 255,
"_color": {
@ -16667,6 +16670,873 @@
"fileId": "b50PfruR5P1axiaB0Q563i",
"sync": false
},
{
"__type__": "cc.Node",
"_name": "ConfirmBox",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [
{
"__id__": 450
},
{
"__id__": 454
},
{
"__id__": 457
},
{
"__id__": 460
},
{
"__id__": 463
}
],
"_active": false,
"_components": [
{
"__id__": 471
}
],
"_prefab": {
"__id__": 472
},
"_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__": 449
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 451
},
{
"__id__": 452
}
],
"_prefab": {
"__id__": 453
},
"_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__": 450
},
"_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__": 450
},
"_enabled": true,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 449
},
"asset": {
"__uuid__": "9fdc6671-8422-410b-b9af-36dab20f1488"
},
"fileId": "47UiHH16RKK6j+4cK469um",
"sync": false
},
{
"__type__": "cc.Node",
"_name": "bg",
"_objFlags": 0,
"_parent": {
"__id__": 449
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 455
}
],
"_prefab": {
"__id__": 456
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 994,
"height": 1462
},
"_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__": 454
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "71f0494c-f638-4d7a-a826-a9407bf2b27c"
},
"_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__": 449
},
"asset": {
"__uuid__": "9fdc6671-8422-410b-b9af-36dab20f1488"
},
"fileId": "eeHwB6Bq5CSbRJy0kYMgo0",
"sync": false
},
{
"__type__": "cc.Node",
"_name": "title",
"_objFlags": 0,
"_parent": {
"__id__": 449
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 458
}
],
"_prefab": {
"__id__": 459
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 160,
"height": 50.4
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
330.904,
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__": 457
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_string": "商城充值",
"_N$string": "商城充值",
"_fontSize": 40,
"_lineHeight": 40,
"_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__": 449
},
"asset": {
"__uuid__": "9fdc6671-8422-410b-b9af-36dab20f1488"
},
"fileId": "fa+8dDqrdLTrl/Ji8K9LMX",
"sync": false
},
{
"__type__": "cc.Node",
"_name": "New Label",
"_objFlags": 0,
"_parent": {
"__id__": 449
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 461
}
],
"_prefab": {
"__id__": 462
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 0,
"b": 0,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 320,
"height": 195.6
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
89.865,
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__": 460
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_string": "网络异常\n请重新登录小游戏\n领取充值奖励",
"_N$string": "网络异常\n请重新登录小游戏\n领取充值奖励",
"_fontSize": 40,
"_lineHeight": 60,
"_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__": 449
},
"asset": {
"__uuid__": "9fdc6671-8422-410b-b9af-36dab20f1488"
},
"fileId": "9149ix6q1AZ4VyIjmSGbdM",
"sync": false
},
{
"__type__": "cc.Node",
"_name": "New Sprite",
"_objFlags": 0,
"_parent": {
"__id__": 449
},
"_children": [
{
"__id__": 464
}
],
"_active": true,
"_components": [
{
"__id__": 467
},
{
"__id__": 468
}
],
"_prefab": {
"__id__": 470
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 519,
"height": 168
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-3.21,
-77.027,
0,
0,
0,
0,
1,
0.4,
0.4,
0
]
},
"_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 Label",
"_objFlags": 0,
"_parent": {
"__id__": 463
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 465
}
],
"_prefab": {
"__id__": 466
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 160,
"height": 100.8
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
13.174,
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__": 464
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_string": "确定",
"_N$string": "确定",
"_fontSize": 80,
"_lineHeight": 80,
"_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__": 449
},
"asset": {
"__uuid__": "9fdc6671-8422-410b-b9af-36dab20f1488"
},
"fileId": "1f0NO1uLNIxrx1dYb9rOaL",
"sync": false
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 463
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "d9be6eea-569b-46da-bb80-0d9c8b8f5263"
},
"_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.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 463
},
"_enabled": true,
"_normalMaterial": null,
"_grayMaterial": null,
"duration": 0.1,
"zoomScale": 1.1,
"clickEvents": [
{
"__id__": 469
}
],
"_N$interactable": true,
"_N$enableAutoGrayEffect": false,
"_N$transition": 3,
"transition": 3,
"_N$normalColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"_N$hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$disabledColor": {
"__type__": "cc.Color",
"r": 124,
"g": 124,
"b": 124,
"a": 255
},
"_N$normalSprite": null,
"_N$pressedSprite": null,
"pressedSprite": null,
"_N$hoverSprite": null,
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": {
"__id__": 463
},
"_id": ""
},
{
"__type__": "cc.ClickEvent",
"target": {
"__id__": 1
},
"component": "",
"_componentId": "48bfeZuYFZE2qmgxbW2IigB",
"handler": "closeConfirmBox",
"customEventData": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 449
},
"asset": {
"__uuid__": "9fdc6671-8422-410b-b9af-36dab20f1488"
},
"fileId": "58sKElg7lE9I935Fpq7n8Y",
"sync": false
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 449
},
"_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__": 449
},
"asset": {
"__uuid__": "9fdc6671-8422-410b-b9af-36dab20f1488"
},
"fileId": "0bIt32pkVJWp47546cV3sp",
"sync": false
},
{
"__type__": "48bfeZuYFZE2qmgxbW2IigB",
"_name": "",

View File

@ -200,16 +200,15 @@ export default class NewClass extends cc.Component {
const systemInfo = wx.getSystemInfoSync();
if (systemInfo.platform === 'ios') {
if (cc.sys.platform === cc.sys.WECHAT_GAME) {
console.log("从后台进入前台订单号:", cc.fx.GameConfig.GM_INFO.iosOutTradeNo);
if (cc.fx.GameConfig.GM_INFO.iosOutTradeNo != null && cc.fx.GameConfig.GM_INFO.iosOutTradeNo != "") {
console.log("从后台进入前台订单号:", cc.fx.GameConfig.GM_INFO.iosShopOrder);
if (cc.fx.GameConfig.GM_INFO.iosShopOrder != null && cc.fx.GameConfig.GM_INFO.iosShopOrder != "") {
console.log("有苹果订单号,开始轮训");
const iosOutTradeNo = cc.fx.GameConfig.GM_INFO.iosOutTradeNo;
// cc.fx.GameConfig.GM_INFO.iosOutTradeNo = "";
const iosShopOrder = cc.fx.GameConfig.GM_INFO.iosShopOrder;
// this.closeLoad();
// this.openLoad();
this.btn_Touch = true;
Utils.getIosPayInfo(iosOutTradeNo,
Utils.getIosPayInfo(iosShopOrder,
(data) => {
console.log("商城获得轮训结果:", data);
const iosID = data.data?.payment_name || this.iosProductId;
@ -222,52 +221,36 @@ export default class NewClass extends cc.Component {
if (data.code == 1) {
console.log("购买成功");
console.log("商品id:", iosID);
const dataSuccess = {
outTradeNo: iosOutTradeNo,
pay_amount: iosAmount,
payment_name: iosID,
payment_num: this.iosCount,
type: "ios",
}
cc.fx.GameTool.shushu_Track("payment", dataSuccess);
// const dataSuccess = {
// outTradeNo: iosShopOrder,
// pay_amount: iosAmount,
// payment_name: iosID,
// payment_num: this.iosCount,
// type: "ios",
// }
// cc.fx.GameTool.shushu_Track("payment", dataSuccess);
let name = "购买金币道具:" + iosID;
MiniGameSdk.API.yinli_Pay(iosAmount, iosOutTradeNo, name)
MiniGameSdk.API.yinli_Pay(iosAmount, iosShopOrder, name)
Utils.setPayInfo(
(res) => {
this.closeLoad();
//console.log("设置轮训结果:", res);
if (res.code === 1) {
console.log("_________正式发货", iosID);
MiniGameSdk.API.showToast("充值成功");
cc.fx.GameTool.shopBuy(iosID, false);
if (iosID == "unlimited_health_bundle_10" ||
iosID == "unlimited_health_bundle_20" ||
iosID == "unlimited_health_bundle_30"
) {
this.updatePower();
}
//console.log("充值成功获得金币");
}
else {
MiniGameSdk.API.showToast("网络异常,充值奖励将在登录后再次发放");
const dataFail4 = {
outTradeNo: iosOutTradeNo,
pay_amount: iosAmount,
payment_name: iosID,
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();
}
}, iosOutTradeNo)
console.log("_________正式发货", iosID);
MiniGameSdk.API.showToast("充值成功");
cc.fx.GameTool.shopBuy(iosID, false);
if (iosID == "unlimited_health_bundle_10" ||
iosID == "unlimited_health_bundle_20" ||
iosID == "unlimited_health_bundle_30"
) {
this.updatePower();
}
cc.fx.GameConfig.GM_INFO.iosShopOrder = null;
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();
}
this.closeLoad();
this.btn_Touch = true;
//console.log("充值成功获得金币");
}
else if (data.code == 0) {
console.log("用户自己取消充值");
@ -275,7 +258,7 @@ export default class NewClass extends cc.Component {
this.closeLoad();
this.btn_Touch = true;
const dataFail = {
outTradeNo: iosOutTradeNo,
outTradeNo: iosShopOrder,
pay_amount: iosAmount,
payment_name: iosID,
payment_num: this.iosCount,
@ -283,13 +266,15 @@ export default class NewClass extends cc.Component {
fail_reason: "用户取消充值",
}
cc.fx.GameTool.shushu_Track("payment_fail", dataFail);
cc.fx.GameConfig.GM_INFO.iosShopOrder = null;
}
else if (data.code == 2) {
this.closeLoad();
this.btn_Touch = true;
console.log("轮训超时");
MiniGameSdk.API.showToast("请检查网络,如充值成功,请重新登录领取");
MiniGameSdk.API.showToast("请检查网络,如充值成功,请重新登录领取", 4);
const dataFail = {
outTradeNo: iosOutTradeNo,
outTradeNo: iosShopOrder,
pay_amount: iosAmount,
payment_name: iosID,
payment_num: this.iosCount,
@ -297,11 +282,8 @@ export default class NewClass extends cc.Component {
fail_reason: "用户充值后,轮训结果超时",
}
cc.fx.GameTool.shushu_Track("payment_fail", dataFail);
this.openConfirmBox();
}
this.closeLoad();
this.btn_Touch = true;
// console.log("商城置空订单号");
// cc.fx.GameConfig.GM_INFO.iosOutTradeNo = null;
})
}
else {
@ -494,7 +476,6 @@ export default class NewClass extends cc.Component {
}
else {
console.log("客服回话失败");
// cc.fx.GameConfig.GM_INFO.iosOutTradeNo = null;
this.closeLoad();
}
});
@ -573,14 +554,14 @@ export default class NewClass extends cc.Component {
}
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);
// 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;
MiniGameSdk.API.yinli_Pay(price, Utils.outTradeNo, name);
@ -760,5 +741,15 @@ export default class NewClass extends cc.Component {
NumberToImage.numberToImageNodes(cc.fx.GameConfig.GM_INFO.monthTime, 35, 15, "button_", this.monthCardTime.children[1], true);
}
openConfirmBox() {
this.node.getChildByName("ConfirmBox").active = true;
this.closeLoad();
}
//关闭商城确认按钮
closeConfirmBox() {
this.node.getChildByName("ConfirmBox").active = false;
}
// update (dt) {}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 MiB

After

Width:  |  Height:  |  Size: 594 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 83 KiB

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 71 KiB

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.4 KiB

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.6 KiB

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@ -1,5 +1,5 @@
{
"last-module-event-record-time": 1754302048063,
"last-module-event-record-time": 1754966862658,
"group-list": [
"default",
"Map"