Authored by biao

Merge branch 'release/1.0' of http://git.yoho.cn/fe/yoho-blk into release/1.0

{{#each category}}
<dl class="clearfix" name="{{key}}">
<dt>{{key}}</dt>
<dt class="brand-key">{{key}}</dt>
<dd class="brand-tabs">
<ul class="clearfix">
{{#each brands}}
... ...
... ... @@ -245,6 +245,7 @@ const _getRelatedData = (idList) => {
const _processContentData = (list) => {
list = list || [];
list = camelCase(list);
//console.log(list)
let contentData = {
contents: []
... ... @@ -268,7 +269,7 @@ const _processContentData = (list) => {
let idList = '';
// let recoLength = '';
let recoLength = '';
let related = {
relatedReco: [],
relatedGroup: []
... ... @@ -283,11 +284,11 @@ const _processContentData = (list) => {
idList += data.id + ',';
related.relatedReco.push(data);
recoLength = recoLength + 1;
});
}
// recoLength = idList.length / 9;
if (value.goodsGroup) {
_.forEach(value.goodsGroup.data, function(data) {
... ... @@ -308,8 +309,8 @@ const _processContentData = (list) => {
_.forEach(related.relatedReco, function(data, index) {
data = _.assign(data, result[index]);
});
result.splice(0, recoLength.length);
}
if (related.relatedGroup) {
... ... @@ -329,7 +330,7 @@ const _processContentData = (list) => {
return contentData;
});
//console.log(contentData)
return contentData;
};
... ... @@ -414,7 +415,7 @@ const _getRelateBrand = (id) => {
return serviceAPI.get('guang/service/v2/article/getBrand', {
article_id: id
}).then((result) => {
if (result && result.code === 200) {
if (result && result.code === 200) {
_.forEach(result.data, function(data) {
let domain = data.url;
... ... @@ -435,7 +436,7 @@ const _getArticlePre = (id) => {
id: id
}).then((result) => {
if (result && result.code === 200) {
console.log(result);
// console.log(result);
return result;
} else {
logger.error('上一篇不是200');
... ... @@ -566,7 +567,7 @@ const getDetailData = (id) => {
tags: res.tags,
content: result[2],
comment: result[3],
brands: result[4]
brands: result[5]
};
})();
};
... ...
... ... @@ -60,9 +60,6 @@
</div>
</div>
{{!-- {{#if relatedGroup}} --}}
<div class="related-reco related-group">
<div class="article-title">
<div class="title-line"></div>
... ... @@ -77,6 +74,8 @@
{{# relatedGroup}}
{{> related-goods}}
{{/ relatedGroup}}
<span class="left iconfont">&#xe62c;</span>
<span class="right iconfont">&#xe629;</span>
</div>
</div>
{{/ related}}
... ... @@ -101,7 +100,7 @@
</a>
<p class="brand-name">{{name}}</p>
</div>
{{/ brands}}
{{/ brands}}
</div>
</div>
{{/if}}
... ...
... ... @@ -19,6 +19,7 @@ const index = (req, res, next) => {
return next();
}
result.page = 'item';
result.title += ` | ${res.locals.title}`;
res.display('item', result);
}).catch(next);
};
... ...
... ... @@ -17,7 +17,7 @@ const list = {
// 列表页
index: (req, res, next) => {
let q = req.query;
let channel = req.cookies._Channel || 'men';
let channel = req.cookies._Channel || req.query._Channel || 'men';
q.page = parseInt(q.page || 1, 10);
q.order = q.order || 's_n_desc';
... ... @@ -69,9 +69,11 @@ const list = {
// 新品到着
newPage: (req, res, next) => {
let q = req.query;
let channel = req.cookies._Channel || req.query._Channel || 'men';
q.page = parseInt(q.page || 1, 10);
q.order = q.order || 's_n_desc';
q.channel = channel;
let retData = {
module: 'product',
... ... @@ -79,44 +81,45 @@ const list = {
title: '新品'
};
Promise.all([Resouces.newProductBanner(), Search.queryAllSort(), Search.queryNewProduct(q)]).then(result => {
let banner = result[0];
let sortData = camelCase(result[1]);
let listData = result[2];
let nav = [DataHelper.getChannelNav(), {
name: '新品'
}];
retData.banner = banner;
if (listData && listData.code === 200 && listData.data) {
let data = camelCase(listData.data);
if (data.filter) {
data.filter.groupSort = DataHelper.sortConvert(sortData.data.sort);
retData.filter = DataHelper.filterHandle(data.filter, q);
retData.filter.showPrice = data.total > 10;
Promise.all([Resouces.newProductBanner(channel), Search.queryAllSort(),
Search.queryNewProduct(q)]).then(result => {
let banner = result[0];
let sortData = camelCase(result[1]);
let listData = result[2];
let nav = [DataHelper.getChannelNav(), {
name: '新品'
}];
retData.banner = banner;
if (listData && listData.code === 200 && listData.data) {
let data = camelCase(listData.data);
if (data.filter) {
data.filter.groupSort = DataHelper.sortConvert(sortData.data.sort);
retData.filter = DataHelper.filterHandle(data.filter, q);
retData.filter.showPrice = data.total > 10;
}
retData.navPath = {
nav: nav
};
retData.paginationData = {
page: q.page,
limit: data.limit || 45,
total: data.total,
pageTotal: data.pageTotal,
queryParams: q
};
res.display('newList', _.assign(retData, {
products: DataHelper.handleProductList(data.productList, q),
order: q.order
}));
} else {
return Promise.reject('query product error');
}
retData.navPath = {
nav: nav
};
retData.paginationData = {
page: q.page,
limit: data.limit || 45,
total: data.total,
pageTotal: data.pageTotal,
queryParams: q
};
res.display('newList', _.assign(retData, {
products: DataHelper.handleProductList(data.productList, q),
order: q.order
}));
} else {
return Promise.reject('query product error');
}
}).catch(next);
}).catch(next);
}
};
... ...
... ... @@ -169,7 +169,7 @@ const setSeoInfo = (goodInfo, nav) => {
sortName = _.get(nav, '[1].name', '');
return {
title: `${brandName} ${sortName}|${goodInfo.name}正品`,
title: `${brandName} ${sortName} | ${goodInfo.name}正品`,
keywords: `${brandName} ${sortName},${brandName}正品官网专卖店,${brandName}官方授权店,${brandName}正品,` +
`${brandName}打折,${brandName}折扣店,${brandName}真品,${brandName}代购`,
description: _.get(goodInfo, 'share.shareDesc', goodInfo.name)
... ...
... ... @@ -14,10 +14,16 @@ const Resources = {
* 获取新品到着-列表页-banner 资源位
* @returns {Promise.<T>}
*/
newProductBanner() {
newProductBanner(channel) {
let codes = {
men: '3d3127b220073fbcda738c8ba26561e5',
women: '2aaf9519b31d1f21c537032f496e7450',
lifestyle: '422bfdb9b410598e11c3e72bd4ee664e'
};
let params = {
content_code: 'a7989369aa86681c678bc40f171b8f1d'
content_code: codes[channel]
};
return api.get('/operations/api/v5/resource/get', params).then(result => {
... ...
... ... @@ -16,10 +16,10 @@
</div>
<div class="right">
{{!-- 新品banner --}}
{{# banner}}
{{#if banner.src}}
<div class="banner-img"
style="height: 200px;margin-bottom:30px; background:url({{image src 850 200 2}}) no-repeat top center;"></div>
{{/banner}}
style="height: 200px;margin-bottom:30px; background:url({{image banner.src 850 200 2}}) no-repeat top center;"></div>
{{/if}}
{{!-- 已选中条件 --}}
{{#filter}}
{{> list/filter-area}}
... ...
... ... @@ -5,7 +5,7 @@
<ul class="main-nav-list">
{{# navbars}}
<li class="nav-item{{#if cur}} cur{{/if}}">
<a href="{{link}}">
<a href="{{link}}"{{#if isNewPage}} target="_blank"{{/if}}>
<span class="nav-en">{{en}}</span>
<span class="nav-cn">{{cn}}</span>
</a>
... ...
... ... @@ -20,13 +20,27 @@ lazyLoad($('.brand-page img.lazy'));
// 品牌类别滚动事件
$(window).scroll(function() {
var navLength = $('.category-nav').find('a').length + 1;
if ($(this).scrollTop() >= categoryTop) {
$gory.addClass('category-fix');
} else {
$gory.removeClass('category-fix');
}
});
$('.brand-key').each(function(i,ele) {
if($(ele).parent().attr('style')) {
return;
}
if($(ele).offset().top - $(window).scrollTop() < 100) {
var key = $(ele).html().charAt($(ele).html().length - 1);
$('.category-nav').find('.' + key).css('color', '#379ed6').siblings().css('color', '#222');
}
});
});
// 点击字母,页面滚动到相关区域
$category.click(function() {
... ...
... ... @@ -193,3 +193,9 @@ if ($('.collocation').find('.good-info').length === 0) {
if ($('.goods').find('.good-info').length === 0) {
$('.related-group').hide();
}
// $('.left').click(function {
// $('.goods').animate({ left: '+50px' }, "slow");
// })
// console.log($('.goods').offsetWidth()
\ No newline at end of file
... ...
.article-title {
position: relative;
text-align: center;
margin-left: 30px;
width: 933px;
.title-line {
border-bottom: 1px solid #bbb;
... ...
.editorial-detail-page {
width: 940px;
width: 990px;
.detail-body {
width: 936px;
width: 990px;
margin: 0 auto;
overflow: hidden;
/*overflow: hidden;*/
}
.detail-title {
... ... @@ -94,18 +94,57 @@
}
.related-reco {
width: 1000px;
width: 990px;
padding-top: 30px;
overflow: hidden;
position: relative;
.btn {
position: relative;
}
.left {
position: absolute;
display: block;
width: 30px;
height: 50px;
left: 0;
top: 200px;
color: #fff;
background: #ccc;
text-align: center;
line-height: 50px;
}
.left:hover{
background: #7f7f7f;
}
.right:hover{
background: #7f7f7f;
}
.right {
position: absolute;
display: block;
width: 30px;
height: 50px;
right: 0;
top: 200px;
color: #fff;
background: #ccc;
text-align: center;
line-height: 50px;
}
}
.related-goods {
padding-top: 60px;
padding: 60px 0 0 30px;
.good-info {
width: 219px;
float: left;
margin: 0 20px 15px 0;
margin: 0 18px 15px 0;
img {
width: 219px;
... ... @@ -120,6 +159,7 @@
display: block;
text-overflow: ellipsis;
white-space: nowrap;
text-align: center;
}
.price {
... ... @@ -131,6 +171,11 @@
}
}
.goods {
height: 420px;
overflow: hidden;
}
.related-brand {
margin-top: 30px;
... ... @@ -138,8 +183,9 @@
.brands {
width: 950px;
padding: 30px 0;
padding: 30px 0 30px 30px;
overflow: hidden;
}
.brand {
... ... @@ -252,11 +298,12 @@
.article-tag {
float: left;
width: 100%;
width: 940px;
border-top: 1px solid #eee;
border-bottom: 1px solid #eee;
padding: 20px 0;
padding: 20px 0 20px 10px;
overflow: hidden;
margin-left: 30px;
.tag-icon {
float: left;
... ... @@ -302,7 +349,8 @@
line-height: 25px;
border: 1px solid #fff;
overflow: hidden;
width: 100%;
width: 940px;
margin-left: 30px;
a {
color: #afafaf;
... ... @@ -319,6 +367,8 @@
.comment-area {
margin-top: 58px;
width: 935px;
margin-left: 30px;
.comment-publish {
height: 48px;
... ... @@ -467,4 +517,9 @@
display: block;
}
}
.share {
padding-left: 30px;
width: 330px;
}
}
... ...