...
|
...
|
@@ -151,9 +151,17 @@ exports.handleSaleBannerData = (origin) => { |
|
|
exports.handleSaleBannerSmallData = (origin) => {
|
|
|
let dest = [];
|
|
|
let count = 0;
|
|
|
let hasThreePic = false;
|
|
|
|
|
|
_.forEach(origin, function(value) {
|
|
|
if (value.template_name === 'threePicture'){
|
|
|
hasThreePic = true;
|
|
|
}
|
|
|
});
|
|
|
console.log(hasThreePic);
|
|
|
_.forEach(origin, function(value) {
|
|
|
|
|
|
if (hasThreePic) {
|
|
|
if (value.template_name === 'threePicture') {
|
|
|
_.forEach(value.data, function(picList) {
|
|
|
if (count++ < 3) {
|
...
|
...
|
@@ -169,7 +177,7 @@ exports.handleSaleBannerSmallData = (origin) => { |
|
|
}
|
|
|
});
|
|
|
}
|
|
|
if (count === 0) {
|
|
|
} else {
|
|
|
if (value.template_name === 'small_pic') {
|
|
|
_.forEach(value.data, function(picList) {
|
|
|
if (count++ < 4) {
|
...
|
...
|
|