/**
* 支付
*/
pay() {
console.log('nonce_str:' + this.data.nonce_str);
console.log('paySign:' + this.data.paySign);
console.log('prepay_id:' + this.data.package);
console.log('price:' + this.data.price);
console.log('timeStamp:' + this.data.timeStamp);
wx.requestPayment({
nonceStr: this.data.nonce_str,
package: this.data.package,
paySign: this.data.paySign,
timeStamp:this.data.timeStamp,
signType: 'MD5',
success: (res) => {
console.log('成功' + res);
console.log(res);
wx.showModal({
showCancel: false,
title: '付款成功,请在我的订单中查看',
success: (result) => {
wx.navigateBack({
delta: 3
})
},
})
},
fail: (res) => {
console.log('失败' + res);
console.log(res);
wx.showModal({
showCancel: false,
title: '付款失败',
success: (result) => {
},
})
},
complete: (res) => {
console.log('完成' + res);
},
})
},
小程序调起微信支付
最新推荐文章于 2024-07-19 08:54:58 发布