Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
5cd01903
authored
Aug 26, 2023
by
YunaiV
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
code review:商品评论
parent
d09366b9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
24 deletions
+15
-24
src/views/mall/product/comment/ReplyForm.vue
+2
-3
src/views/mall/product/comment/index.vue
+13
-21
No files found.
src/views/mall/product/comment/ReplyForm.vue
View file @
5cd01903
...
@@ -48,16 +48,15 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗
...
@@ -48,16 +48,15 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗
/** 提交表单 */
/** 提交表单 */
const
emit
=
defineEmits
([
'success'
])
// 定义 success 事件,用于操作成功后的回调
const
emit
=
defineEmits
([
'success'
])
// 定义 success 事件,用于操作成功后的回调
const
submitReplyForm
=
async
()
=>
{
const
submitReplyForm
=
async
()
=>
{
// 校验表单
const
valid
=
await
formRef
?.
value
?.
validate
()
const
valid
=
await
formRef
?.
value
?.
validate
()
if
(
!
valid
)
return
if
(
!
valid
)
return
// 提交请求
formLoading
.
value
=
true
formLoading
.
value
=
true
try
{
try
{
await
CommentApi
.
replyComment
(
formData
.
value
)
await
CommentApi
.
replyComment
(
formData
.
value
)
message
.
success
(
t
(
'common.createSuccess'
))
message
.
success
(
t
(
'common.createSuccess'
))
dialogVisible
.
value
=
false
dialogVisible
.
value
=
false
// 发送操作成功的事件
// 发送操作成功的事件
emit
(
'success'
)
emit
(
'success'
)
...
...
src/views/mall/product/comment/index.vue
View file @
5cd01903
...
@@ -61,17 +61,24 @@
...
@@ -61,17 +61,24 @@
<el-table
v-loading=
"loading"
:data=
"list"
:stripe=
"true"
:show-overflow-tooltip=
"false"
>
<el-table
v-loading=
"loading"
:data=
"list"
:stripe=
"true"
:show-overflow-tooltip=
"false"
>
<el-table-column
label=
"评论编号"
align=
"center"
prop=
"id"
min-width=
"60"
/>
<el-table-column
label=
"评论编号"
align=
"center"
prop=
"id"
min-width=
"60"
/>
<el-table-column
label=
"用户名称"
align=
"center"
prop=
"userNickname"
width=
"80"
/>
<el-table-column
label=
"用户名称"
align=
"center"
prop=
"userNickname"
width=
"80"
/>
<el-table-column
label=
"商品信息"
align=
"center"
min-width=
"
21
0"
>
<el-table-column
label=
"商品信息"
align=
"center"
min-width=
"
30
0"
>
<template
#
default=
"scope"
>
<template
#
default=
"scope"
>
<div
class=
"flex row items-center gap-x-4px"
>
<div
class=
"flex row items-center gap-x-4px"
>
<el-image
<el-image
v-if=
"scope.row.skuPicUrl"
v-if=
"scope.row.skuPicUrl"
:src=
"scope.row.skuPicUrl"
:src=
"scope.row.skuPicUrl"
:preview-src-list=
"[scope.row.skuPicUrl]"
:preview-src-list=
"[scope.row.skuPicUrl]"
class=
"w-
30px h-3
0px shrink-0"
class=
"w-
40px h-4
0px shrink-0"
preview-teleported
preview-teleported
/>
/>
<div>
{{
scope
.
row
.
spuName
}}
</div>
<div>
{{
scope
.
row
.
spuName
}}
</div>
<el-tag
v-for=
"property in scope.row.skuProperties"
:key=
"property.propertyId"
class=
"mr-10px"
>
{{
property
.
propertyName
}}
:
{{
property
.
valueName
}}
</el-tag>
</div>
</div>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
...
@@ -88,7 +95,7 @@
...
@@ -88,7 +95,7 @@
:src=
"picUrl"
:src=
"picUrl"
:preview-src-list=
"scope.row.picUrls"
:preview-src-list=
"scope.row.picUrls"
:initial-index=
"index"
:initial-index=
"index"
class=
"w-
30px h-3
0px"
class=
"w-
40px h-4
0px"
preview-teleported
preview-teleported
/>
/>
</div>
</div>
...
@@ -151,7 +158,7 @@
...
@@ -151,7 +158,7 @@
import
{
dateFormatter
}
from
'@/utils/formatTime'
import
{
dateFormatter
}
from
'@/utils/formatTime'
import
*
as
CommentApi
from
'@/api/mall/product/comment'
import
*
as
CommentApi
from
'@/api/mall/product/comment'
import
CommentForm
from
'./CommentForm.vue'
import
CommentForm
from
'./CommentForm.vue'
import
ReplyForm
from
'
@/views/mall/product/comment
/ReplyForm.vue'
import
ReplyForm
from
'
.
/ReplyForm.vue'
defineOptions
({
name
:
'ProductComment'
})
defineOptions
({
name
:
'ProductComment'
})
...
@@ -164,25 +171,10 @@ const list = ref([]) // 列表的数据
...
@@ -164,25 +171,10 @@ const list = ref([]) // 列表的数据
const
queryParams
=
reactive
({
const
queryParams
=
reactive
({
pageNo
:
1
,
pageNo
:
1
,
pageSize
:
10
,
pageSize
:
10
,
userId
:
null
,
replyStatus
:
null
,
spuName
:
null
,
userNickname
:
null
,
userNickname
:
null
,
userAvatar
:
null
,
anonymous
:
null
,
orderId
:
null
,
orderId
:
null
,
orderItemId
:
null
,
spuId
:
null
,
spuName
:
null
,
skuId
:
null
,
visible
:
null
,
scores
:
null
,
descriptionScores
:
null
,
benefitScores
:
null
,
content
:
null
,
picUrls
:
null
,
replyStatus
:
null
,
replyUserId
:
null
,
replyContent
:
null
,
replyTime
:
[],
createTime
:
[]
createTime
:
[]
})
})
const
queryFormRef
=
ref
()
// 搜索的表单
const
queryFormRef
=
ref
()
// 搜索的表单
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment