Authored by 郭成尧

首页小图只取三张

... ... @@ -2,7 +2,7 @@
* @Author: Targaryen
* @Date: 2016-05-25 18:16:59
* @Last Modified by: Targaryen
* @Last Modified time: 2016-06-01 16:44:04
* @Last Modified time: 2016-06-01 17:01:39
*/
'use strict';
... ... @@ -179,8 +179,8 @@ const handleSalebreakingYardsSortData = (origin, params) => {
// 判断是否在这组数据里面
if (!_.isEmpty(_.find(value.sort_id.split(','), o => {
return o === sortParam;
}))) {
return o === sortParam;
}))) {
// 如果在某组数据里面,组合数据退出循环
_.forEach(value.sub, function(subValue) {
... ... @@ -531,47 +531,35 @@ exports.handleSaleBannerData = (origin) => {
});
}
if (value.template_name === 'small_pic') {
_.forEach(value.data, function(picList) {
let smallPic = {};
smallPic.link = picList.url;
smallPic.icon = picList.src;
smallPic.title = picList.title;
smallPic.desc = picList.alt;
dest.list.push(smallPic);
});
}
});
return dest;
};
/**
* 处理首页 banner 小图
* 处理首页 banner 小图 只取前三张
* @param {[type]} origin [description]
* @return {[type]} [description]
*/
exports.handleSaleBannerSmallData = (origin) => {
var dest = [];
let count = 0;
_.forEach(origin, function(value) {
if (value.template_name === 'small_pic') {
_.forEach(value.data, function(picList) {
let smallPic = {};
if (count++ < 3) {
let smallPic = {};
smallPic.link = picList.url;
smallPic.icon = picList.src;
smallPic.title = picList.title;
smallPic.desc = picList.alt;
smallPic.link = picList.url;
smallPic.icon = picList.src;
smallPic.title = picList.title;
smallPic.desc = picList.alt;
dest.push(smallPic);
dest.push(smallPic);
}
});
}
});
return dest;
... ... @@ -724,12 +712,12 @@ exports.handleSalePagerData = (total, params) => {
// 处理上一页下一页
if (currentPage !== 1) {
dest = '<a href="' + handleFilterUrl(params, { page: currentPage - 1 }) +
'"><span class="iconfont">&#xe60e;上一页</span></a>' + dest;
'"><span class="iconfont">&#xe60e;上一页</span></a>' + dest;
}
if (currentPage !== totalPage) {
dest += '<a href="' + handleFilterUrl(params, { page: currentPage + 1 }) +
'"><span class="iconfont">下一页&#xe60c;</span></a>';
'"><span class="iconfont">下一页&#xe60c;</span></a>';
}
return dest;
... ...
... ... @@ -2,7 +2,7 @@
* @Author: Targaryen
* @Date: 2016-05-19 10:20:08
* @Last Modified by: Targaryen
* @Last Modified time: 2016-06-01 11:38:12
* @Last Modified time: 2016-06-01 16:54:20
*/
'use strict';
... ...
... ... @@ -19,7 +19,7 @@ const sale = require(`${cRoot}/sale`);
const outlets = require(`${cRoot}/outlets`);
// 商品促销routers
router.get('/sale/index', sale.index); // sale 首页
router.get('/sale', sale.index); // sale 首页
router.get('/sale/discount/detail', sale.discount); // 折扣专场详情页
router.get('/sale/vip', sale.vip); // VIP 活动专区
router.get('/sale/breakingYards', sale.breakingYards); // 断码区
... ...