From 8b791d826a0de99112b48964bba81b4ea3a1b74f Mon Sep 17 00:00:00 2001 From: donqi Date: Mon, 12 Sep 2022 14:50:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=85=E6=8E=A5=E5=8D=95=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=8B=92=E7=BB=9D=E6=8E=A5=E5=8D=95=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/js/request.js | 12 +++++++-- pages/order-manage/order-manage.vue | 40 ++++++++++++++++++++++++++++- 2 files changed, 49 insertions(+), 3 deletions(-) diff --git a/common/js/request.js b/common/js/request.js index bc68785..3f78cbc 100644 --- a/common/js/request.js +++ b/common/js/request.js @@ -13,8 +13,8 @@ export default { }) let userInfo = _this.getCurUserInfo(); // request 触发前拼接 url - // args.url = 'https://www.opsoul.com' + args.url; - args.url = 'http://127.0.0.1:80' + args.url; + args.url = 'https://www.opsoul.com' + args.url; + // args.url = 'http://127.0.0.1:80' + args.url; // args.url = 'http://192.168.2.42:80' + args.url; if (!args.data) { @@ -598,5 +598,13 @@ export default { data: params }) return res[1].data; + }, + async rejectDetailOrder(params = {}) { + let res = await uni.request({ + url: '/order/detail/app/order/reject', + method: 'POST', + data: params + }) + return res[1].data; } } diff --git a/pages/order-manage/order-manage.vue b/pages/order-manage/order-manage.vue index df41d35..71ac496 100644 --- a/pages/order-manage/order-manage.vue +++ b/pages/order-manage/order-manage.vue @@ -136,7 +136,8 @@ - + + @@ -832,6 +833,43 @@ isAll: 1 } return await this.assignWork(params); + }, + async rejectMasterOrder(order) { + let res = await this.$request.updateOrder({ + id: order.orderMasterId, + workerId: -1 + }); + if (res && res.code === 0) { + this.reloadMasterOrderPage(); + uni.showToast({ + icon: 'none', + title: '拒绝接单成功', + duration: 1000 + }) + } else { + uni.showToast({ + icon: 'none', + title: '拒绝接单失败' + }) + } + }, + async rejectDetailOrder(order) { + let res = await this.$request.rejectDetailOrder({ + id: order.orderDetailId + }); + if (res && res.code === 0) { + this.reloadMasterOrderPage(); + uni.showToast({ + icon: 'none', + title: '拒绝接单成功', + duration: 1000 + }) + } else { + uni.showToast({ + icon: 'none', + title: '拒绝接单失败' + }) + } } } }