Browse Source

仅看有货筛选,品牌过滤

yangc 8 years ago
parent
commit
e5e73dee82
1 changed files with 14 additions and 5 deletions
  1. 14 5
      pages/mobile/search/_keycode.vue

+ 14 - 5
pages/mobile/search/_keycode.vue

@@ -60,7 +60,8 @@
         count: '',
         count: '',
         filter: {},
         filter: {},
         page: 1,
         page: 1,
-        sorting: {},
+        sorting: {'RESERVE': 'DESC'},
+        paramJSON: {},
         isShow: true,
         isShow: true,
         isMove: '',
         isMove: '',
         isFocus: false,
         isFocus: false,
@@ -88,7 +89,7 @@
     },
     },
     fetch ({store, route}) {
     fetch ({store, route}) {
       return Promise.all([
       return Promise.all([
-        store.dispatch('searchData/searchForListInMobile', {count: 15, filter: {}, keyword: route.query.w, page: 1, sorting: {}}),
+        store.dispatch('searchData/searchForListInMobile', {count: 15, filter: {}, keyword: route.query.w, page: 1, sorting: {'RESERVE': 'DESC'}}),
         store.dispatch('searchData/searchForBrands', {collectList: 'goods_brand', keyword: route.query.w, paramJSON: {}})
         store.dispatch('searchData/searchForBrands', {collectList: 'goods_brand', keyword: route.query.w, paramJSON: {}})
       ])
       ])
     },
     },
@@ -139,10 +140,14 @@
         this.isChange = true
         this.isChange = true
         if (type === 'store') {
         if (type === 'store') {
           this.activeType = 'store'
           this.activeType = 'store'
-          this.$store.dispatch('searchData/searchForListInMobile', {count: 15, filter: {}, keyword: this.$route.query.w, page: 1, sorting: {}})
+          delete this.filter.goods_status
+          delete this.paramJSON.goods_status
+          this.reloadData()
         } else if (type === 'support') {
         } else if (type === 'support') {
           this.activeType = 'support'
           this.activeType = 'support'
-          this.$store.dispatch('searchData/searchForListInMobile', {count: 15, filter: {'goods_status': 601}, keyword: this.$route.query.w, page: 1, sorting: {'RESERVE': 'DESC'}})
+          this.filter.goods_status = 601
+          this.paramJSON.goods_status = 601
+          this.reloadData()
         }
         }
       },
       },
       goBrand: function (uuid) {
       goBrand: function (uuid) {
@@ -182,7 +187,11 @@
       getMoreSearch: function () {
       getMoreSearch: function () {
         this.page++
         this.page++
         this.isSearchSearchingMore = true
         this.isSearchSearchingMore = true
-        this.$store.dispatch('searchData/searchForListInMobile', {count: 15, filter: {}, keyword: this.$route.query.w, page: this.page, sorting: {'RESERVE': 'DESC'}})
+        this.$store.dispatch('searchData/searchForListInMobile', {count: 15, filter: this.filter, keyword: this.$route.query.w, page: this.page, sorting: this.sorting})
+      },
+      reloadData: function () {
+        this.$store.dispatch('searchData/searchForListInMobile', {count: 15, filter: this.filter, keyword: this.$route.query.w, page: 1, sorting: this.sorting})
+        this.$store.dispatch('searchData/searchForBrands', {collectList: 'goods_brand', keyword: this.$route.query.w, paramJSON: this.paramJSON})
       },
       },
       scroll: function () {
       scroll: function () {
         let scrolled = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop
         let scrolled = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop