From 814b4631c944a4657128210378bda40294628b3f Mon Sep 17 00:00:00 2001 From: owen Date: Fri, 25 Aug 2023 21:02:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E5=93=81=EF=BC=9A=E5=AE=8C=E5=96=84?= =?UTF-8?q?=E5=90=8E=E5=8F=B0=E5=95=86=E5=93=81=E8=AF=84=E8=AE=BA=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/mall/product/comment.ts | 49 +++ .../mall/product/comment/CommentForm.vue | 198 ++++++++++++ .../comment/components/SkuTableSelect.vue | 94 ++++++ .../comment/components/SpuTableSelect.vue | 167 ++++++++++ src/views/mall/product/comment/index.vue | 297 ++++++++++++++++++ 5 files changed, 805 insertions(+) create mode 100644 src/api/mall/product/comment.ts create mode 100644 src/views/mall/product/comment/CommentForm.vue create mode 100644 src/views/mall/product/comment/components/SkuTableSelect.vue create mode 100644 src/views/mall/product/comment/components/SpuTableSelect.vue create mode 100644 src/views/mall/product/comment/index.vue diff --git a/src/api/mall/product/comment.ts b/src/api/mall/product/comment.ts new file mode 100644 index 00000000..defdbb93 --- /dev/null +++ b/src/api/mall/product/comment.ts @@ -0,0 +1,49 @@ +import request from '@/config/axios' + +export interface CommentVO { + id: number + userId: number + userNickname: string + userAvatar: string + anonymous: boolean + orderId: number + orderItemId: number + spuId: number + spuName: string + skuId: number + visible: boolean + scores: number + descriptionScores: number + benefitScores: number + content: string + picUrls: string + replyStatus: boolean + replyUserId: number + replyContent: string + replyTime: Date +} + +// 查询商品评论列表 +export const getCommentPage = async (params) => { + return await request.get({ url: `/product/comment/page`, params }) +} + +// 查询商品评论详情 +export const getComment = async (id: number) => { + return await request.get({ url: `/product/comment/get?id=` + id }) +} + +// 添加自评 +export const createComment = async (data: CommentVO) => { + return await request.post({ url: `/product/comment/create`, data }) +} + +// 显示 / 隐藏评论 +export const updateCommentVisible = async (data: any) => { + return await request.put({ url: `/product/comment/update-visible`, data }) +} + +// 商家回复 +export const replyComment = async (data: any) => { + return await request.put({ url: `/product/comment/reply`, data }) +} diff --git a/src/views/mall/product/comment/CommentForm.vue b/src/views/mall/product/comment/CommentForm.vue new file mode 100644 index 00000000..85458c3d --- /dev/null +++ b/src/views/mall/product/comment/CommentForm.vue @@ -0,0 +1,198 @@ + + + diff --git a/src/views/mall/product/comment/components/SkuTableSelect.vue b/src/views/mall/product/comment/components/SkuTableSelect.vue new file mode 100644 index 00000000..8bbc50cf --- /dev/null +++ b/src/views/mall/product/comment/components/SkuTableSelect.vue @@ -0,0 +1,94 @@ + + + diff --git a/src/views/mall/product/comment/components/SpuTableSelect.vue b/src/views/mall/product/comment/components/SpuTableSelect.vue new file mode 100644 index 00000000..f8560aa3 --- /dev/null +++ b/src/views/mall/product/comment/components/SpuTableSelect.vue @@ -0,0 +1,167 @@ + + + diff --git a/src/views/mall/product/comment/index.vue b/src/views/mall/product/comment/index.vue new file mode 100644 index 00000000..ecb519c9 --- /dev/null +++ b/src/views/mall/product/comment/index.vue @@ -0,0 +1,297 @@ + + +