From 3238359c541d83c3052bb55d52de950cf75ddfd7 Mon Sep 17 00:00:00 2001 From: anfe <448468458@qq.com> Date: Mon, 17 Jun 2024 14:29:13 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E5=A4=84=E7=90=86=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E5=90=88=E5=B9=B6=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lockDetail/lockDetail_logic.dart | 1 + .../lockDetail/lockDetail_page.dart | 62 +------------------ 2 files changed, 2 insertions(+), 61 deletions(-) diff --git a/lib/main/lockDetail/lockDetail/lockDetail_logic.dart b/lib/main/lockDetail/lockDetail/lockDetail_logic.dart index 22609de7..b0728bf9 100755 --- a/lib/main/lockDetail/lockDetail/lockDetail_logic.dart +++ b/lib/main/lockDetail/lockDetail/lockDetail_logic.dart @@ -179,6 +179,7 @@ class LockDetailLogic extends BaseGetXController { Future loadData({ required LockListInfoItemEntity lockListInfoItemEntity,required bool isOnlyOneData}) async { state.keyInfos.value = lockListInfoItemEntity; CommonDataManage().currentLockUserNo = state.keyInfos.value.lockUserNo!; + CommonDataManage().initUserNo = state.keyInfos.value.initUserNo!; CommonDataManage().currentKeyInfo = state.keyInfos.value; state.lockUserNo = state.keyInfos.value.lockUserNo!; diff --git a/lib/main/lockDetail/lockDetail/lockDetail_page.dart b/lib/main/lockDetail/lockDetail/lockDetail_page.dart index 79e27ef0..9c235587 100755 --- a/lib/main/lockDetail/lockDetail/lockDetail_page.dart +++ b/lib/main/lockDetail/lockDetail/lockDetail_page.dart @@ -60,6 +60,7 @@ class _LockDetailPageState extends State _initRefreshLockDetailInfoDataEventAction(); logic.initReplySubscription(); logic.initLockSetOpenOrCloseCheckInRefreshLockDetailWithAttendanceAction(); + logic.loadData(lockListInfoItemEntity: widget.lockListInfoItemEntity, isOnlyOneData: widget.isOnlyOneData); } @override @@ -81,69 +82,8 @@ class _LockDetailPageState extends State }); } - Future loadData() async { - state.keyInfos.value = widget.lockListInfoItemEntity; - CommonDataManage().currentLockUserNo = state.keyInfos.value.lockUserNo!; - CommonDataManage().initUserNo = state.keyInfos.value.initUserNo!; - CommonDataManage().currentKeyInfo = state.keyInfos.value; - - state.lockUserNo = state.keyInfos.value.lockUserNo!; - - if (state.keyInfos.value.keyStatus == - XSConstantMacro.keyStatusWaitIneffective || - state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusFrozen || - state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusExpired || - state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusDeleted || - state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusReset) { - state.openDoorBtnisUneable.value = false; - state.bottomBtnisEable.value = false; - } else { - state.openDoorBtnisUneable.value = true; - state.bottomBtnisEable.value = true; - } - - state.isOnlyOneData = widget.isOnlyOneData; - state.senderUserId = state.keyInfos.value.senderUserId!; - state.isAttendance.value = state.keyInfos.value.lockSetting!.attendance!; - state.isOpenLockNeedOnline.value = - state.keyInfos.value.lockSetting!.appUnlockOnline!; - state.electricQuantity.value = state.keyInfos.value.electricQuantity!; - state.isOpenPassageMode.value = state.keyInfos.value.passageMode!; - state.lockAlias.value = state.keyInfos.value.lockAlias!; - Storage.setString(saveLockAlias, state.lockAlias.value); - - BlueManage().connectDeviceName = - state.keyInfos.value.bluetooth!.bluetoothDeviceName!; - - final List publicKeyData = - state.keyInfos.value.bluetooth!.publicKey!.cast(); - final List saveStrList = changeIntListToStringList(publicKeyData); - Storage.setStringList(saveBluePublicKey, saveStrList); - - // 私钥 - final List privateKeyData = - state.keyInfos.value.bluetooth!.privateKey!.cast(); - final List savePrivateKeyList = - changeIntListToStringList(privateKeyData); - Storage.setStringList(saveBluePrivateKey, savePrivateKeyList); - - // signKey - final List signKeyData = - state.keyInfos.value.bluetooth!.signKey!.cast(); - final List saveSignKeyList = changeIntListToStringList(signKeyData); - Storage.setStringList(saveBlueSignKey, saveSignKeyList); - - final bool ifHaveKey = await Storage.ifHaveKey(saveBlueToken); - if (!ifHaveKey) { - final List saveTokenList = - changeIntListToStringList([0, 0, 0, 0]); - Storage.setStringList(saveBlueToken, saveTokenList); - } - } - @override Widget build(BuildContext context) { - loadData(); return F.sw(skyCall: skWidget, xhjCall: xhjWidget); }