diff --git a/apps/miniprogram/src/pages/pkg-doctor-clinical/dialysis/index.scss b/apps/miniprogram/src/pages/pkg-doctor-clinical/dialysis/index.scss index 0ab9c48..a0f7ebc 100644 --- a/apps/miniprogram/src/pages/pkg-doctor-clinical/dialysis/index.scss +++ b/apps/miniprogram/src/pages/pkg-doctor-clinical/dialysis/index.scss @@ -1,45 +1,24 @@ @import '../../../styles/variables.scss'; -@import '../../../styles/mixins.scss'; -.dialysis-page { - min-height: 100vh; - background: $bg; - padding-bottom: 120px; -} - -.search-bar { - padding: 16px 24px; - background: $card; -} - -.search-input { - background: $bg; - border-radius: $r-sm; - padding: 16px 20px; - font-size: var(--tk-font-body-lg); - color: $tx; -} - -.record-list { - padding: 16px 24px; -} +// PageShell 已接管:min-height, background, padding +// SearchSection 已接管:search-bar +// ContentCard 已接管:record-card 背景/圆角/阴影/触摸反馈 +// StatusTag 已接管:status-tag 标签样式 +// PaginationBar 已接管:pagination 分页样式 .record-count { - font-size: var(--tk-font-h2); - color: $tx3; - padding: 8px 0 16px; + margin-bottom: 16px; + + text { + font-size: var(--tk-font-h2); + color: $tx3; + } } -.record-card { - background: $card; - border-radius: $r; - padding: 24px; - margin-bottom: 16px; - box-shadow: $shadow-sm; - - &:active { - box-shadow: $shadow-md; - } +.record-cards { + display: flex; + flex-direction: column; + gap: var(--tk-gap-md); } .record-card__header { @@ -69,25 +48,6 @@ } } -.status-tag { - display: inline-block; - padding: 4px 12px; - border-radius: $r-xs; - font-size: var(--tk-font-body); - background: $bd-l; - color: $tx3; - - &--completed { - background: $pri-l; - color: $pri; - } - - &--reviewed { - background: $acc-l; - color: $acc; - } -} - .record-card__body { display: flex; flex-wrap: wrap; @@ -106,31 +66,6 @@ font-variant-numeric: tabular-nums; } -.pagination { - display: flex; - justify-content: center; - align-items: center; - padding: 16px 0; - gap: 24px; -} - -.page-btn { - padding: 12px 24px; - background: $card; - border-radius: $r-sm; - font-size: var(--tk-font-h1); - color: $pri; - - &--disabled { - opacity: 0.4; - } -} - -.page-info { - font-size: var(--tk-font-h2); - color: $tx2; -} - .fab { position: fixed; right: 32px; diff --git a/apps/miniprogram/src/pages/pkg-doctor-clinical/dialysis/index.tsx b/apps/miniprogram/src/pages/pkg-doctor-clinical/dialysis/index.tsx index 940a17c..570a6c1 100644 --- a/apps/miniprogram/src/pages/pkg-doctor-clinical/dialysis/index.tsx +++ b/apps/miniprogram/src/pages/pkg-doctor-clinical/dialysis/index.tsx @@ -1,16 +1,21 @@ 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 { listDialysisRecords, type DialysisRecord } from '@/services/doctor/dialysis'; 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 PaginationBar from '@/components/patterns/PaginationBar'; +import SegmentTabs from '@/components/SegmentTabs'; import ErrorState from '@/components/ErrorState'; import EmptyState from '@/components/EmptyState'; import { useElderClass } from '../../../hooks/useElderClass'; import { safeNavigateTo } from '@/utils/navigate'; -import SegmentTabs from '@/components/SegmentTabs'; -import './index.scss';; +import './index.scss'; const TABS = [ { key: '', label: '全部' }, @@ -21,6 +26,12 @@ const TABS = [ const TYPE_MAP: Record = { HD: 'HD', HDF: 'HDF', HF: 'HF' }; +const STATUS_LABEL: Record = { + draft: '草稿', + completed: '已完成', + reviewed: '已审核', +}; + export default function DialysisList() { const router = useRouter(); const patientId = router.params.patientId || ''; @@ -90,82 +101,69 @@ export default function DialysisList() { setPage(1); }; - // 服务端已按 activeTab 过滤,无需客户端二次筛选 - - if (loading && records.length === 0) return ; + if (loading && records.length === 0) return ; if (error) return loadRecords(1)} />; return ( - - {!patientId && ( - - setSearchPatient(e.detail.value)} - confirmType='search' - onConfirm={handleSearch} - /> - + + {!patientId ? ( + + ) : ( + )} - - {!currentPatientId ? ( - + ) : records.length === 0 ? ( - + ) : ( - - 共 {total} 条记录 - {records.map((r) => ( - safeNavigateTo(`/pages/pkg-doctor-clinical/dialysis/detail/index?id=${r.id}`)} - > - - - {TYPE_MAP[r.dialysis_type] || r.dialysis_type} - - - {r.status === 'draft' ? '草稿' : r.status === 'completed' ? '已完成' : '已审核'} - - - - {r.dialysis_date} - {r.dialysis_duration != null && ( - 时长 {r.dialysis_duration}分钟 - )} - {r.ultrafiltration_volume != null && ( - 超滤 {r.ultrafiltration_volume}ml - )} - - - ))} - {total > 20 && ( - - page > 1 && loadRecords(page - 1)} + <> + + 共 {total} 条记录 + + + {records.map((r) => ( + safeNavigateTo(`/pages/pkg-doctor-clinical/dialysis/detail/index?id=${r.id}`)} > - 上一页 - - {page} / {Math.ceil(total / 20)} - = total ? 'page-btn--disabled' : ''}`} - onClick={() => page * 20 < total && loadRecords(page + 1)} - > - 下一页 - - - )} - + + + {TYPE_MAP[r.dialysis_type] || r.dialysis_type} + + {STATUS_LABEL[r.status] || r.status} + + + {r.dialysis_date} + {r.dialysis_duration != null && ( + 时长 {r.dialysis_duration}分钟 + )} + {r.ultrafiltration_volume != null && ( + 超滤 {r.ultrafiltration_volume}ml + )} + + + ))} + + loadRecords(p)} + /> + )} { if (!currentPatientId) { Taro.showToast({ title: '请先选择患者', icon: 'none' }); @@ -174,8 +172,8 @@ export default function DialysisList() { safeNavigateTo(`/pages/pkg-doctor-clinical/dialysis/create/index?patientId=${currentPatientId}`); }} > - + + + - + ); }