...
|
...
|
@@ -144,7 +144,7 @@ exports.handleSaleBannerData = (origin) => { |
|
|
};
|
|
|
|
|
|
/**
|
|
|
* 处理首页 banner 小图 只取前三张
|
|
|
* 处理首页 banner 小图 threePicture楼层和small_pic楼层都去一遍,产品确认只会有一个接口有数据
|
|
|
* @param origin 要处理的原始数据
|
|
|
* @returns {Array}
|
|
|
*/
|
...
|
...
|
@@ -153,9 +153,11 @@ exports.handleSaleBannerSmallData = (origin) => { |
|
|
let count = 0;
|
|
|
|
|
|
_.forEach(origin, function(value) {
|
|
|
|
|
|
if (value.template_name === 'threePicture') {
|
|
|
_.forEach(value.data, function(picList) {
|
|
|
if (count++ < 3) {
|
|
|
console.log(count);
|
|
|
let smallPic = {
|
|
|
link: picList.url,
|
|
|
icon: picList.src,
|
...
|
...
|
@@ -167,6 +169,23 @@ exports.handleSaleBannerSmallData = (origin) => { |
|
|
}
|
|
|
});
|
|
|
}
|
|
|
if (count === 0) {
|
|
|
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;
|
...
|
...
|
|