Merge branch 'feature/brand' into develop
Showing
9 changed files
with
45 additions
and
18 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 | }, |
@@ -4,7 +4,6 @@ | @@ -4,7 +4,6 @@ | ||
4 | * @date: 2016/05/09 | 4 | * @date: 2016/05/09 |
5 | */ | 5 | */ |
6 | 'use strict'; | 6 | 'use strict'; |
7 | -const brand = require('./brand'); | ||
8 | 7 | ||
9 | /** | 8 | /** |
10 | * 频道选择页 | 9 | * 频道选择页 |
@@ -18,4 +17,4 @@ const component = { | @@ -18,4 +17,4 @@ const component = { | ||
18 | } | 17 | } |
19 | }; | 18 | }; |
20 | 19 | ||
21 | -module.exports = Object.assign(component, brand); | 20 | +module.exports = component; |
@@ -65,7 +65,20 @@ module.exports = { | @@ -65,7 +65,20 @@ module.exports = { | ||
65 | */ | 65 | */ |
66 | getBrandShopGoodsOriginData(params) { | 66 | getBrandShopGoodsOriginData(params) { |
67 | return api.get('', { | 67 | return api.get('', { |
68 | - method: '' | 68 | + method: 'app.search.brand', |
69 | + yh_channel: params.channel ? yhChannel[params.channel].channel : '1', | ||
70 | + brand: params.brand, | ||
71 | + shop_id: params.shopId, | ||
72 | + order: params.order, | ||
73 | + limit: params.limit, | ||
74 | + page: params.page, | ||
75 | + gender: params.gender, | ||
76 | + color: params.color, | ||
77 | + price: params.price, | ||
78 | + size: params.size, | ||
79 | + p_d: params.pd, | ||
80 | + sort: params.sort, | ||
81 | + tags_filter: params.tagsFilter | ||
69 | }); | 82 | }); |
70 | }, | 83 | }, |
71 | 84 | ||
@@ -82,7 +95,7 @@ module.exports = { | @@ -82,7 +95,7 @@ module.exports = { | ||
82 | type: params.type | 95 | type: params.type |
83 | }; | 96 | }; |
84 | 97 | ||
85 | - if (isFav) { | 98 | + if (params.isFav) { |
86 | Object.assign(finalParams, { | 99 | Object.assign(finalParams, { |
87 | method: 'app.favorite.add' | 100 | method: 'app.favorite.add' |
88 | }); | 101 | }); |
@@ -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); // 获取品牌列表数据 |
@@ -14,7 +14,7 @@ | @@ -14,7 +14,7 @@ | ||
14 | "debug": "DEBUG=\"express:*\" nodemon -e js,hbs -i public/ app.js", | 14 | "debug": "DEBUG=\"express:*\" nodemon -e js,hbs -i public/ app.js", |
15 | "lint-js": "eslint -c .eslintrc --cache --fix .", | 15 | "lint-js": "eslint -c .eslintrc --cache --fix .", |
16 | "lint-css": "stylelint --config .stylelintrc public/scss/**/*.css", | 16 | "lint-css": "stylelint --config .stylelintrc public/scss/**/*.css", |
17 | - "lint-vue": "stylelint --extract --config .stylelintrc public/vue/**/*.vue; eslint -c .eslintrc --cache --fix public/vue/**/*.vue", | 17 | + "lint-vue": "stylelint --extract --config .stylelintrc public/vue/**/*.vue || eslint -c .eslintrc --cache --fix public/vue/**/*.vue", |
18 | "precommit": "node lint.js" | 18 | "precommit": "node lint.js" |
19 | }, | 19 | }, |
20 | "license": "MIT", | 20 | "license": "MIT", |
@@ -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, |
@@ -58,11 +58,10 @@ | @@ -58,11 +58,10 @@ | ||
58 | let data = {}; | 58 | let data = {}; |
59 | 59 | ||
60 | $.ajax({ | 60 | $.ajax({ |
61 | - method: 'post', | ||
62 | - url: '/product/list', | 61 | + url: this.url, |
63 | data: data | 62 | data: data |
64 | }).done(result => { | 63 | }).done(result => { |
65 | - this.$set('productList', this.productList.concat(result.data.productList)); | 64 | + this.productList = result.data.productList; |
66 | }).fail(() => { | 65 | }).fail(() => { |
67 | tip('网络错误'); | 66 | tip('网络错误'); |
68 | }); | 67 | }); |
@@ -83,8 +82,8 @@ | @@ -83,8 +82,8 @@ | ||
83 | sort: this.sort, | 82 | sort: this.sort, |
84 | filter: this.filter, | 83 | filter: this.filter, |
85 | page: this.page | 84 | page: this.page |
86 | - }).done(res => { | ||
87 | - self.$set('productList', self.productList.concat(res.data.productList)); | 85 | + }).done(result => { |
86 | + this.productList = result.data.productList; | ||
88 | }).fail(error => { | 87 | }).fail(error => { |
89 | self.page--; | 88 | self.page--; |
90 | console.log(error); | 89 | 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