Selaa lähdekoodia

在搜索栏添加九宫格跳转

hao lei 1 vuosi sitten
vanhempi
commit
a0846b3f37
3 muutettua tiedostoa jossa 24 lisäystä ja 8 poistoa
  1. BIN
      src/assets/square.png
  2. 18 6
      src/components/SearchBar/index.vue
  3. 6 2
      src/views/ordinaryPage/index.vue

BIN
src/assets/square.png


+ 18 - 6
src/components/SearchBar/index.vue

@@ -4,6 +4,7 @@
       <div class="iconBtn backBtn" @click="goBack" v-if="goBackVisible"></div>
       <div class="iconBtn mapBtn" @click="modeChange"></div>
       <div class="iconBtn homeBtn" @click="goHome"></div>
+      <div class="iconBtn squareBtn" @click="goSquare"></div>
     </div>
     <input
       placeholder="Search Bench"
@@ -23,6 +24,7 @@
 </template>
 
 <script>
+import bus from "../../service/bus";
 export default {
   props: {},
   data() {
@@ -89,13 +91,17 @@ export default {
       window.open("http://139.196.158.57/#/Overview", "_blank");
     },
     goHome() {
-      this.$router.push({
-        path: '/',
-        query:{
-          m: '8b934420_ZJUb_b6f9'
-        }
-      })
+      bus.emit("goHome");
+      // this.$router.push({
+      //   path: '/',
+      //   query:{
+      //     m: '8b934420_ZJUb_b6f9'
+      //   }
+      // })
     },
+    goSquare(){
+      this.$store.dispatch("common/setSquareStatus", true);
+    }
   },
 };
 </script>
@@ -181,6 +187,12 @@ export default {
   background-image: url(../../assets/home.png);
 }
 
+.squareBtn{
+  height: 23px;
+  width: 23px;
+  background-image: url(../../assets/square.png);
+}
+
 .jumpBtn {
   margin: 0 6px;
   width: 30px;

+ 6 - 2
src/views/ordinaryPage/index.vue

@@ -68,11 +68,11 @@
               :offline="offlineCount"
             ></status-bar>
           </div>
-          <div class="bench-list">
+          <!-- <div class="bench-list">
             <div class="bench-list-buttons" @click="clickBenchList">
               My Bench List
             </div>
-          </div>
+          </div> -->
         </div>
         <div class="ordinary-map-hidden">
           <div class="ordinary-map-blocker" id="ordinary-map-blocker">
@@ -973,6 +973,10 @@ export default {
     bus.on("switchScreen", (param) => {
       this.currentScreen = param.currentScreen;
     });
+    bus.on("goHome", ()=>{
+      this.isConnected = false;
+      this.$store.dispatch("common/setSquareStatus", false);
+    })
   },
   methods: {
     turnToNextManualCase() {},