Commit 569ffcad02ed9b8331d38e1e16b2f7c65ec0e25b
1 parent
fb571d79
1. 在使用余额的时候的报警
Showing
2 changed files
with
5 additions
and
5 deletions
pages/cart/cart2/cart2.js
... | ... | @@ -1658,10 +1658,10 @@ Page({ |
1658 | 1658 | //--------------如果使用余额--------------------- |
1659 | 1659 | if (th.data.bn_use_money == 1) { |
1660 | 1660 | if (amoney> order_m) { |
1661 | - order_m = order_m.toFixed(2); | |
1661 | + order_m = parseFloat(order_m).toFixed(2); | |
1662 | 1662 | th.setData({ [txt]: order_m, [txt2]:0,[txt3]:coupon_price,show_submit:1 }) |
1663 | 1663 | }else{ |
1664 | - order_m =parseFloat(order_m - amoney); | |
1664 | + order_m =parseFloat(order_m) - parseFloat(amoney); | |
1665 | 1665 | order_m = order_m.toFixed(2); |
1666 | 1666 | th.setData({ [txt]: amoney, [txt2]: order_m,[txt3]:coupon_price,show_submit:1 }) |
1667 | 1667 | } |
... | ... | @@ -1709,10 +1709,10 @@ Page({ |
1709 | 1709 | //--------------如果使用余额--------------------- |
1710 | 1710 | if (th.data.bn_use_money == 1) { |
1711 | 1711 | if (amoney> order_m) { |
1712 | - order_m = order_m.toFixed(2); | |
1712 | + order_m = parseFloat(order_m).toFixed(2); | |
1713 | 1713 | th.setData({ [txt]: order_m, [txt2]:0,[txt3]:coupon_price,show_submit:1 }) |
1714 | 1714 | }else{ |
1715 | - order_m =parseFloat(order_m - amoney); | |
1715 | + order_m =parseFloat(order_m) - parseFloat(amoney); | |
1716 | 1716 | order_m = order_m.toFixed(2); |
1717 | 1717 | th.setData({ [txt]: amoney, [txt2]: order_m,[txt3]:coupon_price,show_submit:1 }) |
1718 | 1718 | } | ... | ... |
pages/cart/cart2_pt/cart2_pt.js
... | ... | @@ -455,7 +455,7 @@ Page({ |
455 | 455 | if ( parseFloat(th.data.yuer) > total_m) { |
456 | 456 | th.setData({ [txt]: total_m, [txt2]:0 }) |
457 | 457 | }else{ |
458 | - order_m = order_m - parseFloat(th.data.yuer); | |
458 | + order_m = parseFloat(order_m) - parseFloat(th.data.yuer); | |
459 | 459 | order_m = order_m.toFixed(2); |
460 | 460 | th.setData({ [txt]: th.data.userinfo.yuer, [txt2]: order_m }) |
461 | 461 | } | ... | ... |