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) => {
list: productProcess.processProductList(_.get(result[2], 'data.product_list', []), {
newCoverSort: true,
showDiscount: false,
gender: gender,
href: `/product/shoplist?navBar=1&shopId=${shopId}`
})
gender: gender
}),
href: `/product/shoplist?navBar=1&shopId=${shopId}`
};
_.set(allGoods, 'sort.newPage', true); // 启用新的分页导航
... ... @@ -521,7 +521,8 @@ exports.getShopData = (shopId, channel, params, shopInfo) => {
});
_.forEach(prodList, value => {
coverList[value.productSkn] = value.defaultImages;
coverList[value.product_skn] = helpers.getForceSourceUrl(value.default_images) +
'?imageView/1/w/{width}/h/{height}';
});
if (_.has(finalResult, 'newArrivel.list')) {
... ... @@ -551,6 +552,31 @@ exports.getShopData = (shopId, channel, params, shopInfo) => {
}
}
let articleList = [];
for (let i = 2; i < subRes.length; i++) {
articleList = _.concat(articleList, _.get(subRes[i], 'data', []));
}
if (articleList.length >= 3) {
let trendList = [];
for (let i = 0; i < 3; i++) {
trendList.push({
href: articleList[i].url,
src: articleList[i].src,
mainTitle: articleList[i].title,
Subtitle: articleList[i].intro
});
articleList = _.concat(articleList, _.get(subRes[i], 'data', []));
}
finalResult.trendInfo = {
name: '潮流资讯 HOT ITEMS',
trendList: trendList
};
}
return finalResult;
});
});
... ...
... ... @@ -217,13 +217,14 @@ const brandBrowse = (data, params) => {
let brand = _.get(params, 'brand', '');
let resData = {};
if (!_.isEmpty(data)) {
if (!_.isEmpty(data) && data.length > 1) {
let list = [];
_.forEach(data, value => {
list.push({
url: `${shopListUrl}?shopId=${params.shopId || ''}&brand=${value.id}&title=${value.title}$navBar=1`,
brandName: value.brandName,
title: value.title,
cur: (brand === +value.id)
});
});
... ... @@ -247,18 +248,17 @@ const hotRecommend = (data) => {
if (!_.isEmpty(data)) {
let list = [];
let title;
_.forEach(data, value => {
title = value.title;
list.push({
title: value.title,
img: value.src,
url: value.url
});
});
resData.hotRecommend = {
title: title,
title: list[0].title,
list: list
};
}
... ...
... ... @@ -61,7 +61,7 @@
{{#each trendList}}
<li>
<a href="{{href}}">
<img src="{{src}}" />
<img src="{{image src 264 173}}" />
<div class="main-title">{{mainTitle}}</div>
<div class="sub-title">{{Subtitle}}</div>
</a>
... ...
{{#brandBrowse}}
<div class="brand-collect left-modular">
{{# title}}<h2 class="title">{{.}}</h2>{{/ title}}
{{#if title}}<h2 class="title">{{title}}</h2>{{/if}}
<ul class="left-list">
{{#each list}}
<li class="{{#if cur}} on {{/if}}"><a href="{{url}}">{{brandName}}</a></li>
... ... @@ -11,7 +11,7 @@
{{#recommend}}
<div class="classic-recommend left-modular">
{{# title}}<h2 class="title">{{.}}</h2>{{/ title}}
{{#if title}}<h2 class="title">{{title}}</h2>{{/if}}
<ul class="left-list">
{{#each list}}
<li>
... ... @@ -34,7 +34,7 @@
{{#hotRecommend}}
<div class="sell-recommend left-modular">
{{# title}}<h2 class="title">{{.}}</h2>{{/ title}}
{{#if title}}<h2 class="title">{{title}}</h2>{{/if}}
<ul class="left-list">
{{#each list}}
<li>
... ...
... ... @@ -2,7 +2,7 @@
{{#each list}}
<li>
<a class="item item-{{@index}}" href="{{url}}" target= "_blank">
<img class="lazy" data-original="{{image img 250 250}}"/>
<img class="lazy" data-original="{{image img 235 250}}"/>
<p class="title">
{{title}}
</p>
... ...
... ... @@ -490,6 +490,7 @@
.sub-title {
box-sizing: border-box;
font-size: 16px;
font-weight: 700;
margin-top: 15px;
padding: 0 10px;
width: 100%;
... ...