fix:配网时蓝牙超时进行提示,调整配网成功后的上报流程
This commit is contained in:
parent
066aff8fdf
commit
823b268380
@ -62,10 +62,8 @@ class ConfiguringWifiLogic extends BaseGetXController {
|
||||
peerId: peerId,
|
||||
);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
await _getUploadLockSet();
|
||||
|
||||
showToast('配网成功'.tr, something: () async {
|
||||
eventBus
|
||||
.fire(PassCurrentLockInformationEvent(state.lockSetInfoData.value));
|
||||
// 设置锁的peerID
|
||||
StartChartManage().lockNetworkInfo = DeviceNetworkInfo(
|
||||
wifiName: wifiName,
|
||||
@ -74,6 +72,7 @@ class ConfiguringWifiLogic extends BaseGetXController {
|
||||
peerId: peerId,
|
||||
);
|
||||
});
|
||||
_getUploadLockSet();
|
||||
}
|
||||
}
|
||||
|
||||
@ -135,7 +134,7 @@ class ConfiguringWifiLogic extends BaseGetXController {
|
||||
// 保存到缓存
|
||||
await Storage.saveLockNetWorkInfo(jsonMap);
|
||||
// 上报服务器
|
||||
updateNetworkInfo(
|
||||
updateNetworkInfo(
|
||||
peerId: peerId ?? '',
|
||||
wifiName: wifiName ?? '',
|
||||
secretKey: secretKey ?? '',
|
||||
@ -231,6 +230,13 @@ class ConfiguringWifiLogic extends BaseGetXController {
|
||||
password: state.wifiPWDController.text,
|
||||
gatewayConfigurationStr: state.getGatewayConfigurationStr,
|
||||
);
|
||||
} else if (connectionState == BluetoothConnectionState.disconnected) {
|
||||
dismissEasyLoading();
|
||||
cancelBlueConnetctToastTimer();
|
||||
state.sureBtnState.value = 0;
|
||||
if (state.ifCurrentScreen.value == true) {
|
||||
showBlueConnetctToast();
|
||||
}
|
||||
}
|
||||
},
|
||||
isAddEquipment: true,
|
||||
@ -391,10 +397,10 @@ class ConfiguringWifiLogic extends BaseGetXController {
|
||||
|
||||
// 上传数据获取设置
|
||||
Future<void> _getUploadLockSet() async {
|
||||
showEasyLoading();
|
||||
showBlueConnetctToastTimer(action: () {
|
||||
dismissEasyLoading();
|
||||
});
|
||||
// showEasyLoading();
|
||||
// showBlueConnetctToastTimer(action: () {
|
||||
// dismissEasyLoading();
|
||||
// });
|
||||
BlueManage().blueSendData(BlueManage().connectDeviceName,
|
||||
(BluetoothConnectionState connectionState) async {
|
||||
if (connectionState == BluetoothConnectionState.connected) {
|
||||
@ -476,6 +482,8 @@ class ConfiguringWifiLogic extends BaseGetXController {
|
||||
Get.offAllNamed(Routers.starLockMain);
|
||||
}
|
||||
dismissEasyLoading();
|
||||
eventBus
|
||||
.fire(PassCurrentLockInformationEvent(state.lockSetInfoData.value));
|
||||
if (state.loadingTimer != null) {
|
||||
state.loadingTimer!.cancel();
|
||||
state.loadingTimer = null;
|
||||
@ -493,6 +501,5 @@ class ConfiguringWifiLogic extends BaseGetXController {
|
||||
state.loadingTimer!.cancel();
|
||||
state.loadingTimer = null;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user