Authored by htoooth

Merge remote-tracking branch 'origin/release/1.0' into release/1.0

... ... @@ -43,7 +43,6 @@ const _getBrandAdFloor = d => {
* @return {Object} 处理之后的数据
*/
const _getNewArrivals = d => {
console.log(d);
_.forEach(d, (data, index) => {
if (index === 0 || index === d.length - 1) {
data.smallImg = true;
... ...
<div class="ad-container clearfix">
{{# brandsAd}}
<div class="ad {{#if @first}}first{{/if}}">
<img class="lazy-img" data-original="{{image src 240 240}}" alt="">
<a href="{{url}}">
<img class="lazy-img" data-original="{{image src 240 240}}" alt="">
</a>
{{> brand-text-box}}
</div>
{{/ brandsAd}}
... ...
... ... @@ -5,21 +5,21 @@
<div class="arrival-item {{#if smallImg}}small-img{{/if}} {{#if @last}}last{{^}}normal{{/if}}">
{{#if even}}
<a href="{{url}}">
<img class="lazy-img" data-original="{{#if smallImg}}{{image src 223 490}}{{^}}{{image src 325 490}}{{/if}}" alt="">
<img class="lazy-img" data-original="{{#if smallImg}}{{image src 223 490}}{{^}}{{image src 325 490}}{{/if}}" alt="{{alt}}">
</a>
<div class="brand-name">
<a href="{{url}}">
<span class="bottom">{{name}}</span>
<span class="bottom">{{title}}</span>
</a>
</div>
{{^}}
<div class="brand-name">
<a href="{{url}}">
<span class="top">{{name}}</span>
<span class="top">{{title}}</span>
</a>
</div>
<a href="{{url}}">
<img class="lazy-img" data-original="{{#if smallImg}}{{image src 223 490}}{{^}}{{image src 325 490}}{{/if}}" alt="">
<img class="lazy-img" data-original="{{#if smallImg}}{{image src 223 490}}{{^}}{{image src 325 490}}{{/if}}" alt="{{alt}}">
</a>
{{/if}}
</div>
... ...
... ... @@ -13,6 +13,7 @@ const item = require('../models/item');
* @function index
*/
const index = (req, res, next) => {
req.params.channel = req.yoho.channel;
item.getProductItemData(req.params, req.url, req.user.uid).then(result => {
if (_.isEmpty(result)) {
return next();
... ...
... ... @@ -166,21 +166,37 @@ const setSeoInfo = (goodInfo, nav) => {
* @param { string } name 商品名称
* @return { Object } 面包屑导航数据
*/
const setPathNav = (data, name) => {
const setPathNav = (data, name, channel) => {
let resData = {};
let link = channel,
gender;
channel = channel || 'men';
switch (channel) {
case 'men': // 男
link = '';
gender = '1,3';
break;
case 'women': // 女
gender = '2,3';
break;
default: // 其它
gender = '1,2,3';
break;
}
if (!_.isEmpty(data)) {
let navs = [{
link: helpers.urlFormat(''),
name: 'MEN首页' // 待处理
link: helpers.urlFormat(`/${link}`),
name: `${_.toUpper(channel)}首页`
}];
let sort = data.sort[0];
navs.push({
link: helpers.urlFormat('/list', {
msort: sort.sort_id
// gender: '' // 待处理
msort: sort.sort_id,
gender: gender
}),
name: sort.sort_name,
pathTitle: sort.sort_name
... ... @@ -191,9 +207,8 @@ const setPathNav = (data, name) => {
navs.push({
link: helpers.urlFormat('/list', {
msort: sort.sort_id,
misort: sort.sub.sort_id
// gender: '' // 待处理
misort: sort.sub.sort_id,
gender: gender
}),
name: sort.sub[0].sort_name,
pathTitle: sort.sub[0].sort_name
... ...
... ... @@ -93,7 +93,7 @@ const getProductItemData = (params, url, uid) => {
_.set(data, 'goodInfo.productFav', mulRes.productFav);
Object.assign(data,
itemFun.setPathNav(mulRes.sort, result.productName), // 面包屑导航
itemFun.setPathNav(mulRes.sort, result.productName, params.channel), // 面包屑导航
itemFun.setDescriptionData(mulRes.sizeInfo, mulRes.comfort), // DESCRIPTION商品描述
itemFun.setMaterialData(mulRes.sizeInfo), // MATERIALS材料洗涤
itemFun.setSizeData(mulRes.sizeInfo, mulRes.modelTry), // SIZEINFO尺码信息
... ...
... ... @@ -22,4 +22,4 @@ const getBanner = (req, res, next) => {
module.exports = {
getBanner
};
\ No newline at end of file
};
... ...
... ... @@ -38,8 +38,8 @@ const getBannerData = (code) => {
return resData;
});
}
};
module.exports = {
getBannerData
};
\ No newline at end of file
};
... ...
... ... @@ -423,5 +423,9 @@
background: url('/layout/hot.png');
margin-left: 4px;
}
.show-detail {
float: right;
}
}
}
... ...