Commit 14381db0504f721334cecaf1e4a792a278c9abf5
1 parent
0ea28205
预存支付成功优化
Showing
2 changed files
with
27 additions
and
6 deletions
pages/payment/pay_success/pay_success.js
@@ -15,6 +15,7 @@ Page({ | @@ -15,6 +15,7 @@ Page({ | ||
15 | user_money:0, | 15 | user_money:0, |
16 | order_sn:"", | 16 | order_sn:"", |
17 | pick:null, | 17 | pick:null, |
18 | + pre_cut:0,//预存金额 | ||
18 | }, | 19 | }, |
19 | 20 | ||
20 | /** | 21 | /** |
@@ -96,7 +97,15 @@ Page({ | @@ -96,7 +97,15 @@ Page({ | ||
96 | th.setData({pick:res.data.data}) | 97 | th.setData({pick:res.data.data}) |
97 | }); | 98 | }); |
98 | }; | 99 | }; |
99 | - | 100 | + //--只使用预存支付,达到免单时要请求预存使用额度---- |
101 | + if(order.order_amount==0 && order.user_money==0){ | ||
102 | + await getApp().request.promiseGet("/api/weshop/orderMore/get/"+ e.globalData.setting.stoid+"/"+order_sn,{1:1}).then(res => { | ||
103 | + if(res.data && res.data.code==0 && res.data.data){ | ||
104 | + let pre_cut=res.data.data.pre_cut | ||
105 | + th.setData({pre_cut}) | ||
106 | + } | ||
107 | + }); | ||
108 | + } | ||
100 | 109 | ||
101 | }; | 110 | }; |
102 | 111 |
pages/payment/pay_success/pay_success.wxml
@@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
2 | <view> | 2 | <view> |
3 | <!-- 支付成功提示 --> | 3 | <!-- 支付成功提示 --> |
4 | <view class="payradio"> | 4 | <view class="payradio"> |
5 | - <!-- 提示框 --> | 5 | + <!-- 提示框 --> |
6 | <view class="Success_box flex-center"> | 6 | <view class="Success_box flex-center"> |
7 | <view> | 7 | <view> |
8 | <view class="flex-center"> | 8 | <view class="flex-center"> |
@@ -29,8 +29,14 @@ | @@ -29,8 +29,14 @@ | ||
29 | <view class="pay_money" wx:if="{{options.card == 1}}">{{filters.toFix(order.account,2) }}元</view> | 29 | <view class="pay_money" wx:if="{{options.card == 1}}">{{filters.toFix(order.account,2) }}元</view> |
30 | 30 | ||
31 | <block wx:else> | 31 | <block wx:else> |
32 | - <view class="pay_money" wx:if="{{type==1}}">{{filters.toFix(order.order_amount+order.user_money+order.pt_tail_money,2)}}元</view> | ||
33 | - <view class="pay_money" wx:else>{{filters.toFix(allmoney+user_money,2) }}元</view> | 32 | + <view class="pay_money" wx:if="{{type==1}}"> |
33 | + <view wx:if="{{order.order_amount==0 && order.user_money==0 && pre_cut>0}}">{{filters.toFix(pre_cut,2)}}元</view> | ||
34 | + <view wx:else>{{filters.toFix(order.order_amount+order.user_money+order.pt_tail_money,2)}}元</view> | ||
35 | + </view> | ||
36 | + <view class="pay_money" wx:else> | ||
37 | + <view wx:if="{{order.order_amount==0 && order.user_money==0 && pre_cut>0}}">{{filters.toFix(pre_cut,2)}}元</view> | ||
38 | + <view wx:else>{{filters.toFix(allmoney+user_money,2) }}元</view> | ||
39 | + </view> | ||
34 | </block> | 40 | </block> |
35 | </view> | 41 | </view> |
36 | 42 | ||
@@ -46,14 +52,20 @@ | @@ -46,14 +52,20 @@ | ||
46 | <view wx:if="{{order.order_amount>0 && order.user_money>0 }}">微信支付,余额支付</view> | 52 | <view wx:if="{{order.order_amount>0 && order.user_money>0 }}">微信支付,余额支付</view> |
47 | <view wx:elif="{{order.order_amount>0}}">微信支付</view> | 53 | <view wx:elif="{{order.order_amount>0}}">微信支付</view> |
48 | <view wx:elif="{{order.user_money>0}}">余额支付</view> | 54 | <view wx:elif="{{order.user_money>0}}">余额支付</view> |
49 | - <view wx:else>免单</view> | 55 | + <view wx:else> |
56 | + <view wx:if="{{pre_cut>0}}">预存抵扣</view> | ||
57 | + <view wx:else>免单</view> | ||
58 | + </view> | ||
50 | </view> | 59 | </view> |
51 | <view class="payitem flex" wx:else> | 60 | <view class="payitem flex" wx:else> |
52 | <view>支付方式 :</view> | 61 | <view>支付方式 :</view> |
53 | <view wx:if="{{allmoney>0 && user_money>0 }}">微信支付,余额支付</view> | 62 | <view wx:if="{{allmoney>0 && user_money>0 }}">微信支付,余额支付</view> |
54 | <view wx:elif="{{allmoney>0}}">微信支付</view> | 63 | <view wx:elif="{{allmoney>0}}">微信支付</view> |
55 | <view wx:elif="{{user_money>0}}">余额支付</view> | 64 | <view wx:elif="{{user_money>0}}">余额支付</view> |
56 | - <view wx:else>免单</view> | 65 | + <view wx:else> |
66 | + <view wx:if="{{pre_cut>0}}">预存抵扣</view> | ||
67 | + <view wx:else>免单</view> | ||
68 | + </view> | ||
57 | </view> | 69 | </view> |
58 | </block> | 70 | </block> |
59 | 71 |