diff --git a/Cunkebao/src/pages/mobile/workspace/auto-group/list/index.tsx b/Cunkebao/src/pages/mobile/workspace/auto-group/list/index.tsx index 806a3553..61a35bad 100644 --- a/Cunkebao/src/pages/mobile/workspace/auto-group/list/index.tsx +++ b/Cunkebao/src/pages/mobile/workspace/auto-group/list/index.tsx @@ -38,9 +38,6 @@ interface GroupTask { groupDescription?: string; } -// 初始空列表;真实数据由接口返回 -const mockTasks: GroupTask[] = []; - const getStatusColor = (status: number) => { switch (status) { case 1: @@ -70,8 +67,10 @@ const AutoGroupList: React.FC = () => { const [page, setPage] = useState(1); const [pageSize, setPageSize] = useState(10); const [total, setTotal] = useState(0); + const [loading, setLoading] = useState(false); const refreshTasks = async (p = page, ps = pageSize) => { + setLoading(true); try { const res: any = await getAutoGroupList({ type: 4, page: p, limit: ps }); // 兼容不同返回结构 @@ -101,6 +100,8 @@ const AutoGroupList: React.FC = () => { setTotal(totalCount); } catch (e) { Toast.show({ content: "获取列表失败" }); + } finally { + setLoading(false); } }; @@ -197,6 +198,23 @@ const AutoGroupList: React.FC = () => { > } + footer={ +