更新
This commit is contained in:
@@ -35,6 +35,7 @@ class _AfterCalibrationPersonPageState
|
||||
Timer? _pollingTimer;
|
||||
|
||||
bool exit = false;
|
||||
bool start = false;
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
@@ -123,11 +124,68 @@ class _AfterCalibrationPersonPageState
|
||||
borderRadius: 20.rpx,
|
||||
onTap: () async {
|
||||
if (deviceCalibrationController.flag.value != 2) {
|
||||
showConfirmDialog(
|
||||
context, Container(), "校准未完成提示".tr,
|
||||
onConfirm: () async {
|
||||
// Get.back();
|
||||
// print("object");
|
||||
if (start) {
|
||||
showConfirmDialog(
|
||||
context, Container(), "校准未完成提示".tr,
|
||||
onConfirm: () async {
|
||||
// Get.back();
|
||||
// print("object");
|
||||
deviceCalibrationController.process.value =
|
||||
0;
|
||||
deviceCalibrationController
|
||||
.bed_calibration.value = 0;
|
||||
deviceCalibrationController
|
||||
.position_calibration.value = 0;
|
||||
blueteethBindController.cid!.value = "";
|
||||
PersonController personController =
|
||||
Get.find();
|
||||
var data = personController.after_deveice;
|
||||
if (data['person'] != null) {
|
||||
personController.currentPersonId.value =
|
||||
data['_id'];
|
||||
personController.name.value =
|
||||
data['person']['name'];
|
||||
personController.update_person_mac.value =
|
||||
data['mac'];
|
||||
personController.gender.value =
|
||||
data['person']['gender'] ?? 1;
|
||||
personController.weight?.value =
|
||||
data['person']['weight'] == null
|
||||
? ''
|
||||
: data['person']['weight']
|
||||
.toString();
|
||||
|
||||
personController.height.value =
|
||||
data['person']['height'] == null
|
||||
? ''
|
||||
: data['person']['height']
|
||||
.toString();
|
||||
|
||||
personController
|
||||
.selectedDiseaseIds.value =
|
||||
data['person']['disease'] ?? [];
|
||||
personController.birthday.value =
|
||||
data['person']['birthday'] ?? '';
|
||||
personController.dateTime =
|
||||
MyUtils.formatBirthdayTime(
|
||||
data['person']['birthday']);
|
||||
} else {
|
||||
personController.update_person_mac.value =
|
||||
data['mac'];
|
||||
personController.currentPersonId.value =
|
||||
data['_id'];
|
||||
personController.name.value = "";
|
||||
personController.gender.value = 1;
|
||||
personController.dateTime = null;
|
||||
personController.height.value = "";
|
||||
personController.weight.value = "";
|
||||
personController.diseaseList.value = [];
|
||||
}
|
||||
|
||||
await Get.toNamed("/afterUpdatePersonPage");
|
||||
return;
|
||||
}, onCancel: () {});
|
||||
} else {
|
||||
deviceCalibrationController.process.value = 0;
|
||||
deviceCalibrationController
|
||||
.bed_calibration.value = 0;
|
||||
@@ -180,7 +238,7 @@ class _AfterCalibrationPersonPageState
|
||||
|
||||
await Get.toNamed("/afterUpdatePersonPage");
|
||||
return;
|
||||
}, onCancel: () {});
|
||||
}
|
||||
} else {
|
||||
// Get.back();
|
||||
deviceCalibrationController.process.value = 0;
|
||||
@@ -686,6 +744,7 @@ class _AfterCalibrationPersonPageState
|
||||
borderRadius: AppConstants()
|
||||
.button_container_radius, // 圆角半径
|
||||
onTap: () async {
|
||||
start = true;
|
||||
if (deviceCalibrationController.flag.value ==
|
||||
2) {
|
||||
deviceCalibrationController
|
||||
|
||||
@@ -186,7 +186,7 @@ Future<void> showHaveBindDialog(BuildContext context) async {
|
||||
padding: EdgeInsetsDirectional.fromSTEB(
|
||||
0.rpx, 93.rpx, 0.rpx, 0.rpx),
|
||||
child: Text(
|
||||
'无法绑定'.tr,
|
||||
'蓝牙绑定.无法绑定'.tr,
|
||||
style: TextStyle(
|
||||
fontFamily: 'Inter',
|
||||
fontSize: 30.rpx,
|
||||
@@ -202,21 +202,21 @@ Future<void> showHaveBindDialog(BuildContext context) async {
|
||||
child: RichText(
|
||||
text: TextSpan(children: [
|
||||
TextSpan(
|
||||
text: "无法绑定1".tr,
|
||||
text: "蓝牙绑定.无法绑定1".tr,
|
||||
style: TextStyle(
|
||||
color: themeController.currentColor.sc3,
|
||||
fontSize: AppConstants().normal_text_fontSize,
|
||||
),
|
||||
),
|
||||
TextSpan(
|
||||
text: "无法绑定2".tr,
|
||||
text: "蓝牙绑定.无法绑定2".tr,
|
||||
style: TextStyle(
|
||||
color: themeController.currentColor.sc8,
|
||||
fontSize: AppConstants().normal_text_fontSize,
|
||||
),
|
||||
),
|
||||
TextSpan(
|
||||
text: "无法绑定3".tr,
|
||||
text: "蓝牙绑定.无法绑定3".tr,
|
||||
style: TextStyle(
|
||||
color: themeController.currentColor.sc3,
|
||||
fontSize: AppConstants().normal_text_fontSize,
|
||||
|
||||
@@ -33,6 +33,7 @@ class _CalibrationPageState extends State<CalibrationPage> {
|
||||
Timer? _pollingTimer;
|
||||
|
||||
bool exit = false;
|
||||
bool start = false;
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
@@ -95,9 +96,23 @@ class _CalibrationPageState extends State<CalibrationPage> {
|
||||
child: returnIconButtomAddCallback(() {
|
||||
if (deviceCalibrationController.flag.value != 2) {
|
||||
try {
|
||||
showConfirmDialog(
|
||||
context, Container(), "校准未完成提示".tr,
|
||||
onConfirm: () async {
|
||||
if (start) {
|
||||
showConfirmDialog(
|
||||
context, Container(), "校准未完成提示".tr,
|
||||
onConfirm: () async {
|
||||
exit = true;
|
||||
deviceCalibrationController.process.value =
|
||||
0;
|
||||
deviceCalibrationController
|
||||
.bed_calibration.value = 0;
|
||||
deviceCalibrationController
|
||||
.position_calibration.value = 0;
|
||||
blueteethBindController.cid!.value = "";
|
||||
Get.back();
|
||||
}, onCancel: () {
|
||||
exit = false;
|
||||
});
|
||||
} else {
|
||||
exit = true;
|
||||
deviceCalibrationController.process.value = 0;
|
||||
deviceCalibrationController
|
||||
@@ -106,9 +121,7 @@ class _CalibrationPageState extends State<CalibrationPage> {
|
||||
.position_calibration.value = 0;
|
||||
blueteethBindController.cid!.value = "";
|
||||
Get.back();
|
||||
}, onCancel: () {
|
||||
exit = false;
|
||||
});
|
||||
}
|
||||
} catch (e) {
|
||||
print(e);
|
||||
}
|
||||
@@ -128,9 +141,21 @@ class _CalibrationPageState extends State<CalibrationPage> {
|
||||
onTap: () async {
|
||||
if (deviceCalibrationController.flag.value !=
|
||||
2) {
|
||||
showConfirmDialog(
|
||||
context, Container(), "校准未完成提示".tr,
|
||||
onConfirm: () async {
|
||||
if (start) {
|
||||
showConfirmDialog(
|
||||
context, Container(), "校准未完成提示".tr,
|
||||
onConfirm: () async {
|
||||
await Get.toNamed("/personPage");
|
||||
print("object");
|
||||
deviceCalibrationController
|
||||
.process.value = 0;
|
||||
deviceCalibrationController
|
||||
.bed_calibration.value = 0;
|
||||
deviceCalibrationController
|
||||
.position_calibration.value = 0;
|
||||
blueteethBindController.cid!.value = "";
|
||||
}, onCancel: () {});
|
||||
} else {
|
||||
await Get.toNamed("/personPage");
|
||||
print("object");
|
||||
deviceCalibrationController.process.value =
|
||||
@@ -140,7 +165,7 @@ class _CalibrationPageState extends State<CalibrationPage> {
|
||||
deviceCalibrationController
|
||||
.position_calibration.value = 0;
|
||||
blueteethBindController.cid!.value = "";
|
||||
}, onCancel: () {});
|
||||
}
|
||||
} else {
|
||||
await Get.toNamed("/personPage");
|
||||
deviceCalibrationController.process.value = 0;
|
||||
@@ -595,6 +620,7 @@ class _CalibrationPageState extends State<CalibrationPage> {
|
||||
borderRadius: AppConstants()
|
||||
.button_container_radius, // 圆角半径
|
||||
onTap: () async {
|
||||
start = true;
|
||||
if (deviceCalibrationController.flag.value ==
|
||||
2) {
|
||||
deviceCalibrationController
|
||||
|
||||
@@ -33,6 +33,7 @@ class _CalibrationPersonPageState extends State<CalibrationPersonPage> {
|
||||
Timer? _pollingTimer;
|
||||
|
||||
bool exit = false;
|
||||
bool start = false;
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
@@ -92,12 +93,31 @@ class _CalibrationPersonPageState extends State<CalibrationPersonPage> {
|
||||
),
|
||||
Positioned(
|
||||
left: 0,
|
||||
child: returnIconButtomAddCallback(() {
|
||||
child: returnIconButtomAddCallback(() async {
|
||||
if (deviceCalibrationController.flag.value != 2) {
|
||||
try {
|
||||
showConfirmDialog(
|
||||
context, Container(), "校准未完成提示".tr,
|
||||
onConfirm: () async {
|
||||
if (start) {
|
||||
showConfirmDialog(
|
||||
context, Container(), "校准未完成提示".tr,
|
||||
onConfirm: () async {
|
||||
exit = true;
|
||||
if (widget.type == 2) {
|
||||
Get.back();
|
||||
return;
|
||||
}
|
||||
await Get.toNamed("/personPage");
|
||||
print("object");
|
||||
deviceCalibrationController.process.value =
|
||||
0;
|
||||
deviceCalibrationController
|
||||
.bed_calibration.value = 0;
|
||||
deviceCalibrationController
|
||||
.position_calibration.value = 0;
|
||||
blueteethBindController.cid!.value = "";
|
||||
}, onCancel: () {
|
||||
exit = false;
|
||||
});
|
||||
} else {
|
||||
exit = true;
|
||||
if (widget.type == 2) {
|
||||
Get.back();
|
||||
@@ -111,9 +131,7 @@ class _CalibrationPersonPageState extends State<CalibrationPersonPage> {
|
||||
deviceCalibrationController
|
||||
.position_calibration.value = 0;
|
||||
blueteethBindController.cid!.value = "";
|
||||
}, onCancel: () {
|
||||
exit = false;
|
||||
});
|
||||
}
|
||||
} catch (e) {
|
||||
print(e);
|
||||
}
|
||||
@@ -597,6 +615,7 @@ class _CalibrationPersonPageState extends State<CalibrationPersonPage> {
|
||||
borderRadius: AppConstants()
|
||||
.button_container_radius, // 圆角半径
|
||||
onTap: () async {
|
||||
start = true;
|
||||
if (deviceCalibrationController.flag.value ==
|
||||
2) {
|
||||
deviceCalibrationController
|
||||
|
||||
Reference in New Issue
Block a user