更新
This commit is contained in:
@@ -28,6 +28,7 @@ class CalibrationPage extends StatefulWidget {
|
||||
class _CalibrationPageState extends State<CalibrationPage> {
|
||||
DeviceCalibrationController deviceCalibrationController = Get.find();
|
||||
BlueteethBindController blueteethBindController = Get.find();
|
||||
int flag = 0; //默认没有开始校准过
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
@@ -89,8 +90,32 @@ class _CalibrationPageState extends State<CalibrationPage> {
|
||||
child: CustomCard(
|
||||
borderRadius: 20.rpx,
|
||||
onTap: () async {
|
||||
// Get.toNamed("/personPage");
|
||||
Get.toNamed("/bindDeviceSuccess");
|
||||
if (flag != 0) {
|
||||
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 = "";
|
||||
deviceCalibrationController.complete = false;
|
||||
}, onCancel: () {});
|
||||
} else {
|
||||
await Get.toNamed("/personPage");
|
||||
deviceCalibrationController.process.value = 0;
|
||||
deviceCalibrationController
|
||||
.bed_calibration.value = 0;
|
||||
deviceCalibrationController
|
||||
.position_calibration.value = 0;
|
||||
blueteethBindController.cid!.value = "";
|
||||
deviceCalibrationController.complete = false;
|
||||
}
|
||||
|
||||
// Get.toNamed("/bindDeviceSuccess");
|
||||
},
|
||||
colors: [
|
||||
themeController.currentColor.sc1,
|
||||
@@ -491,6 +516,7 @@ class _CalibrationPageState extends State<CalibrationPage> {
|
||||
borderRadius:
|
||||
AppConstants().button_container_radius, // 圆角半径
|
||||
onTap: () async {
|
||||
flag = 1;
|
||||
if (deviceCalibrationController.complete) {
|
||||
showConfirmDialog(
|
||||
context, Container(), "校准已经完成,是否重新开始校准?",
|
||||
@@ -504,7 +530,7 @@ class _CalibrationPageState extends State<CalibrationPage> {
|
||||
.position_calibration.value = 0;
|
||||
blueteethBindController.cid!.value = "";
|
||||
deviceCalibrationController.complete = false;
|
||||
|
||||
|
||||
String serviceAddress =
|
||||
"https://caibration.he-info.cn";
|
||||
String calibrationApi =
|
||||
@@ -589,6 +615,7 @@ class _CalibrationPageState extends State<CalibrationPage> {
|
||||
currStep == 5 &&
|
||||
status == true) {
|
||||
// 第二步完成:per >= 100 && currStep == 5 && status == true
|
||||
flag = 0;
|
||||
pollingTimer?.cancel();
|
||||
TopSlideNotification.show(context,
|
||||
text: "设备校准完成".tr);
|
||||
|
||||
Reference in New Issue
Block a user