1.修复睡眠日报中睡眠规律性数据显示错误

2.更新时区设置
This commit is contained in:
wyf
2026-01-07 15:19:16 +08:00
parent 36f19a71eb
commit 575f91e8dd
42 changed files with 4236 additions and 1653 deletions

View File

@@ -96,7 +96,7 @@ getContentById(data, BuildContext context) {
),
child: Padding(
padding:
EdgeInsetsDirectional.fromSTEB(40.rpx, 20.rpx, 40.rpx, 20.rpx),
EdgeInsetsDirectional.fromSTEB(30.rpx, 20.rpx, 30.rpx, 20.rpx),
child: Column(
children: [
/// --- 心率小于 ---
@@ -379,8 +379,8 @@ getContentById(data, BuildContext context) {
} else if (id == 100002) {
// 呼吸异常
int min = 10; // 默认
int max = 40; // 默认
int min = 8; // 默认
int max = 25; // 默认
int interval = 600; // 默认
// 若有用户配置
@@ -434,7 +434,7 @@ getContentById(data, BuildContext context) {
),
child: Padding(
padding:
EdgeInsetsDirectional.fromSTEB(40.rpx, 20.rpx, 40.rpx, 20.rpx),
EdgeInsetsDirectional.fromSTEB(30.rpx, 20.rpx, 30.rpx, 20.rpx),
child: Column(
children: [
/// ---- 呼吸小于 ----
@@ -1025,7 +1025,7 @@ getContentById(data, BuildContext context) {
} else if (id == 100005) {
// 未起床
// 1. 优先从 device_type_setting 中查找用户配置
String time = "23:00"; // 默认值
String time = "7:00"; // 默认值
// 2. 如果找到了用户配置,使用用户配置中的 time 值
if (userConfig != null) {
@@ -1187,7 +1187,7 @@ getContentById(data, BuildContext context) {
);
} else if (id == 200001) {
// 1. 优先从 device_type_setting 中查找用户配置
int score = 60; // 默认值
int score = 50; // 默认值
// 2. 如果找到了用户配置,使用用户配置中的 max 值
if (userConfig != null) {
print('找到用户配置: $userConfig');
@@ -1195,7 +1195,7 @@ getContentById(data, BuildContext context) {
if (userConfig['max'] != null) {
score = userConfig['max'] is int
? userConfig['max']
: int.tryParse(userConfig['max'].toString()) ?? 60;
: int.tryParse(userConfig['max'].toString()) ?? score;
print('从用户配置获取睡眠得分阈值: $score');
}
} else {
@@ -1207,7 +1207,7 @@ getContentById(data, BuildContext context) {
if (defaultConfig['max'] != null) {
score = defaultConfig['max'] is int
? defaultConfig['max']
: int.tryParse(defaultConfig['max'].toString()) ?? 60;
: int.tryParse(defaultConfig['max'].toString()) ?? score;
print('从默认配置获取睡眠得分阈值: $score');
}
} else {
@@ -1235,8 +1235,8 @@ getContentById(data, BuildContext context) {
onTap: () async {
final currentScore = score;
final initialScore = currentScore != null
? int.tryParse(currentScore.toString()) ?? 60
: 60;
? int.tryParse(currentScore.toString()) ?? score
: score;
FocusScope.of(context).requestFocus(FocusNode());
Future.delayed(const Duration(milliseconds: 250), () {
showScorePickerDialog(