微信支付拉不起来。
看图和代码
openVip: function () {
let that = this;
console.log(that.data.id)
if (that.data.id <= 0) {
app.warning('请选择会员类型');
return;
}
wx.showLoading({
title: '正在生成订单',
mask: true
})
app.request('api/vip/submit', {id: that.data.id}, function (data, ret) {
console.log(data)
wx.hideLoading()
wx.requestPayment({
'timeStamp': data.timeStamp,
'nonceStr': data.nonceStr,
'package': data.package,
'signType': data.signType,
'paySign': data.paySign,
'success': function (res) {
console.log('321313123123123213123123');
if (res.errMsg = "requestPayment:ok") {
wx.showToast({
title: '支付成功',
icon: 'success',
duration: 1500
})
setTimeout(() => {
wx.navigateBack({
delta: 1
})
}, 1500)
}
},
'fail': function () {
wx.showToast({
title: '支付失败',
icon: 'error',
duration: 1500
})
setTimeout(() => {
wx.navigateBack({
delta: 1
})
}, 1500)
}
})
}, function (data, ret) {
wx.hideLoading()
app.error(ret.msg);
});
},
您好,可以参考下这个:https://developers.weixin.qq.com/community/develop/doc/0006ae5b2f8b483a488bcbcf551009