소스 검색

refactor(payment): 统一处理通用支付逻辑并调整样式细节

- 多个子包和页面中增加调用 useUserStore().handleCommonPayMent 统一处理支付
- 去除多处无用空行和调试注释,保持代码整洁
- 修改微信小程序平台条件编译相关样式,调整图片和容器大小及间距类名
- 修正多处样式中 h-50rpx、w-50rpx 改为 h50rpx、w50rpx,ml-20rpx 改为 ml20rpx,w-[90%] 改为 w100%
zhangtao 1 주 전
부모
커밋
4e31ab1184

+ 4 - 2
src/pages/my/index.vue

@@ -128,16 +128,18 @@ function handleGo(item: { name: string, status: string }) {
               <image :src="`${StaticUrl}/4.png`" class="h-50rpx w-50rpx" />
             </template>
           </wd-cell>
+          <!-- #ifdef MP-WEIXIN -->
           <wd-cell custom-title-class="cell-title" clickable is-link>
             <template #icon>
-              <image :src="`${StaticUrl}/5.png`" class="h-50rpx w-50rpx" />
+              <image :src="`${StaticUrl}/5.png`" class="h50rpx w50rpx" />
             </template>
             <template #title>
-              <view class="ml-20rpx w-[90%]">
+              <view class="ml20rpx w100%">
                 <Zcontact>联系平台客服</Zcontact>
               </view>
             </template>
           </wd-cell>
+          <!-- #endif -->
           <wd-cell title="账户设置" custom-title-class="cell-title" clickable is-link @click="router.push({ name: 'common-user-center' })">
             <template #icon>
               <image :src="`${StaticUrl}/mine-setting-icon.png`" class="h-50rpx w-50rpx" />

+ 1 - 0
src/subPack-attractions/attractionsOrderPay/attractionsOrderPay.vue

@@ -46,6 +46,7 @@ async function submitPay() {
     }
   }
   else {
+    await useUserStore().handleCommonPayMent(orderNo.value)
     router.replace({ name: 'attractions-order-detail', params: { orderNo: String(payPreviewInfo.value?.orderNumber), ispay: 'true' } })
   }
 }

+ 1 - 1
src/subPack-common/threePay/index.vue

@@ -58,7 +58,7 @@ async function handlePay() {
   else {
     const res = await useUserStore().handleCommonPayMent(orderNumber.value)
     priceInfo.value = res
-    // console.log(priceInfo.value, '=============priceInfo.value============')
+    console.log(priceInfo.value, '=============priceInfo.value============')
   }
 }
 async function handleGoPay() {

+ 1 - 0
src/subPack-djk/confirmOrder/index.vue

@@ -54,6 +54,7 @@ async function handlePay() {
       }
     }
     else {
+      await useUserStore().handleCommonPayMent(data.data)
       await useUserStore().paySuccess('djk-homeTabbar', 'subPack-djk/commonTab/index')
     }
   }

+ 2 - 1
src/subPack-djk/orderDetaile/index.vue

@@ -44,6 +44,7 @@ async function handlePay() {
     // #endif
   }
   else {
+    await useUserStore().handleCommonPayMent(String(unref(orderInfo)?.orderNumber))
     getDetail(String(unref(orderInfo)?.orderNumber))
   }
   refreshOrderList.value = true
@@ -90,7 +91,7 @@ function handlePhone() {
     v-if="orderInfo" class="page-xsb"
   >
     <wd-navbar
-      title="订单详情" :bordered="false" :z-index="99" safe-area-inset-top left-arrow placeholder fixed
+      title="订单详情" :bordered="false" :z-index="99" safe-area-inset-top placeholder left-arrow fixed
       @click-left="router.back()"
     />
     <view class="relative z-90 box-border bg-[#f6f6f6] px-24rpx">

+ 1 - 0
src/subPack-smqjh/components/djk-order/index.vue

@@ -27,6 +27,7 @@ async function handlePay(orderNumber: string) {
     // #endif
   }
   else {
+    await useUserStore().handleCommonPayMent(orderNumber)
     _emit('refresh')
   }
 }

+ 2 - 1
src/subPack-smqjh/components/xsb-orderList/xsb-orderList.vue

@@ -24,7 +24,7 @@ async function handlePay(orderNumber: string) {
   const payMent = await useUserStore().getPayMent(orderNumber)
   if (payMent?.payType !== 'point' && payMent) {
     // #ifdef MP-WEIXIN
-    const res = await useUserStore().handleCommonPayMent?.(orderNumber)
+    const res = await useUserStore().handleCommonPayMent(orderNumber)
 
     await useUserStore().getWxCommonPayment(res)
     _emit('refresh')
@@ -34,6 +34,7 @@ async function handlePay(orderNumber: string) {
     // #endif
   }
   else {
+    await useUserStore().handleCommonPayMent(orderNumber)
     _emit('refresh')
   }
 }

+ 3 - 1
src/subPack-xsb/commonTab/components/my.vue

@@ -95,16 +95,18 @@ function handleGo(item: { name: string, status: string }) {
               <image :src="`${StaticUrl}/4.png`" class="h50rpx w50rpx" />
             </template>
           </wd-cell>
+          <!-- #ifdef MP-WEIXIN -->
           <wd-cell custom-title-class="cell-title" clickable is-link>
             <template #icon>
               <image :src="`${StaticUrl}/5.png`" class="h50rpx w50rpx" />
             </template>
             <template #title>
-              <view class="ml20rpx w90%">
+              <view class="ml20rpx w100%">
                 <Zcontact>联系平台客服</Zcontact>
               </view>
             </template>
           </wd-cell>
+          <!-- #endif -->
         </wd-cell-group>
       </wd-card>
     </view>

+ 1 - 1
src/subPack-xsb/confirmOrder/index.vue

@@ -276,7 +276,6 @@ async function handlePay() {
         : undefined,
     )
     const payMent = await useUserStore().getPayMent(orderNumber)
-
     if (payMent.payType !== 'point') {
       try {
         // #ifdef H5
@@ -296,6 +295,7 @@ async function handlePay() {
       }
     }
     else {
+      await useUserStore().handleCommonPayMent(orderNumber)
       await useUserStore().paySuccess('xsb-order', 'subPack-xsb/commonTab/index')
     }
   }

+ 1 - 0
src/subPack-xsb/orderDetaile/index.vue

@@ -90,6 +90,7 @@ async function handlePay() {
     // #endif
   }
   else {
+    await useUserStore().handleCommonPayMent(String(unref(orderInfo)?.orderNumber))
     getDetail(String(unref(orderInfo)?.orderNumber))
   }
 }