更新日历样式

This commit is contained in:
czz
2025-07-11 17:20:22 +08:00
parent ab94817c2c
commit d11943ec6c
2 changed files with 21 additions and 20 deletions

View File

@@ -23,7 +23,7 @@ Widget MonthDataWidget(
), //睡眠评分 ), //睡眠评分
SleepChartContainer( SleepChartContainer(
title: "每日得分", title: "每日得分",
tipText: "每日得分介绍", tipText: "用户本月睡眠分数的汇总。",
sleepReport: sleepReport, sleepReport: sleepReport,
chartContent: LineView( chartContent: LineView(
xLabels: [ xLabels: [
@@ -94,7 +94,7 @@ Widget MonthDataWidget(
IndicatorCompareCard( IndicatorCompareCard(
title: "与上月对比", title: "与上月对比",
headers: ["名称", "上月", "本月", "参考范围"], headers: ["名称", "上月", "本月", "参考范围"],
tooltip: "与上月对比提示", tooltip: "睡眠分数与上月分数进行对比,是通过量化分析近期睡眠质量变化,可了解自身睡眠状态的波动情况,进而调整用户的作息习惯。",
rows: (sleepReport['cwl'] ?? []).map<List<Widget>>((item) { rows: (sleepReport['cwl'] ?? []).map<List<Widget>>((item) {
return [ return [
Text( Text(
@@ -121,7 +121,7 @@ Widget MonthDataWidget(
), ),
SleepChartContainer( SleepChartContainer(
title: "本月睡眠时长", title: "本月睡眠时长",
tipText: "每日得分介绍", tipText: "本月睡眠时长是指从月初到月末,用户每天实际睡眠的时间总和。",
sleepReport: sleepReport, sleepReport: sleepReport,
chartContent: LineView( chartContent: LineView(
xLabels: [ xLabels: [
@@ -187,7 +187,7 @@ Widget MonthDataWidget(
TrendDataTablePage( TrendDataTablePage(
title: sleepReport['dysp'][0]['name'], title: sleepReport['dysp'][0]['name'],
tipText: "入睡时间趋势提示", tipText: sleepReport['dysp'][0]['tips'],
chartContent: LineView( chartContent: LineView(
xLabels: [ xLabels: [
ChartLables( ChartLables(
@@ -253,7 +253,7 @@ Widget MonthDataWidget(
padding: 45.rpx), padding: 45.rpx),
TrendDataTablePage( TrendDataTablePage(
title: sleepReport['dysp'][1]['name'], title: sleepReport['dysp'][1]['name'],
tipText: "起床时间趋势提示", tipText: sleepReport['dysp'][1]['tips'],
chartContent: LineView( chartContent: LineView(
xLabels: [ xLabels: [
ChartLables( ChartLables(
@@ -319,7 +319,7 @@ Widget MonthDataWidget(
padding: 45.rpx), padding: 45.rpx),
TrendDataTablePage( TrendDataTablePage(
title: sleepReport['dysp'][2]['name'], title: sleepReport['dysp'][2]['name'],
tipText: "心率基准趋势提示", tipText: sleepReport['dysp'][2]['tips'],
chartContent: LineView( chartContent: LineView(
xLabels: [ xLabels: [
ChartLables( ChartLables(
@@ -385,7 +385,7 @@ Widget MonthDataWidget(
padding: 45.rpx), padding: 45.rpx),
TrendDataTablePage( TrendDataTablePage(
title: sleepReport['dysp'][3]['name'], title: sleepReport['dysp'][3]['name'],
tipText: "心率变异性趋势提示", tipText: sleepReport['dysp'][3]['tips'],
chartContent: LineView( chartContent: LineView(
xLabels: [ xLabels: [
ChartLables( ChartLables(
@@ -451,7 +451,7 @@ Widget MonthDataWidget(
padding: 45.rpx), padding: 45.rpx),
TrendDataTablePage( TrendDataTablePage(
title: sleepReport['dysp'][4]['name'], title: sleepReport['dysp'][4]['name'],
tipText: "呼吸基准趋势提示", tipText: sleepReport['dysp'][4]['tips'],
chartContent: LineView( chartContent: LineView(
xLabels: [ xLabels: [
ChartLables( ChartLables(
@@ -579,7 +579,8 @@ List<String> buildSleepValueTexts(
String dateStr = ''; String dateStr = '';
if (item['st'] != null) { if (item['st'] != null) {
final dt = DateTime.fromMillisecondsSinceEpoch(item['st']); 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 = [ var q = [
@@ -623,9 +624,9 @@ Map<String, dynamic> buildMonthlyChartData(Map<String, dynamic> dyspData) {
// 获取当前月的总天数(以第一条数据为准) // 获取当前月的总天数(以第一条数据为准)
DateTime baseDate = DateTime.fromMillisecondsSinceEpoch(data.first['st']); DateTime baseDate = DateTime.fromMillisecondsSinceEpoch(data.first['st']);
double daysInMonth = DateTime(baseDate.year, baseDate.month + 1, 0) double daysInMonth =
.day DateTime(baseDate.year, baseDate.month + 1, 0).day.toDouble() -
.toDouble()-1; // 👈 改为 double 1; // 👈 改为 double
List<Offset> points = []; List<Offset> points = [];
List<String> colors = []; List<String> colors = [];

View File

@@ -23,7 +23,7 @@ Widget WeekDataWidget(
), //睡眠评分 ), //睡眠评分
SleepChartContainer( SleepChartContainer(
title: "每日得分", title: "每日得分",
tipText: "睡眠规律性介绍", tipText: "用户本周睡眠分数的汇总。",
sleepReport: sleepReport, sleepReport: sleepReport,
chartContent: LineView( chartContent: LineView(
xLabels: [ xLabels: [
@@ -108,7 +108,7 @@ Widget WeekDataWidget(
IndicatorCompareCard( IndicatorCompareCard(
title: "与上周对比", title: "与上周对比",
headers: ["名称", "上周", "本周", "参考范围"], headers: ["名称", "上周", "本周", "参考范围"],
tooltip: "与上周对比提示", tooltip: "睡眠分数与上周分数进行对比,是通过量化分析近期睡眠质量变化,可了解自身睡眠状态的波动情况,进而调整用户的作息习惯。",
rows: (sleepReport['cwl'] ?? []).map<List<Widget>>((item) { rows: (sleepReport['cwl'] ?? []).map<List<Widget>>((item) {
return [ return [
Text( Text(
@@ -135,7 +135,7 @@ Widget WeekDataWidget(
), ),
SleepChartContainer( SleepChartContainer(
title: "本周睡眠时长", title: "本周睡眠时长",
tipText: "本周睡眠时长介绍", tipText: "本周睡眠时长是指从周一到周日内,每天实际睡眠的时间总和。",
sleepReport: sleepReport, sleepReport: sleepReport,
chartContent: LineView( chartContent: LineView(
xLabels: [ xLabels: [
@@ -212,7 +212,7 @@ Widget WeekDataWidget(
), ),
TrendDataTablePage( TrendDataTablePage(
title: sleepReport['dysp'][0]['name'], title: sleepReport['dysp'][0]['name'],
tipText: "入睡时间趋势提示", tipText: sleepReport['dysp'][0]['tips'],
chartContent: LineView( chartContent: LineView(
xLabels: [ xLabels: [
ChartLables( ChartLables(
@@ -290,7 +290,7 @@ Widget WeekDataWidget(
padding: 45.rpx), padding: 45.rpx),
TrendDataTablePage( TrendDataTablePage(
title: sleepReport['dysp'][1]['name'], title: sleepReport['dysp'][1]['name'],
tipText: "起床时间趋势提示", tipText: sleepReport['dysp'][1]['tips'],
chartContent: LineView( chartContent: LineView(
xLabels: [ xLabels: [
ChartLables( ChartLables(
@@ -368,7 +368,7 @@ Widget WeekDataWidget(
padding: 45.rpx), padding: 45.rpx),
TrendDataTablePage( TrendDataTablePage(
title: sleepReport['dysp'][2]['name'], title: sleepReport['dysp'][2]['name'],
tipText: "心率基准趋势提示", tipText:sleepReport['dysp'][2]['tips'],
chartContent: LineView( chartContent: LineView(
xLabels: [ xLabels: [
ChartLables( ChartLables(
@@ -446,7 +446,7 @@ Widget WeekDataWidget(
padding: 45.rpx), padding: 45.rpx),
TrendDataTablePage( TrendDataTablePage(
title: sleepReport['dysp'][3]['name'], title: sleepReport['dysp'][3]['name'],
tipText: "心率变异性趋势提示", tipText: sleepReport['dysp'][3]['tips'],
chartContent: LineView( chartContent: LineView(
xLabels: [ xLabels: [
ChartLables( ChartLables(
@@ -524,7 +524,7 @@ Widget WeekDataWidget(
padding: 45.rpx), padding: 45.rpx),
TrendDataTablePage( TrendDataTablePage(
title: sleepReport['dysp'][4]['name'], title: sleepReport['dysp'][4]['name'],
tipText: "呼吸基准趋势提示", tipText: sleepReport['dysp'][4]['tips'],
chartContent: LineView( chartContent: LineView(
xLabels: [ xLabels: [
ChartLables( ChartLables(