clickzhifu() {
var that = this;
wx.request({
url: that.data.url + '******',
data: {
user_id: that.data.user_id,
order_id: that.data.order_id
},
success: function(res) {
console.log(res)
if (res.data.status == 200) {
console.log(res.data.data)
res.data.data = JSON.parse(res.data.data)
wx.requestPayment({
appId: res.data.data.appId,
nonceStr: res.data.data.nonceStr,
package: res.data.data.package,
paySign: res.data.data.paySign,
signType: res.data.data.signType,
timeStamp: res.data.data.timeStamp,
success: function(res) {
console.log(res)
wx.showModal({
title: '支付成功',
content: '支付成功,请去我的订单中查看',
success: function(res) {
if (res.confirm) {
wx.switchTab({
url: '../../../../../../my/my',
})
} else {
// console.log('弹框后点取消')
}
}
})
},
fail: function(res) {
wx.showToast({
title: '支付失败,请重新支付',
icon: 'none',
duration: 1500
})
}
})
} else {
wx.showToast({
title: res.data.msg,
duration: 2000,
icon: 'none'
})
}
},
fail: function(res) {
wx.showToast({
title: '失败,请检查网络',
duration: 2000,
icon: 'none'
})
}
})
},