更新设备校准
This commit is contained in:
@@ -66,7 +66,7 @@ class _SingleBlueteethDeviceCompoentWidgetState
|
||||
showConfirmDialog(
|
||||
context, Container(), "其他设备正在绑定中,是否终止其他设备绑定?".tr,
|
||||
onConfirm: () {
|
||||
blueteethBindController.currentDeviceMac = null;
|
||||
blueteethBindController.currentDeviceMac.value = "";
|
||||
blueteethBindController.updateAll();
|
||||
}, onCancel: () {});
|
||||
}
|
||||
@@ -76,7 +76,9 @@ class _SingleBlueteethDeviceCompoentWidgetState
|
||||
}
|
||||
|
||||
if (device.bind == true) {
|
||||
showHaveBindDialog(context);
|
||||
await showHaveBindDialog(context);
|
||||
blueteethBindController.currentDeviceMac.value = "";
|
||||
blueteethBindController.updateAll();
|
||||
} else {
|
||||
showConfirmDialog(
|
||||
context,
|
||||
@@ -87,52 +89,14 @@ class _SingleBlueteethDeviceCompoentWidgetState
|
||||
await blueteethBindController.bindDeviceAndMAC(device);
|
||||
TopSlideNotification.show(context, text: response.msg!);
|
||||
if (response.code == HttpStatusCodes.ok) {
|
||||
// showLoadingDialog(context); // 显示 loading
|
||||
// Get.toNamed("/personPage");
|
||||
|
||||
Get.toNamed("/wifiPage");
|
||||
THapp bledevice = THapp(device: widget.bleDevice.device);
|
||||
blueteethBindController.currentDevice = bledevice;
|
||||
// await bledevice.device.connect();
|
||||
// var res2 = bledevice.isConnected;
|
||||
// if (res2) {
|
||||
// // Navigator.pop(context);
|
||||
// TopSlideNotification.show(
|
||||
// context,
|
||||
// text: "蓝牙绑定.连接成功".tr,
|
||||
// textColor: themeController.currentColor.sc2,
|
||||
// );
|
||||
// blueteethBindController.currentDevice = bledevice;
|
||||
|
||||
// if (lisObj != null) {
|
||||
// lisObj!.cancel();
|
||||
// }
|
||||
// var aa;
|
||||
// lisObj = blueteethBindController.currentDevice!.statusStream
|
||||
// .listen((onData) async {
|
||||
// if (onData.status == BleEventType.recvLineLog) {
|
||||
// final line = onData.val;
|
||||
// print("[bleee]:" + line);
|
||||
// }
|
||||
// if (onData.status == BleEventType.ready) {
|
||||
// aa = await getDeviceNetVersion(
|
||||
// blueteethBindController.currentDevice!, 1);
|
||||
// if (aa == "4g") {
|
||||
// Get.toNamed("/calibrationPage", arguments: 1);
|
||||
// } else {
|
||||
// Get.toNamed("/wifiPage");
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// } else {
|
||||
// // Navigator.pop(context);
|
||||
// TopSlideNotification.show(
|
||||
// context,
|
||||
// text: "蓝牙绑定.连接失败".tr,
|
||||
// textColor: themeController.currentColor.sc9,
|
||||
// );
|
||||
// }
|
||||
// blueteethBindController.currentDeviceMac.value = "";
|
||||
|
||||
} else {
|
||||
blueteethBindController.currentDeviceMac = null;
|
||||
blueteethBindController.currentDeviceMac.value = "";
|
||||
blueteethBindController.updateAll();
|
||||
TopSlideNotification.show(
|
||||
context,
|
||||
@@ -143,7 +107,7 @@ class _SingleBlueteethDeviceCompoentWidgetState
|
||||
},
|
||||
onCancel: () {
|
||||
print('用户点击了取消');
|
||||
blueteethBindController.currentDeviceMac?.value = "";
|
||||
blueteethBindController.currentDeviceMac.value = "";
|
||||
blueteethBindController.updateAll();
|
||||
},
|
||||
);
|
||||
@@ -179,7 +143,8 @@ class _SingleBlueteethDeviceCompoentWidgetState
|
||||
),
|
||||
),
|
||||
Obx(() {
|
||||
if (blueteethBindController.currentDeviceMac == device.mac) {
|
||||
if (blueteethBindController.currentDeviceMac.value ==
|
||||
device.mac) {
|
||||
return SizedBox(
|
||||
width: 24.rpx,
|
||||
height: 24.rpx,
|
||||
|
||||
Reference in New Issue
Block a user