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 | 15 | user_money:0, |
| 16 | 16 | order_sn:"", |
| 17 | 17 | pick:null, |
| 18 | + pre_cut:0,//预存金额 | |
| 18 | 19 | }, |
| 19 | 20 | |
| 20 | 21 | /** |
| ... | ... | @@ -96,7 +97,15 @@ Page({ |
| 96 | 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 | 2 | <view> |
| 3 | 3 | <!-- 支付成功提示 --> |
| 4 | 4 | <view class="payradio"> |
| 5 | - <!-- 提示框 --> | |
| 5 | + <!-- 提示框 --> | |
| 6 | 6 | <view class="Success_box flex-center"> |
| 7 | 7 | <view> |
| 8 | 8 | <view class="flex-center"> |
| ... | ... | @@ -29,8 +29,14 @@ |
| 29 | 29 | <view class="pay_money" wx:if="{{options.card == 1}}">{{filters.toFix(order.account,2) }}元</view> |
| 30 | 30 | |
| 31 | 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 | 40 | </block> |
| 35 | 41 | </view> |
| 36 | 42 | |
| ... | ... | @@ -46,14 +52,20 @@ |
| 46 | 52 | <view wx:if="{{order.order_amount>0 && order.user_money>0 }}">微信支付,余额支付</view> |
| 47 | 53 | <view wx:elif="{{order.order_amount>0}}">微信支付</view> |
| 48 | 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 | 59 | </view> |
| 51 | 60 | <view class="payitem flex" wx:else> |
| 52 | 61 | <view>支付方式 :</view> |
| 53 | 62 | <view wx:if="{{allmoney>0 && user_money>0 }}">微信支付,余额支付</view> |
| 54 | 63 | <view wx:elif="{{allmoney>0}}">微信支付</view> |
| 55 | 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 | 69 | </view> |
| 58 | 70 | </block> |
| 59 | 71 | ... | ... |