|
|
@@ -152,14 +152,26 @@ function handleComment() {
|
|
|
function handleSendComment() {
|
|
|
|
|
|
const payload = {
|
|
|
-
|
|
|
+ orderId: props.orderId,
|
|
|
+ comment: content.value,
|
|
|
+ rating: rating.value
|
|
|
}
|
|
|
|
|
|
commentOrder(payload).then(res => {
|
|
|
if (res.code === '000') {
|
|
|
-
|
|
|
+ ElMessage({
|
|
|
+ message: '评价!',
|
|
|
+ type: 'success',
|
|
|
+ center: true,
|
|
|
+ })
|
|
|
+ getOrderDetail()
|
|
|
+ commentDialogVisible.value = false
|
|
|
} else {
|
|
|
-
|
|
|
+ ElMessage({
|
|
|
+ message: res.msg,
|
|
|
+ type: 'error',
|
|
|
+ center: true,
|
|
|
+ })
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
@@ -184,7 +196,7 @@ function switchButtonFunction() {
|
|
|
<template #header>
|
|
|
<div class="card-header">
|
|
|
<div>
|
|
|
- <span> 商品 {{productId}}</span>
|
|
|
+ <span> 订单号 {{props.orderId}}</span>
|
|
|
<el-tag style="margin-left: 8px"> {{statusText}} </el-tag>
|
|
|
</div>
|
|
|
<el-button @click="switchButtonFunction" v-if="!(status==='DONE')" class="status-change-button" size="small" type="primary">
|
|
|
@@ -196,6 +208,9 @@ function switchButtonFunction() {
|
|
|
<el-descriptions
|
|
|
:column="1"
|
|
|
>
|
|
|
+ <el-descriptions-item style="font-size: 15px" label="商品">
|
|
|
+ {{ productId }}
|
|
|
+ </el-descriptions-item>
|
|
|
<el-descriptions-item style="font-size: 15px" label="数量">
|
|
|
{{ amount }} 件
|
|
|
</el-descriptions-item>
|
|
|
@@ -275,7 +290,7 @@ function switchButtonFunction() {
|
|
|
</el-form-item>
|
|
|
|
|
|
<el-form-item>
|
|
|
- <el-button type="primary" @click="handleComment">评价</el-button>
|
|
|
+ <el-button type="primary" @click="handleSendComment">评价</el-button>
|
|
|
<el-button @click="commentDialogVisible = false">取消</el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|