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

@@ -173,7 +173,7 @@ class _UpdatePageState extends State<UpdatePersonPage> {
children: [
Padding(
padding: EdgeInsetsDirectional.fromSTEB(
70.rpx, 141.rpx, 70.rpx, 0),
70.rpx, 70.rpx, 70.rpx, 0),
child: Container(
width: double.infinity,
height: 100.rpx,
@@ -204,7 +204,12 @@ class _UpdatePageState extends State<UpdatePersonPage> {
letterSpacing: 0.0,
color: themeController.currentColor.sc3,
),
hintText: '人员资料.名字输入提示'.tr,
hintText: (personController.name.value
as String?)
?.isNotEmpty ==
true
? personController.name.value
: '体征检测设备'.tr,
hintStyle: TextStyle(
fontFamily: 'Inter',
fontSize: 26.rpx,
@@ -432,30 +437,77 @@ class _UpdatePageState extends State<UpdatePersonPage> {
);
});
},
child: Center(
child: Text(
personController.dateTime != null
? DateFormat("yyyy/MM/dd").format(
personController.dateTime!)
: '人员资料.生日输入提示'.tr,
textAlign: TextAlign.right,
style: TextStyle(
fontFamily: 'Readex Pro',
color: personController.dateTime != null
? themeController.currentColor.sc3
: themeController.currentColor.sc4,
fontSize:
AppConstants().normal_text_fontSize,
letterSpacing: 0,
child: Stack(
children: [
// 文字居中
Center(
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Text.rich(
TextSpan(
children: [
TextSpan(
text: personController
.dateTime !=
null
? DateFormat(
"yyyy/MM/dd")
.format(
personController
.dateTime!)
: '人员资料.生日输入提示'.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
color: personController
.dateTime !=
null
? themeController
.currentColor.sc3
: themeController
.currentColor.sc4,
fontSize: AppConstants()
.normal_text_fontSize,
letterSpacing: 0,
),
),
TextSpan(
text: ' *',
style: TextStyle(
color: themeController
.currentColor.sc9,
fontSize: AppConstants()
.normal_text_fontSize,
fontWeight:
FontWeight.bold,
),
),
],
),
),
],
),
),
),
// 箭头居右
Positioned(
right: 30.rpx,
top: 0,
bottom: 0,
child: Icon(
Icons.expand_more,
color:
themeController.currentColor.sc4,
size: 30.rpx,
),
),
],
),
),
),
),
Padding(
padding: EdgeInsetsDirectional.fromSTEB(
70.rpx, 50.rpx, 70.rpx, 0),
70.rpx, 25.rpx, 70.rpx, 0),
child: Container(
height: 100.rpx,
decoration: BoxDecoration(
@@ -500,31 +552,76 @@ class _UpdatePageState extends State<UpdatePersonPage> {
);
});
},
child: Center(
child: Text(
personController.height.value != ""
? personController.height.value +
"cm".tr
: '身高输入提示'.tr,
textAlign: TextAlign.right,
style: TextStyle(
fontFamily: 'Readex Pro',
color: personController.height.value !=
""
? themeController.currentColor.sc3
: themeController.currentColor.sc4,
fontSize:
AppConstants().normal_text_fontSize,
letterSpacing: 0,
child: Stack(
children: [
// 文字居中
Center(
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Text.rich(
TextSpan(
children: [
TextSpan(
text: personController
.height.value !=
""
? personController
.height.value +
"cm".tr
: '身高输入提示'.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
color: personController
.height
.value !=
""
? themeController
.currentColor.sc3
: themeController
.currentColor.sc4,
fontSize: AppConstants()
.normal_text_fontSize,
letterSpacing: 0,
),
),
TextSpan(
text: ' *',
style: TextStyle(
color: themeController
.currentColor.sc9,
fontSize: AppConstants()
.normal_text_fontSize,
fontWeight:
FontWeight.bold,
),
),
],
),
),
],
),
),
),
// 箭头居右
Positioned(
right: 30.rpx,
top: 0,
bottom: 0,
child: Icon(
Icons.expand_more,
color:
themeController.currentColor.sc4,
size: 30.rpx,
),
),
],
),
),
),
),
Padding(
padding: EdgeInsetsDirectional.fromSTEB(
70.rpx, 50.rpx, 70.rpx, 0),
70.rpx, 25.rpx, 70.rpx, 0),
child: Container(
height: 100.rpx,
decoration: BoxDecoration(
@@ -555,38 +652,193 @@ class _UpdatePageState extends State<UpdatePersonPage> {
personController.weight.value ?? "",
onConfirm: (int selectedWeight) {
personController.weight.value =
selectedWeight
.toString(); // ✅ 转成字符串
selectedWeight.toString();
personController.updateAll();
},
);
});
},
child: Center(
child: Text(
personController.weight.value != ""
? personController.weight.value +
"kg".tr
: '人员资料.体重输入提示'.tr,
textAlign: TextAlign.right,
style: TextStyle(
fontFamily: 'Readex Pro',
color: personController.weight.value !=
""
? themeController.currentColor.sc3
: themeController.currentColor.sc4,
fontSize:
AppConstants().normal_text_fontSize,
letterSpacing: 0,
child: Stack(
children: [
// 文字居中
Center(
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Text.rich(
TextSpan(
children: [
TextSpan(
text: personController
.weight.value !=
""
? personController
.weight.value +
"kg".tr
: '人员资料.体重输入提示'.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
color: personController
.weight
.value !=
""
? themeController
.currentColor.sc3
: themeController
.currentColor.sc4,
fontSize: AppConstants()
.normal_text_fontSize,
letterSpacing: 0,
),
),
TextSpan(
text: ' *',
style: TextStyle(
color: themeController
.currentColor.sc9,
fontSize: AppConstants()
.normal_text_fontSize,
fontWeight:
FontWeight.bold,
),
),
],
),
),
],
),
),
),
// 箭头居右
Positioned(
right: 30.rpx,
top: 0,
bottom: 0,
child: Icon(
Icons.expand_more,
color:
themeController.currentColor.sc4,
size: 30.rpx,
),
),
],
),
),
),
),
Padding(
padding: EdgeInsetsDirectional.fromSTEB(
70.rpx, 50.rpx, 70.rpx, 0),
70.rpx, 25.rpx, 70.rpx, 0),
child: Container(
height: 100.rpx,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(50.rpx),
border: Border.all(
color: themeController.currentColor.sc4
.withOpacity(0.5),
width: AppConstants().border_width,
),
),
child: InkWell(
onTap: () {
if (widget.status == BindType.share.code) {
TopSlideNotification.show(context,
text: "被分享用户只能修改用户名称",
textColor:
themeController.currentColor.sc9);
return;
}
final timeZone =
personController.timeZone.value;
final initialTimeZone = timeZone;
FocusScope.of(context)
.requestFocus(FocusNode());
Future.delayed(
const Duration(milliseconds: 250), () {
showTimeZonePickerDialog(
context,
title: "选择时区".tr,
initialTimeZone: initialTimeZone,
onConfirm: (String selectedtimezone) {
personController.timeZone.value =
selectedtimezone.toString();
personController.updateAll();
print("时区: $selectedtimezone");
},
);
});
},
child: Stack(
children: [
// 文字居中
Center(
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Text.rich(
TextSpan(
children: [
TextSpan(
text: personController
.timeZone
.value !=
""
? personController
.timeZone.value
: '选择时区'.tr,
style: TextStyle(
fontFamily: 'Readex Pro',
color: personController
.timeZone
.value !=
""
? themeController
.currentColor.sc3
: themeController
.currentColor.sc4,
fontSize: AppConstants()
.normal_text_fontSize,
letterSpacing: 0,
),
),
TextSpan(
text: ' *',
style: TextStyle(
color: themeController
.currentColor.sc9,
fontSize: AppConstants()
.normal_text_fontSize,
fontWeight:
FontWeight.bold,
),
),
],
),
),
],
),
),
// 箭头居右
Positioned(
right: 30.rpx,
top: 0,
bottom: 0,
child: Icon(
Icons.expand_more,
color:
themeController.currentColor.sc4,
size: 30.rpx,
),
),
],
),
),
),
),
Padding(
padding: EdgeInsetsDirectional.fromSTEB(
70.rpx, 25.rpx, 70.rpx, 0),
child: Container(
height: 100.rpx,
decoration: BoxDecoration(
@@ -627,33 +879,80 @@ class _UpdatePageState extends State<UpdatePersonPage> {
title: "选择城市".tr,
cityDataFuture:
cityDataFuture, // 传入预加载的数据
colors: CitySelectionColors(
// pickerBackgroundColor:
// stringToColor("#003058"),
// confirmTextColor:
// stringToColor("#84F5FF"),
selectedCityColor:
themeController.currentColor.sc2,
selectedTextColor: Colors.white,
),
);
});
},
child: Center(
child: Text(
MyUtils.getDetailedCityDisplayText(
personController.cityModel),
textAlign: TextAlign.right,
style: TextStyle(
fontFamily: 'Readex Pro',
color: personController.cityModel !=
null
? themeController.currentColor.sc3
: themeController.currentColor.sc4,
fontSize:
AppConstants().normal_text_fontSize,
letterSpacing: 0,
child: Stack(
children: [
// 文字居中
Center(
child: Row(
mainAxisAlignment:
MainAxisAlignment.center,
children: [
Text(
MyUtils
.getDetailedCityDisplayText(
personController
.cityModel),
textAlign: TextAlign.center,
style: TextStyle(
fontFamily: 'Readex Pro',
color:
personController
.cityModel !=
null
? themeController
.currentColor.sc3
: themeController
.currentColor.sc4,
fontSize: AppConstants()
.normal_text_fontSize,
letterSpacing: 0,
),
),
// Text(
// ' *',
// style: TextStyle(
// color: themeController
// .currentColor.sc9,
// fontSize: AppConstants()
// .normal_text_fontSize,
// fontWeight: FontWeight.bold,
// ),
// ),
],
),
),
),
// 箭头居右
Positioned(
right: 30.rpx,
top: 0,
bottom: 0,
child: Icon(
Icons.expand_more,
color:
themeController.currentColor.sc4,
size: 30.rpx,
),
),
],
),
),
),
),
Padding(
padding: EdgeInsetsDirectional.fromSTEB(
0, 117.rpx, 0, 0),
0, 60.rpx, 0, 0),
child: Container(
width: double.infinity,
decoration: BoxDecoration(),
@@ -858,5 +1157,4 @@ class _UpdatePageState extends State<UpdatePersonPage> {
onFailure: (res) {},
);
}
}