提交 db2fa71d 作者: 龚洪江

功能:论坛详情

上级 918b5503
......@@ -39,3 +39,5 @@ type detailResponseType = {
commentAndReplyVO: detailResponseType[];
};
export type forumDetailType = InterFunction<{ dynamicId: number }, detailResponseType>;
//论坛-点赞信息
export type likeUserInfoType = InterFunction<{ dynamicId: number }, any>;
......@@ -3,6 +3,7 @@ import {
forumDetailType,
forumListType,
hiddenForumType,
likeUserInfoType,
} from '~/api/interface/forumManageType';
import axios from '~/api/request';
......@@ -19,4 +20,7 @@ export class ForumManageAPI {
// 论坛-详情
static getForumDetail: forumDetailType = (params) =>
axios.get('/release/dynamic/dynamicDetails', { params });
// 论坛-点赞人信息
static getLikeUserInfoList: likeUserInfoType = (params) =>
axios.get('/release/backstage/forum/likeUserInfo', { params });
}
......@@ -18,7 +18,7 @@
margin-top: 10px;
}
.info-footer{
margin-top: 40px;
margin-top: 20px;
display: flex;
align-items: center;
justify-content: space-between;
......
......@@ -3,12 +3,21 @@ import { Button, Image, Modal, ModalProps } from 'antd';
import './index.scss';
import { InterDataType } from '~/api/interface';
import { forumDetailType } from '~/api/interface/forumManageType';
import { ForumManageAPI } from '~/api';
//论坛详情返回类型
type detailType = InterDataType<forumDetailType>;
interface selfProps {
forumDetail?: detailType;
}
const DynamicDetailModal: FC<ModalProps & selfProps> = ({ open, onCancel, forumDetail }) => {
const getLikeUserInfo = (dynamicId: number) => {
ForumManageAPI.getLikeUserInfoList({ dynamicId }).then(({ result }) => {});
};
useEffect(() => {
if (forumDetail && forumDetail.likesCount) {
getLikeUserInfo(forumDetail.id);
}
}, [forumDetail]);
return (
<Modal open={open} onCancel={onCancel} title='查看详情' width={800} footer={null}>
<div className='dynamic-detail'>
......@@ -50,8 +59,8 @@ const DynamicDetailModal: FC<ModalProps & selfProps> = ({ open, onCancel, forumD
{forumDetail?.commentAndReplyVO.length ? (
<div className='dynamic-detail-comment'>
<div className='comment-title'>{forumDetail?.commentCount}条评论</div>
{forumDetail.commentAndReplyVO.map((v) => (
<div className='comment-item'>
{forumDetail.commentAndReplyVO.map((v, index: number) => (
<div className='comment-item' key={index}>
<div className='comment-item-header'>
<div className='user-avatar'>
<img src={v.userBaseInfo.userImg} alt='头像' />
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论