Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
corporateCulture-qd
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王立鹏
corporateCulture-qd
Commits
34405c0b
Commit
34405c0b
authored
Nov 18, 2025
by
lijiabin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【需求 17679】 feat: 完成个人中心 评论回复页面
parent
c7fd6aad
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
153 additions
and
1 deletions
+153
-1
index.ts
src/api/user/index.ts
+11
-0
enums.ts
src/constants/enums.ts
+8
-0
options.ts
src/constants/options.ts
+13
-1
selfComment.vue
src/views/userPage/components/selfComment.vue
+113
-0
index.vue
src/views/userPage/index.vue
+8
-0
No files found.
src/api/user/index.ts
View file @
34405c0b
...
...
@@ -113,3 +113,14 @@ export const getSelfTaskList = (data: PageSearchParams) => {
data
,
})
}
/**
* 评论回复
*/
export
const
getSelfCommentList
=
(
data
:
PageSearchParams
)
=>
{
return
service
.
request
({
url
:
'/api/personalCenter/selfComment'
,
method
:
'POST'
,
data
,
})
}
src/constants/enums.ts
View file @
34405c0b
...
...
@@ -71,3 +71,11 @@ export enum TagLevelEnum {
// 主标签
MAIN_TAG
=
1
,
}
// 回复类型
export
enum
CommentTypeEnum
{
// 我评论别人的
COMMNET_TO_OTHER
=
1
,
// 别人评论我的
COMMNET_TO_SELF
=
2
,
}
src/constants/options.ts
View file @
34405c0b
import
{
ArticleTypeEnum
,
TaskTypeEnum
}
from
'./enums'
import
{
ArticleTypeEnum
,
CommentTypeEnum
,
TaskTypeEnum
}
from
'./enums'
// 地区列表
export
const
regionListOptions
=
[
...
...
@@ -72,6 +72,18 @@ export const taskTypeListOptions = [
},
]
// 评论类型列表
export
const
commentTypeListOptions
=
[
{
label
:
'我评论的'
,
value
:
CommentTypeEnum
.
COMMNET_TO_OTHER
,
},
{
label
:
'评论我的'
,
value
:
CommentTypeEnum
.
COMMNET_TO_SELF
,
},
]
// 等级相关内容
export
const
levelListOptions
:
{
label
:
string
...
...
src/views/userPage/components/selfComment.vue
0 → 100644
View file @
34405c0b
<
template
>
<div
class=
"flex-1 flex flex-col"
v-loading=
"loading"
>
<!-- List Container -->
<div
class=
"flex-1 p-4 pt-1"
>
<el-tabs
v-model=
"searchParams.messageType"
@
tab-change=
"toggleTab"
>
<el-tab-pane
v-for=
"tab in commentTypeListOptions"
:key=
"tab.value"
:label=
"tab.label"
:name=
"tab.value"
/>
</el-tabs>
<div
v-if=
"!list.length"
class=
"flex flex-col items-center justify-center h-64"
>
<div
class=
"w-16 h-16 bg-gray-100 rounded-full flex items-center justify-center mb-4"
>
<el-icon
class=
"text-2xl text-gray-300"
><Document
/></el-icon>
</div>
<div
class=
"text-gray-500 text-lg mb-2"
>
暂无内容
</div>
<div
class=
"text-gray-400 text-sm"
>
{{
getEmptyText
()
}}
</div>
</div>
<div
v-else
class=
"space-y-4"
>
<div
v-for=
"item in list"
:key=
"item.id"
class=
"flex items-center p-2 rounded-lg hover:bg-gray-100 transition-colors cursor-pointer"
>
<!-- Content -->
<div
class=
"flex-1 min-w-0"
>
<div
class=
"text-gray-900 font-medium truncate"
>
{{
item
.
title
}}
</div>
<div
class=
"text-gray-500 text-sm mt-1 truncate"
>
<span
class=
"mr-2"
>
{{
dayjs
(
item
.
createTime
*
1000
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
}}
</span>
<span
class=
"mr-2"
>
浏览
{{
item
.
viewCount
}}
</span>
<span
class=
"mr-2"
>
点赞
{{
item
.
replyCount
}}
</span>
<span
class=
"mr-2"
>
评论
{{
item
.
collectionCount
}}
</span>
<span
class=
"mr-2"
>
收藏
{{
item
.
praiseCount
}}
</span>
</div>
</div>
<!-- Meta Info -->
<div
class=
"flex items-center text-gray-400 text-sm ml-4"
>
<el-button
type=
"primary"
link
>
编辑
</el-button>
<el-button
type=
"danger"
link
>
删除
</el-button>
</div>
</div>
</div>
</div>
<div
v-if=
"list.length"
class=
"flex items-center justify-end px-6 py-4 border-t border-gray-200"
>
<div
class=
"pagination-wrapper bg-white rounded-xl shadow-sm border border-gray-100 p-3"
>
<el-pagination
v-model:current-page=
"searchParams.current"
v-model:page-size=
"searchParams.size"
@
size-change=
"changePageSize"
@
current-change=
"goToPage"
:page-sizes=
"[10, 20, 30, 40]"
layout=
"prev, pager, next, jumper, total"
:total=
"total"
class=
"custom-pagination"
/>
</div>
</div>
</div>
</
template
>
<
script
lang=
"ts"
setup
>
import
{
Document
}
from
'@element-plus/icons-vue'
import
{
getSelfCommentList
}
from
'@/api'
import
{
usePageSearch
}
from
'@/hooks'
import
{
commentTypeListOptions
}
from
'@/constants/options'
import
dayjs
from
'dayjs'
import
{
CommentTypeEnum
}
from
'@/constants/enums'
const
toggleTab
=
(
key
:
number
)
=>
{
searchParams
.
value
.
messageType
=
key
refresh
()
}
// State
const
{
list
,
loading
,
searchParams
,
total
,
refresh
,
goToPage
,
changePageSize
}
=
usePageSearch
(
getSelfCommentList
,
{
defaultParams
:
{
messageType
:
CommentTypeEnum
.
COMMNET_TO_OTHER
,
},
},
)
// Computed
const
paginatedList
=
computed
(()
=>
{
const
start
=
(
searchParams
.
value
.
current
-
1
)
*
searchParams
.
value
.
size
const
end
=
start
+
searchParams
.
value
.
size
return
list
.
value
.
slice
(
start
,
end
)
})
const
getEmptyText
=
()
=>
{
const
emptyTexts
:
Record
<
string
,
string
>
=
{
posts
:
'还没有发布任何帖子'
,
videos
:
'还没有上传任何视频'
,
questions
:
'还没有提出任何问题'
,
articles
:
'还没有发表任何专栏文章'
,
practice
:
'还没有分享任何实践经验'
,
interviews
:
'还没有参与任何专访'
,
}
return
emptyTexts
[
searchParams
.
type
]
||
'暂无数据'
}
</
script
>
src/views/userPage/index.vue
View file @
34405c0b
...
...
@@ -141,6 +141,7 @@ import SelfPublish from './components/selfPublish.vue'
import
SelfDraft
from
'./components/selfDraft.vue'
import
SelfCase
from
'./components/selfCase.vue'
import
SelfTask
from
'./components/selfTask.vue'
import
SelfComment
from
'./components/selfComment.vue'
import
{
hasOfficialAccount
}
from
'@/api'
const
editUserInfoRef
=
useTemplateRef
<
InstanceType
<
typeof
EditUserInfo
>>
(
'editUserInfoRef'
)
...
...
@@ -164,6 +165,13 @@ const menuItems = [
{
key
:
'praise'
,
label
:
'我的点赞'
,
icon
:
Pointer
,
component
:
SelfPraise
,
tab
:
'点赞'
},
{
key
:
'case'
,
label
:
'我的案例库'
,
icon
:
Collection
,
component
:
SelfCase
,
tab
:
'案例库'
},
{
key
:
'task'
,
label
:
'我的任务'
,
icon
:
Finished
,
component
:
SelfTask
,
tab
:
'任务'
},
{
key
:
'comment'
,
label
:
'评论回复'
,
icon
:
ChatDotRound
,
component
:
SelfComment
,
tab
:
'评论回复'
,
},
{
key
:
'votes'
,
label
:
'我的投票'
,
icon
:
Trophy
},
{
key
:
'articles'
,
label
:
'我的文章'
,
icon
:
Document
},
{
key
:
'comments'
,
label
:
'评论回复'
,
icon
:
ChatDotRound
},
...
...
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