Browse Source

过滤条件bug修改

yangc 8 years ago
parent
commit
8a0b1ab456
2 changed files with 12 additions and 6 deletions
  1. 0 1
      components/news/Left.vue
  2. 12 5
      pages/search/_keyword.vue

+ 0 - 1
components/news/Left.vue

@@ -4,7 +4,6 @@
     <h4>
     <h4>
       <span>hot</span>热门文章
       <span>hot</span>热门文章
     </h4>
     </h4>
-
     <div>
     <div>
       <ol class="list-unstyled">
       <ol class="list-unstyled">
         <li v-for="item in news_show" v-bind="item">
         <li v-for="item in news_show" v-bind="item">

+ 12 - 5
pages/search/_keyword.vue

@@ -57,16 +57,24 @@
         this.$store.dispatch('searchData/searchForList', {count: this.pageSize, filter: this.filter, keyword: this.$route.query.w, page: this.nowPage, sorting: this.sorting})
         this.$store.dispatch('searchData/searchForList', {count: this.pageSize, filter: this.filter, keyword: this.$route.query.w, page: this.nowPage, sorting: this.sorting})
       },
       },
       reloadKind: function () {
       reloadKind: function () {
-        this.$store.dispatch('searchData/searchForKinds', {collectList: 'goods_kind', keyword: this.$route.query.w, paramJSON: this.paramJSON})
+        if (!this.filter.goods_kindId) {
+          this.$store.dispatch('searchData/searchForKinds', {collectList: 'goods_kind', keyword: this.$route.query.w, paramJSON: this.paramJSON})
+        }
       },
       },
       reloadBrand: function () {
       reloadBrand: function () {
-        this.$store.dispatch('searchData/searchForBrands', {collectList: 'goods_brand', keyword: this.$route.query.w, paramJSON: this.paramJSON})
+        if (!this.filter.goods_brandId) {
+          this.$store.dispatch('searchData/searchForBrands', {collectList: 'goods_brand', keyword: this.$route.query.w, paramJSON: this.paramJSON})
+        }
       },
       },
       reloadStoreType: function () {
       reloadStoreType: function () {
-        this.$store.dispatch('searchData/searchForStoreType', {collectList: 'goods_store_type', keyword: this.$route.query.w, paramJSON: this.paramJSON})
+        if (!this.filter.goods_store_type) {
+          this.$store.dispatch('searchData/searchForStoreType', {collectList: 'goods_store_type', keyword: this.$route.query.w, paramJSON: this.paramJSON})
+        }
       },
       },
       reloadCrname: function () {
       reloadCrname: function () {
-        this.$store.dispatch('searchData/searchForCrname', {collectList: 'goods_crname', keyword: this.$route.query.w, paramJSON: this.paramJSON})
+        if (!this.filter.goods_crname) {
+          this.$store.dispatch('searchData/searchForCrname', {collectList: 'goods_crname', keyword: this.$route.query.w, paramJSON: this.paramJSON})
+        }
       },
       },
       listenPage: function (nPage) {
       listenPage: function (nPage) {
         this.nowPage = nPage
         this.nowPage = nPage
@@ -90,7 +98,6 @@
         this.reloadList()
         this.reloadList()
       },
       },
       listenKindFilter: function (kindarr) {
       listenKindFilter: function (kindarr) {
-        console.log(kindarr.length)
         if (kindarr.length === 0) {
         if (kindarr.length === 0) {
           delete this.filter.goods_kindId
           delete this.filter.goods_kindId
           delete this.paramJSON.goods_kindid
           delete this.paramJSON.goods_kindid