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