Browse Source

增加订单的验货超时和买亏必赔的操作

ylong 8 months ago
parent
commit
d3aa0adfda
2 changed files with 75 additions and 1 deletions
  1. 1 1
      .env.dev.js
  2. 74 0
      pages-mine/pages/order-detail.vue

+ 1 - 1
.env.dev.js

@@ -1,5 +1,5 @@
 export default {
     "NODE_ENV": 'development',
-    "apiUrl":"https://bpi.shuhi.com",
+    "apiUrl":"https://bk.shuhi.com",
     "apiUrlPrefix":"/api",
 };

+ 74 - 0
pages-mine/pages/order-detail.vue

@@ -73,6 +73,10 @@
         <view class="bottom-fixed-con detail-bottom flex-d">
             <service-info :firstOrder="orderInfo.firstOrder"></service-info>
             <view class="flex-a" style="width: 100%;padding: 0 30rpx;">
+                <u-button type="warning" @click="handleOpenOverTime" v-if="orderInfo.confirmCompensationMoney" style="margin-right: 10px;">验货超时补偿</u-button>
+                <u-button type="warning" @click="handleOpenSellLoss" v-if="orderInfo.priceCompensationMoney">卖亏必赔</u-button>
+
+
                 <order-actions size="large" :order="orderInfo" :status="orderInfo.status" @action="handleAction"
                     style="width: 100%;" @success="getOrderInfo"></order-actions>
             </view>
@@ -98,6 +102,19 @@
         <CommonDialog ref="recycleWare" title="是否仓库循环处理" @confirm="handleRecycleWareConfirm">
             感谢您对环保事业的支持,仓库将循环处理
         </CommonDialog>
+
+        <CommonDialog ref="overTimeDialog" title="验货超时补偿" @confirm="handleOverTimeConfirm" :showFooter="false">
+            <view class="flex-a flex-j-b" style="padding:40rpx 0;">
+                <u-button class="confirm-btn" type="success" @click="handleOverTimeConfirm">补贴 ¥{{ orderInfo.confirmCompensationMoney || 0 }} 到余额</u-button>
+                <u-button class="confirm-btn" type="warning" @click="handleCloseOverTime">原谅你了</u-button>
+            </view>
+        </CommonDialog>
+        <CommonDialog ref="sellLossDialog" title="卖亏必赔" @confirm="handleSellLossConfirm" :showFooter="false">
+            <view class="flex-a flex-j-b" style="padding:40rpx 0;">
+                <u-button class="confirm-btn" type="success" @click="handleSellLossConfirm">补贴 ¥{{ orderInfo.priceCompensationMoney || 0 }} 到余额</u-button>
+                <u-button class="confirm-btn" type="warning" @click="handleCloseSellLoss">原谅你了</u-button>
+            </view>
+        </CommonDialog>
     </view>
 </template>
 
@@ -214,6 +231,63 @@ export default {
                 url: `/pages-mine/pages/apply?orderId=${this.orderInfo.orderId}`
             })
             this.closeDialog()
+        },
+
+        //验货超时补偿
+        handleOpenOverTime() {
+            this.$refs.overTimeDialog?.openPopup()
+        },
+        //卖亏必赔
+        handleOpenSellLoss() {
+            this.$refs.sellLossDialog?.openPopup()
+        },
+        //验货超时补偿确认
+        handleOverTimeConfirm() {
+            uni.$u.http.post('/token/order/confirmCompensation/submit', {
+                orderId: this.orderInfo.orderId
+            }).then(res => {
+                if (res.code === 200) {
+                    this.$refs.overTimeDialog?.closePopup()
+                    uni.$u.toast('验货超时补偿申请成功')
+                    this.getOrderInfo(this.orderInfo.orderId)
+                }
+            })
+        },
+        //验货超时补偿取消
+        handleCloseOverTime() {
+            uni.$u.http.post('/token/order/confirmCompensation/abandon', {
+                orderId: this.orderInfo.orderId
+            }).then(res => {
+                if (res.code === 200) {
+                    this.$refs.overTimeDialog?.closePopup()
+                    uni.$u.toast('操作成功')
+                    this.getOrderInfo(this.orderInfo.orderId)
+                }
+            })
+        },
+        //卖亏必赔确认
+        handleSellLossConfirm() {
+            uni.$u.http.post('/token/order/priceCompensation/submit', {
+                orderId: this.orderInfo.orderId
+            }).then(res => {
+                if (res.code === 200) {
+                    this.$refs.sellLossDialog?.closePopup()
+                    uni.$u.toast('卖亏必赔申请成功')
+                    this.getOrderInfo(this.orderInfo.orderId)
+                }
+            })
+        },
+        //卖亏必赔取消
+        handleCloseSellLoss() {
+            uni.$u.http.post('/token/order/priceCompensation/abandon', {
+                orderId: this.orderInfo.orderId
+            }).then(res => {
+                if (res.code === 200) {
+                    this.$refs.sellLossDialog?.closePopup()
+                    uni.$u.toast('操作成功')
+                    this.getOrderInfo(this.orderInfo.orderId)
+                }
+            })
         }
     }
 }