Commit 8ee8acba926b82f0997f47d91ba211526f2da142
Merge branch 'dev' into 'test'
使用佣金的小数店的问题优化 See merge request !1102
Showing
8 changed files
with
20 additions
and
21 deletions
packageC/pages/luckyGo/luckyGo_cart/luckyGo_cart.js
| @@ -2192,11 +2192,10 @@ Page({ | @@ -2192,11 +2192,10 @@ Page({ | ||
| 2192 | var txt4 = "formData.use_commission"; | 2192 | var txt4 = "formData.use_commission"; |
| 2193 | 2193 | ||
| 2194 | if(th.data.bn_use_commission){ | 2194 | if(th.data.bn_use_commission){ |
| 2195 | - order_m=parseFloat(order_m)- parseFloat(th.data.bn_goods.use_commission); | 2195 | + order_m=(parseFloat(order_m)- parseFloat(th.data.bn_goods.use_commission)).toFixed(2); |
| 2196 | th.setData({[txt4]:th.data.bn_goods.use_commission}) | 2196 | th.setData({[txt4]:th.data.bn_goods.use_commission}) |
| 2197 | } | 2197 | } |
| 2198 | 2198 | ||
| 2199 | - | ||
| 2200 | var amoney = parseFloat(th.data.userinfo.user_money - th.data.txmon - th.data.userinfo.frozen_money); | 2199 | var amoney = parseFloat(th.data.userinfo.user_money - th.data.txmon - th.data.userinfo.frozen_money); |
| 2201 | //--------------如果使用余额--------------------- | 2200 | //--------------如果使用余额--------------------- |
| 2202 | if (th.data.bn_use_money == 1) { | 2201 | if (th.data.bn_use_money == 1) { |
| @@ -2257,7 +2256,7 @@ Page({ | @@ -2257,7 +2256,7 @@ Page({ | ||
| 2257 | var txt4= "formData.use_commission"; | 2256 | var txt4= "formData.use_commission"; |
| 2258 | 2257 | ||
| 2259 | if(th.data.bn_use_commission){ | 2258 | if(th.data.bn_use_commission){ |
| 2260 | - order_m=parseFloat(order_m)- parseFloat(th.data.bn_goods.use_commission); | 2259 | + order_m=(parseFloat(order_m)- parseFloat(th.data.bn_goods.use_commission)).toFixed(2); |
| 2261 | th.setData({[txt4]:th.data.bn_goods.use_commission}) | 2260 | th.setData({[txt4]:th.data.bn_goods.use_commission}) |
| 2262 | } | 2261 | } |
| 2263 | 2262 | ||
| @@ -2265,7 +2264,7 @@ Page({ | @@ -2265,7 +2264,7 @@ Page({ | ||
| 2265 | var amoney = parseFloat(th.data.userinfo.user_money - th.data.txmon - th.data.userinfo.frozen_money); | 2264 | var amoney = parseFloat(th.data.userinfo.user_money - th.data.txmon - th.data.userinfo.frozen_money); |
| 2266 | //--------------如果使用余额--------------------- | 2265 | //--------------如果使用余额--------------------- |
| 2267 | if (th.data.bn_use_money == 1) { | 2266 | if (th.data.bn_use_money == 1) { |
| 2268 | - if (amoney > order_m) { | 2267 | + if (amoney > parseFloat(order_m)) { |
| 2269 | order_m = parseFloat(order_m).toFixed(2); | 2268 | order_m = parseFloat(order_m).toFixed(2); |
| 2270 | th.setData({ [txt]: order_m, [txt2]: 0, [txt3]: coupon_price, show_submit: 1 }) | 2269 | th.setData({ [txt]: order_m, [txt2]: 0, [txt3]: coupon_price, show_submit: 1 }) |
| 2271 | } else { | 2270 | } else { |
packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.js
| @@ -796,14 +796,14 @@ Page({ | @@ -796,14 +796,14 @@ Page({ | ||
| 796 | } | 796 | } |
| 797 | 797 | ||
| 798 | if(th.data.bn_use_commission){ | 798 | if(th.data.bn_use_commission){ |
| 799 | - order_m=parseFloat(order_m)- parseFloat(th.data.bn_goods.use_commission); | 799 | + order_m=(parseFloat(order_m)- parseFloat(th.data.bn_goods.use_commission)).toFixed(2); |
| 800 | th.setData({[txt4]:th.data.bn_goods.use_commission}) | 800 | th.setData({[txt4]:th.data.bn_goods.use_commission}) |
| 801 | } | 801 | } |
| 802 | //--------------如果使用余额--------------------- | 802 | //--------------如果使用余额--------------------- |
| 803 | if (th.data.bn_use_money == 1 && th.data.yuer > 0) { | 803 | if (th.data.bn_use_money == 1 && th.data.yuer > 0) { |
| 804 | - if (parseFloat(th.data.yuer) > total_m) { | 804 | + if (parseFloat(th.data.yuer) > parseFloat(order_m)) { |
| 805 | th.setData({ | 805 | th.setData({ |
| 806 | - [txt]: total_m, | 806 | + [txt]: order_m, |
| 807 | [txt2]: 0, | 807 | [txt2]: 0, |
| 808 | is_show_sub:1,sub:0 | 808 | is_show_sub:1,sub:0 |
| 809 | }) | 809 | }) |
packageC/pages/presell/cart/cart.js
| @@ -2206,7 +2206,7 @@ Page({ | @@ -2206,7 +2206,7 @@ Page({ | ||
| 2206 | the_price-=th.data.bn_use_commission; | 2206 | the_price-=th.data.bn_use_commission; |
| 2207 | } | 2207 | } |
| 2208 | 2208 | ||
| 2209 | - th.setData({ exp_price: exp_price, order_m:the_price, show_submit: 1, }) | 2209 | + th.setData({ exp_price: exp_price, order_m:the_price.toFixed(2), show_submit: 1, }) |
| 2210 | } | 2210 | } |
| 2211 | }, | 2211 | }, |
| 2212 | 2212 |
packageC/pages/presell/cart/cart2.js
| @@ -993,14 +993,14 @@ Page({ | @@ -993,14 +993,14 @@ Page({ | ||
| 993 | var txt4 = "formData.use_commission"; | 993 | var txt4 = "formData.use_commission"; |
| 994 | 994 | ||
| 995 | if(th.data.bn_use_commission){ | 995 | if(th.data.bn_use_commission){ |
| 996 | - order_m=parseFloat(order_m)- parseFloat(th.data.bn_goods.use_commission); | 996 | + order_m=(parseFloat(order_m)- parseFloat(th.data.bn_goods.use_commission)).toFixed(2); |
| 997 | th.setData({[txt4]:th.data.bn_goods.use_commission}) | 997 | th.setData({[txt4]:th.data.bn_goods.use_commission}) |
| 998 | } | 998 | } |
| 999 | 999 | ||
| 1000 | var amoney = parseFloat(th.data.userinfo.user_money - th.data.txmon - th.data.userinfo.frozen_money); | 1000 | var amoney = parseFloat(th.data.userinfo.user_money - th.data.txmon - th.data.userinfo.frozen_money); |
| 1001 | //--------------如果使用余额--------------------- | 1001 | //--------------如果使用余额--------------------- |
| 1002 | if (th.data.bn_use_money == 1) { | 1002 | if (th.data.bn_use_money == 1) { |
| 1003 | - if (amoney > order_m) { | 1003 | + if (amoney > parseFloat(order_m)) { |
| 1004 | order_m = parseFloat(order_m).toFixed(2); | 1004 | order_m = parseFloat(order_m).toFixed(2); |
| 1005 | th.setData({ [txt]: order_m, [txt2]: 0, [txt3]: coupon_price, show_submit: 1,dis_btn:0 }) | 1005 | th.setData({ [txt]: order_m, [txt2]: 0, [txt3]: coupon_price, show_submit: 1,dis_btn:0 }) |
| 1006 | } else { | 1006 | } else { |
| @@ -1119,7 +1119,7 @@ Page({ | @@ -1119,7 +1119,7 @@ Page({ | ||
| 1119 | var txt4 = "formData.use_commission"; | 1119 | var txt4 = "formData.use_commission"; |
| 1120 | 1120 | ||
| 1121 | if(th.data.bn_use_commission){ | 1121 | if(th.data.bn_use_commission){ |
| 1122 | - order_m=parseFloat(order_m)- parseFloat(th.data.bn_goods.use_commission); | 1122 | + order_m=(parseFloat(order_m)- parseFloat(th.data.bn_goods.use_commission)).toFixed(2); |
| 1123 | th.setData({[txt4]:th.data.bn_goods.use_commission}) | 1123 | th.setData({[txt4]:th.data.bn_goods.use_commission}) |
| 1124 | } | 1124 | } |
| 1125 | 1125 |
pages/cart/cart2/cart2.js
| @@ -2772,7 +2772,7 @@ Page({ | @@ -2772,7 +2772,7 @@ Page({ | ||
| 2772 | var txt4 = "formData.use_commission"; | 2772 | var txt4 = "formData.use_commission"; |
| 2773 | 2773 | ||
| 2774 | if(th.data.bn_use_commission){ | 2774 | if(th.data.bn_use_commission){ |
| 2775 | - order_m=parseFloat(order_m)- parseFloat(th.data.bn_goods.use_commission); | 2775 | + order_m=(parseFloat(order_m)- parseFloat(th.data.bn_goods.use_commission)).toFixed(2); |
| 2776 | th.setData({[txt4]:th.data.bn_goods.use_commission}) | 2776 | th.setData({[txt4]:th.data.bn_goods.use_commission}) |
| 2777 | } | 2777 | } |
| 2778 | 2778 | ||
| @@ -2781,7 +2781,7 @@ Page({ | @@ -2781,7 +2781,7 @@ Page({ | ||
| 2781 | var amoney = parseFloat(th.data.userinfo.user_money - th.data.txmon - th.data.userinfo.frozen_money); | 2781 | var amoney = parseFloat(th.data.userinfo.user_money - th.data.txmon - th.data.userinfo.frozen_money); |
| 2782 | //--------------如果使用余额--------------------- | 2782 | //--------------如果使用余额--------------------- |
| 2783 | if (th.data.bn_use_money == 1) { | 2783 | if (th.data.bn_use_money == 1) { |
| 2784 | - if (amoney > order_m) { | 2784 | + if (amoney > parseFloat(order_m)) { |
| 2785 | order_m = parseFloat(order_m).toFixed(2); | 2785 | order_m = parseFloat(order_m).toFixed(2); |
| 2786 | th.setData({ [txt]: order_m, [txt2]: 0, [txt3]: coupon_price, show_submit: 1,submit:0 }) | 2786 | th.setData({ [txt]: order_m, [txt2]: 0, [txt3]: coupon_price, show_submit: 1,submit:0 }) |
| 2787 | } else { | 2787 | } else { |
| @@ -2919,7 +2919,7 @@ Page({ | @@ -2919,7 +2919,7 @@ Page({ | ||
| 2919 | var txt4= "formData.use_commission"; | 2919 | var txt4= "formData.use_commission"; |
| 2920 | 2920 | ||
| 2921 | if(th.data.bn_use_commission){ | 2921 | if(th.data.bn_use_commission){ |
| 2922 | - order_m=parseFloat(order_m)- parseFloat(th.data.bn_goods.use_commission); | 2922 | + order_m=(parseFloat(order_m)- parseFloat(th.data.bn_goods.use_commission)).toFixed(2); |
| 2923 | th.setData({[txt4]:th.data.bn_goods.use_commission}) | 2923 | th.setData({[txt4]:th.data.bn_goods.use_commission}) |
| 2924 | } | 2924 | } |
| 2925 | 2925 |
pages/cart/cart2_inte/cart2_inte.js
| @@ -704,15 +704,15 @@ Page({ | @@ -704,15 +704,15 @@ Page({ | ||
| 704 | 704 | ||
| 705 | var txt5 = "formData.use_commission"; | 705 | var txt5 = "formData.use_commission"; |
| 706 | if(th.data.bn_use_commission){ | 706 | if(th.data.bn_use_commission){ |
| 707 | - order_m=parseFloat(order_m)- parseFloat(th.data.bn_goods.use_commission); | 707 | + order_m=(parseFloat(order_m)- parseFloat(th.data.bn_goods.use_commission)).toFixed(2); |
| 708 | th.setData({[txt5]:th.data.bn_goods.use_commission}) | 708 | th.setData({[txt5]:th.data.bn_goods.use_commission}) |
| 709 | } | 709 | } |
| 710 | 710 | ||
| 711 | var amoney = parseFloat(th.data.userinfo.user_money - th.data.txmon - th.data.userinfo.frozen_money); | 711 | var amoney = parseFloat(th.data.userinfo.user_money - th.data.txmon - th.data.userinfo.frozen_money); |
| 712 | //--------------如果使用余额--------------------- | 712 | //--------------如果使用余额--------------------- |
| 713 | if (th.data.bn_use_money == 1) { | 713 | if (th.data.bn_use_money == 1) { |
| 714 | - if (amoney > order_m) { | ||
| 715 | - order_m = order_m.toFixed(2); | 714 | + if (amoney > parseFloat(order_m)) { |
| 715 | + order_m = parseFloat(order_m).toFixed(2); | ||
| 716 | th.setData({ [txt]: order_m, [txt2]: 0, [txt4]: all_integral, show_submit: 1,submit:0 }) | 716 | th.setData({ [txt]: order_m, [txt2]: 0, [txt4]: all_integral, show_submit: 1,submit:0 }) |
| 717 | } else { | 717 | } else { |
| 718 | order_m = parseFloat(order_m - amoney); | 718 | order_m = parseFloat(order_m - amoney); |
pages/cart/cart2_pt/cart2_pt.js
| @@ -717,14 +717,14 @@ Page({ | @@ -717,14 +717,14 @@ Page({ | ||
| 717 | 717 | ||
| 718 | 718 | ||
| 719 | if(th.data.bn_use_commission){ | 719 | if(th.data.bn_use_commission){ |
| 720 | - order_m=parseFloat(order_m)- parseFloat(th.data.bn_goods.use_commission); | 720 | + order_m= (parseFloat(order_m)- parseFloat(th.data.bn_goods.use_commission)).toFixed(2); |
| 721 | th.setData({[txt4]:th.data.bn_goods.use_commission}) | 721 | th.setData({[txt4]:th.data.bn_goods.use_commission}) |
| 722 | } | 722 | } |
| 723 | 723 | ||
| 724 | //--------------如果使用余额--------------------- | 724 | //--------------如果使用余额--------------------- |
| 725 | if (th.data.bn_use_money == 1 && th.data.yuer > 0) { | 725 | if (th.data.bn_use_money == 1 && th.data.yuer > 0) { |
| 726 | - if (parseFloat(th.data.yuer) > total_m) { | ||
| 727 | - th.setData({[txt]: total_m, [txt2]: 0, submit: 0, show_btn: 1}) | 726 | + if (parseFloat(th.data.yuer) > parseFloat(order_m)) { |
| 727 | + th.setData({[txt]: order_m, [txt2]: 0, submit: 0, show_btn: 1}) | ||
| 728 | } else { | 728 | } else { |
| 729 | order_m = parseFloat(order_m) - parseFloat(th.data.yuer); | 729 | order_m = parseFloat(order_m) - parseFloat(th.data.yuer); |
| 730 | order_m = order_m.toFixed(2); | 730 | order_m = order_m.toFixed(2); |
pages/cart/cart2_pt/cart2_pt.wxml
| @@ -134,7 +134,7 @@ | @@ -134,7 +134,7 @@ | ||
| 134 | <view class="set-mes" wx:if="{{bn_goods.use_commission>0 && can_commission && kt_type!=3}}"> | 134 | <view class="set-mes" wx:if="{{bn_goods.use_commission>0 && can_commission && kt_type!=3}}"> |
| 135 | <view class="use-item" bindtap='set_bn_commission' style="padding-left:0;padding-right:0;"> | 135 | <view class="use-item" bindtap='set_bn_commission' style="padding-left:0;padding-right:0;"> |
| 136 | <icon color="{{bn_use_commission?'red':'gray'}}" size="16" type="success"></icon> | 136 | <icon color="{{bn_use_commission?'red':'gray'}}" size="16" type="success"></icon> |
| 137 | - <view class="yu_er">使用余额 :¥{{bn_goods.use_commission}} </view> | 137 | + <view class="yu_er">使用佣金 :¥{{bn_goods.use_commission}} </view> |
| 138 | </view> | 138 | </view> |
| 139 | </view> | 139 | </view> |
| 140 | 140 |