From 18a5f1e2e90d235ee3adea299f2aebb1f84e05dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=AE=BF=E6=98=95?= Date: Thu, 12 Nov 2020 19:48:18 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E8=AF=A6=E6=83=85=E8=AF=84?= =?UTF-8?q?=E4=BB=B7=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/user/order/order_detail.vue | 54 ++++++++++++++++++++++++++- 1 file changed, 52 insertions(+), 2 deletions(-) diff --git a/src/pages/user/order/order_detail.vue b/src/pages/user/order/order_detail.vue index ad15357..37f751c 100644 --- a/src/pages/user/order/order_detail.vue +++ b/src/pages/user/order/order_detail.vue @@ -623,8 +623,58 @@ export default { }, methods: { addEvaluation() { - console.log(this.serviceRate, this.textarea); - this.visible = false; + if (this.textarea == "" || this.serviceRate == null) { + this.$message({ + message: "请先完善评价内容", + type: "error", + }); + } else { + if (this.orderDetail.order_type == 1) { + let query = { + service_id: this.orderDetail.service_id, + content: this.textarea, + score: this.serviceRate, + apply_id: this.orderDetail.apply_id, + }; + this.$api.user.addServiceEvaluation(query).then((response) => { + if (response.data.success == 1) { + this.$message({ + message: "评价订单成功", + type: "success", + }); + this.visible = false; + this.getOrderDetail(); + } else { + this.$message({ + message: "评价订单失败", + type: "error", + }); + } + }); + } else if (this.orderDetail.order_type == 2) { + let query = { + app: this.orderDetail.app_id, + content: this.textarea, + score: this.serviceRate, + apply_id: this.orderDetail.apply_id, + }; + this.$api.user.addServiceEvaluation(query).then((response) => { + if (response.data.success == 1) { + this.$message({ + message: "评价订单成功", + type: "success", + }); + this.visible = false; + this.getOrderDetail(); + } else { + this.$message({ + message: "评价订单失败", + type: "error", + }); + } + }); + } + } }, download() {}, getOrderDetail() { -- 2.26.0