更新IOS 海外版支付

This commit is contained in:
COMPUTER\EDY 2026-06-26 15:38:28 +08:00
parent 94fe50642a
commit 236ce4a58f
8 changed files with 162 additions and 96 deletions

View File

@ -4251,11 +4251,13 @@ export default class JiaZai extends cc.Component {
// ============================================
update(dt) {
if (this.newbieGift && this.monthlyCardNode) {
if (this.monthlyCardNode.active == true) {
if (this.actionpNode) {
if (this.monthlyCardNode.active == true && this.actionpNode.active == true) {
this.monthlyCardNode.active = false;
}
}
}
}
// ============================================
// Cocos生命周期 - onDestroy方法

View File

@ -224,23 +224,8 @@ export default class Revive extends cc.Component {
// this.btn_Touch = true;
this.openLoad();
this.btn_Touch = true;
let iosPayInfo = {
price: price,
payment_name: productId,
payment_count: 1,
}
this.iosPrice = price;
this.iosProductId = productId;
this.iosCount = 1;
Utils.GoKEFu(iosPayInfo, (res) => {
if (res == "success") {
console.log("客服回话成功");
}
else {
console.log("客服回话失败");
this.closeLoad();
}
});
this.iosOldPay(price, productId);
}
else {
// MiniGameSdk.API.showToast("充值成功");
@ -276,6 +261,12 @@ export default class Revive extends cc.Component {
return;
}
else if (res.err) {
console.log("错误原因:", res.errMsg);
if (res.errMsg && res.errMsg.indexOf("fail App Store") !== -1) {
console.log("走ios旧支付");
this.iosOldPay(price, productId);
return;
}
MiniGameSdk.API.showToast("充值失败");
//console.log(res);
this.btn_Touch = true;
@ -436,4 +427,27 @@ export default class Revive extends cc.Component {
onDestroy() {
}
iosOldPay(price, productId) {
// 旧版本ios支付
let iosPayInfo = {
price: price,
payment_name: productId,
payment_count: 1,
}
this.iosPrice = price;
this.iosProductId = productId;
this.iosCount = 1;
console.log("准备跳客服回话:");
console.log(this.iosProductId);
Utils.GoKEFu(iosPayInfo, (res) => {
if (res == "success") {
console.log("客服回话成功");
}
else {
console.log("客服回话失败");
this.closeLoad();
}
});
}
}

View File

@ -302,7 +302,7 @@ export class GameConfig {
vibrateOpen: true, //震动
coinnum: 0, //每局的金币数
paid_user: false, //是否是付费用户
version: "1.9.89", //版本号
version: "1.9.90", //版本号
shushu_DistinctId: "", //数数访客ID
shushu_AccountId: "", //数数账号ID
uid: "", //用户和后端唯一id

View File

@ -126,6 +126,7 @@ export default class Utils {
errCode: errCode,
err: "请求支付失败",
}
console.log("请求支付失败");
callBack(data);
}
})

View File

@ -305,23 +305,8 @@ export default class NewClass extends cc.Component {
// this.btn_Touch = true;
this.openLoad();
this.btn_Touch = true;
let iosPayInfo = {
price: price,
payment_name: productId,
payment_count: 1,
}
this.iosPrice = price;
this.iosProductId = productId;
this.iosCount = 1;
Utils.GoKEFu(iosPayInfo, (res) => {
if (res == "success") {
console.log("客服回话成功");
}
else {
console.log("客服回话失败");
this.closeLoad();
}
});
this.iosOldPay(price, productId);
}
else {
// MiniGameSdk.API.showToast("充值成功");
@ -357,6 +342,12 @@ export default class NewClass extends cc.Component {
return;
}
else if (res.err) {
console.log("错误原因:", res.errMsg);
if (res.errMsg && res.errMsg.indexOf("fail App Store") !== -1) {
console.log("走ios旧支付");
this.iosOldPay(price, productId);
return;
}
MiniGameSdk.API.showToast("充值失败");
//console.log(res);
this.btn_Touch = true;
@ -488,4 +479,27 @@ export default class NewClass extends cc.Component {
onDestroy() {
}
iosOldPay(price, productId) {
// 旧版本ios支付
let iosPayInfo = {
price: price,
payment_name: productId,
payment_count: 1,
}
this.iosPrice = price;
this.iosProductId = productId;
this.iosCount = 1;
console.log("准备跳客服回话:");
console.log(this.iosProductId);
Utils.GoKEFu(iosPayInfo, (res) => {
if (res == "success") {
console.log("客服回话成功");
}
else {
console.log("客服回话失败");
this.closeLoad();
}
});
}
}

View File

@ -385,23 +385,9 @@ export default class NewbieGift extends cc.Component {
// this.btn_Touch = true;
this.openLoad();
this.btn_Touch = true;
let iosPayInfo = {
price: price,
payment_name: productId,
payment_count: 1,
}
this.iosPrice = price;
this.iosProductId = productId;
this.iosCount = 1;
Utils.GoKEFu(iosPayInfo, (res) => {
if (res == "success") {
console.log("客服回话成功");
}
else {
console.log("客服回话失败");
this.closeLoad();
}
});
this.iosOldPay(price, productId);
}
else {
// MiniGameSdk.API.showToast("充值成功");
@ -437,6 +423,12 @@ export default class NewbieGift extends cc.Component {
return;
}
else if (res.err) {
console.log("错误原因:", res.errMsg);
if (res.errMsg && res.errMsg.indexOf("fail App Store") !== -1) {
console.log("走ios旧支付");
this.iosOldPay(price, productId);
return;
}
MiniGameSdk.API.showToast("充值失败");
//console.log(res);
this.btn_Touch = true;
@ -574,5 +566,26 @@ export default class NewbieGift extends cc.Component {
}
iosOldPay(price, productId) {
// 旧版本ios支付
let iosPayInfo = {
price: price,
payment_name: productId,
payment_count: 1,
}
this.iosPrice = price;
this.iosProductId = productId;
this.iosCount = 1;
Utils.GoKEFu(iosPayInfo, (res) => {
if (res == "success") {
console.log("客服回话成功");
}
else {
console.log("客服回话失败");
this.closeLoad();
}
});
}
}

View File

@ -575,25 +575,7 @@ export default class passCheck extends cc.Component {
// this.btn_Touch = true;
this.openLoad();
this.btn_Touch = true;
let iosPayInfo = {
price: price,
payment_name: productId,
payment_count: 1,
}
this.iosPrice = price;
this.iosProductId = productId;
this.iosCount = 1;
console.log("准备跳客服回话:");
console.log(this.iosProductId);
Utils.GoKEFu(iosPayInfo, (res) => {
if (res == "success") {
console.log("客服回话成功");
}
else {
console.log("客服回话失败");
this.closeLoad();
}
});
this.iosOldPay(price, productId);
}
else {
this.openLoad();
@ -615,6 +597,12 @@ export default class passCheck extends cc.Component {
return;
}
else if (res.err) {
console.log("错误原因:", res.errMsg);
if (res.errMsg && res.errMsg.indexOf("fail App Store") !== -1) {
console.log("走ios旧支付");
this.iosOldPay(price, productId);
return;
}
MiniGameSdk.API.showToast("充值失败");
//console.log(res);
this.btn_Touch = true;
@ -792,4 +780,27 @@ export default class passCheck extends cc.Component {
}
iosOldPay(price, productId) {
// 旧版本ios支付
let iosPayInfo = {
price: price,
payment_name: productId,
payment_count: 1,
}
this.iosPrice = price;
this.iosProductId = productId;
this.iosCount = 1;
console.log("准备跳客服回话:");
console.log(this.iosProductId);
Utils.GoKEFu(iosPayInfo, (res) => {
if (res == "success") {
console.log("客服回话成功");
}
else {
console.log("客服回话失败");
this.closeLoad();
}
});
}
}

View File

@ -576,26 +576,8 @@ export default class NewClass extends cc.Component {
this.openLoad();
this.btn_Touch = true;
// 旧版本ios支付
let iosPayInfo = {
price: price,
payment_name: productId,
payment_count: 1,
}
this.iosPrice = price;
this.iosProductId = productId;
this.iosCount = 1;
console.log("准备跳客服回话:");
console.log(this.iosProductId);
Utils.GoKEFu(iosPayInfo, (res) => {
if (res == "success") {
console.log("客服回话成功");
}
else {
console.log("客服回话失败");
this.closeLoad();
}
});
this.iosOldPay(price, productId);
}
else {
// MiniGameSdk.API.showToast("充值成功");
@ -612,9 +594,9 @@ export default class NewClass extends cc.Component {
this.openLoad();
this.btn_Touch = true;
// console.log("7.14_____________________", "调用充值接口", systemType);
console.log("6.26_____________________", "调用充值接口", systemType);
Utils.buyProp(id, count, price, systemType, productId, (res) => {
//console.log("获得充值结果", res);
console.log("获得充值结果_____", res);
if (res == null) {
MiniGameSdk.API.showToast("充值失败");
this.btn_Touch = true;
@ -631,8 +613,14 @@ export default class NewClass extends cc.Component {
return;
}
else if (res.err) {
console.log("错误原因:", res.errMsg);
if (res.errMsg && res.errMsg.indexOf("fail App Store") !== -1) {
console.log("走ios旧支付");
this.iosOldPay(price, productId);
return;
}
MiniGameSdk.API.showToast("充值失败");
//console.log(res);
console.log(res);
this.btn_Touch = true;
let name = "支付拉起失败";
if (res.errCode == -2) {
@ -880,5 +868,28 @@ export default class NewClass extends cc.Component {
this.node.getChildByName("ConfirmBox").active = false;
}
iosOldPay(price, productId) {
// 旧版本ios支付
let iosPayInfo = {
price: price,
payment_name: productId,
payment_count: 1,
}
this.iosPrice = price;
this.iosProductId = productId;
this.iosCount = 1;
console.log("准备跳客服回话:");
console.log(this.iosProductId);
Utils.GoKEFu(iosPayInfo, (res) => {
if (res == "success") {
console.log("客服回话成功");
}
else {
console.log("客服回话失败");
this.closeLoad();
}
});
}
// update (dt) {}
}