ycm 2 anos atrás
pai
commit
8ec7441453

+ 42 - 2
pages/error/jiesuan/index.js

@@ -9,7 +9,9 @@ Page({
         id: 0,
         isprice: false,
         info: '',
-        updateprive: 0
+        updateprive: 0,
+        choosetype: 0,
+        typelist:['应付','退款'],
     },
 
     /**
@@ -61,7 +63,45 @@ Page({
     },
     changeisprice(){
         let that = this
-        that.setData({isprice:!that.data.isprice})
+        if(that.data.isprice){
+            that.setData({isprice:!that.data.isprice})
+        }else{
+            wx.showActionSheet({
+                itemList: that.data.typelist,
+                success (res) {
+                  that.setData({choosetype: res.tapIndex,isprice:!that.data.isprice})
+                }
+            })
+        }
+    },
+    goconfirm(){
+        let that = this;
+        app.api.useApi(app.globalData.baseAppUrl + "api/admin/sorting/entry/abnormal_submit", {
+            id:that.data.id,
+            type:that.data.choosetype+1,
+            price:that.data.updateprive
+        }, "post").then(function (res) {
+            if (res.code != 200) {
+                console.log(res.message.msg)
+                wx.showLoading({
+                    title: res.message.msg,
+                })
+                setTimeout(() => {
+                    wx.hideLoading();
+                    that.changeisprice()
+                }, 2000);
+            } else {
+                wx.showLoading({
+                    title: '成功',
+                })
+                setTimeout(() => {
+                    wx.navigateBack()
+                }, 2000);
+            }
+
+        }).catch(function (err) {
+            console.log(222);
+        })
     },
 
     /**

+ 3 - 3
pages/error/jiesuan/index.wxml

@@ -157,7 +157,7 @@
     </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>实际应付金额:0</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:else>退给用户 0</view>
@@ -174,12 +174,12 @@
 <view class="centerdispley popup_view" wx:if="{{isprice}}">
     <view class="popup_item">
         <view class="centerdispley">
-            <view>修改实际应付金额</view>
+            <view>{{typelist[choosetype]}}金额</view>
             <view><input type="number" value="{{updateprive}}" bindinput="changep" class="input_view" placeholder="请输入.."/></view>
         </view>
         <view class="display-between">
             <view class="centerdispley" bindtap="changeisprice">取消</view>
-            <view class="centerdispley" bindtap="changeisprice">确定</view>
+            <view class="centerdispley" bindtap="goconfirm">确定</view>
         </view>
     </view>
 </view>

+ 7 - 0
project.private.config.json

@@ -193,6 +193,13 @@
                     "launchMode": "default",
                     "scene": null
                 },
+                {
+                    "name": "异常单",
+                    "pathName": "pages/error/yichang/index",
+                    "query": "",
+                    "launchMode": "default",
+                    "scene": null
+                },
                 {
                     "name": "异常单",
                     "pathName": "pages/error/yichang/index",