微调
This commit is contained in:
10
App.vue
10
App.vue
@@ -32,8 +32,8 @@
|
||||
// #ifdef APP-PLUS
|
||||
updata();
|
||||
// 检测是否有未关闭苹果内购订单
|
||||
iap.getChannels();
|
||||
console.log('引入了?');
|
||||
// iap.getChannels();
|
||||
// console.log('引入了?');
|
||||
// #endif
|
||||
|
||||
uni.getSystemInfo({
|
||||
@@ -153,6 +153,12 @@
|
||||
|
||||
},
|
||||
onShow: function(e) {
|
||||
// #ifdef APP-PLUS
|
||||
// updata();
|
||||
// 检测是否有未关闭苹果内购订单
|
||||
iap.getChannels();
|
||||
// console.log('引入了?');
|
||||
// #endif
|
||||
// console.log(plus.runtime.arguments, 'plus.runtime.arguments-----')
|
||||
// #ifdef MP-WEIXIN
|
||||
//获取二维码携带的参数
|
||||
|
||||
@@ -6,8 +6,8 @@ if (process.env.NODE_ENV === 'development') {
|
||||
// socketUrl = "ws://localhost:6001/";
|
||||
// baseUrl = "https://twin-ui.com/demo/";
|
||||
// baseUrl = "https://testapi.nuttyreading.com/"; // 线上测试环境
|
||||
baseUrl = "https://api.nuttyreading.com/"; // 线上正式
|
||||
// baseUrl = "http://192.168.110.100:9200/pb/"; // 开发用电脑
|
||||
// baseUrl = "https://api.nuttyreading.com/"; // 线上正式
|
||||
baseUrl = "http://192.168.110.100:9200/pb/"; // 开发用电脑
|
||||
// baseUrl = "http://59.110.212.44:9200/pb/";
|
||||
// baseUrl = "http://192.168.110.100:9100/pb/"; // 开发用电脑
|
||||
// baseUrl = "http://192.168.110.110:9200/pb/";
|
||||
|
||||
@@ -266,12 +266,13 @@
|
||||
}
|
||||
})
|
||||
}, 1000)
|
||||
}else{
|
||||
uni.showToast({
|
||||
title:'支付环境不支持IAP',
|
||||
icon:'none'
|
||||
})
|
||||
}
|
||||
// else{
|
||||
// uni.showToast({
|
||||
// title:'支付环境不支持IAP',
|
||||
// icon:'none'
|
||||
// })
|
||||
// }
|
||||
}
|
||||
})
|
||||
|
||||
@@ -329,6 +330,7 @@
|
||||
// 支付成功,result 为 IAP商品交易信息对象 IAPTransaction 需将返回的支付凭证传给后端进行二次认证
|
||||
that.iapCheck(result)
|
||||
}, function(e) {
|
||||
uni.hideLoading()
|
||||
console.log('错误回调', e)
|
||||
if (e.code == 2) {
|
||||
uni.showToast({
|
||||
@@ -342,6 +344,7 @@
|
||||
})
|
||||
console.log('其他支付错误',e);
|
||||
}
|
||||
that.restoreComplateRequest()
|
||||
});
|
||||
},
|
||||
iapCheck(result) {
|
||||
@@ -367,14 +370,15 @@
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
}).then(res => {
|
||||
console.log(JSON.stringify(res))
|
||||
// console.log(JSON.stringify(res))
|
||||
if (res.code == 0) {
|
||||
|
||||
uni.hideLoading()
|
||||
uni.showToast({
|
||||
title:'充值成功!',
|
||||
icon:'success'
|
||||
})
|
||||
console.log("充值订单已处理,请留意账户金额变动....");
|
||||
console.log("充值订单已处理,请留意账户金额变动....",res);
|
||||
that.finishTransaction(result);
|
||||
}
|
||||
}).catch(e => {
|
||||
|
||||
Binary file not shown.
@@ -17,14 +17,13 @@ var iap = {
|
||||
console.log('检测支付通道')
|
||||
plus.payment.getChannels(async (channels) => {
|
||||
for (var i in channels) {
|
||||
console.log("channels",channels, );
|
||||
// 判断是否苹果支付1
|
||||
if (channels[i].id === "appleiap") {
|
||||
console.log("存在苹果内购channels",channels, );
|
||||
that.iapChannel = channels[i];
|
||||
// 先检测有没有未完成的订单
|
||||
that.restoreComplateRequest()
|
||||
}else{
|
||||
console.log('安卓客户端');
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -110,6 +109,21 @@ var iap = {
|
||||
})
|
||||
.catch((e) => {
|
||||
console.log('后台验证失败=>',e);
|
||||
uni.showModal({
|
||||
title: "提示",
|
||||
cancelColor:'#0081ff',
|
||||
content: `您的账户下存在验证异常的订单(订单编号为:${e.data.orderId}),可尝试稍后重启app,如不能解决您的问题,可联系官方客服`,
|
||||
cancelText:'已验证关闭订单',
|
||||
confirmText:'知道了',
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
console.log("用户点击确定");
|
||||
}else{
|
||||
console.log('点了取消')
|
||||
that.finishTransaction(result);
|
||||
}
|
||||
},
|
||||
});
|
||||
// that.finishTransaction(result);
|
||||
});
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user