Commit 14741ff5313cbbaed3465ef472ec1660dc7f964e

Authored by yvan.ni
1 parent 8b6d72ec

支付成功页面修改,提交订单确认页面

pages/cart/cart2/cart2.js
@@ -789,6 +789,7 @@ Page({ @@ -789,6 +789,7 @@ Page({
789 //--------------如果使用余额--------------------- 789 //--------------如果使用余额---------------------
790 if (th.data.bn_use_money == 1) { 790 if (th.data.bn_use_money == 1) {
791 if (amoney> order_m) { 791 if (amoney> order_m) {
  792 + order_m = order_m.toFixed(2);
792 th.setData({ [txt]: order_m, [txt2]:0,[txt3]:coupon_price }) 793 th.setData({ [txt]: order_m, [txt2]:0,[txt3]:coupon_price })
793 }else{ 794 }else{
794 order_m =parseFloat(order_m - amoney); 795 order_m =parseFloat(order_m - amoney);
pages/payment/pay_success/pay_success.js
@@ -11,6 +11,7 @@ Page({ @@ -11,6 +11,7 @@ Page({
11 order:null, 11 order:null,
12 type:1, 12 type:1,
13 allmoney:0, 13 allmoney:0,
  14 + user_money:0,
14 order_sn:"", 15 order_sn:"",
15 pick:null, 16 pick:null,
16 }, 17 },
@@ -40,9 +41,10 @@ Page({ @@ -40,9 +41,10 @@ Page({
40 for(var i in res.data.data.pageData){ 41 for(var i in res.data.data.pageData){
41 var item=res.data.data.pageData[i]; 42 var item=res.data.data.pageData[i];
42 allmoney+=item.order_amount; 43 allmoney+=item.order_amount;
  44 + user_money += item.user_money;
43 } 45 }
44 order=res.data.data.pageData[0]; 46 order=res.data.data.pageData[0];
45 - th.setData({order:order,type:2,allmoney:allmoney,order_sn:order_sn}) 47 + th.setData({ order: order, type: 2, allmoney: allmoney, order_sn: order_sn, user_money: user_money})
46 }) 48 })
47 } 49 }
48 //--获取门店-- 50 //--获取门店--
pages/payment/pay_success/pay_success.wxml
@@ -2,7 +2,6 @@ @@ -2,7 +2,6 @@
2 <view> 2 <view>
3 <!-- 支付成功提示 --> 3 <!-- 支付成功提示 -->
4 <view class="payradio"> 4 <view class="payradio">
5 -  
6 <!-- 提示框 --> 5 <!-- 提示框 -->
7 <view class="Success_box flex-center"> 6 <view class="Success_box flex-center">
8 <view> 7 <view>
@@ -22,17 +21,21 @@ @@ -22,17 +21,21 @@
22 </view> 21 </view>
23 22
24 <!-- 实付金额 --> 23 <!-- 实付金额 -->
  24 +
25 <view class="payitem flex"> 25 <view class="payitem flex">
26 <view>实付金额 :</view> 26 <view>实付金额 :</view>
27 <!-- {{filters.toFix()}} --> 27 <!-- {{filters.toFix()}} -->
28 <view class="pay_money" wx:if="{{type==1}}">{{filters.toFix(order.order_amount+order.user_money+order.pt_tail_money)}}元</view> 28 <view class="pay_money" wx:if="{{type==1}}">{{filters.toFix(order.order_amount+order.user_money+order.pt_tail_money)}}元</view>
29 - <view class="pay_money" wx:else>{{allmoney}}元</view> 29 + <view class="pay_money" wx:else>{{filters.toFix(allmoney+user_money,2) }}元</view>
30 </view> 30 </view>
31 31
32 <!-- 支付方式 --> 32 <!-- 支付方式 -->
33 <view class="payitem flex"> 33 <view class="payitem flex">
34 - <view>支付方式 :</view>  
35 - <view>微信支付</view> 34 + <view>支付方式 :</view>
  35 + <view wx:if="{{allmoney>0 && user_money>0 }}">微信支付,余额支付</view>
  36 + <view wx:elif="{{allmoney>0}}">微信支付,余额支付</view>
  37 + <view wx:elif="{{user_money>0}}">微信支付,余额支付</view>
  38 + <view wx:else>免单</view>
36 </view> 39 </view>
37 40
38 </view> 41 </view>