Authored by zhangxiaoru

brand

{{#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}}
... ...
... ... @@ -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;
}
}
... ...