积分文章置顶

积分文章置顶
This commit is contained in:
amypeng 2026-06-08 13:55:29 +08:00
parent 33df45788e
commit 06985146f8
2 changed files with 15 additions and 26 deletions

View File

@ -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
</div>
{currentRow && (
<div className="line dataline">
<span className="content">{currentRow.name}</span>
<span className="content">{currentRow.docName}</span>
<span className="action">
<Button type="primary" shape="round" disabled style={{backgroundColor:'rgba(70, 106, 255, 0.43)', borderColor:'rgba(70, 106, 255, 0.43)', color:'#fff'}}>已置顶</Button>
</span>

View File

@ -553,11 +553,10 @@ export function getProjectListByScore(id,params) {
}
// 专区获取我的积分申请
export function getApplyMyList(params){
export function getMyTopArticle(id){
return fetch({
url:`/zone/points/apply/my/list`,
url:`/zone/points/account/article/top/${id}`,
method:"get",
params
})
}