Просмотр исходного кода

feat(payment): 更新支付页面标题及完善支付流程

- 将支付页面导航栏标题从“下单”修改为“支付”
- 在全局类型定义中新增price字段以支持显示价格
- 调整配置文件,启用正式接口地址
- 修正充值凭证支付成功和失败的路由路径
- 重构threePay支付组件,拆分支付确认逻辑
- 支付页面显示价格信息并增加确认支付按钮
- 支付失败时展示全局toast提示用户重新尝试
zhangtao 3 дней назад
Родитель
Сommit
6f9c8fef94

+ 1 - 0
src/api/globals.d.ts

@@ -1480,4 +1480,5 @@ export interface wxpay {
    * 支付方式 0-微信 1-积分 2-混合
    */
   payType: number
+  price: number
 }

+ 2 - 2
src/config/index.ts

@@ -11,9 +11,9 @@ const mapEnvVersion = {
   // develop: 'http://192.168.0.11:8080', // 王
   // develop: 'http://192.168.1.21: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',
+  develop: 'https://smqjh.api.zswlgz.com',
   /**
    * 体验版
    */

+ 1 - 1
src/pages.json

@@ -278,7 +278,7 @@
           "name": "smqjh-threePay",
           "islogin": false,
           "style": {
-            "navigationBarTitleText": "下单"
+            "navigationBarTitleText": "支付"
           }
         },
         {

+ 2 - 2
src/subPack-charge/chargeVoucher/chargeVoucher.vue

@@ -81,12 +81,12 @@ async function submitPay() {
     })
     uni.hideLoading()
     await useUserStore().getWxCommonPayment(payRes.data)
-    await 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)
-    await useUserStore().payError('charge-buy-a-ticket-list', '/subPack-charge/chargeBuyaTicketList/chargeBuyaTicketList')
+    await useUserStore().payError('charge-buy-a-ticket-list', 'subPack-charge/chargeBuyaTicketList/chargeBuyaTicketList')
   }
 }
 

+ 18 - 7
src/subPack-common/threePay/index.vue

@@ -1,28 +1,39 @@
 <script setup lang="ts">
-definePage({ name: 'smqjh-threePay', islogin: false, style: { navigationBarTitleText: '下单' } })
+import type { wxpay } from '@/api/globals'
+
+definePage({ name: 'smqjh-threePay', islogin: false, style: { navigationBarTitleText: '支付' } })
 
 const orderNumber = ref()
 onLoad((options: any) => {
   orderNumber.value = options.orderNumber
   handlePay()
 })
+const priceInfo = ref<wxpay>()
 async function handlePay() {
   const res = await useUserStore().handleCommonPayMent(orderNumber.value)
-  if (res.payType !== 1) {
+  priceInfo.value = res
+}
+async function handleGoPay() {
+  if (priceInfo.value?.payType !== 1) {
     try {
-      await useUserStore().getWxCommonPayment(res)
-      await useUserStore().paySuccess('xsb-order', 'subPack-xsb/commonTab/index')
+      await useUserStore().getWxCommonPayment(priceInfo.value as wxpay)
     }
     catch {
-      await useUserStore().payError('xsb-order', 'subPack-xsb/commonTab/index')
+      // console.log(111)
+      useGlobalToast().show({ msg: '支付失败!请重试' })
     }
   }
 }
 </script>
 
 <template>
-  <view class="">
-    view
+  <view class="px20rpx pt20rpx">
+    <view class="mb20rpx text-center text-48rpx text-#FF4A39">
+      ¥{{ priceInfo?.price }}
+    </view>
+    <wd-button block @click="handleGoPay">
+      确认支付
+    </wd-button>
   </view>
 </template>