Эх сурвалжийг харах

```
feat(config): 更新开发环境配置

- 注释掉田的开发服务器地址
- 启用付的开发服务器地址

fix(chargeVoucher): 优化支付流程异步处理

- 将showLoading和showToast改为await方式调用
- 支付成功和失败回调改为await方式调用
- 添加退款功能实现

refactor(chargeVoucher): 调整退款按钮功能

- 将充值记录跳转改为退款功能
- 实现完整的退款申请流程
```

zouzexu 5 цаг өмнө
parent
commit
022050e25a

+ 2 - 2
src/config/index.ts

@@ -9,9 +9,9 @@ const mapEnvVersion = {
   // develop: 'http://192.168.0.19:8080', // 邓
   // develop: 'http://192.168.0.217:8080', // 黄
   // develop: 'http://192.168.0.11:8080', // 王
-  develop: 'http://192.168.1.89:8080', // 田
+  // develop: 'http://192.168.1.89:8080', // 田
   // develop: 'http://74949mkfh190.vicp.fun', // 付
-  // develop: 'http://47.109.84.152:8081',
+  develop: 'http://47.109.84.152:8081',
   // develop: 'https://5ed0f7cc.r9.vip.cpolar.cn',
   // develop: 'https://smqjh.api.zswlgz.com',
   /**

+ 29 - 5
src/subPack-charge/chargeVoucher/chargeVoucher.vue

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

+ 0 - 1
src/subPack-charge/index/index.vue

@@ -103,7 +103,6 @@ function handleFilterClick(filterKey: number) {
 /**
  * 申请退款
  */
-
 function refund() {
   useGlobalMessage().confirm({
     title: '提示',