Authored by 刘传洋

Merge branch 'release/newSearch' of http://git.yoho.cn/fe/yohobuy-node into release/newSearch

@@ -472,9 +472,9 @@ exports.getShopData = (shopId, channel, params, shopInfo) => { @@ -472,9 +472,9 @@ exports.getShopData = (shopId, channel, params, shopInfo) => {
472 list: productProcess.processProductList(_.get(result[2], 'data.product_list', []), { 472 list: productProcess.processProductList(_.get(result[2], 'data.product_list', []), {
473 newCoverSort: true, 473 newCoverSort: true,
474 showDiscount: false, 474 showDiscount: false,
475 - gender: gender, 475 + gender: gender
  476 + }),
476 href: `/product/shoplist?navBar=1&shopId=${shopId}` 477 href: `/product/shoplist?navBar=1&shopId=${shopId}`
477 - })  
478 }; 478 };
479 479
480 _.set(allGoods, 'sort.newPage', true); // 启用新的分页导航 480 _.set(allGoods, 'sort.newPage', true); // 启用新的分页导航
@@ -521,7 +521,8 @@ exports.getShopData = (shopId, channel, params, shopInfo) => { @@ -521,7 +521,8 @@ exports.getShopData = (shopId, channel, params, shopInfo) => {
521 }); 521 });
522 522
523 _.forEach(prodList, value => { 523 _.forEach(prodList, value => {
524 - coverList[value.productSkn] = value.defaultImages; 524 + coverList[value.product_skn] = helpers.getForceSourceUrl(value.default_images) +
  525 + '?imageView/1/w/{width}/h/{height}';
525 }); 526 });
526 527
527 if (_.has(finalResult, 'newArrivel.list')) { 528 if (_.has(finalResult, 'newArrivel.list')) {
@@ -551,6 +552,31 @@ exports.getShopData = (shopId, channel, params, shopInfo) => { @@ -551,6 +552,31 @@ exports.getShopData = (shopId, channel, params, shopInfo) => {
551 } 552 }
552 } 553 }
553 554
  555 + let articleList = [];
  556 +
  557 + for (let i = 2; i < subRes.length; i++) {
  558 + articleList = _.concat(articleList, _.get(subRes[i], 'data', []));
  559 + }
  560 +
  561 + if (articleList.length >= 3) {
  562 + let trendList = [];
  563 +
  564 + for (let i = 0; i < 3; i++) {
  565 + trendList.push({
  566 + href: articleList[i].url,
  567 + src: articleList[i].src,
  568 + mainTitle: articleList[i].title,
  569 + Subtitle: articleList[i].intro
  570 + });
  571 + articleList = _.concat(articleList, _.get(subRes[i], 'data', []));
  572 + }
  573 +
  574 + finalResult.trendInfo = {
  575 + name: '潮流资讯 HOT ITEMS',
  576 + trendList: trendList
  577 + };
  578 + }
  579 +
554 return finalResult; 580 return finalResult;
555 }); 581 });
556 }); 582 });
@@ -217,13 +217,14 @@ const brandBrowse = (data, params) => { @@ -217,13 +217,14 @@ const brandBrowse = (data, params) => {
217 let brand = _.get(params, 'brand', ''); 217 let brand = _.get(params, 'brand', '');
218 let resData = {}; 218 let resData = {};
219 219
220 - if (!_.isEmpty(data)) { 220 + if (!_.isEmpty(data) && data.length > 1) {
221 let list = []; 221 let list = [];
222 222
223 _.forEach(data, value => { 223 _.forEach(data, value => {
224 list.push({ 224 list.push({
225 url: `${shopListUrl}?shopId=${params.shopId || ''}&brand=${value.id}&title=${value.title}$navBar=1`, 225 url: `${shopListUrl}?shopId=${params.shopId || ''}&brand=${value.id}&title=${value.title}$navBar=1`,
226 brandName: value.brandName, 226 brandName: value.brandName,
  227 + title: value.title,
227 cur: (brand === +value.id) 228 cur: (brand === +value.id)
228 }); 229 });
229 }); 230 });
@@ -247,18 +248,17 @@ const hotRecommend = (data) => { @@ -247,18 +248,17 @@ const hotRecommend = (data) => {
247 248
248 if (!_.isEmpty(data)) { 249 if (!_.isEmpty(data)) {
249 let list = []; 250 let list = [];
250 - let title;  
251 251
252 _.forEach(data, value => { 252 _.forEach(data, value => {
253 - title = value.title;  
254 list.push({ 253 list.push({
  254 + title: value.title,
255 img: value.src, 255 img: value.src,
256 url: value.url 256 url: value.url
257 }); 257 });
258 }); 258 });
259 259
260 resData.hotRecommend = { 260 resData.hotRecommend = {
261 - title: title, 261 + title: list[0].title,
262 list: list 262 list: list
263 }; 263 };
264 } 264 }
@@ -61,7 +61,7 @@ @@ -61,7 +61,7 @@
61 {{#each trendList}} 61 {{#each trendList}}
62 <li> 62 <li>
63 <a href="{{href}}"> 63 <a href="{{href}}">
64 - <img src="{{src}}" /> 64 + <img src="{{image src 264 173}}" />
65 <div class="main-title">{{mainTitle}}</div> 65 <div class="main-title">{{mainTitle}}</div>
66 <div class="sub-title">{{Subtitle}}</div> 66 <div class="sub-title">{{Subtitle}}</div>
67 </a> 67 </a>
1 {{#brandBrowse}} 1 {{#brandBrowse}}
2 <div class="brand-collect left-modular"> 2 <div class="brand-collect left-modular">
3 - {{# title}}<h2 class="title">{{.}}</h2>{{/ title}} 3 + {{#if title}}<h2 class="title">{{title}}</h2>{{/if}}
4 <ul class="left-list"> 4 <ul class="left-list">
5 {{#each list}} 5 {{#each list}}
6 <li class="{{#if cur}} on {{/if}}"><a href="{{url}}">{{brandName}}</a></li> 6 <li class="{{#if cur}} on {{/if}}"><a href="{{url}}">{{brandName}}</a></li>
@@ -11,7 +11,7 @@ @@ -11,7 +11,7 @@
11 11
12 {{#recommend}} 12 {{#recommend}}
13 <div class="classic-recommend left-modular"> 13 <div class="classic-recommend left-modular">
14 - {{# title}}<h2 class="title">{{.}}</h2>{{/ title}} 14 + {{#if title}}<h2 class="title">{{title}}</h2>{{/if}}
15 <ul class="left-list"> 15 <ul class="left-list">
16 {{#each list}} 16 {{#each list}}
17 <li> 17 <li>
@@ -34,7 +34,7 @@ @@ -34,7 +34,7 @@
34 34
35 {{#hotRecommend}} 35 {{#hotRecommend}}
36 <div class="sell-recommend left-modular"> 36 <div class="sell-recommend left-modular">
37 - {{# title}}<h2 class="title">{{.}}</h2>{{/ title}} 37 + {{#if title}}<h2 class="title">{{title}}</h2>{{/if}}
38 <ul class="left-list"> 38 <ul class="left-list">
39 {{#each list}} 39 {{#each list}}
40 <li> 40 <li>
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 {{#each list}} 2 {{#each list}}
3 <li> 3 <li>
4 <a class="item item-{{@index}}" href="{{url}}" target= "_blank"> 4 <a class="item item-{{@index}}" href="{{url}}" target= "_blank">
5 - <img class="lazy" data-original="{{image img 250 250}}"/> 5 + <img class="lazy" data-original="{{image img 235 250}}"/>
6 <p class="title"> 6 <p class="title">
7 {{title}} 7 {{title}}
8 </p> 8 </p>
@@ -490,6 +490,7 @@ @@ -490,6 +490,7 @@
490 .sub-title { 490 .sub-title {
491 box-sizing: border-box; 491 box-sizing: border-box;
492 font-size: 16px; 492 font-size: 16px;
  493 + font-weight: 700;
493 margin-top: 15px; 494 margin-top: 15px;
494 padding: 0 10px; 495 padding: 0 10px;
495 width: 100%; 496 width: 100%;