fix:调整配网后的再次读取一遍上传一遍锁设置
This commit is contained in:
parent
6d066a722d
commit
70d549d04d
@ -72,17 +72,6 @@ class ConfiguringWifiLogic extends BaseGetXController {
|
||||
secretKey: secretKey,
|
||||
peerId: peerId,
|
||||
);
|
||||
|
||||
if (state.pageName.value == 'lockSet') {
|
||||
Get.close(2);
|
||||
} else {
|
||||
Get.offAllNamed(Routers.starLockMain);
|
||||
}
|
||||
dismissEasyLoading();
|
||||
if (state.loadingTimer != null) {
|
||||
state.loadingTimer!.cancel();
|
||||
state.loadingTimer = null;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -398,8 +387,10 @@ class ConfiguringWifiLogic extends BaseGetXController {
|
||||
|
||||
// 上传数据获取设置
|
||||
Future<void> _getUploadLockSet() async {
|
||||
// showBlueConnetctToastTimer(action: (){
|
||||
// });
|
||||
showEasyLoading();
|
||||
showBlueConnetctToastTimer(action: () {
|
||||
dismissEasyLoading();
|
||||
});
|
||||
BlueManage().blueSendData(BlueManage().connectDeviceName,
|
||||
(BluetoothConnectionState connectionState) async {
|
||||
if (connectionState == BluetoothConnectionState.connected) {
|
||||
@ -408,10 +399,10 @@ class ConfiguringWifiLogic extends BaseGetXController {
|
||||
|
||||
_uploadLockSet(getTokenList);
|
||||
} else if (connectionState == BluetoothConnectionState.disconnected) {
|
||||
// cancelBlueConnetctToastTimer();
|
||||
// if(state.ifCurrentScreen.value == true){
|
||||
// showBlueConnetctToast();
|
||||
// }
|
||||
cancelBlueConnetctToastTimer();
|
||||
if (state.ifCurrentScreen.value == true) {
|
||||
showBlueConnetctToast();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -468,13 +459,23 @@ class ConfiguringWifiLogic extends BaseGetXController {
|
||||
required int recordType,
|
||||
required List records}) async {
|
||||
final LoginEntity entity = await ApiRepository.to.lockDataUpload(
|
||||
lockId: CommonDataManage().currentKeyInfo.lockId!,
|
||||
lockId: state.lockBasicInfo.value.lockId ?? -1,
|
||||
uploadType: uploadType,
|
||||
recordType: recordType,
|
||||
records: records,
|
||||
isUnShowLoading: true);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
update();
|
||||
await Future.delayed((Duration(seconds: 1)));
|
||||
if (state.pageName.value == 'lockSet') {
|
||||
Get.close(2);
|
||||
} else {
|
||||
Get.offAllNamed(Routers.starLockMain);
|
||||
}
|
||||
dismissEasyLoading();
|
||||
if (state.loadingTimer != null) {
|
||||
state.loadingTimer!.cancel();
|
||||
state.loadingTimer = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -44,12 +44,17 @@ class _ConfiguringWifiPageState extends State<ConfiguringWifiPage>
|
||||
SizedBox(
|
||||
height: 50.h,
|
||||
),
|
||||
SubmitBtn(
|
||||
btnName: '确定'.tr,
|
||||
onClick: () {
|
||||
FocusScope.of(context).requestFocus(FocusNode());
|
||||
logic.senderConfiguringWifiAction();
|
||||
},
|
||||
Obx(
|
||||
() => SubmitBtn(
|
||||
btnName: '确定'.tr,
|
||||
isDisabled: state.isLoading.isFalse,
|
||||
onClick: state.isLoading.isTrue
|
||||
? null
|
||||
: () {
|
||||
FocusScope.of(context).requestFocus(FocusNode());
|
||||
logic.senderConfiguringWifiAction();
|
||||
},
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 20.h,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user