|
|
@@ -60,7 +60,7 @@ async function submitPay() {
|
|
|
return
|
|
|
}
|
|
|
try {
|
|
|
- uni.showLoading({ title: '下单中...', mask: true })
|
|
|
+ await uni.showLoading({ title: '下单中...', mask: true })
|
|
|
const orderRes = await Apis.charge.addPurchaseRecord({
|
|
|
data: {
|
|
|
couponAmount: selectedLevel.money,
|
|
|
@@ -71,7 +71,7 @@ async function submitPay() {
|
|
|
const orderNumber = orderRes.data
|
|
|
if (!orderNumber) {
|
|
|
uni.hideLoading()
|
|
|
- uni.showToast({ title: '下单失败', icon: 'none' })
|
|
|
+ await uni.showToast({ title: '下单失败', icon: 'none' })
|
|
|
return
|
|
|
}
|
|
|
const payRes = await Apis.charge.wxJsApiPay({
|
|
|
@@ -81,14 +81,38 @@ async function submitPay() {
|
|
|
})
|
|
|
uni.hideLoading()
|
|
|
await useUserStore().getWxCommonPayment(payRes.data)
|
|
|
- useUserStore().paySuccess('charge-buy-a-ticket-list', '/subPack-charge/chargeBuyaTicketList/chargeBuyaTicketList')
|
|
|
+ await useUserStore().paySuccess('charge-buy-a-ticket-list', '/subPack-charge/chargeBuyaTicketList/chargeBuyaTicketList')
|
|
|
}
|
|
|
catch (error) {
|
|
|
uni.hideLoading()
|
|
|
console.error('支付失败:', error)
|
|
|
- useUserStore().payError('charge-buy-a-ticket-list', '/subPack-charge/chargeBuyaTicketList/chargeBuyaTicketList')
|
|
|
+ await useUserStore().payError('charge-buy-a-ticket-list', '/subPack-charge/chargeBuyaTicketList/chargeBuyaTicketList')
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 申请退款
|
|
|
+ */
|
|
|
+function refund() {
|
|
|
+ useGlobalMessage().confirm({
|
|
|
+ title: '提示',
|
|
|
+ msg: '退款按照购券记录进行逐笔退款,可能产生多笔退款到账记录,请注意查收。',
|
|
|
+ success: async () => {
|
|
|
+ const res = await Apis.charge.userCouponRefund({})
|
|
|
+ if (res.code === '00000') {
|
|
|
+ useGlobalMessage().confirm({
|
|
|
+ title: '提示',
|
|
|
+ msg: '申请退款成功,预计3个工作日内分一笔或多笔退还,到期如未到账请联系客服!',
|
|
|
+ success: () => {
|
|
|
+ router.back()
|
|
|
+ },
|
|
|
+ fail: () => {
|
|
|
+ },
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ })
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
|
@@ -121,7 +145,7 @@ async function submitPay() {
|
|
|
充值记录
|
|
|
</view>
|
|
|
<view class="h-40rpx w-2rpx bg-#E6E6E6" />
|
|
|
- <view @click="router.push({ name: 'charge-buy-a-ticket-list' })">
|
|
|
+ <view @click="refund">
|
|
|
退款
|
|
|
</view>
|
|
|
</view>
|