Authored by 梁志锋

Merge remote-tracking branch 'remotes/origin/feature/sale'

... ... @@ -144,30 +144,55 @@ exports.handleSaleBannerData = (origin) => {
};
/**
* 处理首页 banner 小图 只取前三张
* 处理首页 banner 小图 threePicture楼层和small_pic楼层都去一遍,产品确认只会有一个接口有数据
* @param origin 要处理的原始数据
* @returns {Array}
*/
exports.handleSaleBannerSmallData = (origin) => {
let dest = [];
let count = 0;
let hasThreePic = false;
_.forEach(origin, function(value) {
if (value.template_name === 'threePicture') {
_.forEach(value.data, function(picList) {
if (count++ < 3) {
let smallPic = {
link: picList.url,
icon: picList.src,
title: picList.title,
desc: picList.alt
};
dest.push(smallPic);
}
});
hasThreePic = true;
}
});
_.forEach(origin, function(value) {
if (hasThreePic) {
if (value.template_name === 'threePicture') {
_.forEach(value.data, function(picList) {
if (count++ < 3) {
let smallPic = {
link: picList.url,
icon: picList.src,
title: picList.title,
desc: picList.alt
};
dest.push(smallPic);
}
});
}
} else {
if (value.template_name === 'small_pic') {
_.forEach(value.data, function(picList) {
if (count++ < 4) {
let smallPic = {
link: picList.url,
icon: picList.src,
title: picList.title,
desc: picList.alt
};
dest.push(smallPic);
}
});
}
}
});
return dest;
};
... ...
... ... @@ -32,7 +32,7 @@
<a class="item pull-left" href="{{link}}" target= "_blank">
<img class="pic" src="{{image img 350 350}}">
<div class="detail">
<div class="title">{{title}}{{discount}}{{discountText}}</div>
<div class="title">{{title}}</div>
<div class="time">{{time}}</div>
</div>
</a>
... ...
... ... @@ -389,3 +389,13 @@ $('.senior-sub').on('click', '.multi-select', function() {
}).on('mouseleave', function() {
hideSeniorPanel();
});
// 资源位三张四张样式调整
(function rejustActivityEntryDisplay() {
var activityEntryNumb = $('.activity-entry').find('a').length,
activityItemWidth = (1150 - (activityEntryNumb - 1) * 10) / activityEntryNumb;
$('.activity-entry .entry-item').css('width', activityItemWidth);
}());
... ...
... ... @@ -85,19 +85,13 @@
.activity-entry {
margin: 10px 0;
width: 1170px;
width: 1150px;
.entry-item {
display: block;
width: 376px;
margin-right: 10px;
background: #f5f5f5;
&.first,
&.last {
width: 376px;
}
&.last {
margin-right: 0;
}
... ...