From ae23baeeced690a6d5fde3e2e176977929ace031 Mon Sep 17 00:00:00 2001 From: iven Date: Sat, 16 May 2026 00:56:18 +0800 Subject: [PATCH] =?UTF-8?q?refactor(mp):=20=E8=BF=81=E7=A7=BB=E6=8A=A5?= =?UTF-8?q?=E5=91=8A=E5=88=97=E8=A1=A8=E9=A1=B5=20=E2=80=94=20=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E7=BB=9F=E4=B8=80=E7=BB=84=E4=BB=B6=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - PageShell 替代手写 ScrollView + min-height/bg/padding - SearchSection 替代搜索栏 - ContentCard 替代 report-card 手写样式 - StatusTag 替代 report-card__reviewed 手写标签 - LoadingCard 替代 Loading 组件 - 精简 SCSS:删除 page/search-bar/card 通用样式,保留业务特有样式 --- .../pkg-doctor-clinical/report/index.scss | 110 +++++++----------- .../pkg-doctor-clinical/report/index.tsx | 89 +++++++------- 2 files changed, 84 insertions(+), 115 deletions(-) diff --git a/apps/miniprogram/src/pages/pkg-doctor-clinical/report/index.scss b/apps/miniprogram/src/pages/pkg-doctor-clinical/report/index.scss index 49f005e..7d46586 100644 --- a/apps/miniprogram/src/pages/pkg-doctor-clinical/report/index.scss +++ b/apps/miniprogram/src/pages/pkg-doctor-clinical/report/index.scss @@ -1,26 +1,9 @@ @import '../../../styles/variables.scss'; -@import '../../../styles/mixins.scss'; -.report-page { - min-height: 100vh; - background: $bg; - padding: 24px; - padding-bottom: 120px; -} - -.search-bar { - margin-bottom: 20px; - - .search-input { - background: $card; - border-radius: $r; - padding: 20px 24px; - font-size: var(--tk-font-body-lg); - width: 100%; - box-sizing: border-box; - box-shadow: $shadow-sm; - } -} +// PageShell 已接管:min-height, background, padding +// SearchSection 已接管:search-bar +// ContentCard 已接管:report-card 背景/圆角/阴影/触摸反馈 +// StatusTag 已接管:reviewed 标签样式 .report-count { margin-bottom: 16px; @@ -31,59 +14,44 @@ } } -.report-list { +.report-cards { display: flex; flex-direction: column; + gap: var(--tk-gap-md); +} + +.report-card__header { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 12px; +} + +.report-card__type { + font-family: 'Georgia', 'Times New Roman', serif; + font-size: var(--tk-font-body-lg); + font-weight: 600; + color: $tx; +} + +.report-card__date { + font-size: var(--tk-font-h2); + color: $tx3; +} + +.report-card__indicators { + display: flex; + align-items: center; gap: 16px; } -.report-card { - background: $card; - border-radius: $r-lg; - padding: 28px; - box-shadow: $shadow-sm; - - &:active { - background: $bd-l; - } - - &__header { - display: flex; - justify-content: space-between; - align-items: center; - margin-bottom: 12px; - } - - &__type { - font-family: 'Georgia', 'Times New Roman', serif; - font-size: var(--tk-font-body-lg); - font-weight: 600; - color: $tx; - } - - &__date { - font-size: var(--tk-font-h2); - color: $tx3; - } - - &__indicators { - display: flex; - align-items: center; - gap: 16px; - } - - &__abnormal { - font-size: var(--tk-font-h1); - color: $dan; - font-weight: 600; - } - - &__normal { - font-size: var(--tk-font-h1); - color: $acc; - } - - &__reviewed { - @include tag($acc-l, $acc); - } +.report-card__abnormal { + font-size: var(--tk-font-h1); + color: $dan; + font-weight: 600; +} + +.report-card__normal { + font-size: var(--tk-font-h1); + color: $acc; } diff --git a/apps/miniprogram/src/pages/pkg-doctor-clinical/report/index.tsx b/apps/miniprogram/src/pages/pkg-doctor-clinical/report/index.tsx index 6a09eb4..f899c3e 100644 --- a/apps/miniprogram/src/pages/pkg-doctor-clinical/report/index.tsx +++ b/apps/miniprogram/src/pages/pkg-doctor-clinical/report/index.tsx @@ -1,10 +1,14 @@ import { useState, useEffect, useCallback, useRef } from 'react'; -import { View, Text, Input, ScrollView } from '@tarojs/components'; +import { View, Text } from '@tarojs/components'; import Taro, { useRouter } from '@tarojs/taro'; import { usePageData } from '@/hooks/usePageData'; import { listLabReports, type LabReportItem } from '@/services/doctor/labReport'; import { listPatients } from '@/services/doctor/patient'; -import Loading from '@/components/Loading'; +import PageShell from '@/components/ui/PageShell'; +import ContentCard from '@/components/ui/ContentCard'; +import StatusTag from '@/components/ui/StatusTag'; +import LoadingCard from '@/components/ui/LoadingCard'; +import SearchSection from '@/components/patterns/SearchSection'; import ErrorState from '@/components/ErrorState'; import EmptyState from '@/components/EmptyState'; import { useElderClass } from '../../../hooks/useElderClass'; @@ -68,59 +72,56 @@ export default function ReportList() { const formatDate = (d: string) => new Date(d).toLocaleDateString('zh-CN'); - if (loading && reports.length === 0) return ; + if (loading && reports.length === 0) return ; if (error) return ; return ( - + {!patientId && ( - - setSearchPatient(e.detail.value)} - confirmType='search' - onConfirm={handleSearch} - /> - + )} {!currentPatientId ? ( - + ) : reports.length === 0 ? ( - + ) : ( - - + <> + 共 {total} 份报告 - {reports.map((r) => ( - Taro.navigateTo({ - url: `/pages/pkg-doctor-clinical/report/detail/index?patientId=${currentPatientId}&id=${r.id}`, - })} - > - - {r.report_type} - {formatDate(r.report_date)} - - - {(r.abnormal_count ?? 0) > 0 ? ( - {r.abnormal_count} 项异常 - ) : ( - 指标正常 - )} - {r.status === 'reviewed' && ( - 已审核 - )} - - - ))} - + + {reports.map((r) => ( + Taro.navigateTo({ + url: `/pages/pkg-doctor-clinical/report/detail/index?patientId=${currentPatientId}&id=${r.id}`, + })} + > + + {r.report_type} + {formatDate(r.report_date)} + + + {(r.abnormal_count ?? 0) > 0 ? ( + {r.abnormal_count} 项异常 + ) : ( + 指标正常 + )} + {r.status === 'reviewed' && ( + 已审核 + )} + + + ))} + + )} - + ); }