//正式下订单
downOrder(productId,nlb){
var _this = this;
var statement = {
productid: productId
}
console.log(statement,'充值id')
// #ifdef APP-PLUS
console.log(iapChannel,statement,'查看参数')
plus.payment.request(iapChannel, statement, function(e) {
console.log(JSON.stringify(e), '带参数的回调');
let objData = {
'isSandbox':0,// 沙箱1
'receipt-data':e.transactionReceipt,
'ordernum':nlb.result
}
_this.$api.post('Pay/ApplePay',objData).then(data=>{
console.log(data,'data====')
if(data.code == 200){
uni.showModal({
content: '充值成功',
showCancel: false
})
_this.getInfo();
}else{
uni.showModal({
content: '支付失败,请重新支付',
showCancel: false
})
}
_this.loading = false;
}).catch(err=>{
console.log(err,'err')
uni.showModal({
content: '支付失败,请重新支付',
showCancel: false
})
_this.loading = false;
})
}, function() {
console.log("支付失败")
uni.showModal({
content: '支付失败,请重新支付',
showCancel: false
})
_this.loading = false;
});
// #endif
},