完善功能
This commit is contained in:
@ -278,29 +278,39 @@
|
||||
router.navigateBack(1, 500)
|
||||
} else if (pay.value == PayValue.WeChatPay) {
|
||||
// 微信支付
|
||||
wechatPay(res.pay.config).then((res) => {
|
||||
uni.hideLoading()
|
||||
if (res === 'success') {
|
||||
toast.success('支付成功')
|
||||
result.value = 'success'
|
||||
} else if (res === 'cancel') {
|
||||
toast.info('已取消支付')
|
||||
result.value = 'fail'
|
||||
} else {
|
||||
toast.info('支付失败,请重试')
|
||||
result.value = 'fail'
|
||||
}
|
||||
|
||||
console.log("🚀 ~ res.pay:", res.pay)
|
||||
if (res.pay_type && res.pay_type == 1) {
|
||||
toast.success('支付成功')
|
||||
result.value = 'success'
|
||||
isSubmitting.value = false
|
||||
router.navigateBack(1, 500)
|
||||
return
|
||||
}).catch(() => {
|
||||
uni.hideLoading()
|
||||
toast.info('支付失败,请重试')
|
||||
return
|
||||
})
|
||||
}
|
||||
} else {
|
||||
wechatPay(res.pay.config).then((res) => {
|
||||
console.log("🚀 ~ res:", res)
|
||||
uni.hideLoading()
|
||||
if (res === 'success') {
|
||||
toast.success('支付成功')
|
||||
result.value = 'success'
|
||||
} else if (res === 'cancel') {
|
||||
toast.info('已取消支付')
|
||||
result.value = 'fail'
|
||||
} else {
|
||||
toast.info('支付失败,请重试')
|
||||
result.value = 'fail'
|
||||
}
|
||||
|
||||
isSubmitting.value = false
|
||||
router.navigateBack(1, 500)
|
||||
return
|
||||
}).catch((e) => {
|
||||
console.log("🚀 ~ error:", e)
|
||||
uni.hideLoading()
|
||||
toast.info('支付失败,请重试')
|
||||
return
|
||||
})
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
isSubmitting.value = false
|
||||
uni.hideLoading()
|
||||
|
||||
Reference in New Issue
Block a user