Showing
5 changed files
with
61 additions
and
8 deletions
@@ -31,7 +31,15 @@ module.exports = { | @@ -31,7 +31,15 @@ module.exports = { | ||
31 | brandModel.getBrandData(params).then(result => { | 31 | brandModel.getBrandData(params).then(result => { |
32 | res.json(result); | 32 | res.json(result); |
33 | }); | 33 | }); |
34 | + }, | ||
35 | + | ||
36 | + /* 获取商品列表 */ | ||
37 | + getBrandShopGoods: (req, res) => { | ||
38 | + let params = req.query; | ||
34 | 39 | ||
40 | + brandModel.getBrandShopGoodsData(params).then(result => { | ||
41 | + res.json(result); | ||
42 | + }); | ||
35 | }, | 43 | }, |
36 | 44 | ||
37 | /* 品牌列表页 */ | 45 | /* 品牌列表页 */ |
@@ -13,7 +13,17 @@ module.exports = { | @@ -13,7 +13,17 @@ module.exports = { | ||
13 | * 从接口获取品牌店铺数据 | 13 | * 从接口获取品牌店铺数据 |
14 | * @returns {*} | 14 | * @returns {*} |
15 | */ | 15 | */ |
16 | - getBrandOriginData() { | 16 | + getBrandOriginData(params) { |
17 | + return api.get('', { | ||
18 | + method: '' | ||
19 | + }); | ||
20 | + }, | ||
21 | + | ||
22 | + /** | ||
23 | + * 从接口获取品牌店铺商品数据 | ||
24 | + * @returns {*} | ||
25 | + */ | ||
26 | + getBrandShopGoodsOriginData(params) { | ||
17 | return api.get('', { | 27 | return api.get('', { |
18 | method: '' | 28 | method: '' |
19 | }); | 29 | }); |
@@ -23,7 +33,7 @@ module.exports = { | @@ -23,7 +33,7 @@ module.exports = { | ||
23 | * 从接口获取品牌列表页数据 | 33 | * 从接口获取品牌列表页数据 |
24 | * @returns {*} | 34 | * @returns {*} |
25 | */ | 35 | */ |
26 | - getBrandListOriginData() { | 36 | + getBrandListOriginData(params) { |
27 | return api.get('', { | 37 | return api.get('', { |
28 | method: '' | 38 | method: '' |
29 | }); | 39 | }); |
@@ -33,7 +43,7 @@ module.exports = { | @@ -33,7 +43,7 @@ module.exports = { | ||
33 | * 从接口获取全部分类数据 | 43 | * 从接口获取全部分类数据 |
34 | * @returns {*} | 44 | * @returns {*} |
35 | */ | 45 | */ |
36 | - getCateListData() { | 46 | + getCateListData(params) { |
37 | return api.get('', { | 47 | return api.get('', { |
38 | method: '' | 48 | method: '' |
39 | }); | 49 | }); |
@@ -16,7 +16,7 @@ const brandApi = require('./brand-api'); | @@ -16,7 +16,7 @@ const brandApi = require('./brand-api'); | ||
16 | const getBrandData = params => { | 16 | const getBrandData = params => { |
17 | let finalResult = {}; | 17 | let finalResult = {}; |
18 | 18 | ||
19 | - return api.all([brandApi.getBrandOriginData()]).then(result => { | 19 | + return api.all([brandApi.getBrandOriginData(params)]).then(result => { |
20 | 20 | ||
21 | // 待处理,拼接输出模拟数据 | 21 | // 待处理,拼接输出模拟数据 |
22 | Object.assign(finalResult, { | 22 | Object.assign(finalResult, { |
@@ -33,13 +33,26 @@ const getBrandData = params => { | @@ -33,13 +33,26 @@ const getBrandData = params => { | ||
33 | }; | 33 | }; |
34 | 34 | ||
35 | /** | 35 | /** |
36 | + * 获取品牌店铺商品数据 | ||
37 | + * @param params | ||
38 | + * @returns {*|Promise.<TResult>} | ||
39 | + */ | ||
40 | +const getBrandShopGoodsData = params => { | ||
41 | + let finalResult = {}; | ||
42 | + | ||
43 | + return api.all([brandApi.getBrandShopGoodsOriginData(params)]).then(result => { | ||
44 | + | ||
45 | + }); | ||
46 | +}; | ||
47 | + | ||
48 | +/** | ||
36 | * 获取品牌列表页数据 | 49 | * 获取品牌列表页数据 |
37 | * @param params | 50 | * @param params |
38 | */ | 51 | */ |
39 | const getBrandListData = params => { | 52 | const getBrandListData = params => { |
40 | let finalResult = {}; | 53 | let finalResult = {}; |
41 | 54 | ||
42 | - return api.all([brandApi.getBrandListOriginData()]).then(result => { | 55 | + return api.all([brandApi.getBrandListOriginData(params)]).then(result => { |
43 | Object.assign(finalResult, { | 56 | Object.assign(finalResult, { |
44 | brandList: [ | 57 | brandList: [ |
45 | { | 58 | { |
@@ -117,7 +130,7 @@ const getBrandListData = params => { | @@ -117,7 +130,7 @@ const getBrandListData = params => { | ||
117 | const getCateListData = params => { | 130 | const getCateListData = params => { |
118 | let finalResult = {}; | 131 | let finalResult = {}; |
119 | 132 | ||
120 | - return api.all([brandApi.getCateListData()]).then(result => { | 133 | + return api.all([brandApi.getCateListData(params)]).then(result => { |
121 | 134 | ||
122 | // 待处理,拼接输出模拟数据 | 135 | // 待处理,拼接输出模拟数据 |
123 | Object.assign(finalResult, { | 136 | Object.assign(finalResult, { |
@@ -134,6 +147,7 @@ const getCateListData = params => { | @@ -134,6 +147,7 @@ const getCateListData = params => { | ||
134 | 147 | ||
135 | module.exports = { | 148 | module.exports = { |
136 | getBrandData, | 149 | getBrandData, |
150 | + getBrandShopGoodsData, | ||
137 | getBrandListData, | 151 | getBrandListData, |
138 | getCateListData | 152 | getCateListData |
139 | }; | 153 | }; |
@@ -17,6 +17,7 @@ router.get('/', channel.index); // 首页 | @@ -17,6 +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.get('/brand-list', brand.brandList); // 品牌列表页 | 21 | router.get('/brand-list', brand.brandList); // 品牌列表页 |
21 | router.get('/get-brand-list', brand.getBrandList); // 获取品牌列表数据 | 22 | router.get('/get-brand-list', brand.getBrandList); // 获取品牌列表数据 |
22 | router.get('/cate', brand.cate); // 全部分类 | 23 | router.get('/cate', brand.cate); // 全部分类 |
1 | <template> | 1 | <template> |
2 | <brand-top-cmpnt v-bind:share-Link="shareLink"></brand-top-cmpnt> | 2 | <brand-top-cmpnt v-bind:share-Link="shareLink"></brand-top-cmpnt> |
3 | <brand-shop-top-cmpnt v-bind:domain="'nike'"></brand-shop-top-cmpnt> | 3 | <brand-shop-top-cmpnt v-bind:domain="'nike'"></brand-shop-top-cmpnt> |
4 | + <goods-list v-bind:data="productList"></goods-list> | ||
4 | </template> | 5 | </template> |
5 | 6 | ||
6 | <script> | 7 | <script> |
8 | + const $ = require('yoho-jquery'); | ||
9 | + const tip = require('common/tip'); | ||
7 | const brandTopCmpnt = require('channel/brand-top.vue'); | 10 | const brandTopCmpnt = require('channel/brand-top.vue'); |
8 | const brandShopTopCmpnt = require('channel/brand-shop-top.vue'); | 11 | const brandShopTopCmpnt = require('channel/brand-shop-top.vue'); |
12 | + const goodsList = require('product/list.vue'); | ||
9 | 13 | ||
10 | // TODO 确定分享页面后需要添加拼接分享链接的公共方法 | 14 | // TODO 确定分享页面后需要添加拼接分享链接的公共方法 |
11 | let shareLink = 'http://www.yohobuy.com'; | 15 | let shareLink = 'http://www.yohobuy.com'; |
@@ -13,12 +17,28 @@ | @@ -13,12 +17,28 @@ | ||
13 | module.exports = { | 17 | module.exports = { |
14 | data() { | 18 | data() { |
15 | return { | 19 | return { |
16 | - shareLink: shareLink | 20 | + shareLink: shareLink, |
21 | + productList: [] | ||
17 | }; | 22 | }; |
18 | }, | 23 | }, |
24 | + methods: { | ||
25 | + getProductList(){ | ||
26 | + let data = {}; | ||
27 | + | ||
28 | + $.ajax({ | ||
29 | + url: '/get-brand-shop-goods', | ||
30 | + data: data | ||
31 | + }).done(result => { | ||
32 | + this.productList = result.productList; | ||
33 | + }).fail(() => { | ||
34 | + tip('网络错误'); | ||
35 | + }); | ||
36 | + } | ||
37 | + }, | ||
19 | components: { | 38 | components: { |
20 | brandTopCmpnt, | 39 | brandTopCmpnt, |
21 | - brandShopTopCmpnt | 40 | + brandShopTopCmpnt, |
41 | + goodsList | ||
22 | } | 42 | } |
23 | }; | 43 | }; |
24 | </script> | 44 | </script> |
-
Please register or login to post a comment