From 0105a3ca726a5f74afb7d0be8aa9beccbd688320 Mon Sep 17 00:00:00 2001 From: liyi Date: Tue, 10 Jun 2025 09:25:45 +0800 Subject: [PATCH 1/4] =?UTF-8?q?fix:=E8=B0=83=E6=95=B4=E4=B8=BA=E6=94=B6?= =?UTF-8?q?=E5=88=B0=E9=A2=84=E6=9C=9F=E6=8E=A5=E6=94=B6=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=9B=9E=E5=A4=8D=E4=B9=8B=E5=90=8E=E6=89=8D=E8=BF=9B=E8=A1=8C?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E8=B7=B3=E8=BD=AC=E5=92=8C=E6=92=AD=E6=94=BE?= =?UTF-8?q?=E9=93=83=E5=A3=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../handle/impl/udp_talk_expect_handler.dart | 56 ++++++++++++++++++- .../handle/impl/udp_talk_request_handler.dart | 42 -------------- 2 files changed, 54 insertions(+), 44 deletions(-) diff --git a/lib/talk/starChart/handle/impl/udp_talk_expect_handler.dart b/lib/talk/starChart/handle/impl/udp_talk_expect_handler.dart index 792e7f2c..d500fd44 100644 --- a/lib/talk/starChart/handle/impl/udp_talk_expect_handler.dart +++ b/lib/talk/starChart/handle/impl/udp_talk_expect_handler.dart @@ -4,7 +4,9 @@ import 'dart:typed_data'; import 'package:flutter/services.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:get/get.dart'; +import 'package:star_lock/appRouters.dart'; import 'package:star_lock/app_settings/app_settings.dart'; +import 'package:star_lock/main/lockMian/entity/lockListInfo_entity.dart'; import 'package:star_lock/talk/starChart/constant/message_type_constant.dart'; import 'package:star_lock/talk/starChart/constant/talk_status.dart'; import 'package:star_lock/talk/starChart/entity/scp_message.dart'; @@ -16,6 +18,8 @@ import 'package:star_lock/talk/starChart/proto/talk_data.pb.dart'; import 'package:star_lock/talk/starChart/proto/talk_expect.pb.dart'; import 'package:star_lock/talk/starChart/views/talkView/talk_view_logic.dart'; import 'package:star_lock/talk/starChart/views/talkView/talk_view_state.dart'; +import 'package:star_lock/tools/commonDataManage.dart'; +import 'package:star_lock/tools/storage.dart'; import '../../star_chart_manage.dart'; @@ -32,10 +36,14 @@ class UdpTalkExpectHandler extends ScpMessageBaseHandle } @override - void handleResp(ScpMessage scpMessage) { + void handleResp(ScpMessage scpMessage) async { // 收到预期音视频数据回复 final TalkExpectResp talkExpectResp = scpMessage.Payload; + if (talkExpectResp != null) { + // 播放铃声 + //test:使用自定义铃声 + playRingtone(); // print('收到预期音视频数据回复,scpMessage:$scpMessage'); // 停止发送预期数据的定时器 startChartManage.stopTalkExpectMessageTimer(); @@ -45,7 +53,7 @@ class UdpTalkExpectHandler extends ScpMessageBaseHandle startChartManage.rotateAngle = talkExpectResp.rotate; startChartManage.videoWidth = talkExpectResp.width; startChartManage.videoHeight = talkExpectResp.height; - AppLog.log('视频画面需要旋转:${talkExpectResp.rotate},画面宽高:${talkExpectResp.width}-${talkExpectResp.height}'); + // 收到预期数据的应答后,代表建立了连接,启动通话保持的监听 // 启动通话保持监听定时器(用来判断如果x秒内没有收到通话保持则执行的操作); talkePingOverTimeTimerManager.start(); @@ -59,6 +67,50 @@ class UdpTalkExpectHandler extends ScpMessageBaseHandle // 主动呼叫时需要启动ping startChartManage.startTalkPingMessageTimer(); } + AppLog.log( + '视频画面需要旋转:${talkExpectResp.rotate},画面宽高:${talkExpectResp.width}-${talkExpectResp.height}'); + // 获取锁支持项 + final LockListInfoItemEntity currentKeyInfo = + CommonDataManage().currentKeyInfo; + // 0、wifi保活 1、wifi不保活图传 2、wifi不保活可视对讲 + var isWifiLockType = currentKeyInfo.lockFeature?.wifiLockType == 1; + + final LockListInfoGroupEntity? lockListInfoGroupEntity = + await Storage.getLockMainListData(); + if (lockListInfoGroupEntity != null) { + lockListInfoGroupEntity!.groupList?.forEach((element) { + final lockList = element.lockList; + if (lockList != null && lockList.length != 0) { + for (var lockInfo in lockList) { + final peerId = lockInfo.network?.peerId; + if (peerId != null && peerId != '') { + if (peerId == scpMessage.FromPeerId) { + isWifiLockType = lockInfo.lockFeature?.wifiLockType == 1; + } + } + } + } + }); + } + if (isWifiLockType || + (talkExpectResp.rotate == 0 && + talkExpectResp.width == 640 && + talkExpectResp.height == 480)) { + Get.toNamed(Routers.imageTransmissionView); + return; + } + if (startChartManage + .getDefaultTalkExpect() + .videoType + .contains(VideoTypeE.H264)) { + Get.toNamed( + Routers.h264WebView, + ); + } else { + Get.toNamed( + Routers.starChartTalkView, + ); + } } } diff --git a/lib/talk/starChart/handle/impl/udp_talk_request_handler.dart b/lib/talk/starChart/handle/impl/udp_talk_request_handler.dart index 195c2ab6..4f3a002f 100644 --- a/lib/talk/starChart/handle/impl/udp_talk_request_handler.dart +++ b/lib/talk/starChart/handle/impl/udp_talk_request_handler.dart @@ -90,52 +90,10 @@ class UdpTalkRequestHandler extends ScpMessageBaseHandle }) async { // 发送预期数据、通知锁板需要获取视频数据 _handleRequestSendExpect(lockPeerID: lockPeerID); - // 播放铃声 - //test:使用自定义铃声 - playRingtone(); // 显示状态栏弹窗 // _showTalkRequestNotification(talkObjectName: talkObjectName); // 设置为等待接听状态 talkStatus.setPassiveCallWaitingAnswer(); - - // 获取锁支持项 - final LockListInfoItemEntity currentKeyInfo = - CommonDataManage().currentKeyInfo; - var isWifiLockType = currentKeyInfo.lockFeature?.wifiLockType == 1; - - final LockListInfoGroupEntity? lockListInfoGroupEntity = - await Storage.getLockMainListData(); - if (lockListInfoGroupEntity != null) { - lockListInfoGroupEntity!.groupList?.forEach((element) { - final lockList = element.lockList; - if (lockList != null && lockList.length != 0) { - for (var lockInfo in lockList) { - final peerId = lockInfo.network?.peerId; - if (peerId != null && peerId != '') { - if (peerId == lockPeerID) { - isWifiLockType = lockInfo.lockFeature?.wifiLockType == 1; - } - } - } - } - }); - } - if (isWifiLockType) { - Get.toNamed(Routers.imageTransmissionView); - return; - } - if (startChartManage - .getDefaultTalkExpect() - .videoType - .contains(VideoTypeE.H264)) { - Get.toNamed( - Routers.h264WebView, - ); - } else { - Get.toNamed( - Routers.starChartTalkView, - ); - } } // 收到来电请求时进行本地通知 From b61aceeac9044cf97edfb8dedccb914a252aacc8 Mon Sep 17 00:00:00 2001 From: liyi Date: Tue, 10 Jun 2025 09:26:28 +0800 Subject: [PATCH 2/4] =?UTF-8?q?fix:=E5=9B=BE=E4=BC=A0=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E5=85=BC=E5=AE=B9640*480=E4=B8=8D=E6=97=8B=E8=BD=AC=E7=9A=84?= =?UTF-8?q?=E8=A7=86=E9=A2=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../imageTransmission/image_transmission_page.dart | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/talk/starChart/views/imageTransmission/image_transmission_page.dart b/lib/talk/starChart/views/imageTransmission/image_transmission_page.dart index a7d1109e..2ba567f5 100644 --- a/lib/talk/starChart/views/imageTransmission/image_transmission_page.dart +++ b/lib/talk/starChart/views/imageTransmission/image_transmission_page.dart @@ -55,13 +55,22 @@ class _ImageTransmissionPageState extends State super.dispose(); } + String handlerAppBarTitle() { + if (startChartManage.rotateAngle == 0 && + startChartManage.videoWidth == 640 && + startChartManage.videoHeight == 480) { + return ''; + } + return '图传'.tr; + } + @override Widget build(BuildContext context) { return Scaffold( backgroundColor: AppColors.mainBackgroundColor, resizeToAvoidBottomInset: false, appBar: TitleAppBar( - barTitle: '图传'.tr, + barTitle: handlerAppBarTitle(), haveBack: true, backgroundColor: AppColors.mainColor, backAction: () { @@ -142,7 +151,7 @@ class _ImageTransmissionPageState extends State borderRadius: BorderRadius.circular(30.h), child: Container( width: barWidth, - height: double.infinity, + // height: double.infinity, child: RotatedBox( quarterTurns: startChartManage.rotateAngle ~/ 90, child: RawImage( From 0520733080d357518c4ab50ba071dc551f82f1be Mon Sep 17 00:00:00 2001 From: liyi Date: Wed, 11 Jun 2025 09:17:59 +0800 Subject: [PATCH 3/4] =?UTF-8?q?fix:=E5=A6=82=E6=9E=9C=E6=98=AF=E5=8D=95?= =?UTF-8?q?=E6=AC=A1=E9=92=A5=E5=8C=99=E5=BC=80=E9=94=81=E6=88=90=E5=8A=9F?= =?UTF-8?q?=E4=B9=8B=E5=90=8E=E5=B0=B1=E8=B0=83=E7=94=A8=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lockDetail/lockDetail/lockDetail_logic.dart | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) 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(), From 9d2c9535223bac507d4cc9c7baa4ad40b09a73d9 Mon Sep 17 00:00:00 2001 From: liyi Date: Wed, 11 Jun 2025 09:18:27 +0800 Subject: [PATCH 4/4] =?UTF-8?q?fix:=E4=B8=8A=E4=BC=A0=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=97=B6=E5=9B=9E=E5=A4=8D0=E6=97=B6=E4=B9=9F=E4=BF=9D?= =?UTF-8?q?=E6=8C=81=E8=AF=B7=E6=B1=82=E4=B8=8B=E4=B8=80=E4=BB=BD=E6=95=B0?= =?UTF-8?q?=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lockSet/uploadData/uploadData_logic.dart | 44 ++++++++++++++++++- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/lib/main/lockDetail/lockSet/uploadData/uploadData_logic.dart b/lib/main/lockDetail/lockSet/uploadData/uploadData_logic.dart index b032bb97..e1046768 100644 --- a/lib/main/lockDetail/lockSet/uploadData/uploadData_logic.dart +++ b/lib/main/lockDetail/lockSet/uploadData/uploadData_logic.dart @@ -798,8 +798,48 @@ class UploadDataLogic extends BaseGetXController { } } } else { - state.indexCount.value = 0; - state.sureBtnState.value = 0; + if (uploadType == 1) { + // 1设置 + // state.indexCount.value = 0; + // state.sureBtnState.value = 0; + // showToast('上传成功'.tr); + } else { + // 2开门方式 + switch (recordType) { + // case 1: + // // 电子钥匙 + // + // break; + case 2: + // 密码上传成功之后,获取卡列表 + getUpdataLockCardList(); + break; + case 3: + // IC卡上传成功,获取指纹列表 + getUpdataLockFingerprintList(); + break; + case 4: + // 指纹上传成功,获取人脸列表 + getUpdataLockFaceList(); + break; + case 5: + // 人脸上传成功,获取掌静脉列表 + getUpdataLockPalmVeinList(); + break; + case 6: + // 掌静脉上传成功,获取锁遥控 + getUpdataLockRemoteControlList(); + break; + case 7: + // 遥控上传成功,获取锁设置 + getUpdataLockSet(); + break; + default: + break; + } + } + // state.indexCount.value = 0; + // state.sureBtnState.value = 0; dismissEasyLoading(); } }