fix(mp): 小程序页面优化 + E2E 测试报告更新

- 小程序各页面优化和修复
- 更新联调报告和 E2E 测试报告
- 更新 miniprogram wiki
This commit is contained in:
iven
2026-05-15 23:03:21 +08:00
parent ced1c0ad0c
commit c06e986090
24 changed files with 905 additions and 441 deletions

View File

@@ -5,10 +5,12 @@ import { usePageData } from '@/hooks/usePageData';
import { listDialysisRecords, type DialysisRecord } from '@/services/doctor/dialysis';
import { listPatients } from '@/services/doctor/patient';
import Loading from '@/components/Loading';
import ErrorState from '@/components/ErrorState';
import EmptyState from '@/components/EmptyState';
import { useElderClass } from '../../../hooks/useElderClass';
import { safeNavigateTo } from '@/utils/navigate';
import './index.scss';
import SegmentTabs from '@/components/SegmentTabs';
import './index.scss';;
const TABS = [
{ key: '', label: '全部' },
@@ -28,6 +30,7 @@ export default function DialysisList() {
const [activeTab, setActiveTab] = useState('');
const [records, setRecords] = useState<DialysisRecord[]>([]);
const [loading, setLoading] = useState(false);
const [error, setError] = useState(false);
const [total, setTotal] = useState(0);
const [page, setPage] = useState(1);
const mountedRef = useRef(false);
@@ -35,6 +38,7 @@ export default function DialysisList() {
const loadRecords = useCallback(async (p: number) => {
if (!currentPatientId) return;
setLoading(true);
setError(false);
try {
const params: { page: number; page_size: number; status?: string } = { page: p, page_size: 20 };
if (activeTab) params.status = activeTab;
@@ -43,6 +47,7 @@ export default function DialysisList() {
setTotal(res.total || 0);
setPage(p);
} catch {
setError(true);
Taro.showToast({ title: '加载失败', icon: 'none' });
} finally {
setLoading(false);
@@ -88,6 +93,7 @@ export default function DialysisList() {
// 服务端已按 activeTab 过滤,无需客户端二次筛选
if (loading && records.length === 0) return <Loading />;
if (error) return <ErrorState onRetry={() => loadRecords(1)} />;
return (
<ScrollView scrollY className={`dialysis-page ${modeClass}`}>
@@ -104,17 +110,7 @@ export default function DialysisList() {
</View>
)}
<View className='tabs'>
{TABS.map((t) => (
<View
key={t.key}
className={`tab ${activeTab === t.key ? 'tab--active' : ''}`}
onClick={() => handleTab(t.key)}
>
<Text className='tab-text'>{t.label}</Text>
</View>
))}
</View>
<SegmentTabs tabs={TABS} activeKey={activeTab} onChange={handleTab} variant="underline" />
{!currentPatientId ? (
<EmptyState text='请搜索并选择患者' />