feat(miniprogram): 关怀模式全覆盖 — 58/58 页面 100% 接入
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

- 医生端 18 个页面全部接入(首页/待办/告警/咨询/透析/随访/
  患者/处方/报告及其详情和创建页)
- 商城子包 3 页面(商品详情/积分兑换/订单)
- 患者端剩余页面(AI报告/文章/活动/设备同步/登录/随访详情/
  报告详情/知情同意/诊断/透析处方/透析记录/家庭成员添加)
- 页面覆盖率:22/59 (37%) → 58/58 (100%)
- useElderClass hook 统一接入模式,零样板代码

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
iven
2026-05-09 22:34:44 +08:00
parent e8ccee02d5
commit 7b5138a630
37 changed files with 153 additions and 85 deletions

View File

@@ -5,6 +5,7 @@ import { listConsents, revokeConsent } from '@/services/consent';
import type { Consent } from '@/services/consent';
import EmptyState from '@/components/EmptyState';
import Loading from '@/components/Loading';
import { useElderClass } from '../../../hooks/useElderClass';
import './index.scss';
const CONSENT_TYPE_MAP: Record<string, string> = {
@@ -22,6 +23,7 @@ const STATUS_MAP: Record<string, { label: string; cls: string }> = {
};
export default function ConsentList() {
const modeClass = useElderClass();
const [consents, setConsents] = useState<Consent[]>([]);
const [page, setPage] = useState(1);
const [total, setTotal] = useState(0);
@@ -79,7 +81,7 @@ export default function ConsentList() {
};
return (
<View className='consents-page'>
<View className={`consents-page ${modeClass}`}>
<Text className='page-title'></Text>
<View className='consent-list'>

View File

@@ -4,6 +4,7 @@ import Taro, { useDidShow, usePullDownRefresh, useReachBottom } from '@tarojs/ta
import { listDiagnoses, Diagnosis } from '../../../services/health-record';
import EmptyState from '../../../components/EmptyState';
import Loading from '../../../components/Loading';
import { useElderClass } from '../../../hooks/useElderClass';
import './index.scss';
const TYPE_MAP: Record<string, { label: string; cls: string }> = {
@@ -19,6 +20,7 @@ const STATUS_MAP: Record<string, { label: string; cls: string }> = {
};
export default function Diagnoses() {
const modeClass = useElderClass();
const [records, setRecords] = useState<Diagnosis[]>([]);
const [page, setPage] = useState(1);
const [total, setTotal] = useState(0);
@@ -61,7 +63,7 @@ export default function Diagnoses() {
});
return (
<View className='diagnoses-page'>
<View className={`diagnoses-page ${modeClass}`}>
<Text className='page-title'></Text>
<View className='diagnosis-list'>

View File

@@ -4,6 +4,7 @@ import Taro, { useRouter } from '@tarojs/taro';
import { getDialysisPrescription } from '@/services/dialysis';
import type { DialysisPrescription } from '@/services/dialysis';
import Loading from '@/components/Loading';
import { useElderClass } from '../../../../hooks/useElderClass';
import './index.scss';
const STATUS_MAP: Record<string, { label: string; cls: string }> = {
@@ -13,6 +14,7 @@ const STATUS_MAP: Record<string, { label: string; cls: string }> = {
};
export default function DialysisPrescriptionDetail() {
const modeClass = useElderClass();
const router = useRouter();
const id = router.params.id || '';
const [rx, setRx] = useState<DialysisPrescription | null>(null);
@@ -27,8 +29,8 @@ export default function DialysisPrescriptionDetail() {
.finally(() => setLoading(false));
}, [id]);
if (loading) return <View className='detail-page'><Loading /></View>;
if (!rx) return <View className='detail-page'><View className='empty-state'><Text className='empty-text'></Text></View></View>;
if (loading) return <View className={`detail-page ${modeClass}`}><Loading /></View>;
if (!rx) return <View className={`detail-page ${modeClass}`}><View className='empty-state'><Text className='empty-text'></Text></View></View>;
const si = STATUS_MAP[rx.status] || { label: rx.status, cls: '' };
@@ -43,7 +45,7 @@ export default function DialysisPrescriptionDetail() {
};
return (
<View className='detail-page'>
<View className={`detail-page ${modeClass}`}>
{/* 状态头部 */}
<View className='detail-card header-card'>
<View className='header-row'>

View File

@@ -5,6 +5,7 @@ import { listDialysisPrescriptions } from '@/services/dialysis';
import type { DialysisPrescription } from '@/services/dialysis';
import EmptyState from '@/components/EmptyState';
import Loading from '@/components/Loading';
import { useElderClass } from '../../../hooks/useElderClass';
import './index.scss';
const STATUS_MAP: Record<string, { label: string; cls: string }> = {
@@ -14,6 +15,7 @@ const STATUS_MAP: Record<string, { label: string; cls: string }> = {
};
export default function DialysisPrescriptionList() {
const modeClass = useElderClass();
const [prescriptions, setPrescriptions] = useState<DialysisPrescription[]>([]);
const [page, setPage] = useState(1);
const [total, setTotal] = useState(0);
@@ -54,7 +56,7 @@ export default function DialysisPrescriptionList() {
const statusInfo = (s: string) => STATUS_MAP[s] || { label: s, cls: '' };
return (
<View className='dialysis-prescriptions-page'>
<View className={`dialysis-prescriptions-page ${modeClass}`}>
<Text className='page-title'></Text>
<View className='prescription-list'>

View File

@@ -4,6 +4,7 @@ import Taro, { useRouter } from '@tarojs/taro';
import { getDialysisRecord } from '@/services/dialysis';
import type { DialysisRecord } from '@/services/dialysis';
import Loading from '@/components/Loading';
import { useElderClass } from '../../../../hooks/useElderClass';
import './index.scss';
const STATUS_MAP: Record<string, { label: string; cls: string }> = {
@@ -19,6 +20,7 @@ const TYPE_MAP: Record<string, string> = {
};
export default function DialysisRecordDetail() {
const modeClass = useElderClass();
const router = useRouter();
const id = router.params.id || '';
const [record, setRecord] = useState<DialysisRecord | null>(null);
@@ -33,13 +35,13 @@ export default function DialysisRecordDetail() {
.finally(() => setLoading(false));
}, [id]);
if (loading) return <View className='detail-page'><Loading /></View>;
if (!record) return <View className='detail-page'><View className='empty-state'><Text className='empty-text'></Text></View></View>;
if (loading) return <View className={`detail-page ${modeClass}`}><Loading /></View>;
if (!record) return <View className={`detail-page ${modeClass}`}><View className='empty-state'><Text className='empty-text'></Text></View></View>;
const si = STATUS_MAP[record.status] || { label: record.status, cls: '' };
return (
<View className='detail-page'>
<View className={`detail-page ${modeClass}`}>
{/* 状态头部 */}
<View className='detail-card header-card'>
<View className='header-row'>

View File

@@ -5,6 +5,7 @@ import { listDialysisRecords } from '@/services/dialysis';
import type { DialysisRecord } from '@/services/dialysis';
import EmptyState from '@/components/EmptyState';
import Loading from '@/components/Loading';
import { useElderClass } from '../../../hooks/useElderClass';
import './index.scss';
const TYPE_MAP: Record<string, { label: string; cls: string }> = {
@@ -20,6 +21,7 @@ const STATUS_MAP: Record<string, { label: string; cls: string }> = {
};
export default function DialysisRecordList() {
const modeClass = useElderClass();
const [records, setRecords] = useState<DialysisRecord[]>([]);
const [page, setPage] = useState(1);
const [total, setTotal] = useState(0);
@@ -61,7 +63,7 @@ export default function DialysisRecordList() {
const statusInfo = (s: string) => STATUS_MAP[s] || { label: s, cls: '' };
return (
<View className='dialysis-records-page'>
<View className={`dialysis-records-page ${modeClass}`}>
<Text className='page-title'></Text>
<View className='record-list'>

View File

@@ -2,12 +2,14 @@ import React, { useState, useEffect } from 'react';
import { View, Text, Input, Picker } from '@tarojs/components';
import Taro, { useRouter } from '@tarojs/taro';
import { createPatient, updatePatient, Patient } from '../../../services/patient';
import { useElderClass } from '../../../hooks/useElderClass';
import './index.scss';
const RELATION_OPTIONS = ['本人', '配偶', '父母', '子女', '其他'];
const GENDER_OPTIONS = ['男', '女'];
export default function FamilyAdd() {
const modeClass = useElderClass();
const router = useRouter();
const editId = router.params.id || '';
const editData = Taro.getStorageSync('edit_patient') as Patient | null;
@@ -58,7 +60,7 @@ export default function FamilyAdd() {
};
return (
<View className='family-add-page'>
<View className={`family-add-page ${modeClass}`}>
<Text className='page-title'>{editId ? '编辑就诊人' : '添加就诊人'}</Text>
<View className='form-card'>