deepsea 1 năm trước cách đây
mục cha
commit
6fc2bb22a9

+ 5 - 28
src/components/SearchBar/index.vue

@@ -36,7 +36,7 @@ export default {
   },
   computed: {
     goBackVisible: () => {
-      return window.location.href.indexOf("ordinaryPage") == -1;
+      return false;
     },
   },
   methods: {
@@ -54,35 +54,11 @@ export default {
       // this.$emit("blur");
     },
     goBack() {
-      if (window.location.href.indexOf("squarePage") !== -1) {
-        this.$router.push({
-          path: '/home',
-          query:{
-            m: '8b934420_ZJUb_b6f9'
-          }
-        })
-      } else if (window.location.href.indexOf("ordinaryPage") !== -1) {
-        this.$store.dispatch('common/setSquareStatus', true)
-      }
+      
     },
     modeChange() {
-      if (window.location.href.indexOf("ordinaryPage") !== -1) {
-        window.location.href = "/home?m=8b934420_ZJUb_b6f9";
-        //this.$router.push({
-        //  path: '/home',
-        //  query:{
-        //    m: '8b934420_ZJUb_b6f9'
-        //  }
-        //})
-      } else {
-        this.$store.dispatch('common/setSquareStatus', false)
-        this.$router.push({
-          path: '/',
-          query:{
-            m: '8b934420_ZJUb_b6f9'
-          }
-        })
-      }
+      this.$store.dispatch('common/setSquareStatus', false)
+      this.$store.dispatch("common/toggle3dStatus");
     },
     goMantis() {
       window.open("http://139.196.158.57:8080/mantis_test/#/dashboard", "_blank");
@@ -103,6 +79,7 @@ export default {
       // })
     },
     goSquare(){
+      this.$store.dispatch("common/set3dStatus", false);
       this.$store.dispatch("common/setSquareStatus", true);
     }
   },

+ 5 - 34
src/components/SearchBarMain/index.vue

@@ -30,7 +30,7 @@ export default {
   },
   computed: {
     goBackVisible: () => {
-      return window.location.href.indexOf("ordinaryPage") == -1;
+      return false
     },
   },
   methods: {
@@ -48,35 +48,11 @@ export default {
       // this.$emit("blur");
     },
     goBack() {
-      if (window.location.href.indexOf("ordinaryPage") == -1) {
-        this.$router.push({
-          path: '/ordinaryPage',
-          query:{
-            m: '8b934420_ZJUb_b6f9'
-          }
-        })
-      } else if (window.location.href.indexOf("ordinaryPage") !== -1) {
-        this.$store.dispatch('common/setSquareStatus', true)
-      }
+      
     },
     modeChange() {
-      if (window.location.href.indexOf("ordinaryPage") !== -1) {
-        window.location.href = "/home?m=8b934420_ZJUb_b6f9";
-        //this.$router.push({
-        //  path: '/home',
-        //  query:{
-        //    m: '8b934420_ZJUb_b6f9'
-        //  }
-        //})
-      } else {
-        this.$store.dispatch('common/setSquareStatus', false)
-        this.$router.push({
-          path: '/',
-          query:{
-            m: '8b934420_ZJUb_b6f9'
-          }
-        })
-      }
+      this.$store.dispatch('common/setSquareStatus', false)
+      this.$store.dispatch("common/toggle3dStatus");
     },
     goMantis() {
       window.open("http://139.196.158.57:8080/mantis_test/#/dashboard", "_blank");
@@ -97,13 +73,8 @@ export default {
       // })
     },
     goSquare(){
+      this.$store.dispatch("common/set3dStatus", false);
       this.$store.dispatch("common/setSquareStatus", true);
-      this.$router.push({
-        path: '/ordinaryPage',
-        query:{
-          m: '8b934420_ZJUb_b6f9'
-        }
-      })
     }
   },
 };

+ 9 - 1
src/components/homeProgress/index.vue

@@ -8,6 +8,7 @@
 </template>
 
 <script>
+import {mapState} from 'vuex'
 export default {
   data() {
     return {
@@ -16,10 +17,17 @@ export default {
       duration: 5000,
     };
   },
+  computed: {
+    ...mapState({
+      isOpen3d: (state) => {
+        return state.common.isOpen3d
+      }
+    })
+  },
   methods: {},
   mounted() {
     console.log("window.location.pathname", window.location.pathname);
-    if (window.location.pathname.indexOf("home") > -1) {
+    if (this.isOpen3d) {
       this.progressVisible = true;
     }
 

+ 6 - 0
src/store/modules/common/actions.js

@@ -11,5 +11,11 @@ export default {
   },
   setSquareStatus({ commit }, data) {
     commit('setSquareStatus', data);
+  },
+  set3dStatus({ commit }, data) {
+    commit('set3dStatus', data);
+  },
+  toggle3dStatus({commit}) {
+    commit('toggle3dStatus')
   }
 };

+ 2 - 1
src/store/modules/common/index.js

@@ -17,7 +17,8 @@ export default {
       marketOptions:[],
       resultOptions: [],
       TBTypeOptions: [],
-      isOpenSquare: false
+      isOpenSquare: false,
+      isOpen3d: true
     };
   },
   mutations,

+ 6 - 0
src/store/modules/common/mutations.js

@@ -80,5 +80,11 @@ export default {
   },
   setSquareStatus(state, data) {
     state.isOpenSquare = data;
+  },
+  set3dStatus(state, data) {
+    state.isOpen3d = data;
+  },
+  toggle3dStatus(state) {
+    state.isOpen3d = !state.isOpen3d;
   }
 };

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 553 - 510
src/views/ordinaryPage/index.vue