提交 db2fa71d 作者: 龚洪江

功能:论坛详情

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