Files
cuimengxue/frontend/src/views/merchant/MerchantReviews.vue
wangziqi d6451cf188 feat: 重构后台路由并使用嵌套路由;添加图片上传功能
- 拆分 AdminView 为多个子页面组件,使用嵌套路由
- 拆分 MerchantView 为多个子页面组件,使用嵌套路由
- 创建 AdminLayout 和 MerchantLayout 布局组件
- 修复编译错误:IconSend 重复导入、IconDatabase 不存在
- 修复 HomeView 缺失 onMounted 导入
- 添加文件上传后端接口和静态资源映射
- 为商品和轮播图添加图片上传功能(支持预览、清除)
2026-02-10 15:14:23 +08:00

53 lines
1.3 KiB
Vue

<template>
<a-card :bordered="false" class="content-card">
<template #title>
<a-space>
<span>评价管理</span>
<a-tag color="orange"> {{ reviews.length }} 条评价</a-tag>
</a-space>
</template>
<a-table :columns="reviewColumns" :data="reviews" :pagination="{ pageSize: 8 }" :bordered="false">
<template #rating="{ record }">
<a-rate :model-value="record.rating" readonly />
</template>
</a-table>
</a-card>
</template>
<script setup>
import { ref, onMounted } from 'vue'
import { api } from '../../api'
const reviews = ref([])
const reviewColumns = [
{ title: 'ID', dataIndex: 'id', width: 60 },
{ title: '订单号', dataIndex: 'orderNo' },
{ title: '商品名称', dataIndex: 'productName' },
{ title: '评分', slotName: 'rating', width: 180 },
{ title: '内容', dataIndex: 'content', ellipsis: true },
{ title: '时间', dataIndex: 'createdAt', width: 160, render: ({ record }) => formatDate(record.createdAt) }
]
const formatDate = (date) => {
if (!date) return '-'
return new Date(date).toLocaleString('zh-CN')
}
const loadReviews = async () => { reviews.value = await api.merchantReviews() }
onMounted(() => {
loadReviews()
})
</script>
<style scoped>
.content-card {
border-radius: 12px;
}
:deep(.arco-card-header) {
border-bottom: 1px solid #f0f0f0;
}
</style>