1.修复睡眠日报中睡眠规律性数据显示错误
2.更新时区设置
This commit is contained in:
@@ -60,6 +60,13 @@ class _EPageState extends State<PersonPage> {
|
||||
personController.weight.value = "";
|
||||
personController.height.value = "";
|
||||
personController.dateTime = null;
|
||||
personController.cityModel = null;
|
||||
personController.timeZone.value = "";
|
||||
|
||||
personController.getTimeZoneByLocalTime().then((value) {
|
||||
personController.timeZone.value = value;
|
||||
personController.updateAll();
|
||||
});
|
||||
|
||||
cityDataFuture = cityController.loadAndSetCityData().then((success) {
|
||||
return cityController.cityList;
|
||||
@@ -172,7 +179,7 @@ class _EPageState extends State<PersonPage> {
|
||||
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,
|
||||
@@ -404,30 +411,77 @@ class _EPageState extends State<PersonPage> {
|
||||
}, title: "选择生日".tr);
|
||||
});
|
||||
},
|
||||
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(
|
||||
@@ -464,31 +518,76 @@ class _EPageState extends State<PersonPage> {
|
||||
);
|
||||
});
|
||||
},
|
||||
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(
|
||||
@@ -512,38 +611,184 @@ class _EPageState extends State<PersonPage> {
|
||||
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: () {
|
||||
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: Obx(() {
|
||||
return 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(
|
||||
@@ -577,32 +822,77 @@ class _EPageState extends State<PersonPage> {
|
||||
title: "选择城市".tr,
|
||||
cityDataFuture:
|
||||
cityDataFuture, // 传入预加载的数据
|
||||
colors: CitySelectionColors(
|
||||
// pickerBackgroundColor:
|
||||
// stringToColor("#003058"),
|
||||
// confirmTextColor:
|
||||
// stringToColor("#84F5FF"),
|
||||
selectedCityColor:
|
||||
themeController.currentColor.sc2,
|
||||
selectedTextColor: Colors.white,
|
||||
),
|
||||
);
|
||||
});
|
||||
},
|
||||
child: Center(
|
||||
child: Text(
|
||||
_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(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
_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(),
|
||||
|
||||
@@ -3,9 +3,11 @@ import 'dart:convert';
|
||||
import 'package:ef/ef.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:vbvs_app/common/color/appConstants.dart';
|
||||
import 'package:vbvs_app/common/pojo/city.dart';
|
||||
import 'package:vbvs_app/common/util/FitTool.dart';
|
||||
import 'package:vbvs_app/common/util/ListSearchWidget.dart';
|
||||
import 'package:vbvs_app/common/util/MyUtils.dart';
|
||||
import 'package:vbvs_app/component/tool/ClickableContainer.dart';
|
||||
import 'package:vbvs_app/controller/person/person_controller.dart';
|
||||
import 'package:vbvs_app/controller/theme_controller/ThemeController.dart';
|
||||
@@ -666,7 +668,7 @@ Widget _buildCityPickerContent(
|
||||
Get.find();
|
||||
cityModelController.tmp;
|
||||
ef.log("${cityModelController.tmp.value}");
|
||||
return getOnePickers(
|
||||
return getOnePickersCity(
|
||||
context,
|
||||
countries,
|
||||
countryIndex,
|
||||
@@ -684,7 +686,7 @@ Widget _buildCityPickerContent(
|
||||
Get.find();
|
||||
cityModelController.tmp;
|
||||
ef.log("${cityModelController.tmp.value}");
|
||||
return getOnePickers(
|
||||
return getOnePickersCity(
|
||||
context,
|
||||
provinces,
|
||||
provinceIndex,
|
||||
@@ -702,7 +704,7 @@ Widget _buildCityPickerContent(
|
||||
Get.find();
|
||||
cityModelController.tmp;
|
||||
ef.log("${cityModelController.tmp.value}");
|
||||
return getOnePickers(
|
||||
return getOnePickersCity(
|
||||
context,
|
||||
cities,
|
||||
cityIndex,
|
||||
@@ -813,3 +815,149 @@ Widget _buildErrorBottomSheet(
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> showTimeMHTZonePickerDialog(
|
||||
BuildContext context, {
|
||||
required String initialTimeZone, // 初始时区字符串,如 "UTC+8"
|
||||
required Function(String selectedTimeZone) onConfirm,
|
||||
String title = "选择时区",
|
||||
}) async {
|
||||
// 使用 AppConstants.integerTimeZones 作为数据源
|
||||
List<String> timeZones = AppConstants.integerTimeZones;
|
||||
int selectedIndex = timeZones.indexOf(initialTimeZone);
|
||||
|
||||
// 如果没有找到,使用默认的UTC+8(北京时间)
|
||||
if (selectedIndex == -1) {
|
||||
selectedIndex = timeZones.indexOf("UTC+8");
|
||||
if (selectedIndex == -1) {
|
||||
selectedIndex = 0; // 如果连UTC+8都没有,使用第一个
|
||||
}
|
||||
}
|
||||
|
||||
final RxInt tempIndex = RxInt(selectedIndex);
|
||||
ThemeController themeController = Get.find();
|
||||
|
||||
await showDialog(
|
||||
context: context,
|
||||
barrierDismissible: true,
|
||||
builder: (BuildContext context) {
|
||||
return Stack(
|
||||
children: [
|
||||
Positioned(
|
||||
bottom: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
child: Material(
|
||||
color: Colors.transparent,
|
||||
child: Dialog(
|
||||
backgroundColor: stringToColor("#003058"),
|
||||
insetPadding: EdgeInsets.zero,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(0),
|
||||
),
|
||||
child: Container(
|
||||
padding: EdgeInsets.fromLTRB(0.rpx, 0.rpx, 0.rpx, 90.rpx),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Container(
|
||||
padding:
|
||||
EdgeInsets.fromLTRB(30.rpx, 0.rpx, 30.rpx, 0.rpx),
|
||||
color: themeController.currentColor.sc5,
|
||||
height: 80.rpx,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
ClickableContainer(
|
||||
backgroundColor: Colors.transparent,
|
||||
highlightColor: Colors.transparent,
|
||||
padding: EdgeInsets.only(top: 0),
|
||||
onTap: () {
|
||||
Get.back();
|
||||
},
|
||||
child: Container(
|
||||
alignment: Alignment.center,
|
||||
width: 110.rpx,
|
||||
height: 60.rpx,
|
||||
child: Text(
|
||||
"取消".tr,
|
||||
style: TextStyle(
|
||||
fontSize: 30.rpx,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
title,
|
||||
style: TextStyle(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: themeController.currentColor.sc3,
|
||||
fontSize: 30.rpx,
|
||||
),
|
||||
),
|
||||
ClickableContainer(
|
||||
backgroundColor: Colors.transparent,
|
||||
highlightColor: Colors.transparent,
|
||||
padding: EdgeInsets.only(top: 0),
|
||||
onTap: () {
|
||||
onConfirm(timeZones[tempIndex.value]);
|
||||
Get.back();
|
||||
},
|
||||
child: Container(
|
||||
alignment: Alignment.center,
|
||||
width: 110.rpx,
|
||||
height: 60.rpx,
|
||||
child: Text(
|
||||
"确定".tr,
|
||||
style: TextStyle(
|
||||
fontSize: 30.rpx,
|
||||
color: stringToColor("#84F5FF"),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(height: 20.rpx),
|
||||
Stack(
|
||||
children: [
|
||||
Positioned.fill(
|
||||
child: IgnorePointer(
|
||||
child: Center(
|
||||
child: Container(
|
||||
height: 90.rpx,
|
||||
margin:
|
||||
EdgeInsets.symmetric(horizontal: 95.rpx),
|
||||
decoration: BoxDecoration(
|
||||
color: stringToColor("#84F5FF"),
|
||||
borderRadius: BorderRadius.circular(16.rpx),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 240.rpx,
|
||||
child: getOnePickers(
|
||||
context,
|
||||
timeZones, // 传入字符串列表
|
||||
tempIndex,
|
||||
unit: "", // 时区不需要单位
|
||||
selectedColor: stringToColor("#011D33"),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1306,3 +1306,150 @@ Future<void> showCountryCodePickerDialog(
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Future<void> showTimeZonePickerDialog(
|
||||
BuildContext context, {
|
||||
required String initialTimeZone, // 初始时区字符串,如 "UTC+8"
|
||||
required Function(String selectedTimeZone) onConfirm,
|
||||
String title = "选择时区",
|
||||
}) async {
|
||||
// 使用 AppConstants.integerTimeZones 作为数据源
|
||||
List<String> timeZones = AppConstants.integerTimeZones;
|
||||
int selectedIndex = timeZones.indexOf(initialTimeZone);
|
||||
|
||||
// 如果没有找到,使用默认的UTC+8(北京时间)
|
||||
if (selectedIndex == -1) {
|
||||
selectedIndex = timeZones.indexOf("UTC+8");
|
||||
if (selectedIndex == -1) {
|
||||
selectedIndex = 0; // 如果连UTC+8都没有,使用第一个
|
||||
}
|
||||
}
|
||||
|
||||
final RxInt tempIndex = RxInt(selectedIndex);
|
||||
ThemeController themeController = Get.find();
|
||||
|
||||
await showDialog(
|
||||
context: context,
|
||||
barrierDismissible: true,
|
||||
builder: (BuildContext context) {
|
||||
return Stack(
|
||||
children: [
|
||||
Positioned(
|
||||
bottom: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
child: Material(
|
||||
color: Colors.transparent,
|
||||
child: Dialog(
|
||||
backgroundColor: themeController.currentColor.sc17,
|
||||
insetPadding: EdgeInsets.zero,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(0),
|
||||
),
|
||||
child: Container(
|
||||
padding: EdgeInsets.fromLTRB(0.rpx, 0.rpx, 0.rpx, 90.rpx),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Container(
|
||||
padding:
|
||||
EdgeInsets.fromLTRB(30.rpx, 0.rpx, 30.rpx, 0.rpx),
|
||||
color: themeController.currentColor.sc5,
|
||||
height: 80.rpx,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
ClickableContainer(
|
||||
backgroundColor: Colors.transparent,
|
||||
highlightColor: Colors.transparent,
|
||||
padding: EdgeInsets.only(top: 0),
|
||||
onTap: () {
|
||||
Get.back();
|
||||
},
|
||||
child: Container(
|
||||
alignment: Alignment.center,
|
||||
width: 110.rpx,
|
||||
height: 60.rpx,
|
||||
child: Text(
|
||||
"取消".tr,
|
||||
style: TextStyle(
|
||||
fontSize: 30.rpx,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
title,
|
||||
style: TextStyle(
|
||||
fontFamily: 'Readex Pro',
|
||||
color: themeController.currentColor.sc3,
|
||||
fontSize: 30.rpx,
|
||||
),
|
||||
),
|
||||
ClickableContainer(
|
||||
backgroundColor: Colors.transparent,
|
||||
highlightColor: Colors.transparent,
|
||||
padding: EdgeInsets.only(top: 0),
|
||||
onTap: () {
|
||||
onConfirm(timeZones[tempIndex.value]);
|
||||
Get.back();
|
||||
},
|
||||
child: Container(
|
||||
alignment: Alignment.center,
|
||||
width: 110.rpx,
|
||||
height: 60.rpx,
|
||||
child: Text(
|
||||
"确定".tr,
|
||||
style: TextStyle(
|
||||
fontSize: 30.rpx,
|
||||
color: themeController.currentColor.sc2,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(height: 20.rpx),
|
||||
Stack(
|
||||
children: [
|
||||
Positioned.fill(
|
||||
child: IgnorePointer(
|
||||
child: Center(
|
||||
child: Container(
|
||||
height: 90.rpx,
|
||||
margin:
|
||||
EdgeInsets.symmetric(horizontal: 95.rpx),
|
||||
decoration: BoxDecoration(
|
||||
color: themeController.currentColor.sc2,
|
||||
borderRadius: BorderRadius.circular(16.rpx),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 240.rpx,
|
||||
child: getOnePickers(
|
||||
context,
|
||||
timeZones, // 传入字符串列表
|
||||
tempIndex,
|
||||
unit: "", // 时区不需要单位
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -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) {},
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user