feat:增加电机功率操作成功提示、不在锁边应提示操作失败、无网络在点击时应提示网络访问失败

This commit is contained in:
liyi 2025-03-12 14:22:56 +08:00
parent 1ca854e435
commit 2fb3c7d2b5

View File

@ -30,9 +30,10 @@ class MotorPowerLogic extends BaseGetXController {
state.lockSetInfoData.value.lockSettingInfo!.openDirectionValue = state.lockSetInfoData.value.lockSettingInfo!.openDirectionValue =
state.motorTorsion.value; state.motorTorsion.value;
eventBus showToast('操作成功'.tr, something: () {
.fire(PassCurrentLockInformationEvent(state.lockSetInfoData.value)); eventBus
showToast('操作成功'.tr); .fire(PassCurrentLockInformationEvent(state.lockSetInfoData.value));
});
} }
} }
@ -80,6 +81,7 @@ class MotorPowerLogic extends BaseGetXController {
switch (status) { switch (status) {
case 0x00: case 0x00:
// //
cancelBlueConnetctToastTimer();
_setLockSetGeneralSetting(); _setLockSetGeneralSetting();
break; break;
case 0x06: case 0x06:
@ -123,6 +125,10 @@ class MotorPowerLogic extends BaseGetXController {
// () // ()
Future<void> sendOpenDoorDirection() async { Future<void> sendOpenDoorDirection() async {
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) {
@ -149,6 +155,10 @@ class MotorPowerLogic extends BaseGetXController {
needAuthor: 1, needAuthor: 1,
publicKey: getPublicKeyList, publicKey: getPublicKeyList,
privateKey: getPrivateKeyList); privateKey: getPrivateKeyList);
} else if (connectionState == BluetoothConnectionState.disconnected) {
dismissEasyLoading();
cancelBlueConnetctToastTimer();
showBlueConnetctToast();
} }
}); });
} }