From 54a0e393ac525c990c4a94d92b4510330aa41b78 Mon Sep 17 00:00:00 2001 From: iven Date: Fri, 24 Apr 2026 12:27:16 +0800 Subject: [PATCH] =?UTF-8?q?fix(miniprogram):=20=E9=A6=96=E9=A1=B5/?= =?UTF-8?q?=E5=81=A5=E5=BA=B7=E9=A1=B5/=E8=AF=A6=E6=83=85=E9=A1=B5?= =?UTF-8?q?=E7=BB=9F=E4=B8=80=E4=BD=BF=E7=94=A8=20Loading=20=E7=BB=84?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/miniprogram/src/pages/health/index.tsx | 5 ++++ apps/miniprogram/src/pages/index/index.tsx | 25 +++++++++++-------- .../src/pages/report/detail/index.tsx | 5 ++-- 3 files changed, 22 insertions(+), 13 deletions(-) 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 ( - - 加载中... - + ); }