Parcourir la source

Merge pull request #250 from John-Hong/John/release-2.17.0/SCRM-4670

fix(SCRM-4670): [DE][C端]临时停车,进入停车首页,输入车牌,查询车费以后。返回到停车首页。再输入另一个车牌。支付详情…
Tron il y a 1 an
Parent
commit
34e4e9f8f3

+ 6 - 2
src/pages/parkingFeeV2/index.vue

@@ -2,7 +2,7 @@
   <div>
 <!--    <div>cachedViews: {{ cachedViews }}-{{ key }}</div>-->
     <keep-alive v-if="isInit" :include="cachedViews" :max="15">
-      <router-view :key="key" />
+      <router-view :key="refreshPageKey" />
     </keep-alive>
   </div>
 </template>
@@ -18,6 +18,9 @@ export default {
     cachedViews() {
       return this.$store.state.cachedViews.cachedViews;
     },
+    refreshPageKey() {
+      return this.$store.state.refreshPageKey;
+    },
     passLogin() {
       return this.$store.state.passLogin;
     },
@@ -58,7 +61,8 @@ export default {
         // parkingFeeMsg home parkingFeeSuccess parkingFeePayment
         // console.log('5858585858', to.name)
         if(fromNoADD.indexOf(name)  < 0 && toNoADD.indexOf(to.name) > -1 ) {
-          this.key += 1
+          // this.key += 1
+          this.$store.commit('SET_REGRESH_PAGE_KEY')
         }
       },
     },

+ 5 - 1
src/pages/parkingFeeV2/mixins/parkingFee.js

@@ -272,6 +272,7 @@ export default {
       this.$store.commit('cachedViews/DEL_CACHED_VIEW', {
         name: 'parkingFeeDetailV2',
       });
+      this.$store.commit('SET_REGRESH_PAGE_KEY')
       this.$nextTick(() => {
         const query = {
             ...this.$route.query,
@@ -293,7 +294,7 @@ export default {
       this.$store.commit('cachedViews/DEL_CACHED_VIEW', {
         name: 'parkingFeeDetailV2',
       });
-
+      this.$store.commit('SET_REGRESH_PAGE_KEY')
       this.$nextTick(() => {
           const query = {
               ...this.$route.query,
@@ -447,6 +448,7 @@ export default {
       //   this.$router.push({ path: 'login' });
       //   return;
       // }
+      this.$store.commit('SET_REGRESH_PAGE_KEY')
       this.$router.push({ path: 'parkingFeeList', query: this.$route.query });
     },
     // 车牌管理
@@ -460,6 +462,7 @@ export default {
       //     value: ''
       //   },
       // });
+      this.$store.commit('SET_REGRESH_PAGE_KEY')
       uni.setStorageSync('loadData', '');
       // if (this.$store.state.isLogin === 'loginDenied') {
       //   this.$router.push({ path: 'login' });
@@ -506,6 +509,7 @@ export default {
       uni.hideLoading()
       uni.removeStorageSync('invoiceindex');
       this.$store.dispatch('clearUnlicensed');
+      this.$store.commit('SET_REGRESH_PAGE_KEY')
       // window?.toWXSendMsg({
       //   type: 'uni_func',
       //   funcName: 'setStorageSync',

+ 4 - 1
src/pages/parkingFeeV2/mixins/parkingFeeDetail.js

@@ -54,7 +54,10 @@ export default {
      *  format: success, fail
      *  fromPage: 'parkingFeeDetail' 
      */
-    if(fromPage && format && unlicensed) {
+    if(fromPage && format && unlicensed && !this.$store.state.pageHistory?.parkingFeeDetailPaystatus) {
+      this.$store.commit('setPageHistory', {
+        parkingFeeDetailPaystatus: 1
+      })
       const query = {
         ...this.$route.query,
       }

+ 5 - 1
src/store/index.js

@@ -59,7 +59,8 @@ const store = new Vuex.Store({
     // 防止用户在无牌车流程中卡死
     endlessLoop: '',
     sourceId: '', // 微信:unionId; 支付宝:userId
-    pageHistory: {}// 记录未登录页面已经跳转过
+    pageHistory: {},// 记录未登录页面已经跳转过
+    refreshPageKey: 1
   },
   mutations: {
     SET_GROUP_ID(state, payload) {
@@ -180,6 +181,9 @@ const store = new Vuex.Store({
         ...state.pageHistory,
         ...payload
       };
+    },
+    SET_REGRESH_PAGE_KEY(state) {
+      state.refreshPageKey = state.refreshPageKey + 1;
     }
   },
   actions: {