更新睡眠报告时区显示问题。
This commit is contained in:
@@ -196,32 +196,36 @@ class _HeartRateStandardWidgetState extends State<HeartRateStandardWidget> {
|
||||
),
|
||||
Padding(
|
||||
padding:
|
||||
EdgeInsetsDirectional.fromSTEB(0.rpx, 0.rpx, 30.rpx, 0.rpx),
|
||||
EdgeInsetsDirectional.fromSTEB(0.rpx, 0.rpx, 0.rpx, 0.rpx),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
// 圆形小球容器
|
||||
Container(
|
||||
width: 14.rpx, // 圆球的直径
|
||||
height: 14.rpx,
|
||||
decoration: BoxDecoration(
|
||||
color: themeController.currentColor.sc2, // 小球的颜色
|
||||
shape: BoxShape.circle, // 设置为圆形
|
||||
Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
0.rpx, 0.rpx, 30.rpx, 0.rpx),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
// 圆形小球容器
|
||||
Container(
|
||||
width: 14.rpx, // 圆球的直径
|
||||
height: 14.rpx,
|
||||
decoration: BoxDecoration(
|
||||
color: themeController.currentColor.sc2, // 小球的颜色
|
||||
shape: BoxShape.circle, // 设置为圆形
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(width: 15.rpx), // 圆球和文字之间的间隔
|
||||
// 文字
|
||||
Text(
|
||||
'正常范围'.tr + "${range}",
|
||||
style: TextStyle(
|
||||
fontSize:
|
||||
AppConstants().smaller_text_fontSize, // 文字的大小
|
||||
color: themeController.currentColor.sc3, // 文字颜色
|
||||
SizedBox(width: 15.rpx), // 圆球和文字之间的间隔
|
||||
// 文字
|
||||
Text(
|
||||
'正常范围'.tr + "${range}",
|
||||
style: TextStyle(
|
||||
fontSize:
|
||||
AppConstants().smaller_text_fontSize, // 文字的大小
|
||||
color: themeController.currentColor.sc3, // 文字颜色
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
// Container(
|
||||
// // color: Colors.red,
|
||||
@@ -235,18 +239,22 @@ class _HeartRateStandardWidgetState extends State<HeartRateStandardWidget> {
|
||||
// dataPoints: dataPoints,
|
||||
// ),
|
||||
// ),
|
||||
Container(
|
||||
// color: Colors.red,
|
||||
width: double.infinity,
|
||||
// height: 300.rpx,
|
||||
child: TimeSeriesChart(
|
||||
startTime: startTime,
|
||||
endTime: endTime,
|
||||
yMin: 50,
|
||||
yMax: 150,
|
||||
dataPoints: dataPoints,
|
||||
// actYMin: min.toDouble(),
|
||||
// actYMax: max.toDouble(),
|
||||
Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
0.rpx, 0.rpx, 30.rpx, 0.rpx),
|
||||
child: Container(
|
||||
// color: Colors.red,
|
||||
width: double.infinity,
|
||||
// height: 300.rpx,
|
||||
child: TimeSeriesChart(
|
||||
startTime: startTime,
|
||||
endTime: endTime,
|
||||
yMin: 50,
|
||||
yMax: 150,
|
||||
dataPoints: dataPoints,
|
||||
// actYMin: min.toDouble(),
|
||||
// actYMax: max.toDouble(),
|
||||
),
|
||||
),
|
||||
),
|
||||
// Padding(
|
||||
@@ -406,7 +414,7 @@ class _HeartRateStandardWidgetState extends State<HeartRateStandardWidget> {
|
||||
// ),
|
||||
Padding(
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
30.rpx, 0.rpx, 0.rpx, 0.rpx),
|
||||
0.rpx, 0.rpx, 0.rpx, 0.rpx),
|
||||
child: Row(
|
||||
children: [
|
||||
_buildHeartRateItem(avgHeartRate),
|
||||
|
||||
@@ -14,6 +14,7 @@ import 'package:vbvs_app/component/tool/ClickableContainer.dart';
|
||||
import 'package:vbvs_app/component/tool/TopSlideNotification.dart';
|
||||
import 'package:vbvs_app/controller/date/CalendarController.dart';
|
||||
import 'package:vbvs_app/controller/sleep/sleep_report_controller.dart';
|
||||
import 'package:vbvs_app/controller/sleep/sleep_time_convert.dart';
|
||||
import 'package:vbvs_app/controller/theme_controller/ThemeController.dart';
|
||||
import 'package:vbvs_app/language/AppLanguage.dart';
|
||||
import 'package:vbvs_app/pages/common/selectDialog.dart';
|
||||
@@ -106,7 +107,11 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
|
||||
// "https://sleepdata.he-info.com/api/analysis/sleep/analysis?mac=${widget.data['mac']}&time=$date&type=${sleepReportController.model.type}",
|
||||
queryUrl: queryUrl,
|
||||
onSuccess: (res) {
|
||||
sleepReportController.sleepReport.value = res.data;
|
||||
// 获取原始数据
|
||||
final sleepData = Map<String, dynamic>.from(res.data);
|
||||
// 处理时区转换
|
||||
applyTimezoneConversion(sleepData);
|
||||
sleepReportController.sleepReport.value = sleepData;
|
||||
sleepReportController.updateAll();
|
||||
_scrollToTargetComponent(sleepReportController.sleepReport);
|
||||
},
|
||||
@@ -997,8 +1002,10 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
|
||||
// "https://sleepdata.he-info.com/api/analysis/sleep/analysis?mac=${widget.data['mac']}&time=${data}&type=${sleepReportController.model.type}",
|
||||
queryUrl: queryUrl,
|
||||
onSuccess: (res) {
|
||||
print(res);
|
||||
sleepReportController.sleepReport.value = res.data;
|
||||
final sleepData = Map<String, dynamic>.from(res.data);
|
||||
// 处理时区转换
|
||||
applyTimezoneConversion(sleepData);
|
||||
sleepReportController.sleepReport.value = sleepData;
|
||||
sleepReportController.updateAll();
|
||||
},
|
||||
onFailure: (res) {
|
||||
@@ -1088,8 +1095,10 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
|
||||
// "https://sleepdata.he-info.com/api/analysis/sleep/analysis?mac=${widget.data['mac']}&time=${data}&type=${sleepReportController.model.type}",
|
||||
queryUrl: queryUrl,
|
||||
onSuccess: (res) {
|
||||
print(res);
|
||||
sleepReportController.sleepReport.value = res.data;
|
||||
final sleepData = Map<String, dynamic>.from(res.data);
|
||||
// 处理时区转换
|
||||
applyTimezoneConversion(sleepData);
|
||||
sleepReportController.sleepReport.value = sleepData;
|
||||
sleepReportController.updateAll();
|
||||
},
|
||||
onFailure: (res) {
|
||||
@@ -1138,8 +1147,10 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
|
||||
// "https://sleepdata.he-info.com/api/analysis/sleep/analysis?mac=${widget.data['mac']}&time=${data}&type=${sleepReportController.model.type}",
|
||||
queryUrl: queryUrl,
|
||||
onSuccess: (res) {
|
||||
print(res);
|
||||
sleepReportController.sleepReport.value = res.data;
|
||||
final sleepData = Map<String, dynamic>.from(res.data);
|
||||
// 处理时区转换
|
||||
applyTimezoneConversion(sleepData);
|
||||
sleepReportController.sleepReport.value = sleepData;
|
||||
sleepReportController.updateAll();
|
||||
},
|
||||
onFailure: (res) {
|
||||
@@ -1237,8 +1248,11 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
|
||||
// "https://sleepdata.he-info.com/api/analysis/sleep/analysis?mac=${widget.data['mac']}&time=${data}&type=${sleepReportController.model.type}",
|
||||
queryUrl: queryUrl,
|
||||
onSuccess: (res) {
|
||||
print(res);
|
||||
sleepReportController.sleepReport.value = res.data;
|
||||
final sleepData =
|
||||
Map<String, dynamic>.from(res.data);
|
||||
// 处理时区转换
|
||||
applyTimezoneConversion(sleepData);
|
||||
sleepReportController.sleepReport.value = sleepData;
|
||||
sleepReportController.updateAll();
|
||||
},
|
||||
onFailure: (res) {
|
||||
@@ -1285,9 +1299,12 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
|
||||
// "https://sleepdata.he-info.com/api/analysis/sleep/analysis?mac=${widget.data['mac']}&time=${data}&type=${sleepReportController.model.type}",
|
||||
queryUrl: queryUrl,
|
||||
onSuccess: (res) {
|
||||
print(res);
|
||||
final sleepData =
|
||||
Map<String, dynamic>.from(res.data);
|
||||
// 处理时区转换
|
||||
applyTimezoneConversion(sleepData);
|
||||
sleepReportController.sleepReport.value =
|
||||
res.data;
|
||||
sleepData;
|
||||
sleepReportController.updateAll();
|
||||
},
|
||||
onFailure: (res) {
|
||||
@@ -1400,7 +1417,10 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
|
||||
// "https://sleepdata.he-info.com/api/analysis/sleep/analysis?mac=${widget.data['mac']}&time=$data&type=$type",
|
||||
queryUrl: queryUrl,
|
||||
onSuccess: (res) {
|
||||
sleepReportController.sleepReport.value = res.data;
|
||||
final sleepData = Map<String, dynamic>.from(res.data);
|
||||
// 处理时区转换
|
||||
applyTimezoneConversion(sleepData);
|
||||
sleepReportController.sleepReport.value = sleepData;
|
||||
},
|
||||
onFailure: (res) {
|
||||
TopSlideNotification.show(
|
||||
@@ -1485,7 +1505,10 @@ class _NewSleepReportPageState extends State<NewSleepReportPage> {
|
||||
queryUrl: queryUrl,
|
||||
onSuccess: (res) {
|
||||
sleepReportController.isLoading.value = false;
|
||||
sleepReportController.sleepReport.value = res.data;
|
||||
final sleepData = Map<String, dynamic>.from(res.data);
|
||||
// 处理时区转换
|
||||
applyTimezoneConversion(sleepData);
|
||||
sleepReportController.sleepReport.value = sleepData;
|
||||
sleepReportController.updateAll();
|
||||
_scrollToTargetComponent(sleepReportController.sleepReport);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user