diff --git a/lib/main/lockDetail/lockDetail/lockDetail_logic.dart b/lib/main/lockDetail/lockDetail/lockDetail_logic.dart index 44e9259d..1155117f 100755 --- a/lib/main/lockDetail/lockDetail/lockDetail_logic.dart +++ b/lib/main/lockDetail/lockDetail/lockDetail_logic.dart @@ -126,6 +126,17 @@ class LockDetailLogic extends BaseGetXController { TalkStatus.answeredSuccessfully) { showToast('开锁成功'.tr); } + // 如果是单次钥匙,则开锁成功之后调用删除 + if (state.keyInfos.value.keyType == 3) { + final LockListInfoEntity entity = await ApiRepository.to + .deletOwnerKeyData( + lockId: state.keyInfos.value.lockId.toString(), + keyId: state.keyInfos.value!.keyId.toString(), + includeUnderlings: 0); + if (entity.errorCode!.codeIsSuccessful) { + AppLog.log("删除成功"); + } + } break; case 0x06: //无权限 @@ -532,8 +543,7 @@ class LockDetailLogic extends BaseGetXController { final List getPublicKeyList = changeStringListToIntList(publicKey!); - AppLog.log( - '发送同步锁记录命令:${BlueManage().connectDeviceName}'); + AppLog.log('发送同步锁记录命令:${BlueManage().connectDeviceName}'); IoSenderManage.senderReferEventRecordTimeCommand( keyID: BlueManage().connectDeviceName, userID: await Storage.getUid(),