fix:配网时蓝牙超时进行提示,调整配网成功后的上报流程

This commit is contained in:
liyi 2025-04-08 14:34:25 +08:00
parent 066aff8fdf
commit 823b268380

View File

@ -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;
}
}
}