Просмотр исходного кода

修改首页会请求两次的问题

wangn 5 лет назад
Родитель
Сommit
d586011aab

+ 1 - 1
hdApp/src/admin/home/result.vue

@@ -34,7 +34,7 @@ export default {
       uni.removeStorageSync('HOME_STATUS_STROAGE_SHOW')
       this.$util.pageTo({
         url: '/admin/home/workbench',
-        type: 4
+        type: 3
       })
       this.$store.commit("setLoginInfo", {});
     },

+ 18 - 7
hdApp/src/mixins/globalMixins.js

@@ -35,13 +35,10 @@ export default {
 			uni.setStorageSync('account', option.account)
 		}
     uni.setStorageSync('currentQuery', JSON.stringify(option))
-    console.log(uni.getStorageSync('HOME_STATUS_STROAGE_SHOW'),'this.shopAdminId', this.getLoginInfo, this.getLoginInfo.openShop)
-	},
-	onShow(){
-		if (isLogin()&&!this.$util.isEmpty(this.getLoginInfo)) {
-			if (this.init) {
-				this.init()
-      }
+    console.log(uni.getStorageSync('HOME_STATUS_STROAGE_SHOW'), 'this.shopAdminId', this.getLoginInfo, this.getLoginInfo.openShop)
+    if (uni.getStorageSync('HOME_STATUS_STROAGE_SHOW') == 0) {
+      this.AUTHORITY_SHOW = true;
+      uni.hideTabBar()
     }
     if (this.$util.isEmpty(this.getLoginInfo)) {
       wxLoginFn(true).then(res => {
@@ -67,6 +64,7 @@ export default {
             this.AUTHORITY_SHOW = true
             uni.hideTabBar()
             uni.removeStorageSync('HOME_STATUS_STROAGE_SHOW')
+            uni.removeStorageSync('HOME_REFRESH')
             uni.setStorageSync('OPEN_SHOP_ID', res.data.admin.openShop)
           } else {
             this.AUTHORITY_SHOW = false;
@@ -80,6 +78,19 @@ export default {
           this.init()
         }
       })
+    }
+	},
+	onShow(){
+		if (isLogin()&&!this.$util.isEmpty(this.getLoginInfo)) {
+			if (this.init) {
+				this.init()
+      }
+    }
+    if (uni.getStorageSync('HOME_REFRESH') == '1') {
+      this.MODEL_TITLE = '已申请'
+      this.MODEL_BTN_TEXT = '查看申请进度'
+      this.AUTHORITY_SHOW = true
+      uni.hideTabBar()
     }
 	},
 	methods: {

+ 16 - 15
hdApp/src/pagesClient/official/result.vue

@@ -1,14 +1,14 @@
 <template>
 	<appResult title="已提交">
-        <view class="dec">
-            审核时间为一个工作日
-        </view>
+      <view class="dec">
+          审核时间为一个工作日
+      </view>
 		<button 
-            class="admin-button-com blue big" 
-            @click="close"
-            >
-            返回
-            </button>
+      class="admin-button-com blue big" 
+      @click="close"
+      >
+      返回
+    </button>
 	</appResult>
 </template>
 
@@ -19,14 +19,15 @@ export default {
 	components:{
 		appResult
     },
+    onUnload() {
+      console.log(12312321)
+      uni.setStorageSync('HOME_REFRESH', '1')
+    },
     methods:{
-        handleContact(e){
-            console.log(e)
-        },
-        close() {
-          this.pageTo({url: '/admin/home/workbench', type: 4})
-          this.$store.commit("setLoginInfo", {});
-        }
+      close() {
+        this.pageTo({url: '/admin/home/workbench', type: 4})
+        uni.setStorageSync('HOME_REFRESH', '1')
+      }
     }
 };
 </script>