Merge branch 'feature/newGolbal' into release/5.6
Showing
5 changed files
with
28 additions
and
9 deletions
@@ -38,8 +38,16 @@ const getGlobalProductHtmlAsync = (skn, channelNum) => { | @@ -38,8 +38,16 @@ const getGlobalProductHtmlAsync = (skn, channelNum) => { | ||
38 | }, config.apiCache); | 38 | }, config.apiCache); |
39 | }; | 39 | }; |
40 | 40 | ||
41 | +const getGlobalBrandInfoAsync = brand => { | ||
42 | + return globalApi.get('editor/api/v1/brand/get', { | ||
43 | + brandId: brand | ||
44 | + }, config.apiCache); | ||
45 | + | ||
46 | +}; | ||
47 | + | ||
41 | module.exports = { | 48 | module.exports = { |
42 | getGlobalProductListAsync, | 49 | getGlobalProductListAsync, |
43 | getGlobalProductDetailAsync, | 50 | getGlobalProductDetailAsync, |
44 | - getGlobalProductHtmlAsync | 51 | + getGlobalProductHtmlAsync, |
52 | + getGlobalBrandInfoAsync | ||
45 | }; | 53 | }; |
@@ -150,7 +150,8 @@ const getGlobalProductListData = (params, yoho) => { | @@ -150,7 +150,8 @@ const getGlobalProductListData = (params, yoho) => { | ||
150 | }, dps)), | 150 | }, dps)), |
151 | list: globalApi.getGlobalProductListAsync(Object.assign({ | 151 | list: globalApi.getGlobalProductListAsync(Object.assign({ |
152 | physical_channel: yoho.channelNum | 152 | physical_channel: yoho.channelNum |
153 | - }, params, {limit: limitNum})) | 153 | + }, params, {limit: limitNum})), |
154 | + brand: dps.brand ? globalApi.getGlobalBrandInfoAsync(dps.brand) : {} | ||
154 | }).then(result => { | 155 | }).then(result => { |
155 | let resData = {}; | 156 | let resData = {}; |
156 | 157 | ||
@@ -193,13 +194,11 @@ const getGlobalProductListData = (params, yoho) => { | @@ -193,13 +194,11 @@ const getGlobalProductListData = (params, yoho) => { | ||
193 | let pathInfo = {}; | 194 | let pathInfo = {}; |
194 | 195 | ||
195 | if (dps.brand) { | 196 | if (dps.brand) { |
196 | - let bandInfo = _.find(_.get(result.fullList, 'data.filter.brand', []), o => { | ||
197 | - return o.id * 1 === dps.brand * 1; | ||
198 | - }); | 197 | + let brandName = _.get(result.brand, 'data.brand_name', ''); |
199 | 198 | ||
200 | - if (bandInfo) { | 199 | + if (brandName) { |
201 | pathInfo.brand = { | 200 | pathInfo.brand = { |
202 | - name: bandInfo.brand_name | 201 | + name: brandName |
203 | }; | 202 | }; |
204 | } | 203 | } |
205 | } | 204 | } |
@@ -311,11 +311,13 @@ const getShopList = params => { | @@ -311,11 +311,13 @@ const getShopList = params => { | ||
311 | home: helpers.urlFormat('', null, value.shop_domain || value.brand_domain), | 311 | home: helpers.urlFormat('', null, value.shop_domain || value.brand_domain), |
312 | logo: value.shop_logo || value.brand_ico, | 312 | logo: value.shop_logo || value.brand_ico, |
313 | shopName: value.shop_name || value.brand_name, | 313 | shopName: value.shop_name || value.brand_name, |
314 | + shopType: '', | ||
314 | sort: [] | 315 | sort: [] |
315 | }; | 316 | }; |
316 | 317 | ||
317 | if (value.is_global === 'Y') { | 318 | if (value.is_global === 'Y') { |
318 | shopInfo.home = helpers.urlFormat(GLOBAL_BASE_URI, {brand: value.global_brand_id}); | 319 | shopInfo.home = helpers.urlFormat(GLOBAL_BASE_URI, {brand: value.global_brand_id}); |
320 | + shopInfo.shopType = 'global-brand'; | ||
319 | } | 321 | } |
320 | 322 | ||
321 | // 店铺/品牌的小分类 | 323 | // 店铺/品牌的小分类 |
@@ -6,7 +6,7 @@ | @@ -6,7 +6,7 @@ | ||
6 | </a> | 6 | </a> |
7 | 7 | ||
8 | <div class="name pull-left"> | 8 | <div class="name pull-left"> |
9 | - <a class="shop-name" href="{{home}}">{{shopName}}</a> | 9 | + <a class="shop-name {{shopType}}" href="{{home}}">{{shopName}}</a> |
10 | <p class="sorts"> | 10 | <p class="sorts"> |
11 | {{#each sort}} | 11 | {{#each sort}} |
12 | <a href="{{href}}">{{name}}</a> | 12 | <a href="{{href}}">{{name}}</a> |
@@ -24,4 +24,4 @@ | @@ -24,4 +24,4 @@ | ||
24 | </a> | 24 | </a> |
25 | </div> | 25 | </div> |
26 | {{/ shopEntry}} | 26 | {{/ shopEntry}} |
27 | -</div> | ||
27 | +</div> |
@@ -18,6 +18,16 @@ | @@ -18,6 +18,16 @@ | ||
18 | font-size: 16px; | 18 | font-size: 16px; |
19 | color: #222; | 19 | color: #222; |
20 | line-height: 26px; | 20 | line-height: 26px; |
21 | + | ||
22 | + &.global-brand:after { | ||
23 | + content: ""; | ||
24 | + width: 54px; | ||
25 | + height: 20px; | ||
26 | + margin-left: 6px; | ||
27 | + display: inline-block; | ||
28 | + background-image: url("/product/global-path-icon.png"); | ||
29 | + vertical-align: text-bottom; | ||
30 | + } | ||
21 | } | 31 | } |
22 | 32 | ||
23 | .sorts { | 33 | .sorts { |
-
Please register or login to post a comment