From d11943ec6cb6aa0336fac81828a9122b15ea02af Mon Sep 17 00:00:00 2001 From: czz <862977248@qq.com> Date: Fri, 11 Jul 2025 17:20:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=97=A5=E5=8E=86=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/MonthDataWidget.dart | 25 ++++++++++--------- .../component/WeekDataWidget.dart | 16 ++++++------ 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/lib/pages/sleep_report/component/MonthDataWidget.dart b/lib/pages/sleep_report/component/MonthDataWidget.dart index 0f345b2..75a62c4 100644 --- a/lib/pages/sleep_report/component/MonthDataWidget.dart +++ b/lib/pages/sleep_report/component/MonthDataWidget.dart @@ -23,7 +23,7 @@ Widget MonthDataWidget( ), //睡眠评分 SleepChartContainer( title: "每日得分", - tipText: "每日得分介绍", + tipText: "用户本月睡眠分数的汇总。", sleepReport: sleepReport, chartContent: LineView( xLabels: [ @@ -94,7 +94,7 @@ Widget MonthDataWidget( IndicatorCompareCard( title: "与上月对比", headers: ["名称", "上月", "本月", "参考范围"], - tooltip: "与上月对比提示", + tooltip: "睡眠分数与上月分数进行对比,是通过量化分析近期睡眠质量变化,可了解自身睡眠状态的波动情况,进而调整用户的作息习惯。", rows: (sleepReport['cwl'] ?? []).map>((item) { return [ Text( @@ -121,7 +121,7 @@ Widget MonthDataWidget( ), SleepChartContainer( title: "本月睡眠时长", - tipText: "每日得分介绍", + tipText: "本月睡眠时长是指从月初到月末,用户每天实际睡眠的时间总和。", sleepReport: sleepReport, chartContent: LineView( xLabels: [ @@ -187,7 +187,7 @@ Widget MonthDataWidget( TrendDataTablePage( title: sleepReport['dysp'][0]['name'], - tipText: "入睡时间趋势提示", + tipText: sleepReport['dysp'][0]['tips'], chartContent: LineView( xLabels: [ ChartLables( @@ -253,7 +253,7 @@ Widget MonthDataWidget( padding: 45.rpx), TrendDataTablePage( title: sleepReport['dysp'][1]['name'], - tipText: "起床时间趋势提示", + tipText: sleepReport['dysp'][1]['tips'], chartContent: LineView( xLabels: [ ChartLables( @@ -319,7 +319,7 @@ Widget MonthDataWidget( padding: 45.rpx), TrendDataTablePage( title: sleepReport['dysp'][2]['name'], - tipText: "心率基准趋势提示", + tipText: sleepReport['dysp'][2]['tips'], chartContent: LineView( xLabels: [ ChartLables( @@ -385,7 +385,7 @@ Widget MonthDataWidget( padding: 45.rpx), TrendDataTablePage( title: sleepReport['dysp'][3]['name'], - tipText: "心率变异性趋势提示", + tipText: sleepReport['dysp'][3]['tips'], chartContent: LineView( xLabels: [ ChartLables( @@ -451,7 +451,7 @@ Widget MonthDataWidget( padding: 45.rpx), TrendDataTablePage( title: sleepReport['dysp'][4]['name'], - tipText: "呼吸基准趋势提示", + tipText: sleepReport['dysp'][4]['tips'], chartContent: LineView( xLabels: [ ChartLables( @@ -579,7 +579,8 @@ List buildSleepValueTexts( String dateStr = ''; if (item['st'] != null) { final dt = DateTime.fromMillisecondsSinceEpoch(item['st']); - dateStr = "${dt.year}年${dt.month.toString().padLeft(2, '0')}月${dt.day.toString().padLeft(2, '0')}日"; + dateStr = + "${dt.year}年${dt.month.toString().padLeft(2, '0')}月${dt.day.toString().padLeft(2, '0')}日"; } var q = [ @@ -623,9 +624,9 @@ Map buildMonthlyChartData(Map dyspData) { // 获取当前月的总天数(以第一条数据为准) DateTime baseDate = DateTime.fromMillisecondsSinceEpoch(data.first['st']); - double daysInMonth = DateTime(baseDate.year, baseDate.month + 1, 0) - .day - .toDouble()-1; // 👈 改为 double + double daysInMonth = + DateTime(baseDate.year, baseDate.month + 1, 0).day.toDouble() - + 1; // 👈 改为 double List points = []; List colors = []; diff --git a/lib/pages/sleep_report/component/WeekDataWidget.dart b/lib/pages/sleep_report/component/WeekDataWidget.dart index c29a015..681a224 100644 --- a/lib/pages/sleep_report/component/WeekDataWidget.dart +++ b/lib/pages/sleep_report/component/WeekDataWidget.dart @@ -23,7 +23,7 @@ Widget WeekDataWidget( ), //睡眠评分 SleepChartContainer( title: "每日得分", - tipText: "睡眠规律性介绍", + tipText: "用户本周睡眠分数的汇总。", sleepReport: sleepReport, chartContent: LineView( xLabels: [ @@ -108,7 +108,7 @@ Widget WeekDataWidget( IndicatorCompareCard( title: "与上周对比", headers: ["名称", "上周", "本周", "参考范围"], - tooltip: "与上周对比提示", + tooltip: "睡眠分数与上周分数进行对比,是通过量化分析近期睡眠质量变化,可了解自身睡眠状态的波动情况,进而调整用户的作息习惯。", rows: (sleepReport['cwl'] ?? []).map>((item) { return [ Text( @@ -135,7 +135,7 @@ Widget WeekDataWidget( ), SleepChartContainer( title: "本周睡眠时长", - tipText: "本周睡眠时长介绍", + tipText: "本周睡眠时长是指从周一到周日内,每天实际睡眠的时间总和。", sleepReport: sleepReport, chartContent: LineView( xLabels: [ @@ -212,7 +212,7 @@ Widget WeekDataWidget( ), TrendDataTablePage( title: sleepReport['dysp'][0]['name'], - tipText: "入睡时间趋势提示", + tipText: sleepReport['dysp'][0]['tips'], chartContent: LineView( xLabels: [ ChartLables( @@ -290,7 +290,7 @@ Widget WeekDataWidget( padding: 45.rpx), TrendDataTablePage( title: sleepReport['dysp'][1]['name'], - tipText: "起床时间趋势提示", + tipText: sleepReport['dysp'][1]['tips'], chartContent: LineView( xLabels: [ ChartLables( @@ -368,7 +368,7 @@ Widget WeekDataWidget( padding: 45.rpx), TrendDataTablePage( title: sleepReport['dysp'][2]['name'], - tipText: "心率基准趋势提示", + tipText:sleepReport['dysp'][2]['tips'], chartContent: LineView( xLabels: [ ChartLables( @@ -446,7 +446,7 @@ Widget WeekDataWidget( padding: 45.rpx), TrendDataTablePage( title: sleepReport['dysp'][3]['name'], - tipText: "心率变异性趋势提示", + tipText: sleepReport['dysp'][3]['tips'], chartContent: LineView( xLabels: [ ChartLables( @@ -524,7 +524,7 @@ Widget WeekDataWidget( padding: 45.rpx), TrendDataTablePage( title: sleepReport['dysp'][4]['name'], - tipText: "呼吸基准趋势提示", + tipText: sleepReport['dysp'][4]['tips'], chartContent: LineView( xLabels: [ ChartLables(