Commit a5efc0fc by 张立顺

支付请求判断修复

1 parent 406b66c4
...@@ -287,21 +287,31 @@ export default { ...@@ -287,21 +287,31 @@ export default {
duration: 0 duration: 0
}) })
createWxPayH5(params).then((result) => { createWxPayH5(params).then((result) => {
console.log(result, 'result') const { tradeNO } = JSON.parse(result.jsapiPayInfo)
const { code, data, message } = result this.tradeNO = tradeNO
if (code == 0) { console.log('tradeNO', tradeNO)
const { tradeNO } = JSON.parse(result.jsapiPayInfo) this.tradeNO && this.aliPayment()
this.tradeNO = tradeNO
console.log('tradeNO', tradeNO)
this.tradeNO && this.aliPayment()
} else {
this.$toast.fail(message || '支付失败')
}
}).catch((err) => { }).catch((err) => {
console.log(err) console.log(err)
}).finally(() => { }).finally(() => {
this.$toast.clear() this.$toast.clear()
}) })
// createWxPayH5(params).then((result) => {
// console.log(result, 'result')
// const { code, data, message } = result
// if (code == 0) {
// const { tradeNO } = JSON.parse(result.jsapiPayInfo)
// this.tradeNO = tradeNO
// console.log('tradeNO', tradeNO)
// this.tradeNO && this.aliPayment()
// } else {
// this.$toast.fail(message || '支付失败')
// }
// }).catch((err) => {
// console.log(err)
// }).finally(() => {
// this.$toast.clear()
// })
}, },
aliPayment() { aliPayment() {
const that = this const that = this
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!