This commit is contained in:
lanzhihui 2024-09-29 16:37:42 +08:00
parent 0b497d3fdc
commit bcdc824449

View File

@ -412,7 +412,7 @@
// } // }
that.$post({url: url, data}).then(({code, data}) => { that.$post({url: url, data}).then(({code, data}) => {
that.trade_no = data.trade_no that.trade_no = data.trade_no
if (data.wx_pay.length == 0) { if (data.length == 0) {
that.$post({url: `${service.host}/order/${that.trade_no}/callback`}).then(({code, data}) => { that.$post({url: `${service.host}/order/${that.trade_no}/callback`}).then(({code, data}) => {
that.cardCur_1 = 0 that.cardCur_1 = 0
that.getUserData() that.getUserData()
@ -420,7 +420,7 @@
that.$Toast_success('支付成功') that.$Toast_success('支付成功')
}) })
} else { } else {
let wxconfig = data.wx_pay.config let wxconfig = data.config
// wx.config(JSON.parse(response.data.data.order.wx_pay.js)); // wx.config(JSON.parse(response.data.data.order.wx_pay.js));
if (wxconfig.payment_debug) { if (wxconfig.payment_debug) {
return that.$post({url: `${service.host}/order/${that.trade_no}/callback`}).then(({code, data}) => { return that.$post({url: `${service.host}/order/${that.trade_no}/callback`}).then(({code, data}) => {
@ -429,7 +429,7 @@
}) })
} }
wx.requestPayment({ wx.requestPayment({
timeStamp: wxconfig.timestamp, // 支付签名时间戳注意微信jssdk中的所有使用timestamp字段均为小写。但最新版的支付后台生成签名使用的timeStamp字段名需大写其中的S字符 timeStamp: wxconfig.timeStamp, // 支付签名时间戳注意微信jssdk中的所有使用timestamp字段均为小写。但最新版的支付后台生成签名使用的timeStamp字段名需大写其中的S字符
nonceStr: wxconfig.nonceStr, // 支付签名随机串,不长于 32 位 nonceStr: wxconfig.nonceStr, // 支付签名随机串,不长于 32 位
package: wxconfig.package, // 统一支付接口返回的prepay_id参数值提交格式如prepay_id=*** package: wxconfig.package, // 统一支付接口返回的prepay_id参数值提交格式如prepay_id=***
signType: wxconfig.signType, // 签名方式,默认为'SHA1',使用新版支付需传入'MD5' signType: wxconfig.signType, // 签名方式,默认为'SHA1',使用新版支付需传入'MD5'