This commit is contained in:
@fawn-nine
2024-07-15 17:04:49 +08:00
parent 2c7bd95cc1
commit 7487f74259
5 changed files with 39 additions and 15 deletions

View File

@@ -266,12 +266,13 @@
}
})
}, 1000)
}else{
uni.showToast({
title:'支付环境不支持IAP',
icon:'none'
})
}
// else{
// uni.showToast({
// title:'支付环境不支持IAP',
// icon:'none'
// })
// }
}
})
@@ -329,7 +330,8 @@
// 支付成功result 为 IAP商品交易信息对象 IAPTransaction 需将返回的支付凭证传给后端进行二次认证
that.iapCheck(result)
}, function(e) {
console.log('错误回调', e)
uni.hideLoading()
console.log('错误回调', e)
if (e.code == 2) {
uni.showToast({
title:'取消支付,内购订单即将关闭',
@@ -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 => {