Browse Source

解决页面请求两次接口的问题

wangn 5 years ago
parent
commit
b73b793490
2 changed files with 14 additions and 3 deletions
  1. 7 0
      ghsApp/src/mixins/globalMixins.js
  2. 7 3
      ghsApp/src/pagesClient/official/result.vue

+ 7 - 0
ghsApp/src/mixins/globalMixins.js

@@ -59,6 +59,7 @@ export default {
             this.AUTHORITY_SHOW = true
             this.AUTHORITY_SHOW = true
             uni.hideTabBar()
             uni.hideTabBar()
             uni.removeStorageSync('HOME_STATUS_STROAGE_SHOW')
             uni.removeStorageSync('HOME_STATUS_STROAGE_SHOW')
+            uni.removeStorageSync('HOME_REFRESH')
             uni.setStorageSync('OPEN_SHOP_ID', res.data.admin.openShop)
             uni.setStorageSync('OPEN_SHOP_ID', res.data.admin.openShop)
           } else {
           } else {
             uni.showTabBar()
             uni.showTabBar()
@@ -78,6 +79,12 @@ export default {
 			if (this.init) {
 			if (this.init) {
 				this.init()
 				this.init()
 			}
 			}
+    }
+    if (uni.getStorageSync('HOME_REFRESH') == '1') {
+      this.MODEL_TITLE = '已申请'
+      this.MODEL_BTN_TEXT = '查看申请进度'
+      this.AUTHORITY_SHOW = true
+      uni.hideTabBar()
     }
     }
 	},
 	},
 	methods: {
 	methods: {

+ 7 - 3
ghsApp/src/pagesClient/official/result.vue

@@ -19,15 +19,19 @@ export default {
 	components:{
 	components:{
 		appResult
 		appResult
     },
     },
+    onUnload() {
+      uni.setStorageSync('HOME_REFRESH', '1')
+      uni.removeStorageSync('HOME_STATUS_STROAGE_SHOW')
+    },
     methods:{
     methods:{
         handleContact(e){
         handleContact(e){
             console.log(e)
             console.log(e)
         },
         },
         close() {
         close() {
           // this.pageTo({url: '/admin/home/workbench', type:})
           // this.pageTo({url: '/admin/home/workbench', type:})
-          uni.reLaunch({url: '/admin/home/workbench'})
-          this.$store.commit("setLoginInfo", {});
-          uni.setStorageSync('OPEN_SHOP_ID', '2')
+          this.pageTo({url: '/admin/home/workbench', type: 4})
+          uni.setStorageSync('HOME_REFRESH', '1')
+          uni.removeStorageSync('HOME_STATUS_STROAGE_SHOW')
         }
         }
     }
     }
 };
 };