Showing
5 changed files
with
25 additions
and
12 deletions
@@ -37,9 +37,21 @@ module.exports = { | @@ -37,9 +37,21 @@ module.exports = { | ||
37 | 37 | ||
38 | /* 获取商品列表 */ | 38 | /* 获取商品列表 */ |
39 | getBrandShopGoods: (req, res) => { | 39 | getBrandShopGoods: (req, res) => { |
40 | - let params = req.query; | ||
41 | - | ||
42 | - brandModel.getBrandShopGoodsData(params).then(result => { | 40 | + brandModel.getBrandShopGoodsData({ |
41 | + sort: req.body.sort, | ||
42 | + page: req.body.page, | ||
43 | + channel: req.body.filter.channel || 'men', | ||
44 | + gender: req.body.filter.gender || '1,2,3', | ||
45 | + brand: req.body.filter.brand, | ||
46 | + shopId: req.body.filter.shopId, | ||
47 | + order: req.body.filter.order || 's_t_desc', | ||
48 | + limit: req.body.filter.limit || '60', | ||
49 | + color: req.body.filter.color, | ||
50 | + price: req.body.filter.price, | ||
51 | + size: req.body.filter.size, | ||
52 | + pd: req.body.filter.pd, | ||
53 | + tagsFilter: req.body.filter.tagsFilter | ||
54 | + }).then(result => { | ||
43 | res.json(result); | 55 | res.json(result); |
44 | }); | 56 | }); |
45 | }, | 57 | }, |
@@ -66,7 +66,7 @@ module.exports = { | @@ -66,7 +66,7 @@ module.exports = { | ||
66 | getBrandShopGoodsOriginData(params) { | 66 | getBrandShopGoodsOriginData(params) { |
67 | return api.get('', { | 67 | return api.get('', { |
68 | method: 'app.search.brand', | 68 | method: 'app.search.brand', |
69 | - yh_channel: yhChannel[params.channel].channel, | 69 | + yh_channel: params.channel ? yhChannel[params.channel].channel : '1', |
70 | brand: params.brand, | 70 | brand: params.brand, |
71 | shop_id: params.shopId, | 71 | shop_id: params.shopId, |
72 | order: params.order, | 72 | order: params.order, |
@@ -17,7 +17,7 @@ router.get('/', channel.index); // 首页 | @@ -17,7 +17,7 @@ router.get('/', channel.index); // 首页 | ||
17 | router.get('/resources', channel.resources); // 资源位接口 | 17 | router.get('/resources', channel.resources); // 资源位接口 |
18 | router.get('/brand', brand.index); // 店铺首页 | 18 | router.get('/brand', brand.index); // 店铺首页 |
19 | router.get('/get-brand-intro', brand.getBrandIntro); // 店铺介绍 | 19 | router.get('/get-brand-intro', brand.getBrandIntro); // 店铺介绍 |
20 | -router.get('/get-brand-shop-goods', brand.getBrandShopGoods); // 店铺介绍 | 20 | +router.post('/get-brand-shop-goods', brand.getBrandShopGoods); // 店铺介绍 |
21 | router.get('/brand-list', brand.brandList); // 品牌列表页 | 21 | router.get('/brand-list', brand.brandList); // 品牌列表页 |
22 | router.get('/get-brand-list', brand.getBrandList); // 获取品牌列表数据 | 22 | router.get('/get-brand-list', brand.getBrandList); // 获取品牌列表数据 |
23 | router.get('/brand-share', brand.brandShare); // 获取品牌列表数据 | 23 | router.get('/brand-share', brand.brandShare); // 获取品牌列表数据 |
@@ -31,8 +31,8 @@ | @@ -31,8 +31,8 @@ | ||
31 | filterConfig: global.filterConfig, | 31 | filterConfig: global.filterConfig, |
32 | 32 | ||
33 | // query | 33 | // query |
34 | - url: '/product/list', | ||
35 | - sort: 3, | 34 | + url: '/get-brand-shop-goods', |
35 | + sort: '', | ||
36 | filter: {}, | 36 | filter: {}, |
37 | page: 0, // page= 0 未搜索, 1 并且productList.length =0 没有数据, page = page_total 全部加载完 | 37 | page: 0, // page= 0 未搜索, 1 并且productList.length =0 没有数据, page = page_total 全部加载完 |
38 | totalPage: 3, | 38 | totalPage: 3, |
@@ -60,11 +60,10 @@ | @@ -60,11 +60,10 @@ | ||
60 | let data = {}; | 60 | let data = {}; |
61 | 61 | ||
62 | $.ajax({ | 62 | $.ajax({ |
63 | - method: 'post', | ||
64 | - url: '/product/list', | 63 | + url: this.url, |
65 | data: data | 64 | data: data |
66 | }).done(result => { | 65 | }).done(result => { |
67 | - this.$set('productList', this.productList.concat(result.data.productList)); | 66 | + this.productList = result.data.productList; |
68 | }).fail(() => { | 67 | }).fail(() => { |
69 | tip('网络错误'); | 68 | tip('网络错误'); |
70 | }); | 69 | }); |
@@ -85,8 +84,8 @@ | @@ -85,8 +84,8 @@ | ||
85 | sort: this.sort, | 84 | sort: this.sort, |
86 | filter: this.filter, | 85 | filter: this.filter, |
87 | page: this.page | 86 | page: this.page |
88 | - }).done(res => { | ||
89 | - self.$set('productList', self.productList.concat(res.data.productList)); | 87 | + }).done(result => { |
88 | + this.productList = result.data.productList; | ||
90 | }).fail(error => { | 89 | }).fail(error => { |
91 | self.page--; | 90 | self.page--; |
92 | console.log(error); | 91 | console.log(error); |
@@ -57,6 +57,8 @@ | @@ -57,6 +57,8 @@ | ||
57 | const shareBottom = require('channel/share-bottom.vue'); | 57 | const shareBottom = require('channel/share-bottom.vue'); |
58 | 58 | ||
59 | module.exports = { | 59 | module.exports = { |
60 | + | ||
61 | + /* TODO 数据需要从接口获取 */ | ||
60 | data() { | 62 | data() { |
61 | return { | 63 | return { |
62 | brandName: 'COLORMAD', | 64 | brandName: 'COLORMAD', |
-
Please register or login to post a comment