diff --git a/src/forge/users/contribution/index.jsx b/src/forge/users/contribution/index.jsx index fa1a15edf..f79b047a9 100644 --- a/src/forge/users/contribution/index.jsx +++ b/src/forge/users/contribution/index.jsx @@ -12,8 +12,7 @@ import { FlexAJ } from '../../Component/layout'; // 个人中心-贡献确权 function Contribution(props){ - // 接口暂不支持分页 - const limit = 15; + const limit = 10; const [page, setPage] = useState(1); const [total, setTotal] = useState(undefined); // 转账列表 @@ -34,13 +33,30 @@ function Contribution(props){ useEffect(()=>{ // token转账列表 - axios.get(`/users/blockchain/balance.json`,{params: {user_id}}).then(res=>{ + axios.get(`/users/blockchain/balance.json`,{params: { + user_id, + limit, + page + }}).then(res=>{ if(res && res.data){ - setList(res.data.projects); + const {projects} = res.data; + const newProjects = []; + let deleteProjectCount = 0; + projects.map(item=>{ + if(item.id){ + newProjects.unshift(item); + }else{ + deleteProjectCount++; + } + }) + deleteProjectCount && newProjects.push({ + 'balance': deleteProjectCount + }) + setList(newProjects); setTotal(res.data.total_count); } }) - }, [reload]) + }, [reload, page]) useEffect(()=>{ if(user){ @@ -115,7 +131,7 @@ function Contribution(props){