隐藏未实现功能

This commit is contained in:
wyf
2025-08-21 09:52:37 +08:00
parent a69209db72
commit 4fba3eb3a4
6 changed files with 83 additions and 73 deletions

View File

@@ -59,7 +59,7 @@ class DeviceStatusInfoWidget extends StatelessWidget {
// ),
),
Text(
value,
value.tr,
style: TextStyle(
fontFamily: 'Inter',
fontSize: 48.rpx,
@@ -72,7 +72,7 @@ class DeviceStatusInfoWidget extends StatelessWidget {
.addToStart(SizedBox(width: 31.rpx)),
),
Text(
title,
title.tr,
style: TextStyle(
fontFamily: 'Inter',
fontSize: 30.rpx,

View File

@@ -123,18 +123,23 @@ class _InstantBodyPageState extends State<InstantBodyPage>
CommonVariables.callMap["/vsbs/web/rt/marttress"] = (data) {
inBed = data["inBed"];
// 心率 呼吸 体动 呼吸暂停
if ("离床" == inBed) {
breathState = "";
if ("离床".tr == inBed) {
breathState = "".tr;
bodyMotion = 0;
breathrate = 0;
heartrate = 0;
snores = "";
snores = "".tr;
} else {
breathState = data["breathState"];
bodyMotion = data['bodyMotion'];
breathrate = data["breathRate"];
heartrate = data['heartRate'];
snores = data['snores'];
breathState = data["breathState"] == null || data["breathState"] == ""
? "-"
: data["breathState"].toString().tr;
bodyMotion = data['bodyMotion'] == null ? 0 : data['bodyMotion'];
breathrate = data["breathRate"] == null ? 0 : data["breathRate"];
heartrate = data['heartRate'] == null ? 0 : data['heartRate'];
snores = data['snores'] == null || data['snores'] == ""
? "".tr
: data['snores'].tr;
}
if (mounted) {
@@ -142,7 +147,6 @@ class _InstantBodyPageState extends State<InstantBodyPage>
onlineState = "在线".tr; // 接收到数据,设置为在线
});
}
_startOnlineTimer(); // 重置定时器
};
@@ -184,7 +188,7 @@ class _InstantBodyPageState extends State<InstantBodyPage>
TextSpan(
text: "${onlineState}",
style: TextStyle(
color: onlineState == '在线'
color: onlineState == '在线'.tr
? themeController.currentColor.sc2
: themeController
.currentColor.sc9, // 👈 单独设置颜色
@@ -454,7 +458,7 @@ class _InstantBodyPageState extends State<InstantBodyPage>
title: "体动".tr,
iconAsset:
"assets/img/icon/bodymotion.svg",
value: inBed == "离床"
value: inBed == "离床".tr
? ("-")
: (bodyMotion == null ||
bodyMotion == -1)
@@ -471,7 +475,7 @@ class _InstantBodyPageState extends State<InstantBodyPage>
title: "心率".tr,
iconAsset:
"assets/img/icon/heart.svg",
value: inBed == "离床"
value: inBed == "离床".tr
? "-"
: ((heartrate == null ||
heartrate == -1)
@@ -482,7 +486,7 @@ class _InstantBodyPageState extends State<InstantBodyPage>
title: "打鼾".tr,
iconAsset:
"assets/img/icon/snore.svg",
value: inBed == "离床"
value: inBed == "离床".tr
? "-"
: ('${snores}'.tr),
),
@@ -496,7 +500,7 @@ class _InstantBodyPageState extends State<InstantBodyPage>
title: "呼吸".tr,
iconAsset:
"assets/img/icon/breathe.svg",
value: inBed == "离床"
value: inBed == "离床".tr
? ("-")
: ((breathrate == null ||
breathrate == -1)
@@ -507,7 +511,7 @@ class _InstantBodyPageState extends State<InstantBodyPage>
title: "呼吸暂停".tr,
iconAsset:
"assets/img/icon/breathe_pause.svg",
value: inBed == "离床"
value: inBed == "离床".tr
? "-"
: ('${breathState}'),
),