Quellcode durchsuchen

Merge branch 'master' into ch-h5

zhangtao vor 4 Tagen
Ursprung
Commit
0594ad0612

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

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

+ 8 - 0
src/pages.json

@@ -273,6 +273,14 @@
             "disableScroll": true
           }
         },
+        {
+          "path": "threePay/index",
+          "name": "smqjh-threePay",
+          "islogin": false,
+          "style": {
+            "navigationBarTitleText": "支付"
+          }
+        },
         {
           "path": "user-center/index",
           "name": "common-user-center",

+ 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')
   }
 }
 

+ 40 - 0
src/subPack-common/threePay/index.vue

@@ -0,0 +1,40 @@
+<script setup lang="ts">
+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)
+  priceInfo.value = res
+}
+async function handleGoPay() {
+  if (priceInfo.value?.payType !== 1) {
+    try {
+      await useUserStore().getWxCommonPayment(priceInfo.value as wxpay)
+    }
+    catch {
+      // console.log(111)
+      useGlobalToast().show({ msg: '支付失败!请重试' })
+    }
+  }
+}
+</script>
+
+<template>
+  <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>
+
+<style lang="scss" scoped></style>

+ 1 - 1
src/subPack-xsb/store-xsb/sys.ts

@@ -94,7 +94,7 @@ export const useSysXsbStore = defineStore('system-xsb', {
         Apis.xsb.nearestShop({ data: { longitude, latitude } }).then((res) => {
           const newShop = this.xsbShopList.find(it => it.shopId === res.data.nearestShopId)
           if (newShop) {
-            this.SelectShopInfo = this.SelectShopInfo || newShop
+            this.SelectShopInfo = this.SelectShopInfo.shopId ? this.SelectShopInfo : newShop
           }
           resolve(res)
         }).catch((err) => { reject(err) })

+ 1 - 0
src/uni-pages.d.ts

@@ -24,6 +24,7 @@ interface NavigateToOptions {
        "/subPack-common/paySuccess/index" |
        "/subPack-common/revalue/index" |
        "/subPack-common/revalueSuccess/index" |
+       "/subPack-common/threePay/index" |
        "/subPack-common/user-center/index" |
        "/subPack-smqjh/bannerDetaile/index" |
        "/subPack-smqjh/order/index" |