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';
... ... @@ -531,36 +531,24 @@ 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) {
if (count++ < 3) {
let smallPic = {};
smallPic.link = picList.url;
... ... @@ -569,9 +557,9 @@ exports.handleSaleBannerSmallData = (origin) => {
smallPic.desc = picList.alt;
dest.push(smallPic);
}
});
}
});
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); // 断码区
... ...