yangc 8 years ago
parent
commit
a42a13be59
2 changed files with 5 additions and 6 deletions
  1. 4 5
      components/mobile/search/MainSearch.vue
  2. 1 1
      layouts/main.vue

+ 4 - 5
components/mobile/search/MainSearch.vue

@@ -10,7 +10,7 @@
         <i class="icon-sousuo iconfont"></i>
         <span>{{similar}}</span>
       </li>
-      <li>查找“{{keyword}}”</li>
+      <li @click="onAssociateClick(keyword)">查找“{{keyword}}”</li>
     </ul>
     <div class="hot-history" v-show="!associate.show">
       <div class="search-history">
@@ -56,11 +56,11 @@
       }
     },
 //    filters: {
-//      similarFilter: function (key) {
-//        let keyword = this.keyword
+//      similarFilter: function ([key, keyword]) {
+//        console.log(keyword)
 //        let index = key.indexOf(keyword)
 //        if (index !== -1) {
-//          key = key.substring(0, index) + '<strong>' + key.sub(index, keyword.length) + '</strong>' + key.substring(index + keyword.length, key.length)
+//          key = key.substring(0, index) + '<strong>' + key.substr(index, keyword.length) + '</strong>' + key.substring(index + keyword.length, key.length)
 //        }
 //        return key
 //      }
@@ -71,7 +71,6 @@
           this.keyword = key
         }
         if (this.keyword) {
-          this.associate.show = false
           this.$router.push({path: '/mobile/search?w=' + encodeURIComponent(this.keyword)})
         }
       },

+ 1 - 1
layouts/main.vue

@@ -7,7 +7,7 @@
     <nuxt/>
     <footer-view v-if="!isMobile"></footer-view>
     <right-bar v-if="!isMobile"></right-bar>
-    <mobile-footer v-else></mobile-footer>
+    <mobile-footer v-if="isMobile"></mobile-footer>
   </div>
 </template>
 <script>