Showing
1 changed file
with
9 additions
and
1 deletions
@@ -151,9 +151,17 @@ exports.handleSaleBannerData = (origin) => { | @@ -151,9 +151,17 @@ exports.handleSaleBannerData = (origin) => { | ||
151 | exports.handleSaleBannerSmallData = (origin) => { | 151 | exports.handleSaleBannerSmallData = (origin) => { |
152 | let dest = []; | 152 | let dest = []; |
153 | let count = 0; | 153 | let count = 0; |
154 | + let hasThreePic = false; | ||
154 | 155 | ||
155 | _.forEach(origin, function(value) { | 156 | _.forEach(origin, function(value) { |
157 | + if (value.template_name === 'threePicture'){ | ||
158 | + hasThreePic = true; | ||
159 | + } | ||
160 | + }); | ||
161 | +console.log(hasThreePic); | ||
162 | + _.forEach(origin, function(value) { | ||
156 | 163 | ||
164 | + if (hasThreePic) { | ||
157 | if (value.template_name === 'threePicture') { | 165 | if (value.template_name === 'threePicture') { |
158 | _.forEach(value.data, function(picList) { | 166 | _.forEach(value.data, function(picList) { |
159 | if (count++ < 3) { | 167 | if (count++ < 3) { |
@@ -169,7 +177,7 @@ exports.handleSaleBannerSmallData = (origin) => { | @@ -169,7 +177,7 @@ exports.handleSaleBannerSmallData = (origin) => { | ||
169 | } | 177 | } |
170 | }); | 178 | }); |
171 | } | 179 | } |
172 | - if (count === 0) { | 180 | + } else { |
173 | if (value.template_name === 'small_pic') { | 181 | if (value.template_name === 'small_pic') { |
174 | _.forEach(value.data, function(picList) { | 182 | _.forEach(value.data, function(picList) { |
175 | if (count++ < 4) { | 183 | if (count++ < 4) { |
-
Please register or login to post a comment