diff --git a/src/forge/Information/Component/pointsDoc.jsx b/src/forge/Information/Component/pointsDoc.jsx index 81b340b18..b99102612 100644 --- a/src/forge/Information/Component/pointsDoc.jsx +++ b/src/forge/Information/Component/pointsDoc.jsx @@ -3,7 +3,7 @@ import { Modal, Form, Input, Button, Spin, Pagination } from 'antd'; import Nodata from '../../Nodata'; -import { getNewsMyList, getApplyMyList, doDocTop } from '../api'; +import { getNewsMyList, getMyTopArticle, doDocTop } from '../api'; const { TextArea } = Input; @@ -14,7 +14,7 @@ import { getImageUrl } from 'educoder' import '../indexUser.scss'; function PointsDoc({ visible , onCancel , onSure , type , username , choosed , history , showCompeleteDialog , member }) { - const limit = 5; + const limit = 2; const [ page , setPage ] = useState(1); const [ total , setTotal ] = useState(0); @@ -45,23 +45,17 @@ function PointsDoc({ visible , onCancel , onSure , type , username , choosed , h async function init() { setIsSpin(true); try{ - // let result = await getApplyMyList({ - // zoneId: member.zoneId, - // applyType: 'doc', - // status:1, - // pageSize:limit, - // pageNum:page - // }); - // let rows = result.data && result.data.rows; - // TODO 查询获取用户已置顶新闻 - let rows = null; - if(Array.isArray(rows) && rows.length > 0) { - setCurrentId(rows[0].applyId) - } else { - setCurrentId(null) + let res = await getMyTopArticle(member.zoneId); + if(res && res.data.code === 200){ + setCurrentRow(res.data.data); + if(res.data.data) { + setCurrentId(res.data.data.docId); + } else { + setCurrentId(null); + } + + await getMyNews(); } - - await getMyNews(); }finally{ setIsSpin(false) } @@ -72,10 +66,6 @@ function PointsDoc({ visible , onCancel , onSure , type , username , choosed , h let rows = result.data && result.data.rows; if(rows && rows.length>0){ setList(rows); - if(currentId){ - const row = rows.find(item => item.applyId === currentId || item.id === currentId); - setCurrentRow(row || null); - } }else{ setList([]); setCurrentRow(null); @@ -124,7 +114,7 @@ function PointsDoc({ visible , onCancel , onSure , type , username , choosed , h {currentRow && (