Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
corporate-culture-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
王立鹏
corporate-culture-qd
Commits
3e4e6b88
Commit
3e4e6b88
authored
Apr 17, 2026
by
lijiabin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【需求 21402】 feat: 加一个最早评论筛选项
parent
efff3c48
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
6 deletions
+22
-6
enums.ts
src/constants/enums.ts
+12
-0
index.vue
src/views/questionDetail/index.vue
+10
-6
No files found.
src/constants/enums.ts
View file @
3e4e6b88
...
...
@@ -163,3 +163,15 @@ export enum SpecificVideoRewardEnum {
// 创新碎片
INNOVATION_CHIP
=
'INNOVATION_CHIP'
,
}
// 评论排序类型枚举
export
enum
CommentSortTypeEnum
{
// 最多评论
MOST_COMMENT
=
1
,
// 最新发布
NEWEST_PUBLISH
=
2
,
// 最早发布
EARLIEST_PUBLISH
=
3
,
// 最高点赞
MOST_LIKE
=
4
,
}
src/views/questionDetail/index.vue
View file @
3e4e6b88
...
...
@@ -240,9 +240,10 @@
@
change=
"(val) => changeSortType(val as number)"
fill=
"#3b82f6"
>
<el-radio-button
label=
"最新"
:value=
"2"
/>
<el-radio-button
label=
"最多点赞"
:value=
"4"
/>
<el-radio-button
label=
"最多评论"
:value=
"1"
/>
<el-radio-button
label=
"最多点赞"
:value=
"CommentSortTypeEnum.MOST_LIKE"
/>
<el-radio-button
label=
"最多评论"
:value=
"CommentSortTypeEnum.MOST_COMMENT"
/>
<el-radio-button
label=
"最早发布"
:value=
"CommentSortTypeEnum.EARLIEST_PUBLISH"
/>
<el-radio-button
label=
"最新发布"
:value=
"CommentSortTypeEnum.NEWEST_PUBLISH"
/>
</el-radio-group>
<!-- <span
@click="changeSortType(2)"
...
...
@@ -330,7 +331,8 @@
<!-- 正文 换行 -->
<div
class=
"text-slate-800 leading-7 mb-4 rich-text-content break-all"
v-html=
"parseEmoji(answer.content)"
v-html=
"parseEmoji(answer.contentHtml || answer.content)"
v-parse-comment
></div>
<!-- 评论图片列表 -->
<div
class=
"flex flex-wrap gap-3 mb-3"
>
...
...
@@ -393,7 +395,7 @@
<Transition
name=
"fade"
>
<div
v-show=
"answer.showComment"
class=
"mt-4 border border-slate-200 rounded-lg bg-slate-50/50
overflow-hidden
"
class=
"mt-4 border border-slate-200 rounded-lg bg-slate-50/50"
>
<Comment
:authorId=
"questionDetail.createUserId"
...
...
@@ -449,6 +451,8 @@ import { useNavigation, useScrollTop } from '@/hooks'
import
{
parseEmoji
}
from
'@/utils/emoji'
import
{
ArticleTypeEnum
,
BooleanFlag
}
from
'@/constants'
import
{
push
}
from
'notivue'
import
{
CommentSortTypeEnum
}
from
'@/constants'
const
userStore
=
useUserStore
()
const
{
userInfo
}
=
storeToRefs
(
userStore
)
const
{
jumpToUserHomePage
}
=
useNavigation
()
...
...
@@ -499,7 +503,7 @@ const {
// immediate: false,
defaultParams
:
{
articleId
:
questionId
,
sortType
:
2
,
sortType
:
CommentSortTypeEnum
.
MOST_LIKE
,
},
formatList
:
(
list
)
=>
list
.
map
((
item
)
=>
({
...
...
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