4 Commits 50594ffcc7 ... 662aa32826

Author SHA1 Message Date
  zhangtao 662aa32826 Merge branch 'master' of http://git.zonelife.cn:3000/zhangtao/city-gather 2 weeks ago
  zhangtao 90cda9f9af fix(config): 修复配置注释和位置获取逻辑 2 weeks ago
  zhangtao f26b3c0b27 fix(payment): 禁用微信支付功能并显示提示 2 weeks ago
  zhangtao 899337f53b fix(payment): 优化支付流程及状态管理 2 weeks ago

+ 2 - 2
src/config/index.ts

@@ -11,10 +11,10 @@ const mapEnvVersion = {
   // develop: 'http://192.168.0.11:8081', // 王
   // develop: 'http://192.168.0.11:8081', // 王
   // develop: 'http://192.168.1.21:8080', // 田
   // develop: 'http://192.168.1.21:8080', // 田
   // develop: 'http://74949mkfh190.vicp.fun', // 付
   // 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://5ed0f7cc.r9.vip.cpolar.cn',
   // develop: 'https://25740642.r3.cpolar.top',
   // develop: 'https://25740642.r3.cpolar.top',
-  // develop: 'https://smqjh.api.zswlgz.com',
+  develop: 'https://smqjh.api.zswlgz.com',
   /**
   /**
    * 体验版
    * 体验版
    */
    */

+ 3 - 0
src/store/address.ts

@@ -67,6 +67,9 @@ export const useAddressStore = defineStore('address', {
           console.log('位置获取成功', res)
           console.log('位置获取成功', res)
           this.Location.latitude = res.latitude
           this.Location.latitude = res.latitude
           this.Location.longitude = res.longitude
           this.Location.longitude = res.longitude
+          // this.Location.latitude = 26.5919
+          // this.Location.longitude = 106.621
+
           // #ifndef MP-WEIXIN
           // #ifndef MP-WEIXIN
           uni.hideLoading()
           uni.hideLoading()
           // #endif
           // #endif

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

@@ -133,9 +133,12 @@ onHide(() => {
 })
 })
 
 
 // 页面卸载时清理,下次进入重新开始
 // 页面卸载时清理,下次进入重新开始
-onUnload(() => {
+onUnload(async () => {
   stopCountdown()
   stopCountdown()
   endTimestamp = null
   endTimestamp = null
+  await useUserStore().$reset()
+  useSmqjhCartStore().$reset()
+  useAddressStore().$reset()
 })
 })
 </script>
 </script>
 
 

+ 48 - 25
src/subPack-film/submit-order/index.vue

@@ -89,38 +89,61 @@ function next() {
 
 
 async function pay() {
 async function pay() {
   loading.value = true
   loading.value = true
-  console.log(info.value.chooseSeatList)
-  query.value.fastTicket = isWithin45Minutes(new Date(), info.value.showTime)
-  query.value.movieOrderItems = info.value.chooseSeatList.map((item: any) => {
-    if (isWithin45Minutes(new Date(), info.value.showTime)) { // 如果在45分钟内,快速出票
-      return {
-        name: item.seatName,
-        price: item.fastPrice,
+  try {
+    query.value.fastTicket = isWithin45Minutes(new Date(), info.value.showTime)
+    query.value.movieOrderItems = info.value.chooseSeatList.map((item: any) => {
+      if (isWithin45Minutes(new Date(), info.value.showTime)) { // 如果在45分钟内,快速出票
+        return {
+          name: item.seatName,
+          price: item.fastPrice,
+        }
+      }
+      else {
+        return {
+          name: item.seatName,
+          price: item.ticketPrice,
+        }
+      }
+    })
+    const { data: orderNumber } = await Apis.film.addFilmOrder({ data: query.value })
+    const payMent = await useUserStore().getPayMent(orderNumber)
+    if (payMent.payType !== 'point') {
+      try {
+        // // #ifdef MP-WEIXIN
+        // const res = await useUserStore().handleCommonPayMent(orderNumber)
+        // await useUserStore().getWxCommonPayment(res)
+        // await useUserStore().paySuccess('film-order', 'subPack-film/index/index')
+        // // #endif
+        // // #ifdef H5
+        // useUserStore().handleCommonWechatPay(orderNumber)
+        // await handleH5PayResult(orderNumber)
+        // // #endif
+        useGlobalToast().show('暂不支持微信支付')
+      }
+      catch {
+        await useUserStore().payError('film-order', 'subPack-film/index/index')
       }
       }
     }
     }
     else {
     else {
-      return {
-        name: item.seatName,
-        price: item.ticketPrice,
-      }
+      await useUserStore().handleCommonPayMent(orderNumber)
+      await useUserStore().paySuccess('film-order', 'subPack-film/index/index')
     }
     }
-  })
-  const { data: orderNumber } = await Apis.film.addFilmOrder({ data: query.value })
-  const res = await useUserStore().handleCommonPayMent(orderNumber)
-  loading.value = false
-  if (res.payType !== 1) {
-    // await getWxCommonPayment(res)
-    uni.showToast({
-      title: '当前只支持积分支付',
-      icon: 'none',
-      duration: 2000,
-    })
   }
   }
-  else {
-    await useUserStore().paySuccess('film-order', 'subPack-film/index/index')
+  catch (error) {
+    console.error('支付失败:', error)
+  }
+  finally {
+    loading.value = false
   }
   }
 }
 }
-
+// async function handleH5PayResult(orderNumber: string) {
+//   const isPaySuccess = await useUserStore().pollOrderPaySuccess(orderNumber)
+//   if (isPaySuccess) {
+//     await useUserStore().paySuccess('film-order', 'subPack-film/index/index')
+//     return
+//   }
+//   useGlobalToast().show({ msg: '暂未查询到支付成功,请稍后在订单列表查看' })
+// }
 function call() {
 function call() {
   uni.makePhoneCall({
   uni.makePhoneCall({
     phoneNumber: info.value.phone,
     phoneNumber: info.value.phone,

+ 11 - 4
src/subPack-smqjh/components/film-orderList/film-orderList.vue

@@ -10,12 +10,19 @@ const _emit = defineEmits<{
 }>()
 }>()
 
 
 async function handlePay(orderNumber: string) {
 async function handlePay(orderNumber: string) {
-  const res = await useUserStore().handleCommonPayMent(orderNumber)
-  if (res.payType !== 1) {
-    // await useUserStore().getWxCommonPayment(res, 1)
-    useGlobalToast().show('当前只支持积分支付')
+  const payMent = await useUserStore().getPayMent(orderNumber)
+  if (payMent?.payType !== 'point' && payMent) {
+    // // #ifdef MP-WEIXIN
+    // const res = await useUserStore().handleCommonPayMent(orderNumber)
+    // await useUserStore().getWxCommonPayment(res)
+    // _emit('refresh')
+    // // #endif
+    // // #ifdef H5
+    // useUserStore().handleCommonWechatPay(orderNumber)
+    // // #endif
   }
   }
   else {
   else {
+    await useUserStore().handleCommonPayMent(orderNumber)
     _emit('refresh')
     _emit('refresh')
   }
   }
 }
 }

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

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