Browse Source

搜索结果提示修改

yangc 8 years ago
parent
commit
f5644c02f7

+ 13 - 32
components/default/Header.vue

@@ -33,16 +33,21 @@
                 </li>
               </ul>
             </div>
-            <nuxt-link class="item size-l" :to="'/'" v-show="showHome">商城首页</nuxt-link>
-            <a class="item size-l" href="/user#/index">买家中心</a>
-            <a class="item size-l" @click="toVendor">卖家中心</a>
+            <nuxt-link class="item" :to="'/'">商城首页</nuxt-link>
+            <!--<nuxt-link class="item" to="/user">买家中心</nuxt-link>
+            <nuxt-link class="item" to="/vendor">卖家中心</nuxt-link>-->
+            <!--<a class="item" :href="url + '/user'">买家中心</a>
+            <a class="item" :href="url + '/vendor'">卖家中心</a>-->
+            <a class="item" href="/user#/index">买家中心</a>
+            <a class="item" @click="toVendor">卖家中心</a>
           </template>
           <template v-else>
-            <a class="item size-s" @click="onLoginClick()">登录</a>
-            <a class="item size-s" @click="onRegisterClick">注册</a>
-            <nuxt-link class="item size-l" :to="'/'" v-show="showHome">商城首页</nuxt-link>
+            <a class="item" @click="onLoginClick()">登录</a>
+            <a class="item" @click="onRegisterClick">注册</a>
+            <nuxt-link class="item" :to="'/'">商城首页</nuxt-link>
           </template>
-          <nuxt-link class="item size-l" to="/help/home">帮助中心</nuxt-link>
+          <nuxt-link class="item" to="/help/home">帮助中心</nuxt-link>
+          <!--<a class="item" href="/help#/home">帮助中心</a>-->
         </div>
       </div>
     </nav>
@@ -70,9 +75,6 @@
       },
       url () {
         return this.$store.state.option.url
-      },
-      showHome () {
-        return this.$route.path && this.$route.path !== '/' && this.$route.path !== ''
       }
     },
     methods: {
@@ -165,10 +167,6 @@
   .header .navbar .navbar-container .navbar-right .dropdown .dropdown-menu .menu-item{
     height: 30px;
   }
-  .header .navbar .navbar-container .navbar-right >a:hover {
-    /*font-weight: bold;*/
-    font-size: 13px;
-  }
   .dropdown-menu>li>a{
     padding: 0;
     line-height: 30px;
@@ -207,7 +205,6 @@
 
         .item-wrap {
           display: inline-block;
-          padding: 0 1em;
         }
 
         .item {
@@ -215,7 +212,6 @@
           display: inline-block;
           height: $nav-height;
           line-height: $nav-height;
-          vertical-align: middle;
         }
 
         a {
@@ -225,20 +221,12 @@
         .navbar-header {
           float: left;
 
-          &:hover {
-            .navbar-slogan {
-              font-size: 13px;
-            }
-          }
-
           .navbar-logo {
             margin-bottom: 2px;
-            vertical-align: middle;
           }
 
           .navbar-slogan {
             margin-left: $sm-pad;
-            vertical-align: middle;
           }
 
         }
@@ -246,15 +234,8 @@
         .navbar-right {
           float: right;
 
-          .size-l {
-            width: 72px;
-          }
-          .size-s {
-            width: 48px;
-          }
-
           .item {
-            text-align: center;
+            padding: 0 $pad;
           }
 
           .dropdown {

+ 1 - 1
components/search/GoodList.vue

@@ -230,7 +230,7 @@
       },
       sortBy: function (param) {
         if (param === 'normal1') {
-          this.sorting = {'GO_RESERVE': 'DESC', 'GO_SEARCH': 'DESC'}
+          this.sorting = {'GO_SEARCH': 'DESC', 'GO_RESERVE': 'DESC'}
           this.activeTag = 'normal1'
         } else if (param === 'normal2') {
           this.sorting = {'GO_RESERVE': 'DESC', 'GO_SEARCH': 'DESC'}

+ 20 - 3
components/search/ResultTitle.vue

@@ -1,17 +1,34 @@
 <template>
   <div class="result-title text-muted">
-    搜索"<span class="text-inverse" >{{keyword}}</span>",为您找到
-    <span class="text-num" v-text="good_list.total"></span> 个相关产品:
+    搜索"<span class="text-inverse" >{{keyword}}</span>"<span v-if="status != 1">暂无结果</span>
+    <span v-if="status != 3">,为您找到
+    <span class="text-num" v-text="good_list.total"></span> 个<span v-if="status == 2">相关</span>产品</span>:
   </div>
 </template>
 <script>
   export default{
-    props: ['keyword'],
+    props: ['keyword', 'page'],
+    data () {
+      return {
+        status: 1
+      }
+    },
     computed: {
       good_lists () {
         return this.$store.state.searchData.searchList.lists
       },
       good_list () {
+        if (this.page === 1) {
+          if (this.good_lists.data.components && this.good_lists.data.components.length > 0) {
+            if (this.keyword === this.good_lists.data.components[0].code) {
+              this.status = 1
+            } else {
+              this.status = 2
+            }
+          } else {
+            this.status = 3
+          }
+        }
         return this.good_lists.data
       }
     }

+ 1 - 1
pages/search/_keyword.vue

@@ -1,7 +1,7 @@
 <template>
 <div class="container" id="searchResult">
   <detail-brand></detail-brand>
-  <result-title :keyword="key"></result-title>
+  <result-title :keyword="key" :page="nowPage"></result-title>
     <kind @kindFilterEvent="listenKindFilter"
           @brandFilterEvent="listenBrandFilter"
           @typeFilterEvent="listenTypeFilter"