yangc 8 жил өмнө
parent
commit
005fac4ebd

+ 5 - 1
components/mobile/MobileHeader.vue

@@ -57,7 +57,7 @@
     <div class="mobile-header" v-if="showHeader && !showMainSearch">
       <!--<a class="iconfont icon-fanhui" @click="goLastPage">返回</a>-->
       <p>{{title}}
-        <span v-show="showSearch" @click="showMainSearch = true"><i class="icon-sousuo iconfont"></i>搜索</span>
+        <span v-show="showSearch" @click="goMainSearch"><i class="icon-sousuo iconfont"></i>搜索</span>
       </p>
     </div>
     <main-search v-if="showMainSearch" @cancelSearchAction="onCancelSearch"></main-search>
@@ -236,6 +236,10 @@
       },
       stopPropagation: function (event) {
         event.stopPropagation()
+      },
+      goMainSearch: function () {
+        this.showMainSearch = true
+        this.$store.dispatch('searchData/getSearchHistory')
       }
     }
   }

+ 3 - 2
components/mobile/brand/BrandCenter.vue

@@ -13,7 +13,7 @@
       <div class="mobile-brand-list">
         <div v-for="(brands, initial) in brandList">
           <div class="brand-initial">
-            <p v-text="initial"></p>
+            <p v-text="initial" :style="initial === '0~9' ? 'font-size: .28rem': 'font-size: .32rem'"></p>
             <span>
               {{initial}}开头共<span>{{brands.length || 0}}</span>个品牌
             </span>
@@ -152,6 +152,7 @@
           p {
             width: .64rem;
             height: .43rem;
+            line-height: .43rem;
             margin: 0;
             background: #418bf6;
             color: #fff;
@@ -180,7 +181,7 @@
             color: #333;
             border-radius: .05rem;
             background: #fff;
-            margin: .19rem .42rem .32rem 0;
+            margin: .18rem .42rem .12rem 0;
             &:nth-child(3n) {
               margin-right: 0;
             }

+ 1 - 0
components/mobile/brand/ComponentDetail.vue

@@ -413,6 +413,7 @@
                   padding: 0;
                   width: 1.2rem;
                   overflow: hidden;
+                  margin-left: .16rem;
                 }
               }
               div {

+ 12 - 2
components/mobile/search/MainSearch.vue

@@ -6,7 +6,7 @@
       <a @click="cancelSearch">取消</a>
     </div>
     <ul class="associate-list" v-show="associate.show">
-      <li @click="onAssociateClick(similar)" v-for="similar in similarKeywords">
+      <li @click="onAssociateClick(similar)" v-for="similar in similarKeywords.all">
         <i class="icon-sousuo iconfont"></i>
         <span>{{similar}}</span>
       </li>
@@ -14,7 +14,7 @@
     </ul>
     <div class="hot-history" v-show="!associate.show">
       <div class="search-history" v-if="searchHistory && searchHistory.length > 0">
-        <p>历史搜索</p>
+        <p>历史搜索<i class="iconfont icon-lajitong" @click="deleteHistory"></i></p>
         <ul>
           <li v-for="item in searchHistory" @click="onSearch(item.keyword)">
             <a>{{item.keyword}}</a>
@@ -98,6 +98,11 @@
       },
       cancelFocus: function () {
         document.getElementById('search-box').blur()
+      },
+      deleteHistory () {
+        this.$http.delete('/search/searchHistory').then(response => {
+          this.$store.dispatch('searchData/getSearchHistory')
+        })
       }
     },
     created () {
@@ -213,6 +218,11 @@
         >p {
           font-size: .3rem;
           color: #333;
+          i {
+            font-size: .3rem;
+            float: right;
+            margin-right: 0.4rem;
+          }
         }
         ul {
           text-align: left;

+ 1 - 1
components/mobile/store/StoreDetail.vue

@@ -218,7 +218,7 @@
         background: #fff;
         position: relative;
         img {
-          max-height: 2.19rem;
+          max-height: 2.1rem;
           max-width: 3.71rem;
         }
         >i {

+ 2 - 2
pages/mobile/search/_keycode.vue

@@ -242,7 +242,7 @@
         flex-wrap: wrap;
         display:inline-flex;
         overflow: hidden;
-        margin:0 .2rem;
+        margin: 0 .2rem;
         text-align: center;
         >div {
           display: inline-block;
@@ -254,7 +254,7 @@
             width: 1.57rem;
             height: .77rem;
             display: inline-block;
-            margin-top: .2rem;
+            margin: .1rem 0;
             border: .02rem solid #53a0f7;
             border-radius: .1rem;
             line-height: .77rem;

+ 1 - 1
store/searchData.js

@@ -106,7 +106,7 @@ export const actions = {
         commit('searchCrname/GET_CRNAME_FAILURE', err)
       })
   },
-  // 获取搜索币种
+  // 获取搜索历史
   getSearchHistory ({ commit }, params = {}) {
     commit('searchHistory/REQUEST_SEARCH_HISTORY', params)
     return axios.get(`/search/searchHistory`, {params})