Browse Source

未开放的专题不能点进去

gcz 2 years ago
parent
commit
96d3df16cd
1 changed files with 8 additions and 7 deletions
  1. 8 7
      src/views/index.vue

+ 8 - 7
src/views/index.vue

@@ -331,6 +331,13 @@ export default {
       console.log('addrChange', value);
     },
     navClick(index) {
+      let pageName = this.navList[index - 1].en;
+      if (
+        pageName == 'sink' ||pageName == 'circulation'
+      ) {
+        Message('暂未开放!');
+        return;
+      }
       this.$store.commit('changePage', this.navList[index - 1].en);
       console.log('this.navList[index-1].en', this.navList[index - 1].en);
       this.page = index;
@@ -345,13 +352,7 @@ export default {
         this.showbase = false;
         this.showxiaoban = true;
       }
-      if (
-        this.$store.state.addr.page == 'sink' ||
-        this.$store.state.addr.page == 'circulation'
-      ) {
-        Message('暂未开放!');
-        return;
-      }
+      
 
       // 切换专题时,重置区域
       // this.$store.dispatch('searchArea', {