提交 6cb69a7d 作者: ZhangLingKun

Merge remote-tracking branch 'origin/develop' into develop

......@@ -14,4 +14,4 @@ patches:
images:
- name: REGISTRY/NAMESPACE/IMAGE:TAG
newName: mmc-registry.cn-shenzhen.cr.aliyuncs.com/sharefly-dev/admin
newTag: 6734c922902c32116dbfda98fbd95793607fb835
newTag: d5a039efef4e1e66a9e302410d46878f5054b2a1
......@@ -40,4 +40,7 @@ type detailResponseType = {
};
export type forumDetailType = InterFunction<{ dynamicId: number }, detailResponseType>;
//论坛-点赞信息
export type likeUserInfoType = InterFunction<{ dynamicId: number }, any>;
export type likeUserInfoType = InterFunction<
{ dynamicId: number },
{ nickName: string; userImg: string; userName: string }[]
>;
......@@ -3,6 +3,7 @@
&-media{
display: flex;
align-items: center;
flex-wrap: wrap;
.media-item{
margin-right: 10px;
margin-bottom: 10px;
......@@ -73,4 +74,20 @@
color: rgba(0,0,0,0.5);
font-weight: bold;
}
}
.dynamic-like-user{
display: flex;
width: 200px;
min-height: 100px;
.user-info{
display: flex;
margin: 10px;
img{
width: 20px;
height: 20px;
border-radius: 50%;
margin-right: 5px;
}
}
}
import { FC, useEffect, useState } from 'react';
import { Button, Image, Modal, ModalProps } from 'antd';
import { Button, Image, Modal, ModalProps, Tooltip } from 'antd';
import './index.scss';
import { InterDataType } from '~/api/interface';
import { forumDetailType } from '~/api/interface/forumManageType';
import { forumDetailType, likeUserInfoType } from '~/api/interface/forumManageType';
import { ForumManageAPI } from '~/api';
//论坛详情返回类型
type detailType = InterDataType<forumDetailType>;
interface selfProps {
forumDetail?: detailType;
}
//点赞人返回类型
type likeUserType = InterDataType<likeUserInfoType>;
const DynamicDetailModal: FC<ModalProps & selfProps> = ({ open, onCancel, forumDetail }) => {
//点赞人列表
const [likeUserList, setLikeUserList] = useState<likeUserType>([]);
const getLikeUserInfo = (dynamicId: number) => {
ForumManageAPI.getLikeUserInfoList({ dynamicId }).then(({ result }) => {});
ForumManageAPI.getLikeUserInfoList({ dynamicId }).then(({ result }) => {
setLikeUserList(result || []);
});
};
useEffect(() => {
if (forumDetail && forumDetail.likesCount) {
getLikeUserInfo(forumDetail.id);
} else {
setLikeUserList([]);
}
}, [forumDetail]);
return (
......@@ -52,7 +61,25 @@ const DynamicDetailModal: FC<ModalProps & selfProps> = ({ open, onCancel, forumD
<div className='time'>发布于{forumDetail?.dynamicPublishTime}</div>
<div className='operate'>
<div>{forumDetail?.commentCount}人回答</div>
<Button type='link'>{forumDetail?.likesCount}人爱心赞</Button>
<Tooltip
placement='bottom'
title={
likeUserList.length ? (
<div className='dynamic-like-user'>
{likeUserList.map((v, index: number) => (
<div key={index} className='user-info'>
<img src={v.userImg} alt='头像' />
<span>{v.userName || v.nickName}</span>
</div>
))}
</div>
) : (
'暂无点赞'
)
}
>
<Button type='link'>{forumDetail?.likesCount}人爱心赞</Button>
</Tooltip>
</div>
</div>
</div>
......
......@@ -64,8 +64,8 @@ const DynamicList = () => {
<Button type='link' onClick={() => deleteForumClick(record)}>
强制删除
</Button>
<Button type='link' onClick={() => hiddenForumClick(record)} disabled={!!record.show}>
强制隐藏
<Button type='link' onClick={() => hiddenForumClick(record)}>
{record.show ? '恢复显示' : '强制隐藏'}
</Button>
</>
),
......@@ -127,12 +127,12 @@ const DynamicList = () => {
//强制隐藏
const hiddenForumClick = (record: forumType[0]) => {
Modal.confirm({
title: '强制隐藏',
content: '确认隐藏这条动态?',
title: `${record.show ? '恢复显示' : '强制隐藏'}`,
content: `确认${record.show ? '显示' : '隐藏'}这条动态?`,
onOk: () => {
ForumManageAPI.hiddenForum({ dynamicId: record.id }).then(({ code }) => {
if (code === '200') {
message.success('隐藏成功');
message.success(`${record.show ? '显示' : '隐藏'}成功`);
getDynamicList(query);
}
});
......
......@@ -34,11 +34,13 @@ const IndustryNews = () => {
title: '文章名称',
align: 'center',
dataIndex: 'newsTitle',
width: '20%',
},
{
title: '发布时间',
align: 'center',
dataIndex: 'createTime',
width: '15%',
},
{
title: '来源',
......@@ -59,6 +61,7 @@ const IndustryNews = () => {
{
title: '操作',
align: 'center',
width: '20%',
render: (_text: string, record) => (
<>
<Button type='link' onClick={() => addOrEditIndustryNewsClick(record)}>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论