ycm 2 tahun lalu
induk
melakukan
a1bcfab29f
3 mengubah file dengan 45 tambahan dan 10 penghapusan
  1. 25 0
      pages/error/jiesuan/index.js
  2. 11 10
      pages/error/jiesuan/index.wxml
  3. 9 0
      utils/convertUtil.wxs

+ 25 - 0
pages/error/jiesuan/index.js

@@ -49,6 +49,31 @@ Page({
             console.log(222);
         })
     },
+    goover(){
+        let that = this;
+        app.api.useApi(app.globalData.baseAppUrl + "api/admin/sorting/entry/abnormal_end", {
+            id:that.data.id
+        }, "post").then(function (res) {
+            if (res.code != 200) {
+                wx.showLoading({
+                    title: res.message.msg,
+                })
+                setTimeout(() => {
+                    wx.hideLoading();
+                }, 2000);
+            } else {
+                wx.showLoading({
+                    title: '成功',
+                })
+                setTimeout(() => {
+                    wx.navigateBack()
+                }, 2000);
+            }
+
+        }).catch(function (err) {
+            console.log(222);
+        })
+    },
     changep(e){
         this.setData({updateprive:e.detail.value})
         console.log(e.detail.value)

+ 11 - 10
pages/error/jiesuan/index.wxml

@@ -1,4 +1,5 @@
 <!--pages/error/jiesuan/index.wxml-->
+<wxs module="dateUtil" src="../../../utils/convertUtil.wxs"></wxs>
 <view class="centerdispley header_view">
     <image src="../../../image/ycm/07.png" class="header_icon"></image>此单需人工结算
 </view>
@@ -129,37 +130,37 @@
         <view>
             <view class="display-between">
                 <view>用户下单金额</view>
-                <view>¥{{info.total_price}}</view>
+                <view>¥{{dateUtil.toFix(info.total_price)}}</view>
             </view>
             <view class="display-between">
                 <view>优惠券</view>
-                <view>-¥{{info.coupon_money}}</view>
+                <view>-¥{{dateUtil.toFix(info.coupon_money)}}</view>
             </view>
             <view class="display-between">
                 <view>实际支付(不含运费)</view>
-                <view>¥{{info.total_price - info.freight}}</view>
+                <view>¥{{dateUtil.toFix(info.total_price - info.freight)}}</view>
             </view>
         </view>
         <view>
             <view class="display-between">
                 <view>实际清洗费用</view>
-                <view>¥{{info.order_price}}</view>
+                <view>¥{{dateUtil.toFix(info.order_price)}}</view>
             </view>
             <view class="display-between">
                 <view>优惠券</view>
-                <view>-¥{{info.coupon_money}}</view>
+                <view>-¥{{dateUtil.toFix(info.coupon_money)}}</view>
             </view>
             <view class="display-between">
                 <view>实际应付</view>
-                <view>¥{{info.order_price - info.coupon_money}}</view>
+                <view>¥{{dateUtil.toFix(info.order_price - info.coupon_money)}}</view>
             </view>
         </view>
     </view>
     <view class="centerdispley item_two_three">
-        <view wx:if="{{(info.order_price - info.coupon_money) - (info.total_price - info.freight)>=0}}">实际应付金额:{{(info.order_price - info.coupon_money) - (info.total_price - info.freight)}}</view>
+        <view wx:if="{{(info.order_price - info.coupon_money) - (info.total_price - info.freight)>=0}}">实际应付金额:{{dateUtil.toFix((info.order_price - info.coupon_money) - (info.total_price - info.freight))}}</view>
         <view wx:else>实际应付金额:0</view>
         <view bindtap="changeisprice">修改金额</view>
-        <view wx:if="{{(info.order_price - info.coupon_money) - (info.total_price - info.freight)<0}}">退给用户 {{(info.total_price - info.freight) - (info.order_price - info.coupon_money)}}</view>
+        <view wx:if="{{(info.order_price - info.coupon_money) - (info.total_price - info.freight)<0}}">退给用户 {{dateUtil.toFix((info.total_price - info.freight) - (info.order_price - info.coupon_money))}}</view>
         <view wx:else>退给用户 0</view>
     </view>
 </view>
@@ -167,7 +168,7 @@
 <view class="bottom_view">
   <view bindtap="goback">暂不处理</view>
   <view bindtap="gophone"><image src="../../../image/ycm/05.png" class="bottom_icon"></image>联系用户</view>
-  <view>完结</view>
+  <view bindtap="goover">完结</view>
 </view>
 
 <!-- 弹窗 -->
@@ -175,7 +176,7 @@
     <view class="popup_item">
         <view class="centerdispley">
             <view>{{typelist[choosetype]}}金额</view>
-            <view><input type="number" value="{{updateprive}}" bindinput="changep" class="input_view" placeholder="请输入.."/></view>
+            <view><input type="number" value="{{dateUtil.toFix(updateprive)}}" bindinput="changep" class="input_view" placeholder="请输入.."/></view>
         </view>
         <view class="display-between">
             <view class="centerdispley" bindtap="changeisprice">取消</view>

+ 9 - 0
utils/convertUtil.wxs

@@ -0,0 +1,9 @@
+var filters = {
+    toFix: function (value) {
+      return Number(value).toFixed(2)//此处2为保留两位小数
+    }
+  }
+  
+  module.exports = {
+    toFix: filters.toFix
+  }