Authored by 郭成尧

'shopFilterOK'

@@ -31,23 +31,21 @@ module.exports = { @@ -31,23 +31,21 @@ module.exports = {
31 31
32 /* 获取商品列表 */ 32 /* 获取商品列表 */
33 getBrandShopGoods: (req, res, next) => { 33 getBrandShopGoods: (req, res, next) => {
34 - let filter = req.body.filter || {};  
35 -  
36 shopModel.getBrandShopGoodsData({ 34 shopModel.getBrandShopGoodsData({
37 - domain: filter.domain, 35 + domain: req.body.domain,
38 sort: req.body.sort, 36 sort: req.body.sort,
39 page: req.body.page, 37 page: req.body.page,
40 - channel: filter.channel || 'men',  
41 - gender: filter.gender || '1,2,3',  
42 - brand: filter.brand,  
43 - shopId: filter.shopId,  
44 - order: filter.order || 's_t_desc',  
45 - limit: filter.limit || '60',  
46 - color: filter.color,  
47 - price: filter.price,  
48 - size: filter.size,  
49 - pd: filter.pd,  
50 - tagsFilter: filter.tagsFilter 38 + channel: req.body.channel || 'men',
  39 + gender: req.body.gender || '1,2,3',
  40 + brand: req.body.brand,
  41 + shopId: req.body.shopId,
  42 + order: req.body.order || 's_t_desc',
  43 + limit: req.body.limit || '60',
  44 + color: req.body.color,
  45 + price: req.body.price,
  46 + size: req.body.size,
  47 + pd: req.body.pd,
  48 + tagsFilter: req.body.tagsFilter
51 }).then(result => { 49 }).then(result => {
52 res.json(result); 50 res.json(result);
53 }).catch(next); 51 }).catch(next);
@@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@
13 </style> 13 </style>
14 <script> 14 <script>
15 const $ = require('yoho-jquery'); 15 const $ = require('yoho-jquery');
16 - const qs = require('yoho-qs'); 16 + const qs = require('yoho-qs/parse');
17 const bus = require('common/vue-bus'); 17 const bus = require('common/vue-bus');
18 const tip = require('common/tip'); 18 const tip = require('common/tip');
19 19
@@ -30,7 +30,6 @@ @@ -30,7 +30,6 @@
30 module.exports = { 30 module.exports = {
31 data() { 31 data() {
32 return { 32 return {
33 - domain: qs.domain,  
34 shareData: {}, // 分享相关数据 33 shareData: {}, // 分享相关数据
35 shopInfo: {}, // 店铺介绍相关数据 34 shopInfo: {}, // 店铺介绍相关数据
36 35
@@ -40,9 +39,7 @@ @@ -40,9 +39,7 @@
40 // query 39 // query
41 url: '/product/shop/goods.json', 40 url: '/product/shop/goods.json',
42 sort: '', 41 sort: '',
43 - filter: {  
44 - domain: qs.domain  
45 - }, 42 + filter: {},
46 page: 0, // page= 0 未搜索, 1 并且productList.length =0 没有数据, page = page_total 全部加载完 43 page: 0, // page= 0 未搜索, 1 并且productList.length =0 没有数据, page = page_total 全部加载完
47 totalPage: 3, 44 totalPage: 3,
48 45
@@ -70,7 +67,7 @@ @@ -70,7 +67,7 @@
70 $.get({ 67 $.get({
71 url: '/product/shop/info.json', 68 url: '/product/shop/info.json',
72 data: { 69 data: {
73 - domain: this.domain 70 + domain: locationQuery.domain
74 } 71 }
75 }).done(result => { 72 }).done(result => {
76 if (result) { 73 if (result) {
@@ -140,7 +137,7 @@ @@ -140,7 +137,7 @@
140 }, 137 },
141 created() { 138 created() {
142 const self = this; 139 const self = this;
143 - 140 +
144 this.getShopInfo(); 141 this.getShopInfo();
145 this.search(); 142 this.search();
146 bus.$on('list.paging', () => { 143 bus.$on('list.paging', () => {
@@ -161,7 +158,6 @@ @@ -161,7 +158,6 @@
161 * 2. 关闭 filter 组件 158 * 2. 关闭 filter 组件
162 */ 159 */
163 bus.$on('filter.change', function({val}) { 160 bus.$on('filter.change', function({val}) {
164 - console.log(val);  
165 let filter = {}; 161 let filter = {};
166 162
167 $.each(val, (type, item) => { 163 $.each(val, (type, item) => {