From 00eb60acf54bfa5dcfebb477ef81f537ffd8c685 Mon Sep 17 00:00:00 2001 From: wyf <494641114@qq.com> Date: Fri, 11 Jul 2025 16:20:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=AE=9E=E6=97=B6=E4=BD=93?= =?UTF-8?q?=E5=BE=81=E6=95=B0=E6=8D=AE=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/DeviceDataComponentWidget.dart | 18 ++++++--- lib/pages/device/instant_body_page.dart | 38 ++++++++++++------- 2 files changed, 37 insertions(+), 19 deletions(-) diff --git a/lib/pages/device/component/DeviceDataComponentWidget.dart b/lib/pages/device/component/DeviceDataComponentWidget.dart index 5f0b2bf..2f5aab7 100644 --- a/lib/pages/device/component/DeviceDataComponentWidget.dart +++ b/lib/pages/device/component/DeviceDataComponentWidget.dart @@ -1207,11 +1207,19 @@ class _DeviceDataComponentWidgetState extends State { child: CustomCard( borderRadius: AppConstants().button_container_radius, onTap: () { - String mac = widget.device['mac']; - String sleepReportUrl = - "${ServiceConstant.sleep_report_url}?mac=${mac}&token=${ServiceConstant.sleep_token}"; - Get.toNamed("/sleepReportPage", - arguments: sleepReportUrl); + // String mac = widget.device['mac']; + // String sleepReportUrl = + // "${ServiceConstant.sleep_report_url}?mac=${mac}&token=${ServiceConstant.sleep_token}"; + // Get.toNamed("/sleepReportPage", + // arguments: sleepReportUrl); + Get.toNamed("/newSleepReportPage", arguments: { + 'date':DateTime.now().millisecondsSinceEpoch, + "mac": widget.device['mac'], + 'type': 1, + 'name': 'sleep', //'sleep', 'heartRate' 或 'breathe' + // 'itemName': widget.data['id'], + 'person': widget.device['person'], + }); }, colors: [ themeController.currentColor.sc1, diff --git a/lib/pages/device/instant_body_page.dart b/lib/pages/device/instant_body_page.dart index d4f0763..de7657e 100644 --- a/lib/pages/device/instant_body_page.dart +++ b/lib/pages/device/instant_body_page.dart @@ -830,10 +830,12 @@ class _InstantBodyPageState extends State title: "体动".tr, iconAsset: "assets/img/icon/bodymotion.svg", - value: (bodyMotion == null || - bodyMotion == -1) - ? "未知数据".tr - : "$bodyMotion", + value: inBed == "离床" + ? ("-") + : (bodyMotion == null || + bodyMotion == -1) + ? "未知数据".tr + : "$bodyMotion", ), ], ), @@ -845,16 +847,20 @@ class _InstantBodyPageState extends State title: "心率".tr, iconAsset: "assets/img/icon/heart.svg", - value: (heartrate == null || - heartrate == -1) - ? "未知数据".tr - : "$heartrate", + value: inBed == "离床" + ? "-" + : ((heartrate == null || + heartrate == -1) + ? "未知数据".tr + : "$heartrate"), ), DeviceStatusInfoWidget( title: "打鼾".tr, iconAsset: "assets/img/icon/snore.svg", - value: '${snores}'.tr, + value: inBed == "离床" + ? "-" + : ('${snores}'.tr), ), ], ), @@ -866,16 +872,20 @@ class _InstantBodyPageState extends State title: "呼吸".tr, iconAsset: "assets/img/icon/breathe.svg", - value: (breathrate == null || - breathrate == -1) - ? "未知数据".tr - : "$breathrate", + value: inBed == "离床" + ? ("-") + : ((breathrate == null || + breathrate == -1) + ? "未知数据".tr + : "$breathrate"), ), DeviceStatusInfoWidget( title: "呼吸暂停".tr, iconAsset: "assets/img/icon/breathe_pause.svg", - value: '${breathState}', + value: inBed == "离床" + ? "-" + : ('${breathState}'), ), ], ),