فهرست منبع

Merge pull request #2 from John-Hong/John/release-1.30.0/fix-6833

fix(KIP-6833): 临时停车,多次点击支付按钮,会使页面没有反应
Joel-BH-Zhang 2 سال پیش
والد
کامیت
4a38afe0dc
4فایلهای تغییر یافته به همراه26 افزوده شده و 21 حذف شده
  1. 1 1
      package.json
  2. 8 7
      src/components/Login/Login.vue
  3. 1 1
      src/manifest.json
  4. 16 12
      src/pages/parkingFee/parkingFeeDetail.vue

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "temporay-parking",
-  "version": "1.0.0",
+  "version": "1.30.0",
   "private": true,
   "scripts": {
     "serve": "cross-env NODE_ENV=dev vue-cli-service serve",

+ 8 - 7
src/components/Login/Login.vue

@@ -1,6 +1,8 @@
-<temaplte>
-
-</temaplte>
+<template>
+  <div style="color: transparent">
+    login
+  </div>
+</template>
 <script>
 // import { isMini } from '@/utils/common';
 
@@ -310,7 +312,7 @@ export default {
       //   return `${window?.injectConfig?.api}/xcrm-api`;
       // }
       const href = `${window.location.href}`;
-      if (/dev-/.test(href)) {
+      if (/dev-|8080/.test(href)) {
         console.log('333', '在这里定位问题 dev');
         return 'https://qa-crm-kpl.kerryprops.com.cn/xcrm-api';
       }
@@ -319,9 +321,8 @@ export default {
         return 'https://qa-crm-kpl.kerryprops.com.cn/xcrm-api';
       }
       console.log('333', '在这里定位问题  prod');
-      // TODO 在 sl 环境验证生产数据时,先使用qa环境的websocket通信
-      return 'https://qa-crm-kpl.kerryprops.com.cn/xcrm-api';
-      // return `https://crm.kerryplus.com/xcrm-api`;
+      // return 'https://qa-crm-kpl.kerryprops.com.cn/xcrm-api';
+      return `https://crm.kerryplus.com/xcrm-api`;
     },
     wss(callback) {
       try {

+ 1 - 1
src/manifest.json

@@ -2,7 +2,7 @@
     "name" : "嘉里集团",
     "appid" : "__UNI__14A40A0",
     "description" : "",
-    "versionName" : "1.0.0",
+    "versionName" : "1.30.0",
     "versionCode" : "100",
     "transformPx" : false,
     "app-plus" : {

+ 16 - 12
src/pages/parkingFee/parkingFeeDetail.vue

@@ -190,10 +190,11 @@
         </div>
       </div>
       <div
-        :class="{
-          flewx_index3: true,
-          'btn-disabled': payBtnDisabled,
-        }"
+        :class="[
+          'flewx_index3',
+          payBtnDisabled && 'btn-disabled',
+          btnLoading && 'btn-disabled',
+        ]"
         @click="toPay"
       >
         支付
@@ -318,6 +319,8 @@ export default {
       integralMaxMoney: 0, // 深圳前海停车积分上限
       // 是否重载
       // isReload: '1',
+      Toastloading: null,
+      btnLoading: false,
     };
   },
   beforeRouteLeave(to, from, next) {
@@ -325,7 +328,6 @@ export default {
     if (/index|home/.test(to.name)) {
       // 不在缓存列表中,从cachedViews缓存列表中移除
       this.$store.commit('cachedViews/DEL_CACHED_VIEW', from);
-      
     }
     next();
   },
@@ -1530,9 +1532,12 @@ export default {
       // ) {
       //   return;
       // }
-      uni.showLoading({
-        title: '加载中',
+      this.Toastloading = Toast.loading({
+        message: '加载中',
+        duration: 0,
+        forbidClick: true,
       });
+      this.btnLoading = true;
       let bonus = this.duration * this.integral;
       // 深圳特殊处理(单位:金额)
       if (this.parkMallCode === 5) {
@@ -1788,12 +1793,14 @@ export default {
                 },
               });
               window.subscribe('wxPayOver', (options) => {
+                this.Toastloading.clear();
                 // console.log('微信支付结束之后的返回参数', options);
                 // TODO: 在 qa 新发版前,只提示支付成功的信息
                 if (options?.wxPayOver === 'fail') {
                   // console.log('支付失败');
                   this.failedParkOrder();
                 } else {
+                  this.btnLoading = false;
                   this.$router.replace({
                     path: '/parkingFeeSuccess?carno=' + this.parkInfo.carno,
                   });
@@ -1849,7 +1856,7 @@ export default {
         message: '支付失败',
         confirmButtonColor: '#333',
       }).then(() => {
-        // on confirm
+        this.btnLoading = false;
         this.createParkOrder();
       });
       // uni.showModal({
@@ -1864,12 +1871,11 @@ export default {
 
     // 支付失败后返还优惠券
     failedParkOrder() {
+      this.Toastloading.clear();
       const param = {
         orderno: this.parkInfo.orderno,
       };
-      // console.log(1943, '支付失败后返还优惠券');
       this.$md(param);
-      // console.log(1946, this.$baseURL + 'api/1.0/park/failedParkOrder');
       uni
         .request({
           url: this.$baseURL + 'api/1.0/park/failedParkOrder',
@@ -1878,11 +1884,9 @@ export default {
           header: JSON.parse(uni.getStorageSync('handleUser')),
         })
         .then((res) => {
-          // console.log(1954, 'reCreateParkOrder then');
           this.reCreateParkOrder();
         })
         .catch((err) => {
-          // console.log(1958, 'reCreateParkOrder catch');
           this.reCreateParkOrder();
         });
     },