From 794bf8cf1127a9c15a0775b231b9ea3bc68e34a0 Mon Sep 17 00:00:00 2001 From: liyi Date: Wed, 12 Mar 2025 17:31:54 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E8=B0=83=E6=95=B4=E8=AF=BB=E5=8F=96?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E6=97=B6=E4=B8=80=E7=9B=B4=E8=BD=AC=E5=9C=88?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../doorLockLog/doorLockLog_logic.dart | 76 +++++++++---------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/lib/main/lockDetail/doorLockLog/doorLockLog_logic.dart b/lib/main/lockDetail/doorLockLog/doorLockLog_logic.dart index 052ac7e8..4999b8ed 100755 --- a/lib/main/lockDetail/doorLockLog/doorLockLog_logic.dart +++ b/lib/main/lockDetail/doorLockLog/doorLockLog_logic.dart @@ -54,9 +54,11 @@ class DoorLockLogLogic extends BaseGetXController { switch (status) { case 0x00: + dismissEasyLoading(); + cancelBlueConnetctToastTimer(); //成功 final int dataLength = (reply.data[5] << 8) + reply.data[6]; - // AppLog.log("dataLength:$dataLength"); + AppLog.log("dataLength:$dataLength"); // var dataLength = reply.data[5]; if (dataLength > 0) { reply.data.removeRange(0, 7); @@ -108,6 +110,8 @@ class DoorLockLogLogic extends BaseGetXController { state.ifHaveNext = false; } lockRecordUploadData(uploadList); + } else { + showToast('暂无最新记录'.tr); } break; case 0x06: @@ -117,6 +121,7 @@ class DoorLockLogLogic extends BaseGetXController { default: //失败 dismissEasyLoading(); + cancelBlueConnetctToastTimer(); break; } } @@ -148,30 +153,23 @@ class DoorLockLogLogic extends BaseGetXController { ).toString(); showEasyLoading(); - showBlueConnetctToastTimer( - isShowBlueConnetctToast: true, - action: () async { - cancelBlueConnetctToastTimer(); + showBlueConnetctToastTimer(action: () async { + dismissEasyLoading(); + final String getMobile = (await Storage.getMobile())!; + ApmHelper.instance.trackEvent('check_doorLockLog', { + 'lockName': state.keyInfos.value.lockName!, + 'account': + getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!, + 'date': DateTool().getNowDateWithType(1), + 'open_lock_result': '超时', + }); - final String getMobile = (await Storage.getMobile())!; - ApmHelper.instance.trackEvent('check_doorLockLog', { - 'lockName': state.keyInfos.value.lockName!, - 'account': - getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!, - 'date': DateTool().getNowDateWithType(1), - 'open_lock_result': '超时', - }); - - BuglyTool.uploadException( - message: '查询锁记录超时-查询锁记录失败', - detail: - '添加密码超时,查询锁记录失败--senderReferEventRecordTimeCommand:$command', - eventStr: '查询锁记录事件超时', - upload: true); - if (state.isLockReceiveResponse == false) { - dismissEasyLoading(); - } - }); + BuglyTool.uploadException( + message: '查询锁记录超时-查询锁记录失败', + detail: '添加密码超时,查询锁记录失败--senderReferEventRecordTimeCommand:$command', + eventStr: '查询锁记录事件超时', + upload: true); + }); BlueManage().blueSendData(BlueManage().connectDeviceName, (BluetoothConnectionState connectionStateState) async { if (connectionStateState == BluetoothConnectionState.connected) { @@ -303,20 +301,22 @@ class DoorLockLogLogic extends BaseGetXController { lockId: state.keyInfos.value.lockId.toString(), records: list); final String getMobile = (await Storage.getMobile())!; if (entity.errorCode!.codeIsSuccessful) { - if (state.ifHaveNext == true) { - showEasyLoading(); - getLockRecordLastUploadDataTime(); - } else { - ApmHelper.instance.trackEvent('check_doorLockLog', { - 'lockName': state.keyInfos.value.lockName!, - 'account': - getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!, - 'date': DateTool().getNowDateWithType(1), - 'open_lock_result': '成功', - }); - mockNetworkDataRequest(isRefresh: true); - } - dismissEasyLoading(); + showToast('操作成功'.tr, something: () async { + dismissEasyLoading(); + if (state.ifHaveNext == true) { + showEasyLoading(); + getLockRecordLastUploadDataTime(); + } else { + ApmHelper.instance.trackEvent('check_doorLockLog', { + 'lockName': state.keyInfos.value.lockName!, + 'account': + getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!, + 'date': DateTool().getNowDateWithType(1), + 'open_lock_result': '成功', + }); + mockNetworkDataRequest(isRefresh: true); + } + }); } else { ApmHelper.instance.trackEvent('check_doorLockLog', { 'lockName': state.keyInfos.value.lockName!,