|
@@ -21,6 +21,9 @@ import { MaterialService } from 'Material/Material.service'
|
|
import ColumnContent from './components/ColumnContent'
|
|
import ColumnContent from './components/ColumnContent'
|
|
import ColumnInfoEdit from './components/ColumnInfoEdit'
|
|
import ColumnInfoEdit from './components/ColumnInfoEdit'
|
|
import ColumnCenter from './components/ColumnCenter'
|
|
import ColumnCenter from './components/ColumnCenter'
|
|
|
|
+import ColumnMessage from './components/ColumnMessage'
|
|
|
|
+import LikesCollections from './components/LikesCollections'
|
|
|
|
+import ColumnFansModal from './components/ColumnFansModal'
|
|
import styles from './css/ColumnIndex.module.scss'
|
|
import styles from './css/ColumnIndex.module.scss'
|
|
|
|
|
|
interface IColumnIndexProps {
|
|
interface IColumnIndexProps {
|
|
@@ -45,6 +48,7 @@ const ColumnIndex: React.FC<IColumnIndexProps> = props => {
|
|
const pageSize = 20
|
|
const pageSize = 20
|
|
const [editInfoVisible, setEditInfoVisible] = useState<boolean>(false) // 修改专栏信息
|
|
const [editInfoVisible, setEditInfoVisible] = useState<boolean>(false) // 修改专栏信息
|
|
const [openCenter, setOpenCenter] = useState<boolean>(false) // 打开内容中心
|
|
const [openCenter, setOpenCenter] = useState<boolean>(false) // 打开内容中心
|
|
|
|
+ const [openMessage, setOpenMessage] = useState<boolean>(false) // 打开留言管理
|
|
const [actColumnAuthorID, setActColumnAuthorID] = useState<number | undefined>(undefined) // 当前选中的专栏ID
|
|
const [actColumnAuthorID, setActColumnAuthorID] = useState<number | undefined>(undefined) // 当前选中的专栏ID
|
|
const [columnAuthorListHasMore, setColumnAuthorListHasMore] = useState<boolean>(true) // 专栏作者列表的加载更多
|
|
const [columnAuthorListHasMore, setColumnAuthorListHasMore] = useState<boolean>(true) // 专栏作者列表的加载更多
|
|
const [columnAuthorListCurrentPage, setColumnAuthorListCurrentPage] = useState<number>(1) // 专栏作者列表的当前页码
|
|
const [columnAuthorListCurrentPage, setColumnAuthorListCurrentPage] = useState<number>(1) // 专栏作者列表的当前页码
|
|
@@ -54,6 +58,9 @@ const ColumnIndex: React.FC<IColumnIndexProps> = props => {
|
|
const [columnListCurrentPage, setColumnListCurrentPage] = useState<number>(1) // 专栏文章列表的当前页码
|
|
const [columnListCurrentPage, setColumnListCurrentPage] = useState<number>(1) // 专栏文章列表的当前页码
|
|
const [columnList, setColumnList] = useState<IColumnDetail[]>([]) // 专栏文章列表
|
|
const [columnList, setColumnList] = useState<IColumnDetail[]>([]) // 专栏文章列表
|
|
|
|
|
|
|
|
+ const [collectionsShow, setCollectionsShow] = useState<boolean>(false) // 获赞与收藏的开关
|
|
|
|
+ const [fansModalShow, setFansModalShow] = useState<boolean>(false) // 粉丝开关
|
|
|
|
+
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
getColumnAuthorList(pageSize, 1)
|
|
getColumnAuthorList(pageSize, 1)
|
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -155,7 +162,7 @@ const ColumnIndex: React.FC<IColumnIndexProps> = props => {
|
|
imgWindow?.document.write(image.outerHTML)
|
|
imgWindow?.document.write(image.outerHTML)
|
|
}
|
|
}
|
|
|
|
|
|
- const handleOpenModel = (type: 'editInfo' | 'openCenter' | 'openCreate') => {
|
|
|
|
|
|
+ const handleOpenModel = (type: 'editInfo' | 'openCenter' | 'openCreate' | 'openMessage') => {
|
|
if (type !== 'editInfo' && !columnAuthor?.IsImproveInformation) {
|
|
if (type !== 'editInfo' && !columnAuthor?.IsImproveInformation) {
|
|
message.error('请先完善专栏信息')
|
|
message.error('请先完善专栏信息')
|
|
return
|
|
return
|
|
@@ -167,6 +174,9 @@ const ColumnIndex: React.FC<IColumnIndexProps> = props => {
|
|
case 'openCenter':
|
|
case 'openCenter':
|
|
setOpenCenter(true)
|
|
setOpenCenter(true)
|
|
break
|
|
break
|
|
|
|
+ case 'openMessage':
|
|
|
|
+ setOpenMessage(true)
|
|
|
|
+ break
|
|
case 'openCreate':
|
|
case 'openCreate':
|
|
window.open(`/column/editor/${props.columnId}`)
|
|
window.open(`/column/editor/${props.columnId}`)
|
|
break
|
|
break
|
|
@@ -175,7 +185,7 @@ const ColumnIndex: React.FC<IColumnIndexProps> = props => {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- const handleClose = (type: 'editInfo' | 'openCenter') => {
|
|
|
|
|
|
+ const handleClose = (type: 'editInfo' | 'openCenter' | 'openMessage') => {
|
|
switch (type) {
|
|
switch (type) {
|
|
case 'editInfo':
|
|
case 'editInfo':
|
|
setEditInfoVisible(false)
|
|
setEditInfoVisible(false)
|
|
@@ -183,6 +193,9 @@ const ColumnIndex: React.FC<IColumnIndexProps> = props => {
|
|
case 'openCenter':
|
|
case 'openCenter':
|
|
setOpenCenter(false)
|
|
setOpenCenter(false)
|
|
break
|
|
break
|
|
|
|
+ case 'openMessage':
|
|
|
|
+ setOpenMessage(false)
|
|
|
|
+ break
|
|
default:
|
|
default:
|
|
break
|
|
break
|
|
}
|
|
}
|
|
@@ -247,6 +260,16 @@ const ColumnIndex: React.FC<IColumnIndexProps> = props => {
|
|
getColumnAuthorList(pageSize, 1)
|
|
getColumnAuthorList(pageSize, 1)
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // 显示获赞和收藏弹框
|
|
|
|
+ const showCollectionsFansModal = (type: string) => {
|
|
|
|
+ type === '粉丝' ? setFansModalShow(true) : setCollectionsShow(true)
|
|
|
|
+ }
|
|
|
|
+ // 获赞和收藏弹框的关闭事件
|
|
|
|
+ const CollectionFansClose = (type: string) => {
|
|
|
|
+ console.log(type)
|
|
|
|
+ type === 'Fans' ? setFansModalShow(false) : setCollectionsShow(false)
|
|
|
|
+ }
|
|
|
|
+
|
|
if (columnAuthor?.List?.length === 0)
|
|
if (columnAuthor?.List?.length === 0)
|
|
return (
|
|
return (
|
|
<div className={styles['column-empty-wrapper']}>
|
|
<div className={styles['column-empty-wrapper']}>
|
|
@@ -351,11 +374,21 @@ const ColumnIndex: React.FC<IColumnIndexProps> = props => {
|
|
<div className="columnindex-count">{columnInfo?.SpecialArticleNum || 0}</div>
|
|
<div className="columnindex-count">{columnInfo?.SpecialArticleNum || 0}</div>
|
|
<div className="columnindex-count-title">文章</div>
|
|
<div className="columnindex-count-title">文章</div>
|
|
</div>
|
|
</div>
|
|
- <div className="columnindex-count-item">
|
|
|
|
|
|
+ <div
|
|
|
|
+ className="columnindex-count-item"
|
|
|
|
+ onClick={() => {
|
|
|
|
+ showCollectionsFansModal('收藏')
|
|
|
|
+ }}
|
|
|
|
+ >
|
|
<div className="columnindex-count">{columnInfo?.CollectNum || 0}</div>
|
|
<div className="columnindex-count">{columnInfo?.CollectNum || 0}</div>
|
|
- <div className="columnindex-count-title">被收藏</div>
|
|
|
|
|
|
+ <div className="columnindex-count-title">获赞与收藏</div>
|
|
</div>
|
|
</div>
|
|
- <div className="columnindex-count-item">
|
|
|
|
|
|
+ <div
|
|
|
|
+ className="columnindex-count-item"
|
|
|
|
+ onClick={() => {
|
|
|
|
+ showCollectionsFansModal('粉丝')
|
|
|
|
+ }}
|
|
|
|
+ >
|
|
<div className="columnindex-count">{columnInfo?.FollowNum || 0}</div>
|
|
<div className="columnindex-count">{columnInfo?.FollowNum || 0}</div>
|
|
<div className="columnindex-count-title">粉丝</div>
|
|
<div className="columnindex-count-title">粉丝</div>
|
|
</div>
|
|
</div>
|
|
@@ -423,6 +456,11 @@ const ColumnIndex: React.FC<IColumnIndexProps> = props => {
|
|
onClick={handleOpenModel.bind(this, 'openCenter')}
|
|
onClick={handleOpenModel.bind(this, 'openCenter')}
|
|
/>
|
|
/>
|
|
<div className="columnindex-right-text">内容中心</div>
|
|
<div className="columnindex-right-text">内容中心</div>
|
|
|
|
+ <ColumnCenterSvg
|
|
|
|
+ className="columnindex-right-svg columnindex-svg-center"
|
|
|
|
+ onClick={handleOpenModel.bind(this, 'openMessage')}
|
|
|
|
+ />
|
|
|
|
+ <div className="columnindex-right-text">留言管理</div>
|
|
</div>
|
|
</div>
|
|
) : null}
|
|
) : null}
|
|
{editInfoVisible ? (
|
|
{editInfoVisible ? (
|
|
@@ -440,6 +478,9 @@ const ColumnIndex: React.FC<IColumnIndexProps> = props => {
|
|
/>
|
|
/>
|
|
) : null}
|
|
) : null}
|
|
{openCenter ? <ColumnCenter open={openCenter} onClose={handleClose} /> : null}
|
|
{openCenter ? <ColumnCenter open={openCenter} onClose={handleClose} /> : null}
|
|
|
|
+ {openMessage ? <ColumnMessage open={openMessage} onClose={handleClose} /> : null}
|
|
|
|
+ <LikesCollections open={collectionsShow} onClose={CollectionFansClose} />
|
|
|
|
+ <ColumnFansModal open={fansModalShow} onClose={CollectionFansClose} />
|
|
</div>
|
|
</div>
|
|
)
|
|
)
|
|
}
|
|
}
|