Commit 3e4e6b88 by lijiabin

【需求 21402】 feat: 加一个最早评论筛选项

parent efff3c48
...@@ -163,3 +163,15 @@ export enum SpecificVideoRewardEnum { ...@@ -163,3 +163,15 @@ export enum SpecificVideoRewardEnum {
// 创新碎片 // 创新碎片
INNOVATION_CHIP = 'INNOVATION_CHIP', INNOVATION_CHIP = 'INNOVATION_CHIP',
} }
// 评论排序类型枚举
export enum CommentSortTypeEnum {
// 最多评论
MOST_COMMENT = 1,
// 最新发布
NEWEST_PUBLISH = 2,
// 最早发布
EARLIEST_PUBLISH = 3,
// 最高点赞
MOST_LIKE = 4,
}
...@@ -240,9 +240,10 @@ ...@@ -240,9 +240,10 @@
@change="(val) => changeSortType(val as number)" @change="(val) => changeSortType(val as number)"
fill="#3b82f6" fill="#3b82f6"
> >
<el-radio-button label="最新" :value="2" /> <el-radio-button label="最多点赞" :value="CommentSortTypeEnum.MOST_LIKE" />
<el-radio-button label="最多点赞" :value="4" /> <el-radio-button label="最多评论" :value="CommentSortTypeEnum.MOST_COMMENT" />
<el-radio-button label="最多评论" :value="1" /> <el-radio-button label="最早发布" :value="CommentSortTypeEnum.EARLIEST_PUBLISH" />
<el-radio-button label="最新发布" :value="CommentSortTypeEnum.NEWEST_PUBLISH" />
</el-radio-group> </el-radio-group>
<!-- <span <!-- <span
@click="changeSortType(2)" @click="changeSortType(2)"
...@@ -330,7 +331,8 @@ ...@@ -330,7 +331,8 @@
<!-- 正文 换行 --> <!-- 正文 换行 -->
<div <div
class="text-slate-800 leading-7 mb-4 rich-text-content break-all" 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>
<!-- 评论图片列表 --> <!-- 评论图片列表 -->
<div class="flex flex-wrap gap-3 mb-3"> <div class="flex flex-wrap gap-3 mb-3">
...@@ -393,7 +395,7 @@ ...@@ -393,7 +395,7 @@
<Transition name="fade"> <Transition name="fade">
<div <div
v-show="answer.showComment" 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 <Comment
:authorId="questionDetail.createUserId" :authorId="questionDetail.createUserId"
...@@ -449,6 +451,8 @@ import { useNavigation, useScrollTop } from '@/hooks' ...@@ -449,6 +451,8 @@ import { useNavigation, useScrollTop } from '@/hooks'
import { parseEmoji } from '@/utils/emoji' import { parseEmoji } from '@/utils/emoji'
import { ArticleTypeEnum, BooleanFlag } from '@/constants' import { ArticleTypeEnum, BooleanFlag } from '@/constants'
import { push } from 'notivue' import { push } from 'notivue'
import { CommentSortTypeEnum } from '@/constants'
const userStore = useUserStore() const userStore = useUserStore()
const { userInfo } = storeToRefs(userStore) const { userInfo } = storeToRefs(userStore)
const { jumpToUserHomePage } = useNavigation() const { jumpToUserHomePage } = useNavigation()
...@@ -499,7 +503,7 @@ const { ...@@ -499,7 +503,7 @@ const {
// immediate: false, // immediate: false,
defaultParams: { defaultParams: {
articleId: questionId, articleId: questionId,
sortType: 2, sortType: CommentSortTypeEnum.MOST_LIKE,
}, },
formatList: (list) => formatList: (list) =>
list.map((item) => ({ list.map((item) => ({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment