Commit 18a5f1e2 authored by 刘殿昕's avatar 刘殿昕

订单详情评价方法

parent 8d643d69
......@@ -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() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment