diff --git a/apps/miniprogram/src/pages/pkg-doctor-core/followup/index.scss b/apps/miniprogram/src/pages/pkg-doctor-core/followup/index.scss index fcf2323..91bc019 100644 --- a/apps/miniprogram/src/pages/pkg-doctor-core/followup/index.scss +++ b/apps/miniprogram/src/pages/pkg-doctor-core/followup/index.scss @@ -1,13 +1,12 @@ @import '../../../styles/variables.scss'; -@import '../../../styles/mixins.scss'; -.followup-page { - min-height: 100vh; - background: $bg; -} +// PageShell 已接管:min-height, background, padding +// SearchSection 已接管:标签筛选栏 +// ContentCard 已接管:task-card 背景/圆角/阴影/触摸反馈 +// StatusTag 已接管:任务状态标签 .task-count { - padding: 20px 28px; + margin-bottom: 16px; text { font-size: var(--tk-font-h2); @@ -16,56 +15,37 @@ } .task-list { - padding: 0 24px 120px; display: flex; flex-direction: column; - gap: 16px; + gap: var(--tk-gap-md); } -.task-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; - } - - &__status { - @include tag(transparent, $tx2); - font-size: var(--tk-font-body); - font-weight: 500; - } - - &__patient { - font-size: var(--tk-font-h1); - color: $tx2; - display: block; - margin-bottom: 8px; - } - - &__footer { - display: flex; - justify-content: space-between; - } - - &__date { - font-size: var(--tk-font-h2); - color: $tx3; - } +.task-card__header { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 12px; +} + +.task-card__type { + font-size: var(--tk-font-body-lg); + font-weight: 600; + color: $tx; +} + +.task-card__patient { + font-size: var(--tk-font-h1); + color: $tx2; + display: block; + margin-bottom: 8px; +} + +.task-card__footer { + display: flex; + justify-content: space-between; +} + +.task-card__date { + font-size: var(--tk-font-h2); + color: $tx3; } diff --git a/apps/miniprogram/src/pages/pkg-doctor-core/followup/index.tsx b/apps/miniprogram/src/pages/pkg-doctor-core/followup/index.tsx index afb5b7c..87fbdcd 100644 --- a/apps/miniprogram/src/pages/pkg-doctor-core/followup/index.tsx +++ b/apps/miniprogram/src/pages/pkg-doctor-core/followup/index.tsx @@ -1,14 +1,16 @@ import { useState, useEffect, useCallback, useRef } from 'react'; -import { View, Text, ScrollView } from '@tarojs/components'; +import { View, Text } from '@tarojs/components'; import Taro, { useRouter } from '@tarojs/taro'; import { usePageData } from '@/hooks/usePageData'; import { listFollowUpTasks, type FollowUpTask } from '@/services/doctor/followup'; -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'; -import { getStatusInlineStyle, getStatusLabel } from '@/utils/statusTag'; -import SegmentTabs from '@/components/SegmentTabs'; import './index.scss'; const TABS = [ @@ -19,6 +21,13 @@ const TABS = [ { key: 'overdue', label: '已逾期' }, ]; +const STATUS_COLOR_MAP: Record = { + pending: 'warning', + in_progress: 'info', + completed: 'success', + overdue: 'error', +}; + export default function FollowUpList() { const router = useRouter(); const patientId = router.params.patientId || ''; @@ -52,7 +61,6 @@ export default function FollowUpList() { const { trigger } = usePageData(loadTasks); - // tab/patientId 变化时重新加载(跳过首次 mount,由 usePageData 的 useDidShow 处理) useEffect(() => { if (mountedRef.current) { trigger(); @@ -74,43 +82,48 @@ export default function FollowUpList() { return map[type] || type; }; - if (loading && tasks.length === 0) return ; + if (loading && tasks.length === 0) return ; if (error) return ; return ( - - setActiveTab(key)} variant="underline" /> + + {}} + filters={TABS} + activeFilter={activeTab} + onFilterChange={(key) => setActiveTab(key)} + /> - + 共 {total} 项任务 {tasks.length === 0 ? ( - + ) : ( - - {tasks.map((task) => { - return ( - Taro.navigateTo({ url: `/pages/pkg-doctor-core/followup/detail/index?id=${task.id}` })} - > - - {getTypeLabel(task.follow_up_type)} - - {getStatusLabel(task.status)} - - - {task.patient_name || '未知患者'} - - 计划日期: {formatDate(task.planned_date)} - + + {tasks.map((task) => ( + Taro.navigateTo({ url: `/pages/pkg-doctor-core/followup/detail/index?id=${task.id}` })} + > + + {getTypeLabel(task.follow_up_type)} + - ); - })} + {task.patient_name || '未知患者'} + + 计划日期: {formatDate(task.planned_date)} + + + ))} )} - + ); }