fix:调整配网后的再次读取一遍上传一遍锁设置

This commit is contained in:
liyi 2025-03-25 14:05:18 +08:00
parent 6d066a722d
commit 70d549d04d
2 changed files with 31 additions and 25 deletions

View File

@ -72,17 +72,6 @@ class ConfiguringWifiLogic extends BaseGetXController {
secretKey: secretKey, secretKey: secretKey,
peerId: peerId, 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 { Future<void> _getUploadLockSet() async {
// showBlueConnetctToastTimer(action: (){ showEasyLoading();
// }); showBlueConnetctToastTimer(action: () {
dismissEasyLoading();
});
BlueManage().blueSendData(BlueManage().connectDeviceName, BlueManage().blueSendData(BlueManage().connectDeviceName,
(BluetoothConnectionState connectionState) async { (BluetoothConnectionState connectionState) async {
if (connectionState == BluetoothConnectionState.connected) { if (connectionState == BluetoothConnectionState.connected) {
@ -408,10 +399,10 @@ class ConfiguringWifiLogic extends BaseGetXController {
_uploadLockSet(getTokenList); _uploadLockSet(getTokenList);
} else if (connectionState == BluetoothConnectionState.disconnected) { } else if (connectionState == BluetoothConnectionState.disconnected) {
// cancelBlueConnetctToastTimer(); cancelBlueConnetctToastTimer();
// if(state.ifCurrentScreen.value == true){ if (state.ifCurrentScreen.value == true) {
// showBlueConnetctToast(); showBlueConnetctToast();
// } }
} }
}); });
} }
@ -468,13 +459,23 @@ class ConfiguringWifiLogic extends BaseGetXController {
required int recordType, required int recordType,
required List records}) async { required List records}) async {
final LoginEntity entity = await ApiRepository.to.lockDataUpload( final LoginEntity entity = await ApiRepository.to.lockDataUpload(
lockId: CommonDataManage().currentKeyInfo.lockId!, lockId: state.lockBasicInfo.value.lockId ?? -1,
uploadType: uploadType, uploadType: uploadType,
recordType: recordType, recordType: recordType,
records: records, records: records,
isUnShowLoading: true); isUnShowLoading: true);
if (entity.errorCode!.codeIsSuccessful) { 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;
}
} }
} }

View File

@ -44,12 +44,17 @@ class _ConfiguringWifiPageState extends State<ConfiguringWifiPage>
SizedBox( SizedBox(
height: 50.h, height: 50.h,
), ),
SubmitBtn( Obx(
btnName: '确定'.tr, () => SubmitBtn(
onClick: () { btnName: '确定'.tr,
FocusScope.of(context).requestFocus(FocusNode()); isDisabled: state.isLoading.isFalse,
logic.senderConfiguringWifiAction(); onClick: state.isLoading.isTrue
}, ? null
: () {
FocusScope.of(context).requestFocus(FocusNode());
logic.senderConfiguringWifiAction();
},
),
), ),
SizedBox( SizedBox(
height: 20.h, height: 20.h,