Browse Source

Merge pull request #149 from John-Hong/John/release-2.10.0/KIP-10514

fix(SCRM-3985): CRM临停付款,微信商户号内查询到用户有重复付款记录,但是在临停订单明细及前海停车系统只有一条记录
Tron 2 năm trước cách đây
mục cha
commit
9e7e6c0c90
2 tập tin đã thay đổi với 34 bổ sung5 xóa
  1. 6 0
      src/api/request.js
  2. 28 5
      src/pages/parkingFee/mixins/parkingFeeDetail.js

+ 6 - 0
src/api/request.js

@@ -174,6 +174,12 @@ export const createAxiosByinterceptors = (config) => {
       return response.data;
     },
     function (error) {
+      console.log('error', error);
+      // 断网
+      if (error.code === 'ERR_NETWORK') {
+        uni.showToast({ title: '网络连接失败,请重试', duration: 3000, icon: 'fail' });
+        return Promise.reject(error.code);
+      }
       // 对响应错误做点什么
       console.log('error-response:', error.response);
       console.log('error-config:', error.config);

+ 28 - 5
src/pages/parkingFee/mixins/parkingFeeDetail.js

@@ -83,6 +83,9 @@ export default {
       appId: state => state.appId,
       source: state => state.source,
     }),
+    isNoLogin() {
+      return JSON.stringify(this.member) === '{}' || !this.member
+    },
     // 支付按钮状态
     payBtnDisabled() {
       // 当存在待支付金额 或者 用户登陆
@@ -122,11 +125,12 @@ export default {
   methods: {
     // 前往支付
     async toPay() {
+      if (this.btnLoading) return
       this.btnLoading = true
       setTimeout(() => {
         if ( this.btnLoading && !this.isPay ) {
           const toast1 = Toast({
-            message: '操作异常,返回上一页后请重试!',
+            message: '网络连接失败,请重试',
             duration: 3000,
             onClose: () => {
               this.$router.replace({
@@ -137,7 +141,7 @@ export default {
           });
           this.btnLoading = false
         }
-      }, 7000)
+      }, 10000)
       const { parkingRecord, discountInfo = {}, parkingRule = {}} = this.orderDetail;
       const { coupons, points, memberGrade = [], paperCoupons = [], consume = [] } = discountInfo
       const { hourPrice } = parkingRule
@@ -242,8 +246,17 @@ export default {
         }
         this.kerryPayment(res.sessionId);
       } catch (err) {
-        this.btnLoading = false
-        this.isPay = false
+        if(err ==='ERR_NETWORK') {
+          setTimeout(() => {
+            this.$router.replace({
+              // path: 'parkingFeeSuccess?carno=' + this.parkInfo.carno,
+              path: 'home',
+            });  
+          }, 2900)
+        } else {
+          this.btnLoading = false
+          this.isPay = false
+        }
         console.log(err);
       }
     },
@@ -335,7 +348,17 @@ export default {
           }
         })
         .catch((err) => {
-          console.log(1854, err);
+          if(err.code === "ERR_NETWORK") {
+            this.btnLoading = true;
+            uni.showToast({ title: '网络连接失败,请重试', duration: 3000, icon: 'fail' });
+            setTimeout(() => {
+              this.$router.replace({
+                // path: 'parkingFeeSuccess?carno=' + this.parkInfo.carno,
+                path: 'home',
+              });
+            }, 2900)
+            return
+          }
           this.reCreateParkOrder();
         });
     },