feat(miniprogram): 通用组件 + 页面接入 — Chunk 7
- 创建 EmptyState/ErrorState/Loading 三个通用组件 - 8个列表页面接入通用组件替换内联空状态/loading - app.config.ts 添加 login 页面路由
This commit is contained in:
@@ -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 { listReports, LabReport } from '../../services/report';
|
||||
import EmptyState from '../../components/EmptyState';
|
||||
import Loading from '../../components/Loading';
|
||||
import './index.scss';
|
||||
|
||||
const PAGE_SIZE = 20;
|
||||
@@ -82,15 +84,11 @@ export default function ReportList() {
|
||||
</View>
|
||||
|
||||
{reports.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>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user