diff --git a/apps/miniprogram/src/pages/health/index.tsx b/apps/miniprogram/src/pages/health/index.tsx index 3487f8d..bef1033 100644 --- a/apps/miniprogram/src/pages/health/index.tsx +++ b/apps/miniprogram/src/pages/health/index.tsx @@ -1,6 +1,7 @@ import { View, Text } from '@tarojs/components'; import Taro, { useDidShow } from '@tarojs/taro'; import { useHealthStore } from '../../stores/health'; +import Loading from '../../components/Loading'; import './index.scss'; export default function Health() { @@ -35,6 +36,9 @@ export default function Health() { + {loading && !todaySummary ? ( + + ) : ( {items.map((item) => ( goToTrend(item.indicator)}> @@ -47,6 +51,7 @@ export default function Health() { ))} + )} goToTrend('blood_pressure_systolic')}> diff --git a/apps/miniprogram/src/pages/index/index.tsx b/apps/miniprogram/src/pages/index/index.tsx index 585c16a..ffd8631 100644 --- a/apps/miniprogram/src/pages/index/index.tsx +++ b/apps/miniprogram/src/pages/index/index.tsx @@ -3,11 +3,12 @@ import Taro, { useDidShow } from '@tarojs/taro'; import { useAuthStore } from '../../stores/auth'; import { useHealthStore } from '../../stores/health'; import EmptyState from '../../components/EmptyState'; +import Loading from '../../components/Loading'; import './index.scss'; export default function Index() { const { user, currentPatient, restore: restoreAuth } = useAuthStore(); - const { todaySummary, refreshToday } = useHealthStore(); + const { todaySummary, loading, refreshToday } = useHealthStore(); useDidShow(() => { restoreAuth(); @@ -48,15 +49,19 @@ export default function Index() { 今日健康 - - {healthItems.map((item) => ( - - {item.label} - {item.value} - {item.unit} - - ))} - + {loading && !todaySummary ? ( + + ) : ( + + {healthItems.map((item) => ( + + {item.label} + {item.value} + {item.unit} + + ))} + + )} diff --git a/apps/miniprogram/src/pages/report/detail/index.tsx b/apps/miniprogram/src/pages/report/detail/index.tsx index 7b84c86..cbe2022 100644 --- a/apps/miniprogram/src/pages/report/detail/index.tsx +++ b/apps/miniprogram/src/pages/report/detail/index.tsx @@ -2,6 +2,7 @@ import React, { useState, useEffect } from 'react'; import { View, Text } from '@tarojs/components'; import Taro, { useRouter } from '@tarojs/taro'; import { getReportDetail, LabReport } from '../../../services/report'; +import Loading from '../../../components/Loading'; import './index.scss'; interface IndicatorItem { @@ -51,9 +52,7 @@ export default function ReportDetail() { if (loading) { return ( - - 加载中... - + ); }