From ed06392a80ac3c9cbc0d66ef2124e39156359e9f Mon Sep 17 00:00:00 2001 From: donqi Date: Thu, 6 Oct 2022 03:06:21 +0800 Subject: [PATCH] =?UTF-8?q?=E9=97=AE=E9=A2=98fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/js/request.js | 23 ++++- .../components/modal/apply-after-service.vue | 36 +++++++- pages/my/serv-detail.vue | 90 ++++++++++--------- 3 files changed, 103 insertions(+), 46 deletions(-) diff --git a/common/js/request.js b/common/js/request.js index a4022a6..fcf4f6b 100644 --- a/common/js/request.js +++ b/common/js/request.js @@ -603,6 +603,19 @@ export default { }) return res[1].data; }, + async delAfterServiceRecord(ids) { + let res = await uni.request({ + url: '/worker/record/remove', + method: 'POST', + data: { + ids: ids + }, + header: { + 'content-type': 'application/x-www-form-urlencoded' + } + }) + return res[1].data; + }, async getOrderAfterServiceRecords(params = {}) { let res = await uni.request({ url: '/worker/record/app/list', @@ -622,5 +635,13 @@ export default { } }) return res[1].data; - } + }, + async getChangeOrderPrice(params = {}) { + let res = await uni.request({ + url: '/order/detail/app/getChangePrice', + method: 'POST', + data: params + }) + return res[1].data; + }, } diff --git a/pages/my/components/modal/apply-after-service.vue b/pages/my/components/modal/apply-after-service.vue index 0f5adcd..5ee2b4e 100644 --- a/pages/my/components/modal/apply-after-service.vue +++ b/pages/my/components/modal/apply-after-service.vue @@ -20,9 +20,13 @@ v-model="customerReasonType"> - + + 最大可退款金额: + {{detailObj ? detailObj.payMoney : 0}} + + 退款金额: - + 具体原因: @@ -152,7 +156,30 @@ } }) }, + validData() { + let errMsg = null; + if (!this.detailObj) { + errMsg = "请选择子单"; + } else if (this.refund == null) { + errMsg = "退款金额不能为空"; + } else if (this.refund > this.detailObj.payMoney) { + errMsg = "不可超出最大退款金额"; + } + if (errMsg) { + uni.showToast({ + title: errMsg, + duration: 1500, + icon: 'none' + }) + return false; + } + return true; + }, async apply() { + if (!this.validData()) { + return; + } + let imgObjList = []; this.imgList.forEach(url => { imgObjList.push({ @@ -181,8 +208,9 @@ } if (updateStatusRes && updateStatusRes.code === 0) { uni.showToast({ - icon: 'success', - duration: 1000 + title: '已发起售后,进度可在订单详情内查看', + icon: 'none', + duration: 2000 }) this.hideModal(); this.$emit('confirmFeedback'); diff --git a/pages/my/serv-detail.vue b/pages/my/serv-detail.vue index f1ad9fb..3d367ae 100644 --- a/pages/my/serv-detail.vue +++ b/pages/my/serv-detail.vue @@ -94,7 +94,7 @@ v-for="(item, index) in servDetail.orderStandardDetailList"> - 施工记录 + 服务记录 编码:{{item.orderDetailCode}} @@ -131,9 +131,12 @@ - - 客户发起 - + + 客户发起 + + + 退单退款已提交至商家,其最大时限24小时内需完成操作! 退款申请: - + + 售后已提交至商家,其最大时限24小时内需完成操作! 待处理售后: - +