完善功能

This commit is contained in:
wangxiaowei
2025-12-27 01:34:44 +08:00
parent a92e4354ad
commit 18b7d483a6
6 changed files with 46 additions and 28 deletions

View File

@ -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()