优化优惠券逻辑 review by bevishuang
Showing
1 changed file
with
1 additions
and
1 deletions
@@ -32,7 +32,7 @@ Component({ | @@ -32,7 +32,7 @@ Component({ | ||
32 | let itemCode = item && item.coupon_code || ''; | 32 | let itemCode = item && item.coupon_code || ''; |
33 | let itemAmount = item && item.coupon_value_str || ''; | 33 | let itemAmount = item && item.coupon_value_str || ''; |
34 | itemCode && code.push(itemCode); | 34 | itemCode && code.push(itemCode); |
35 | - amount = itemAmount && parseFloat(itemAmount) + amount; | 35 | + amount = (itemAmount ? parseFloat(itemAmount) : 0) + amount; |
36 | }) | 36 | }) |
37 | code = code.join(','); | 37 | code = code.join(','); |
38 | this.triggerEvent('confirmselect', { code, amount}) | 38 | this.triggerEvent('confirmselect', { code, amount}) |
-
Please register or login to post a comment