Commit afc48ef5 by lijiabin

【需求 21402】 feat: 完成楼层显示

parent 5d676393
...@@ -20,7 +20,7 @@ import type { ...@@ -20,7 +20,7 @@ import type {
UpdateArticleRecommendAndSortDto, UpdateArticleRecommendAndSortDto,
} from './types' } from './types'
import type { BackendServicePageResult, PageSearchParams } from '@/utils/request/types' import type { BackendServicePageResult, PageSearchParams } from '@/utils/request/types'
import { SpecificVideoRewardEnum } from '@/constants' import { SpecificVideoRewardEnum, BooleanFlag } from '@/constants'
// 文章相关的接口(帖子 视频 实践等) // 文章相关的接口(帖子 视频 实践等)
...@@ -379,3 +379,14 @@ export const topOrCancelTopComment = (commentId: number) => { ...@@ -379,3 +379,14 @@ export const topOrCancelTopComment = (commentId: number) => {
method: 'POST', method: 'POST',
}) })
} }
/**
* 获取可@的用户列表
*/
export const getAtUserList = (data: { findType?: BooleanFlag; findValue?: string }) => {
return service.request<string[]>({
url: `/api/auth/getUserInfo`,
method: 'POST',
data,
})
}
...@@ -368,6 +368,7 @@ export interface CommentItemDto { ...@@ -368,6 +368,7 @@ export interface CommentItemDto {
isExpand: boolean isExpand: boolean
childNum: number childNum: number
imgUrl: string imgUrl: string
floorNumber: number
} }
/** /**
......
...@@ -121,6 +121,12 @@ ...@@ -121,6 +121,12 @@
></span> ></span>
置顶评论 置顶评论
</span> </span>
<span
v-if="!isQuestion"
class="inline-flex items-center rounded-full border border-gray-200 bg-gray-50 px-1.5 py-0.5 text-xs leading-none text-gray-500"
>
{{ item.floorNumber || '顶' }}楼
</span>
</div> </div>
<!-- 作者有权利置顶 并且不是问吧(问吧是获取的二级评论列表) --> <!-- 作者有权利置顶 并且不是问吧(问吧是获取的二级评论列表) -->
<button <button
......
...@@ -266,7 +266,8 @@ ...@@ -266,7 +266,8 @@
</div> </div>
<!-- 3. 回答列表 --> <!-- 3. 回答列表 -->
<div class="space-y-3">
<div class="space-y-3" v-loading="commentLoading">
<div <div
v-for="(answer, index) in list" v-for="(answer, index) in list"
:ref="(el) => (answerRefList[index] = el as HTMLElement)" :ref="(el) => (answerRefList[index] = el as HTMLElement)"
...@@ -297,6 +298,11 @@ ...@@ -297,6 +298,11 @@
></span> ></span>
置顶回答 置顶回答
</span> </span>
<span
class="inline-flex items-center rounded-full border border-gray-200 bg-gray-50 px-1.5 py-0.5 text-11px leading-none text-gray-500"
>
{{ answer.floorNumber || '顶' }}楼
</span>
</div> </div>
</div> </div>
</div> </div>
...@@ -482,7 +488,14 @@ const getQuestionDetail = async () => { ...@@ -482,7 +488,14 @@ const getQuestionDetail = async () => {
questionDetail.value = data questionDetail.value = data
} }
const { list, total, searchParams, goToPage, refresh } = usePageSearch(getCommentList, { const {
list,
total,
searchParams,
goToPage,
refresh,
loading: commentLoading,
} = usePageSearch(getCommentList, {
// immediate: false, // immediate: false,
defaultParams: { defaultParams: {
articleId: questionId, articleId: questionId,
......
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