Commit 965047dd7d91da4d011b211035c30459cb848acc

Authored by 常守达
1 parent a6814ded

fix(ui): 看板问题修复

@@ -258,11 +258,11 @@ class TodayController extends GetMaterialController { @@ -258,11 +258,11 @@ class TodayController extends GetMaterialController {
258 258
259 void changeDate(DateTime date, {DateTime? focused}) { 259 void changeDate(DateTime date, {DateTime? focused}) {
260 final normalizedDate = _clampDate(date); 260 final normalizedDate = _clampDate(date);
261 - if (!DateUtils.isSameDay(date, lastSelectableDay.value) &&  
262 - !_userStateService.isVip) {  
263 - toPremiumPage('今日-查看非当日数据');  
264 - return;  
265 - } 261 + // if (!DateUtils.isSameDay(date, lastSelectableDay.value) &&
  262 + // !_userStateService.isVip) {
  263 + // toPremiumPage('今日-查看非当日数据');
  264 + // return;
  265 + // }
266 selectedDate.value = normalizedDate; 266 selectedDate.value = normalizedDate;
267 focusedDay.value = _clampDate(focused ?? normalizedDate); 267 focusedDay.value = _clampDate(focused ?? normalizedDate);
268 } 268 }
@@ -33,63 +33,70 @@ class HrvMeasurementBottomSheet extends StatelessWidget { @@ -33,63 +33,70 @@ class HrvMeasurementBottomSheet extends StatelessWidget {
33 ), 33 ),
34 child: SafeArea( 34 child: SafeArea(
35 top: false, 35 top: false,
36 - child: Column( 36 + child: Stack(
37 children: [ 37 children: [
38 - SizedBox(  
39 - height: 64,  
40 - child: Stack(  
41 - alignment: Alignment.center,  
42 - children: [  
43 - Positioned(  
44 - left: 16,  
45 - child: GestureDetector(  
46 - behavior: HitTestBehavior.opaque,  
47 - onTap: Get.back,  
48 - child: SizedBox(  
49 - width: 44,  
50 - height: 44,  
51 - child: Center(  
52 - child: Image.asset(  
53 - 'assets/images/common/ic_close.png',  
54 - width: 20,  
55 - height: 20,  
56 - color: context.colors.chartPurple,  
57 - ),  
58 - ),  
59 - ),  
60 - ),  
61 - ),  
62 - ], 38 + Container(
  39 + margin: EdgeInsets.only(
  40 + left: 16,
  41 + right: 16,
63 ), 42 ),
64 - ),  
65 - Expanded(  
66 - child: Container(  
67 - margin: EdgeInsets.only(left: 16, right: 16),  
68 - padding: const EdgeInsets.only(top: 16, bottom: 32), 43 + padding: const EdgeInsets.only(
  44 + top: 16,
  45 + bottom: 32,
  46 + ),
  47 + child: SingleChildScrollView(
  48 + padding: EdgeInsets.only(top: 64, bottom: 48),
69 child: Center( 49 child: Center(
70 child: const _HrvInstructionCard(), 50 child: const _HrvInstructionCard(),
71 ), 51 ),
72 ), 52 ),
73 ), 53 ),
74 - Container(  
75 - height: 48,  
76 - width: 280,  
77 - margin: const EdgeInsets.only(bottom: 20),  
78 - child: ElevatedButton(  
79 - onPressed: Get.back,  
80 - style: ElevatedButton.styleFrom(  
81 - backgroundColor: context.colors.primary,  
82 - foregroundColor: Colors.white,  
83 - elevation: 0,  
84 - shape: RoundedRectangleBorder(  
85 - borderRadius: BorderRadius.circular(24), 54 + Positioned(
  55 + height: 64,
  56 + left: 16,
  57 + child: GestureDetector(
  58 + behavior: HitTestBehavior.opaque,
  59 + onTap: Get.back,
  60 + child: SizedBox(
  61 + width: 44,
  62 + height: 44,
  63 + child: Center(
  64 + child: Image.asset(
  65 + 'assets/images/common/ic_close.png',
  66 + width: 20,
  67 + height: 20,
  68 + color: context.colors.chartPurple,
  69 + ),
86 ), 70 ),
87 ), 71 ),
88 - child: Text(  
89 - l10n.todayBottomSheetGotIt,  
90 - style: TextStyle(  
91 - fontSize: 16,  
92 - fontWeight: FontWeight.w600, 72 + ),
  73 + ),
  74 + Positioned(
  75 + bottom: 0,
  76 + left: 0,
  77 + right: 0,
  78 + child: Center(
  79 + child: Container(
  80 + height: 48,
  81 + width: 280,
  82 + margin: const EdgeInsets.only(bottom: 20),
  83 + child: ElevatedButton(
  84 + onPressed: Get.back,
  85 + style: ElevatedButton.styleFrom(
  86 + backgroundColor: context.colors.primary,
  87 + foregroundColor: Colors.white,
  88 + elevation: 0,
  89 + shape: RoundedRectangleBorder(
  90 + borderRadius: BorderRadius.circular(24),
  91 + ),
  92 + ),
  93 + child: Text(
  94 + l10n.todayBottomSheetGotIt,
  95 + style: TextStyle(
  96 + fontSize: 16,
  97 + fontWeight: FontWeight.w600,
  98 + ),
  99 + ),
93 ), 100 ),
94 ), 101 ),
95 ), 102 ),
1 import 'package:doublefeel_flutter/app/widget/circular_gradient_progress/combine.dart'; 1 import 'package:doublefeel_flutter/app/widget/circular_gradient_progress/combine.dart';
  2 +import 'package:doublefeel_flutter/core/config/app_environment_config.dart';
2 import 'package:doublefeel_flutter/core/theme/app_theme.dart'; 3 import 'package:doublefeel_flutter/core/theme/app_theme.dart';
3 import 'package:doublefeel_flutter/l10n/l10n_extensions.dart'; 4 import 'package:doublefeel_flutter/l10n/l10n_extensions.dart';
4 import 'package:flutter/material.dart'; 5 import 'package:flutter/material.dart';
@@ -14,6 +15,8 @@ class TodaySleepCard extends StatelessWidget { @@ -14,6 +15,8 @@ class TodaySleepCard extends StatelessWidget {
14 @override 15 @override
15 Widget build(BuildContext context) { 16 Widget build(BuildContext context) {
16 final l10n = context.l10n; 17 final l10n = context.l10n;
  18 + final isGlobal =
  19 + controller.environmentConfig.region.value == AppRegion.global;
17 return GestureDetector( 20 return GestureDetector(
18 onTap: controller.toTrendSleepPage, 21 onTap: controller.toTrendSleepPage,
19 child: Obx(() { 22 child: Obx(() {
@@ -62,9 +65,12 @@ class TodaySleepCard extends StatelessWidget { @@ -62,9 +65,12 @@ class TodaySleepCard extends StatelessWidget {
62 ), 65 ),
63 children: [ 66 children: [
64 if (sleepHours > 0) ...[ 67 if (sleepHours > 0) ...[
65 - TextSpan(text: '$sleepHours'),  
66 TextSpan( 68 TextSpan(
67 - text: l10n.reportUnitHour, 69 + text: isGlobal
  70 + ? '$sleepHours '
  71 + : '$sleepHours'),
  72 + TextSpan(
  73 + text: l10n.sleepDailyUnitHour,
68 style: TextStyle( 74 style: TextStyle(
69 color: context.colors.textSecondary, 75 color: context.colors.textSecondary,
70 fontSize: 12, 76 fontSize: 12,
@@ -73,9 +79,12 @@ class TodaySleepCard extends StatelessWidget { @@ -73,9 +79,12 @@ class TodaySleepCard extends StatelessWidget {
73 ) 79 )
74 ], 80 ],
75 if (sleepMinutes > 0) ...[ 81 if (sleepMinutes > 0) ...[
76 - TextSpan(text: '$sleepMinutes'),  
77 TextSpan( 82 TextSpan(
78 - text: l10n.reportUnitMinute, 83 + text: isGlobal
  84 + ? '${sleepHours > 0 ? ' ' : ''}$sleepMinutes '
  85 + : '$sleepMinutes'),
  86 + TextSpan(
  87 + text: l10n.sleepDailyUnitMinute,
79 style: TextStyle( 88 style: TextStyle(
80 color: context.colors.textSecondary, 89 color: context.colors.textSecondary,
81 fontSize: 12, 90 fontSize: 12,
@@ -120,7 +129,7 @@ class TodaySleepCard extends StatelessWidget { @@ -120,7 +129,7 @@ class TodaySleepCard extends StatelessWidget {
120 children: [ 129 children: [
121 TextSpan(text: sleepAverageHeartRate), 130 TextSpan(text: sleepAverageHeartRate),
122 TextSpan( 131 TextSpan(
123 - text: 'bpm', 132 + text: isGlobal ? ' bpm' : 'bpm',
124 style: TextStyle( 133 style: TextStyle(
125 color: context.colors.textSecondary, 134 color: context.colors.textSecondary,
126 fontSize: 12, 135 fontSize: 12,
@@ -174,6 +183,8 @@ class TodayActivityCard extends StatelessWidget { @@ -174,6 +183,8 @@ class TodayActivityCard extends StatelessWidget {
174 @override 183 @override
175 Widget build(BuildContext context) { 184 Widget build(BuildContext context) {
176 final l10n = context.l10n; 185 final l10n = context.l10n;
  186 + final isGlobal =
  187 + controller.environmentConfig.region.value == AppRegion.global;
177 return GestureDetector( 188 return GestureDetector(
178 onTap: controller.toTrendActivityPage, 189 onTap: controller.toTrendActivityPage,
179 child: Obx(() { 190 child: Obx(() {
@@ -184,7 +195,9 @@ class TodayActivityCard extends StatelessWidget { @@ -184,7 +195,9 @@ class TodayActivityCard extends StatelessWidget {
184 var exercise = healthData?.exercise ?? 0; 195 var exercise = healthData?.exercise ?? 0;
185 196
186 var activityStr = (activity > 0 && (activityTarget?.move ?? 0) > 0) 197 var activityStr = (activity > 0 && (activityTarget?.move ?? 0) > 0)
187 - ? '$activity' 198 + ? isGlobal
  199 + ? '$activity '
  200 + : '$activity'
188 : '-'; 201 : '-';
189 // exercise 单位为秒,转换为小时+分钟 202 // exercise 单位为秒,转换为小时+分钟
190 Widget exerciseWidget; 203 Widget exerciseWidget;
@@ -198,9 +211,10 @@ class TodayActivityCard extends StatelessWidget { @@ -198,9 +211,10 @@ class TodayActivityCard extends StatelessWidget {
198 fontWeight: FontWeight.w600, 211 fontWeight: FontWeight.w600,
199 ), 212 ),
200 children: [ 213 children: [
201 - TextSpan(text: '$exTotalMinutes'),  
202 TextSpan( 214 TextSpan(
203 - text: l10n.reportUnitMinute, 215 + text: isGlobal ? '$exTotalMinutes ' : '$exTotalMinutes'),
  216 + TextSpan(
  217 + text: l10n.activityUnitMinute,
204 style: TextStyle( 218 style: TextStyle(
205 color: context.colors.textSecondary, 219 color: context.colors.textSecondary,
206 fontSize: 12, 220 fontSize: 12,
@@ -236,9 +250,9 @@ class TodayActivityCard extends StatelessWidget { @@ -236,9 +250,9 @@ class TodayActivityCard extends StatelessWidget {
236 fontWeight: FontWeight.w600, 250 fontWeight: FontWeight.w600,
237 ), 251 ),
238 children: [ 252 children: [
239 - TextSpan(text: '$stand'), 253 + TextSpan(text: isGlobal ? '$stand ' : '$stand'),
240 TextSpan( 254 TextSpan(
241 - text: l10n.reportUnitHour, 255 + text: l10n.activityUnitHour,
242 style: TextStyle( 256 style: TextStyle(
243 color: context.colors.textSecondary, 257 color: context.colors.textSecondary,
244 fontSize: 12, 258 fontSize: 12,