feat(miniprogram): 通用组件 + 页面接入 — Chunk 7
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled

- 创建 EmptyState/ErrorState/Loading 三个通用组件
- 8个列表页面接入通用组件替换内联空状态/loading
- app.config.ts 添加 login 页面路由
This commit is contained in:
iven
2026-04-24 01:03:23 +08:00
parent 9ef65b9a9f
commit 0c73927450
14 changed files with 201 additions and 45 deletions

View File

@@ -2,6 +2,8 @@ import React, { useState, useCallback } from 'react';
import { View, Text } from '@tarojs/components';
import Taro, { useDidShow, usePullDownRefresh, useReachBottom } from '@tarojs/taro';
import { listArticles, Article } from '../../services/article';
import EmptyState from '../../components/EmptyState';
import Loading from '../../components/Loading';
import './index.scss';
export default function ArticleList() {
@@ -80,15 +82,11 @@ export default function ArticleList() {
</View>
{articles.length === 0 && !loading && (
<View className='empty-state'>
<Text className='empty-text'></Text>
</View>
<EmptyState text='暂无资讯文章' />
)}
{loading && (
<View className='loading-hint'>
<Text className='loading-text'>...</Text>
</View>
<Loading />
)}
</View>
);