This commit is contained in:
YZ\249929363 2025-08-08 15:31:24 +08:00
parent 2cc681c468
commit bfc3bc3100
5 changed files with 24 additions and 18 deletions

View File

@ -1015,11 +1015,11 @@ export default class JiaZai extends cc.Component {
cc.fx.GameConfig.GM_INFO.monthTime = remainingDays; cc.fx.GameConfig.GM_INFO.monthTime = remainingDays;
resolve(remainingDays); resolve(remainingDays);
} else { } else {
resolve(0); // 或 reject(data) 根据需要 // resolve(0); // 或 reject(data) 根据需要
} }
} }
else { else {
resolve(0); // 或 reject(data) 根据需要 // resolve(0); // 或 reject(data) 根据需要
} }
}); });
}); });

View File

@ -181,7 +181,6 @@ export default class Revive extends cc.Component {
let shopComp = shop.getComponent("shop"); let shopComp = shop.getComponent("shop");
if (shopComp) { if (shopComp) {
shopComp.openShop(); shopComp.openShop();
shopComp.init();
} }
} }
cc.fx.GameConfig.GM_INFO.revive = 1; cc.fx.GameConfig.GM_INFO.revive = 1;

View File

@ -62,6 +62,7 @@ export default class Utils {
payment_num: 1, payment_num: 1,
type: systemType, type: systemType,
} }
console.log("创建订单", Utils.outTradeNo);
cc.fx.GameTool.shushu_Track("init_order", data); cc.fx.GameTool.shushu_Track("init_order", data);
//console.log("创建的最新订单的订单号:", Utils.outTradeNo); //console.log("创建的最新订单的订单号:", Utils.outTradeNo);
// let timeoutId: number; // let timeoutId: number;
@ -186,7 +187,7 @@ export default class Utils {
payment_num: iosPayInfo.payment_count, payment_num: iosPayInfo.payment_count,
type: "ios", type: "ios",
} }
//console.log("ios创建订单信息:", data); console.log("ios创建订单信息:", data);
cc.fx.GameTool.shushu_Track("init_order", shushu_data); cc.fx.GameTool.shushu_Track("init_order", shushu_data);
//@ts-ignore //@ts-ignore
wx.openCustomerServiceConversation({ wx.openCustomerServiceConversation({
@ -208,7 +209,7 @@ export default class Utils {
...Array(3).fill(1000), ...Array(3).fill(1000),
...Array(5).fill(2000), ...Array(5).fill(2000),
...Array(6).fill(5000), ...Array(6).fill(5000),
...Array(5).fill(15000) ...Array(5).fill(10000)
]; ];
let attempt = 0; // 轮询次数 let attempt = 0; // 轮询次数
const iosOutTradeNo = order; const iosOutTradeNo = order;
@ -223,8 +224,8 @@ export default class Utils {
//console.log("请求uid:" + Utils.uid); //console.log("请求uid:" + Utils.uid);
//console.log("outTradeNo:" + iosOutTradeNo); //console.log("outTradeNo:" + iosOutTradeNo);
Utils.POST("wx/iosgetPayInfo", { outTradeNo: 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);
} else if (res.code === 0) { } else if (res.code === 0) {
@ -243,6 +244,8 @@ export default class Utils {
} }
//#endregion //#endregion
//#region 微信云 //#region 微信云

View File

@ -232,7 +232,6 @@ export default class NewClass extends cc.Component {
let shopComp = shop.getComponent("shop"); let shopComp = shop.getComponent("shop");
if (shopComp) { if (shopComp) {
shopComp.openShop(); shopComp.openShop();
shopComp.init();
} }
} }

View File

@ -200,19 +200,23 @@ export default class NewClass extends cc.Component {
if (systemInfo.platform === 'ios') { if (systemInfo.platform === 'ios') {
if (cc.sys.platform === cc.sys.WECHAT_GAME) { if (cc.sys.platform === cc.sys.WECHAT_GAME) {
console.log("从后台进入前台订单号:", cc.fx.GameConfig.GM_INFO.iosOutTradeNo); console.log("从后台进入前台订单号:", cc.fx.GameConfig.GM_INFO.iosOutTradeNo);
this.closeLoad();
if (cc.fx.GameConfig.GM_INFO.iosOutTradeNo != null && cc.fx.GameConfig.GM_INFO.iosOutTradeNo != "") { if (cc.fx.GameConfig.GM_INFO.iosOutTradeNo != null && cc.fx.GameConfig.GM_INFO.iosOutTradeNo != "") {
console.log("有苹果订单号,开始轮训"); console.log("有苹果订单号,开始轮训");
const iosOutTradeNo = cc.fx.GameConfig.GM_INFO.iosOutTradeNo; const iosOutTradeNo = cc.fx.GameConfig.GM_INFO.iosOutTradeNo;
cc.fx.GameConfig.GM_INFO.iosOutTradeNo = ""; cc.fx.GameConfig.GM_INFO.iosOutTradeNo = "";
this.openLoad(); // this.closeLoad();
// this.openLoad();
this.btn_Touch = true; this.btn_Touch = true;
Utils.getIosPayInfo(iosOutTradeNo, Utils.getIosPayInfo(iosOutTradeNo,
(data) => { (data) => {
console.log("获得轮训结果:", data); console.log("获得轮训结果:", data);
const iosID = data.data?.payment_name || this.iosProductId; const iosID = data.data?.payment_name || this.iosProductId;
let iosAmount = data.data?.goodsPrice || this.iosPrice; let iosAmount = data.data?.goodsPrice || this.iosPrice;
iosAmount = parseInt(iosAmount); iosAmount = parseInt(iosAmount);
if (iosID == "reborn_Gift" || iosID == "month_Card") {
return;
}
if (data.code == 1) { if (data.code == 1) {
console.log("购买成功"); console.log("购买成功");
console.log("商品id:", iosID); console.log("商品id:", iosID);
@ -292,7 +296,7 @@ export default class NewClass extends cc.Component {
} }
cc.fx.GameTool.shushu_Track("payment_fail", dataFail); cc.fx.GameTool.shushu_Track("payment_fail", dataFail);
} }
this.closeLoad();
this.btn_Touch = true; this.btn_Touch = true;
cc.fx.GameConfig.GM_INFO.iosOutTradeNo = null; cc.fx.GameConfig.GM_INFO.iosOutTradeNo = null;
}) })
@ -466,7 +470,6 @@ export default class NewClass extends cc.Component {
console.error('获取系统信息失败', e); console.error('获取系统信息失败', e);
} }
// Utils.GoKEFu();
if (systemType == "ios") { if (systemType == "ios") {
// MiniGameSdk.API.showToast("IOS系统暂不支持支付"); // MiniGameSdk.API.showToast("IOS系统暂不支持支付");
// this.btn_Touch = true; // this.btn_Touch = true;
@ -483,7 +486,14 @@ export default class NewClass extends cc.Component {
console.log("准备跳客服回话:"); console.log("准备跳客服回话:");
console.log(this.iosProductId); console.log(this.iosProductId);
Utils.GoKEFu(iosPayInfo, (res) => { Utils.GoKEFu(iosPayInfo, (res) => {
if (res == "success") {
console.log("客服回话成功");
}
else {
console.log("客服回话失败");
cc.fx.GameConfig.GM_INFO.iosOutTradeNo = null;
this.closeLoad(); this.closeLoad();
}
}); });
} }
else { else {
@ -715,11 +725,6 @@ export default class NewClass extends cc.Component {
} }
} }
openmonthCard() { openmonthCard() {
if (cc.sys.platform === cc.sys.WECHAT_GAME && this.onShowListener) {
console.log("shop移除onshow11111");
//@ts-ignore
wx.offShow(this.onShowListener);
}
const winCOIN = cc.find("Canvas"); // 假设 Canvas 节点 const winCOIN = cc.find("Canvas"); // 假设 Canvas 节点
if (winCOIN) { if (winCOIN) {
const wincoin = winCOIN.getComponent(SceneManager); const wincoin = winCOIN.getComponent(SceneManager);