Commit ea5378749a52b6ecbd04cd3278adfcf11a1d6e96
1 parent
2876b81f
支付尾款的金额合计的优化
Showing
4 changed files
with
44 additions
and
5 deletions
packageA/pages/details_serviceCard/details_serviceCard.js
@@ -73,6 +73,7 @@ Page({ | @@ -73,6 +73,7 @@ Page({ | ||
73 | var dd=res.data.data.pageData[0]; | 73 | var dd=res.data.data.pageData[0]; |
74 | dd.prom_type=dd.list[0].prom_type; | 74 | dd.prom_type=dd.list[0].prom_type; |
75 | dd.pt_status=dd.list[0].pt_status; | 75 | dd.pt_status=dd.list[0].pt_status; |
76 | + dd.pt_tail_money=dd.list[0].pt_tail_money; | ||
76 | 77 | ||
77 | this.setData({ | 78 | this.setData({ |
78 | details: dd, | 79 | details: dd, |
@@ -568,7 +569,12 @@ Page({ | @@ -568,7 +569,12 @@ Page({ | ||
568 | // }) | 569 | // }) |
569 | }, | 570 | }, |
570 | 571 | ||
571 | - | 572 | + //-- 支付尾款 -- |
573 | + pay2(){ | ||
574 | + var url="/packageA/pages/serviceCard_pd/cart_wk/cart_wk?order_id="+this.data.details.order_id; | ||
575 | + getApp().goto(url); | ||
576 | + }, | ||
577 | + | ||
572 | //------调起支付框-------- | 578 | //------调起支付框-------- |
573 | weixinPay: function(n, success, fail) { | 579 | weixinPay: function(n, success, fail) { |
574 | if (!n) return false; | 580 | if (!n) return false; |
packageA/pages/details_serviceCard/details_serviceCard.wxml
@@ -48,7 +48,9 @@ | @@ -48,7 +48,9 @@ | ||
48 | 48 | ||
49 | 49 | ||
50 | <!-- 统计栏 --> | 50 | <!-- 统计栏 --> |
51 | - <view class="t-r bdt pdv20">共{{filter.count(details.list)}}件商品,合计:<text class="rmb c-red bold fs30">{{details.account}}</text></view> | 51 | + <view class="t-r bdt pdv20"> |
52 | + 共{{filter.count(details.list)}}件商品,合计:<text class="rmb c-red bold fs30">{{filter.toFix(details.account+details.pt_tail_money,2) }}</text> | ||
53 | + </view> | ||
52 | </view> | 54 | </view> |
53 | 55 | ||
54 | 56 | ||
@@ -89,6 +91,10 @@ | @@ -89,6 +91,10 @@ | ||
89 | <text class="btn bg-red white mgl20" bindtap="pay">立即支付</text> | 91 | <text class="btn bg-red white mgl20" bindtap="pay">立即支付</text> |
90 | </block> | 92 | </block> |
91 | 93 | ||
94 | + <block wx:if="{{details.pt_status == 2 && details.order_status<2 && details.prom_type==6 && details.pt_tail_money>0 }}"> | ||
95 | + <text class="btn bg-red white mgl20" bindtap="pay2">支付尾款</text> | ||
96 | + </block> | ||
97 | + | ||
92 | <!-- 已支付/未评价 --> | 98 | <!-- 已支付/未评价 --> |
93 | <block wx:if="{{details.order_status == 1 && details.pay_status == 1 }}"> | 99 | <block wx:if="{{details.order_status == 1 && details.pay_status == 1 }}"> |
94 | <text class="btn bg-orange white" bindtap="buy2">再来一单</text> | 100 | <text class="btn bg-orange white" bindtap="buy2">再来一单</text> |
packageA/pages/serviceCard_pd/cart/cart.js
@@ -63,7 +63,10 @@ Page({ | @@ -63,7 +63,10 @@ Page({ | ||
63 | rank_switch: 0, //是不是开同等级卡 | 63 | rank_switch: 0, //是不是开同等级卡 |
64 | show_card: null, //显示的等级卡 | 64 | show_card: null, //显示的等级卡 |
65 | card_name: '', //显示的卡的名称 | 65 | card_name: '', //显示的卡的名称 |
66 | - card_cut_price: null,//减价多少钱 | 66 | + card_cut_price: null,//减价多少钱 |
67 | + | ||
68 | + //dis_config:null, //因为拼团有佣金抵扣 | ||
69 | + //bn_use_commission: 0, //是不是使用佣金 | ||
67 | }, | 70 | }, |
68 | onLoad: function (t) { | 71 | onLoad: function (t) { |
69 | console.log("onLoad_pt_cart"); | 72 | console.log("onLoad_pt_cart"); |
@@ -84,6 +87,8 @@ Page({ | @@ -84,6 +87,8 @@ Page({ | ||
84 | th.data.param = t; | 87 | th.data.param = t; |
85 | //先获取物流,再获取用户信息,再展示页面 | 88 | //先获取物流,再获取用户信息,再展示页面 |
86 | //th.get_wuliu(th.get_info(th.show_page)); | 89 | //th.get_wuliu(th.get_info(th.show_page)); |
90 | + //getApp().is_distribut(this); | ||
91 | + | ||
87 | }, | 92 | }, |
88 | onUnload: function () { this.setData({ isclose: 1 }) }, | 93 | onUnload: function () { this.setData({ isclose: 1 }) }, |
89 | 94 | ||
@@ -188,6 +193,28 @@ Page({ | @@ -188,6 +193,28 @@ Page({ | ||
188 | if (pt_data.kttype == 3) { | 193 | if (pt_data.kttype == 3) { |
189 | t.data.data.shop_price = tt.data.data.yf_price; //用定金来购买 | 194 | t.data.data.shop_price = tt.data.data.yf_price; //用定金来购买 |
190 | } | 195 | } |
196 | + | ||
197 | + //-- 计算获得佣金的金额 -- | ||
198 | + if (getApp().globalData.userInfo.is_distribut | ||
199 | + && th.data.dis_config && th.data.dis_config.is_yongjin_dk) { | ||
200 | + var fir_num = 0; | ||
201 | + var sec_num = 0; | ||
202 | + var thi_num = 0; | ||
203 | + if (th.data.dis_config.pattern == 1) { | ||
204 | + fir_num = (teamlist.fir_rate || 0) * order_goods.goods_num; | ||
205 | + sec_num = (teamlist.sec_rate || 0) * order_goods.goods_num; | ||
206 | + thi_num = (teamlist.thi_rate || 0) * order_goods.goods_num; | ||
207 | + } else { | ||
208 | + fir_num = parseFloat((teamlist.commission || 0) * order_goods.goods_num * (th.data.dis_config.firstRate || 0) / 100).toFixed(2); | ||
209 | + sec_num = parseFloat((teamlist.commission || 0) * order_goods.goods_num * (th.data.dis_config.secondRate || 0) / 100).toFixed(2); | ||
210 | + thi_num = parseFloat((teamlist.commission || 0) * order_goods.goods_num * (th.data.dis_config.thirdRate || 0) / 100).toFixed(2); | ||
211 | + } | ||
212 | + var c_num = getApp().get_commission(fir_num, sec_num, thi_num, th); | ||
213 | + goods.use_commission = parseFloat(c_num.toFixed(2)); | ||
214 | + | ||
215 | + } | ||
216 | + | ||
217 | + | ||
191 | } | 218 | } |
192 | } else { | 219 | } else { |
193 | t.data.data.prom_id = 0; | 220 | t.data.data.prom_id = 0; |
pages/user/order_list/order_list.wxml
@@ -396,7 +396,7 @@ | @@ -396,7 +396,7 @@ | ||
396 | <view class="commodity_money flex baseline"> | 396 | <view class="commodity_money flex baseline"> |
397 | <view>合计<text wx:if="{{item.discount!=underdefine && item.discount!=null && item.discount!=0}}" style="color:#d60021;">(改)</text>:</view> | 397 | <view>合计<text wx:if="{{item.discount!=underdefine && item.discount!=null && item.discount!=0}}" style="color:#d60021;">(改)</text>:</view> |
398 | <view class="fs24 c-r">¥</view> | 398 | <view class="fs24 c-r">¥</view> |
399 | - <view class="c-r">{{filters.toFix(item.account,2)}} | 399 | + <view class="c-r">{{filters.toFix(item.account+item.pt_tail_money,2)}} |
400 | </view> | 400 | </view> |
401 | 401 | ||
402 | </view> | 402 | </view> |
@@ -428,7 +428,7 @@ | @@ -428,7 +428,7 @@ | ||
428 | bindtap="pay" data-index="{{index}}" wx:if="{{item.prom_type==6 && item.pt_status==0 && item.order_status<2}}">立即支付</navigator> | 428 | bindtap="pay" data-index="{{index}}" wx:if="{{item.prom_type==6 && item.pt_status==0 && item.order_status<2}}">立即支付</navigator> |
429 | 429 | ||
430 | <navigator class="commodity_To_evaluate flex-level comment_go" url="/packageA/pages/serviceCard_pd/cart_wk/cart_wk?order_id={{item.order_id}}" | 430 | <navigator class="commodity_To_evaluate flex-level comment_go" url="/packageA/pages/serviceCard_pd/cart_wk/cart_wk?order_id={{item.order_id}}" |
431 | - data-idx="{{index}}" wx:if="{{item.pt_status==2 && item.pt_tail_money>0}}">支付尾款</navigator> | 431 | + data-idx="{{index}}" wx:if="{{item.order_status<2 && item.pt_status==2 && item.pt_tail_money>0}}">支付尾款</navigator> |
432 | 432 | ||
433 | 433 | ||
434 | </view> | 434 | </view> |