Merge branch 'classify' of http://git.yoho.cn/mobile/YH_RNComponent into classify
Showing
1 changed file
with
8 additions
and
4 deletions
@@ -337,13 +337,17 @@ export function getShopCouponList() { | @@ -337,13 +337,17 @@ export function getShopCouponList() { | ||
337 | } | 337 | } |
338 | 338 | ||
339 | function parseCouponList(json) { | 339 | function parseCouponList(json) { |
340 | - if (!json) { | ||
341 | - return []; | ||
342 | - } | ||
343 | 340 | ||
344 | let shopCoupons = []; | 341 | let shopCoupons = []; |
345 | let logShopCoupons = []; | 342 | let logShopCoupons = []; |
346 | 343 | ||
344 | + if (!json) { | ||
345 | + return { | ||
346 | + shopCoupons, | ||
347 | + logShopCoupons, | ||
348 | + }; | ||
349 | + } | ||
350 | + | ||
347 | _.forEach(json, value => { | 351 | _.forEach(json, value => { |
348 | let couPonstatus = parseInt(value.status, 10); | 352 | let couPonstatus = parseInt(value.status, 10); |
349 | 353 | ||
@@ -362,7 +366,7 @@ function parseCouponList(json) { | @@ -362,7 +366,7 @@ function parseCouponList(json) { | ||
362 | }); | 366 | }); |
363 | } | 367 | } |
364 | }); | 368 | }); |
365 | - | 369 | + |
366 | return { | 370 | return { |
367 | shopCoupons, | 371 | shopCoupons, |
368 | logShopCoupons, | 372 | logShopCoupons, |
-
Please register or login to post a comment