From 7b235718c5c723f773b80e60e54df5e9c46d6001 Mon Sep 17 00:00:00 2001 From: Liuyf Date: Tue, 8 Apr 2025 09:07:37 +0800 Subject: [PATCH 01/12] =?UTF-8?q?other:=20=E4=BF=AE=E6=94=B9=E8=81=94?= =?UTF-8?q?=E8=B0=83=20=EF=BC=8C=E9=A2=84=E5=8F=91=E5=B8=83=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=E5=9F=9F=E5=90=8D=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/flavors.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/flavors.dart b/lib/flavors.dart index 0d4fbe8f..f2c54c95 100755 --- a/lib/flavors.dart +++ b/lib/flavors.dart @@ -140,11 +140,11 @@ class F { case Flavor.dev: case Flavor.xhj_dev: case Flavor.sky_dev: - return 'https://dev.lock.star-lock.cn'; + return 'https://lock.dev.star-lock.cn'; case Flavor.pre: case Flavor.xhj_pre: case Flavor.sky_pre: - return 'https://pre.lock.star-lock.cn'; + return 'https://lock.pre.star-lock.cn'; case Flavor.sky: return 'https://lock.skychip.top'; case Flavor.xhj: From eb801de7c3f4128a2389b411f68ed0051f4cbd8d Mon Sep 17 00:00:00 2001 From: liyi Date: Tue, 8 Apr 2025 14:33:27 +0800 Subject: [PATCH 02/12] =?UTF-8?q?fix:=E5=A2=9E=E5=8A=A0=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=91=98=E5=B7=B2=E6=BB=A1=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fingerprint/addFingerprint/addFingerprint_logic.dart | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/main/lockDetail/fingerprint/addFingerprint/addFingerprint_logic.dart b/lib/main/lockDetail/fingerprint/addFingerprint/addFingerprint_logic.dart index c8507a3f..6bd97fb8 100755 --- a/lib/main/lockDetail/fingerprint/addFingerprint/addFingerprint_logic.dart +++ b/lib/main/lockDetail/fingerprint/addFingerprint/addFingerprint_logic.dart @@ -105,6 +105,13 @@ class AddFingerprintLogic extends BaseGetXController { token: token, isBeforeAddUser: false); break; + case 0xFE: + // 管理员已满 + state.ifAddState.value = false; + showToast('管理员已满'.tr, something: () { + Get.back(); + }); + break; default: //失败 state.ifAddState.value = false; From 066aff8fdf834817b93988859c876f7efa539386 Mon Sep 17 00:00:00 2001 From: liyi Date: Tue, 8 Apr 2025 14:33:54 +0800 Subject: [PATCH 03/12] =?UTF-8?q?fix:=E5=AF=B9=E8=AE=B2=E6=97=B6=E8=BF=9B?= =?UTF-8?q?=E5=85=A5=E5=90=8E=E5=8F=B0=E5=85=B3=E9=97=AD=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../starChart/status/appLifecycle_observer.dart | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/lib/talk/starChart/status/appLifecycle_observer.dart b/lib/talk/starChart/status/appLifecycle_observer.dart index 03a0a37f..37b70152 100644 --- a/lib/talk/starChart/status/appLifecycle_observer.dart +++ b/lib/talk/starChart/status/appLifecycle_observer.dart @@ -28,17 +28,16 @@ class AppLifecycleObserver extends WidgetsBindingObserver { void onAppPaused() { // 处理应用程序进入后台的逻辑 - print('App has entered the background.'); - if (StartChartManage().talkStatus.status == - TalkStatus.passiveCallWaitingAnswer || - StartChartManage().talkStatus.status == - TalkStatus.proactivelyCallWaitingAnswer) { - StartChartManage().startTalkHangupMessageTimer(); - StartChartManage().startTalkRejectMessageTimer(); - // 如果是等待接听时就退出页面 + + final status = StartChartManage().talkStatus.status; + + if (status == TalkStatus.passiveCallWaitingAnswer || + status == TalkStatus.proactivelyCallWaitingAnswer || + status == TalkStatus.answeredSuccessfully || + status == TalkStatus.uninitialized) { + StartChartManage().destruction(); Get.back(); } - StartChartManage().destruction(); } void onAppResumed() async { From 823b268380043b92f97f9d331cd0b00994548364 Mon Sep 17 00:00:00 2001 From: liyi Date: Tue, 8 Apr 2025 14:34:25 +0800 Subject: [PATCH 04/12] =?UTF-8?q?fix:=E9=85=8D=E7=BD=91=E6=97=B6=E8=93=9D?= =?UTF-8?q?=E7=89=99=E8=B6=85=E6=97=B6=E8=BF=9B=E8=A1=8C=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=EF=BC=8C=E8=B0=83=E6=95=B4=E9=85=8D=E7=BD=91=E6=88=90=E5=8A=9F?= =?UTF-8?q?=E5=90=8E=E7=9A=84=E4=B8=8A=E6=8A=A5=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../configuringWifi_logic.dart | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/lib/main/lockDetail/lockSet/configuringWifi/configuringWifi/configuringWifi_logic.dart b/lib/main/lockDetail/lockSet/configuringWifi/configuringWifi/configuringWifi_logic.dart index f4688019..c38d4761 100755 --- a/lib/main/lockDetail/lockSet/configuringWifi/configuringWifi/configuringWifi_logic.dart +++ b/lib/main/lockDetail/lockSet/configuringWifi/configuringWifi/configuringWifi_logic.dart @@ -62,10 +62,8 @@ class ConfiguringWifiLogic extends BaseGetXController { peerId: peerId, ); if (entity.errorCode!.codeIsSuccessful) { - await _getUploadLockSet(); + showToast('配网成功'.tr, something: () async { - eventBus - .fire(PassCurrentLockInformationEvent(state.lockSetInfoData.value)); // 设置锁的peerID StartChartManage().lockNetworkInfo = DeviceNetworkInfo( wifiName: wifiName, @@ -74,6 +72,7 @@ class ConfiguringWifiLogic extends BaseGetXController { peerId: peerId, ); }); + _getUploadLockSet(); } } @@ -135,7 +134,7 @@ class ConfiguringWifiLogic extends BaseGetXController { // 保存到缓存 await Storage.saveLockNetWorkInfo(jsonMap); // 上报服务器 - updateNetworkInfo( + updateNetworkInfo( peerId: peerId ?? '', wifiName: wifiName ?? '', secretKey: secretKey ?? '', @@ -231,6 +230,13 @@ class ConfiguringWifiLogic extends BaseGetXController { password: state.wifiPWDController.text, gatewayConfigurationStr: state.getGatewayConfigurationStr, ); + } else if (connectionState == BluetoothConnectionState.disconnected) { + dismissEasyLoading(); + cancelBlueConnetctToastTimer(); + state.sureBtnState.value = 0; + if (state.ifCurrentScreen.value == true) { + showBlueConnetctToast(); + } } }, isAddEquipment: true, @@ -391,10 +397,10 @@ class ConfiguringWifiLogic extends BaseGetXController { // 上传数据获取设置 Future _getUploadLockSet() async { - showEasyLoading(); - showBlueConnetctToastTimer(action: () { - dismissEasyLoading(); - }); + // showEasyLoading(); + // showBlueConnetctToastTimer(action: () { + // dismissEasyLoading(); + // }); BlueManage().blueSendData(BlueManage().connectDeviceName, (BluetoothConnectionState connectionState) async { if (connectionState == BluetoothConnectionState.connected) { @@ -476,6 +482,8 @@ class ConfiguringWifiLogic extends BaseGetXController { Get.offAllNamed(Routers.starLockMain); } dismissEasyLoading(); + eventBus + .fire(PassCurrentLockInformationEvent(state.lockSetInfoData.value)); if (state.loadingTimer != null) { state.loadingTimer!.cancel(); state.loadingTimer = null; @@ -493,6 +501,5 @@ class ConfiguringWifiLogic extends BaseGetXController { state.loadingTimer!.cancel(); state.loadingTimer = null; } - } } From 3552d154294ce44d4919f0a273f5856611f24ed8 Mon Sep 17 00:00:00 2001 From: liyi Date: Tue, 8 Apr 2025 14:34:59 +0800 Subject: [PATCH 05/12] =?UTF-8?q?fix:=E5=A2=9E=E5=8A=A0=E5=90=8C=E6=84=8F?= =?UTF-8?q?=E9=9A=90=E7=A7=81=E5=8D=8F=E8=AE=AE=E4=B9=8B=E5=90=8E=E8=BF=9B?= =?UTF-8?q?=E8=A1=8C=E4=B8=80=E9=94=AE=E7=99=BB=E5=BD=95=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=8C=96=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/login/login/starLock_login_logic.dart | 22 ++++++++++++++++------ lib/main.dart | 4 +++- lib/tools/eventBusEventManage.dart | 5 +++++ 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/lib/login/login/starLock_login_logic.dart b/lib/login/login/starLock_login_logic.dart index d7244068..d0f5d2cd 100755 --- a/lib/login/login/starLock_login_logic.dart +++ b/lib/login/login/starLock_login_logic.dart @@ -1,18 +1,17 @@ -import 'dart:io'; - import 'package:flutter/material.dart'; import 'package:get/get.dart'; import 'package:star_lock/apm/apm_helper.dart'; -import 'package:jverify/jverify.dart'; import 'package:star_lock/appRouters.dart'; import 'package:star_lock/app_settings/app_settings.dart'; import 'package:star_lock/blue/blue_manage.dart'; +import 'package:star_lock/blue/io_tool/manager_event_bus.dart'; import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart'; import 'package:star_lock/login/login/entity/LoginEntity.dart'; import 'package:star_lock/mine/mine/starLockMine_state.dart'; import 'package:star_lock/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_entity.dart'; import 'package:star_lock/network/start_chart_api.dart'; import 'package:star_lock/talk/starChart/entity/star_chart_register_node_entity.dart'; +import 'package:star_lock/tools/appFirstEnterHandle.dart'; import 'package:star_lock/tools/baseGetXController.dart'; import '../../main/lockMian/lockMain/lockMain_logic.dart'; @@ -143,7 +142,7 @@ class StarLockLoginLogic extends BaseGetXController { if (entity.errorCode!.codeIsSuccessful) { if (state.countryName != entity.data!.name) { ShowTipView().showSureAlertDialog( - '国家地区的选择将影响数据安全,你当前选择的是'+state.countryName+'请确认后再继续'.tr, + '国家地区的选择将影响数据安全,你当前选择的是' + state.countryName + '请确认后再继续'.tr, tipTitle: '确认国家或地区'.tr, sureStr: '我知道了'.tr); } @@ -175,11 +174,22 @@ class StarLockLoginLogic extends BaseGetXController { state.canNext.value = state.pwdIsOK && state.isEmailOrPhone; } + void _initEventListen() { + eventBus + .on() + .listen((AgreePrivacyAgreement event) async { + await JverifyOneClickLoginManage(); + oneClickLoginAction(); + state.isCheckVerifyEnable.value = + await JverifyOneClickLoginManage().checkVerifyEnable(); + AppLog.log('一键登录初始化认证结果:${state.isCheckVerifyEnable.value}'); + }); + } + @override Future onInit() async { + _initEventListen(); super.onInit(); - - } @override diff --git a/lib/main.dart b/lib/main.dart index 9e20bdd8..9e9f5927 100755 --- a/lib/main.dart +++ b/lib/main.dart @@ -18,6 +18,7 @@ import 'package:star_lock/talk/starChart/handle/impl/debug_Info_model.dart'; import 'package:star_lock/talk/starChart/status/appLifecycle_observer.dart'; import 'package:star_lock/tools/bugly/bugly_tool.dart'; import 'package:star_lock/tools/device_info_service.dart'; +import 'package:star_lock/tools/eventBusEventManage.dart'; import 'package:star_lock/tools/jverify_one_click_login.dart'; import 'package:star_lock/tools/platform_info_services.dart'; import 'package:star_lock/tools/push/notification_service.dart'; @@ -104,8 +105,9 @@ Future privacySDKInitialization() async { // 初始化一键登录服务 final StarLockLoginLogic loginLogic = Get.put(StarLockLoginLogic()); - JverifyOneClickLoginManage(); + await JverifyOneClickLoginManage(); loginLogic.oneClickLoginAction(); loginLogic.state.isCheckVerifyEnable.value = await JverifyOneClickLoginManage().checkVerifyEnable(); + eventBus.fire(AgreePrivacyAgreement()); } diff --git a/lib/tools/eventBusEventManage.dart b/lib/tools/eventBusEventManage.dart index 5d5e7416..a1791c6e 100755 --- a/lib/tools/eventBusEventManage.dart +++ b/lib/tools/eventBusEventManage.dart @@ -195,3 +195,8 @@ class RogerThatLockInfoDataEvent { class GetGatewayListRefreshUI { GetGatewayListRefreshUI(); } +/// 同意隐私协议 +class AgreePrivacyAgreement { + AgreePrivacyAgreement(); +} + From 99813877b6839e19f8d74a038411ece19594befb Mon Sep 17 00:00:00 2001 From: liyi Date: Tue, 8 Apr 2025 14:35:15 +0800 Subject: [PATCH 06/12] =?UTF-8?q?fix:=E8=B0=83=E6=95=B4=E4=BA=BA=E8=84=B8?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E5=8A=A0=E8=BD=BD=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../face/faceList/faceList_logic.dart | 39 ++++++++++------- .../face/faceList/faceList_page.dart | 42 ++++++------------- 2 files changed, 38 insertions(+), 43 deletions(-) diff --git a/lib/main/lockDetail/face/faceList/faceList_logic.dart b/lib/main/lockDetail/face/faceList/faceList_logic.dart index debdc5ce..9781a916 100755 --- a/lib/main/lockDetail/face/faceList/faceList_logic.dart +++ b/lib/main/lockDetail/face/faceList/faceList_logic.dart @@ -22,6 +22,7 @@ class FaceListLogic extends BaseGetXController { // 获取解析后的数据 late StreamSubscription _replySubscription; + void _initReplySubscription() { _replySubscription = EventBusManager().eventBus!.on().listen((Reply reply) { @@ -77,11 +78,15 @@ class FaceListLogic extends BaseGetXController { userID: (await Storage.getUid())!, faceNo: state.deletFaceNo, useCountLimit: 0xffff, - operate: state.isDeletAll == true ? 3 : 2, // 0:注册 1:修改 2:删除 3:删除全部 + operate: state.isDeletAll == true ? 3 : 2, + // 0:注册 1:修改 2:删除 3:删除全部 isAdmin: 0, - isForce: 0, // 是否是胁迫 - isRound: 0, // 是否是循环 - weekRound: 0, // 周循环 + isForce: 0, + // 是否是胁迫 + isRound: 0, + // 是否是循环 + weekRound: 0, + // 周循环 startDate: 0x11223344, endDate: 0x11223344, startTime: '0', @@ -277,11 +282,15 @@ class FaceListLogic extends BaseGetXController { userID: (await Storage.getUid())!, faceNo: state.deletFaceNo, useCountLimit: 0xffff, - operate: state.isDeletAll == true ? 3 : 2, // 0:注册 1:修改 2:删除 3:删除全部 + operate: state.isDeletAll == true ? 3 : 2, + // 0:注册 1:修改 2:删除 3:删除全部 isAdmin: 0, - isForce: 0, // 是否是胁迫 - isRound: 0, // 是否是循环 - weekRound: 0, // 周循环 + isForce: 0, + // 是否是胁迫 + isRound: 0, + // 是否是循环 + weekRound: 0, + // 周循环 startDate: 0x11223344, endDate: 0x11223344, startTime: '0', @@ -348,8 +357,8 @@ class FaceListLogic extends BaseGetXController { lockId: state.lockId.value, ); if (entity.errorCode!.codeIsSuccessful) { - showToast('删除成功'.tr, something: () { - getFaceListData(isRefresh: true); + showToast('删除成功'.tr, something: () async { + await getFaceListData(isRefresh: true); }); } } @@ -366,8 +375,8 @@ class FaceListLogic extends BaseGetXController { lockId: state.lockId.value, ); if (entity.errorCode!.codeIsSuccessful) { - showToast('重置成功'.tr, something: () { - getFaceListData(isRefresh: true); + showToast('重置成功'.tr, something: () async{ + await getFaceListData(isRefresh: true); }); } } @@ -403,11 +412,12 @@ class FaceListLogic extends BaseGetXController { // 监听修改完详情之后刷新列表 late StreamSubscription _teamEvent; + void _initRefreshAction() { _teamEvent = eventBus .on() - .listen((OtherTypeRefreshListEvent event) { - getFaceListData(isRefresh: true); + .listen((OtherTypeRefreshListEvent event) async { + await getFaceListData(isRefresh: true); }); } @@ -434,6 +444,7 @@ class FaceListLogic extends BaseGetXController { // senderCheckingUserInfoCount(); } + getFaceListData(isRefresh: true); } @override diff --git a/lib/main/lockDetail/face/faceList/faceList_page.dart b/lib/main/lockDetail/face/faceList/faceList_page.dart index 5758785b..43248d26 100755 --- a/lib/main/lockDetail/face/faceList/faceList_page.dart +++ b/lib/main/lockDetail/face/faceList/faceList_page.dart @@ -1,4 +1,3 @@ - import 'package:flutter/material.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; @@ -31,24 +30,6 @@ class _FaceListPageState extends State with RouteAware { final FaceListLogic logic = Get.put(FaceListLogic()); final FaceListState state = Get.find().state; - Future getHttpData({required bool isRefresh}) async { - final bool? isDemoMode = await Storage.getBool(ifIsDemoModeOrNot); - if (isDemoMode == false) { - logic.getFaceListData(isRefresh: isRefresh).then((FingerprintListDataEntity value) { - if (mounted) { - setState(() {}); - } - }); - } - } - - @override - void initState() { - super.initState(); - - getHttpData(isRefresh: true); - } - @override Widget build(BuildContext context) { return Scaffold( @@ -92,17 +73,17 @@ class _FaceListPageState extends State with RouteAware { ), body: EasyRefreshTool( onRefresh: () { - getHttpData(isRefresh: true); + logic.getFaceListData(isRefresh: true); }, onLoad: () { - getHttpData(isRefresh: false); + logic.getFaceListData(isRefresh: false); }, child: Column( children: [ KeySearchWidget( editingController: state.searchController, onSubmittedAction: () { - getHttpData(isRefresh: true); + logic.getFaceListData(isRefresh: true); }, ), SizedBox( @@ -110,14 +91,15 @@ class _FaceListPageState extends State with RouteAware { ), Expanded(child: _buildMainUI()), AddBottomWhiteBtn( - btnName: - '添加人脸'.tr, + btnName: '添加人脸'.tr, onClick: () async { - await Get.toNamed(Routers.addFaceTypePage, arguments: { + await Get.toNamed(Routers.addFaceTypePage, + arguments: { 'lockId': state.lockId.value, 'fromType': 1 // 1从添加钥匙列表进入 2从考勤添加员工入口进入 - })!.then((value) { - getHttpData(isRefresh: true); + })! + .then((value) { + logic.getFaceListData(isRefresh: true); }); }, ), @@ -154,9 +136,11 @@ class _FaceListPageState extends State with RouteAware { logic.getKeyType(getFaceItemData), logic.getKeyDateType(getFaceItemData), () async { await Get.toNamed(Routers.faceDetailPage, - arguments: { + arguments: { 'faceItemData': getFaceItemData, - })!.then((value) => getHttpData(isRefresh: true)); + })! + .then((value) => + logic.getFaceListData(isRefresh: true)); }), ); } From fe82f87200e1b65092f4937af4179615eb111ab4 Mon Sep 17 00:00:00 2001 From: liyi Date: Tue, 8 Apr 2025 14:35:36 +0800 Subject: [PATCH 07/12] =?UTF-8?q?fix:=E8=B0=83=E6=95=B4=E5=A4=9A=E4=B8=AA?= =?UTF-8?q?=E5=AF=B9=E8=AE=B2=E8=AF=B7=E6=B1=82=E6=97=B6=E4=B8=8D=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../handle/impl/udp_talk_request_handler.dart | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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 06b79ad6..be2f4565 100644 --- a/lib/talk/starChart/handle/impl/udp_talk_request_handler.dart +++ b/lib/talk/starChart/handle/impl/udp_talk_request_handler.dart @@ -25,8 +25,24 @@ class UdpTalkRequestHandler extends ScpMessageBaseHandle RxString currentLanguage = CurrentLocaleTool.getCurrentLocaleString().obs; // 当前选择语言 + // 添加上次处理请求的时间戳 + int _lastRequestTime = 0; + @override void handleReq(ScpMessage scpMessage) async { + + final currentTime = DateTime.now().millisecondsSinceEpoch; + // 确保与上次请求间隔至少1秒 + if (currentTime - _lastRequestTime < 1000) { + // 如果间隔小于1秒,直接拒绝请求 + replyErrorMessage(scpMessage); + AppLog.log('对讲请求过于频繁,已拒绝'); + return; + } + + // 更新最后处理时间 + _lastRequestTime = currentTime; + // 判断是否登录账户 final loginData = await Storage.getLoginData(); @@ -47,6 +63,7 @@ class UdpTalkRequestHandler extends ScpMessageBaseHandle } else { // 拒绝接听,回复失败 replyErrorMessage(scpMessage); + AppLog.log('正在接听,回复拒绝'); } } From 5864b290557005543af2b581949c4ef2ee248c8e Mon Sep 17 00:00:00 2001 From: liyi Date: Tue, 8 Apr 2025 14:35:43 +0800 Subject: [PATCH 08/12] =?UTF-8?q?fix:=E8=B0=83=E6=95=B4=E5=9B=BD=E9=99=85?= =?UTF-8?q?=E5=8C=96=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lan/lan_hk.json | 6 +++--- lan/lan_tw.json | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lan/lan_hk.json b/lan/lan_hk.json index 101c334c..49b5232c 100644 --- a/lan/lan_hk.json +++ b/lan/lan_hk.json @@ -173,9 +173,9 @@ "接收人信息": "收件人", "转移网关": "傳輸網關", "锁屏": "屏幕鎖定", - "已关闭": "關閉", - "已开启": "上", - "开启": "開", + "已关闭": "已關閉", + "已开启": "已開啟", + "开启": "開啟", "确定要开启重置键?": "繼續啟用Reset掣?", "确定要关闭重置键?": "繼續禁用Reset掣?", "隐藏无效开锁权限": "隱藏無效訪問權限", diff --git a/lan/lan_tw.json b/lan/lan_tw.json index f1ed8445..7110352a 100644 --- a/lan/lan_tw.json +++ b/lan/lan_tw.json @@ -172,9 +172,9 @@ "接收人信息": "收件人", "转移网关": "傳輸網關", "锁屏": "屏幕鎖定", - "已关闭": "關", - "已开启": "開啟", - "开启": "打開", + "已关闭": "已關閉", + "已开启": "已開啟", + "开启": "開啟", "确定要开启重置键?": "是否繼續啟用重置按鈕?", "确定要关闭重置键?": "是否繼續禁用重置按鈕?", "隐藏无效开锁权限": "隱藏無效訪問", From 47b0a18ef3d998ea238fa172a1d7657c35b6fb17 Mon Sep 17 00:00:00 2001 From: liyi Date: Tue, 8 Apr 2025 16:43:11 +0800 Subject: [PATCH 09/12] =?UTF-8?q?fix:=E8=B0=83=E6=95=B4=E8=A7=86=E9=A2=91?= =?UTF-8?q?=E5=B8=A7=E7=BC=93=E5=86=B2=E5=8C=BA=E9=80=BB=E8=BE=91=E8=AE=A1?= =?UTF-8?q?=E7=AE=97=E9=80=BB=E8=BE=91=EF=BC=8C=E5=A2=9E=E5=8A=A0=E7=BC=93?= =?UTF-8?q?=E5=86=B2=E5=8C=BA=E6=9C=80=E5=A4=A7=E5=A4=A7=E5=B0=8F=E8=87=B3?= =?UTF-8?q?20=E5=B8=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/talkView/talk_view_logic.dart | 48 +++++++++++-------- 1 file changed, 27 insertions(+), 21 deletions(-) diff --git a/lib/talk/starChart/views/talkView/talk_view_logic.dart b/lib/talk/starChart/views/talkView/talk_view_logic.dart index 8c0e3737..05d0636c 100644 --- a/lib/talk/starChart/views/talkView/talk_view_logic.dart +++ b/lib/talk/starChart/views/talkView/talk_view_logic.dart @@ -56,6 +56,9 @@ class TalkViewLogic extends BaseGetXController { final Map _imageCache = {}; + // 添加一个变量用于记录上一帧的时间戳 + int _lastFrameTimestamp = 0; // 初始值为 0 + // 添加帧率计算相关变量 int _frameCount = 0; int _lastFpsUpdateTime = 0; @@ -100,11 +103,11 @@ class TalkViewLogic extends BaseGetXController { // 判断数据类型,进行分发处理 switch (contentType) { case TalkData_ContentTypeE.G711: - // 第一帧到达时记录开始时间 - if (_isFirstAudioFrame) { - _startAudioTime = currentTime; - _isFirstAudioFrame = false; - } + // // 第一帧到达时记录开始时间 + // if (_isFirstAudioFrame) { + // _startAudioTime = currentTime; + // _isFirstAudioFrame = false; + // } // 计算音频延迟 final expectedTime = _startAudioTime + talkData.durationMs; @@ -130,15 +133,16 @@ class TalkViewLogic extends BaseGetXController { if (_isFirstFrame) { _startTime = currentTime; _isFirstFrame = false; - // AppLog.log('记录第一帧的时间戳${currentTime},${talkData.durationMs}'); + AppLog.log('第一帧帧的时间戳:${talkData.durationMs}'); } + // AppLog.log('其他帧的时间戳:${talkData.durationMs}'); + // 计算帧间间隔 + if (_lastFrameTimestamp != 0) { + final int frameInterval = talkData.durationMs - _lastFrameTimestamp; + _adjustBufferSize(frameInterval); // 根据帧间间隔调整缓冲区 + } + _lastFrameTimestamp = talkData.durationMs; // 更新上一帧时间戳 - // 计算实际延迟:当前时间 - 预期播放时间 - final expectedTime = _startTime + talkData.durationMs; - final videoDelay = currentTime - expectedTime; // 修改延迟计算方式 - - // 动态调整缓冲区 - _adjustBufferSize(videoDelay); // 然后添加到播放缓冲区 if (state.videoBuffer.length >= bufferSize) { state.videoBuffer.removeAt(0); @@ -257,19 +261,21 @@ class TalkViewLogic extends BaseGetXController { } // 新增:动态调整缓冲区大小的方法 - void _adjustBufferSize(int delay) { - const int delayThresholdHigh = 250; // 高延迟阈值(约3帧的时间) - const int delayThresholdLow = 166; // 低延迟阈值(约2帧的时间) + void _adjustBufferSize(int frameInterval) { + const int frameDuration = 83; // 假设每帧的时间间隔为 83ms(12fps) + const int delayThresholdHigh = frameDuration * 2; // 高延迟阈值(2帧时间) + const int delayThresholdLow = frameDuration; // 低延迟阈值(1帧时间) const int adjustInterval = 1; // 每次调整1帧 - if (delay > delayThresholdHigh && bufferSize < maxBufferSize) { - // 延迟较大,增加缓冲区 + if (frameInterval > delayThresholdHigh && bufferSize < maxBufferSize) { + // 帧间间隔较大,增加缓冲区 bufferSize = min(bufferSize + adjustInterval, maxBufferSize); - // AppLog.log('📈 增加缓冲区 - 当前大小: $bufferSize, 延迟: ${delay}ms'); - } else if (delay < delayThresholdLow && bufferSize > minBufferSize) { - // 延迟较小,减少缓冲区 + AppLog.log('📈 增加缓冲区 - 当前大小: $bufferSize, 帧间间隔: ${frameInterval}ms'); + } else if (frameInterval < delayThresholdLow && + bufferSize > minBufferSize) { + // 帧间间隔较小,减少缓冲区 bufferSize = max(bufferSize - adjustInterval, minBufferSize); - // AppLog.log('📉 减少缓冲区 - 当前大小: $bufferSize, 延迟: ${delay}ms'); + AppLog.log('📉 减少缓冲区 - 当前大小: $bufferSize, 帧间间隔: ${frameInterval}ms'); } } From c373cc402a5b258c27b1173eedaba1508d16dbeb Mon Sep 17 00:00:00 2001 From: liyi Date: Wed, 9 Apr 2025 10:40:15 +0800 Subject: [PATCH 10/12] =?UTF-8?q?fix:=E8=B0=83=E6=95=B4=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E8=B6=85=E5=87=BA=E5=B1=8F=E5=B9=95=E6=97=B6?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E4=B8=8B=E6=BB=91=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/main/lockDetail/lockDetail/lockDetail_page.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/main/lockDetail/lockDetail/lockDetail_page.dart b/lib/main/lockDetail/lockDetail/lockDetail_page.dart index 4352d93d..db230836 100755 --- a/lib/main/lockDetail/lockDetail/lockDetail_page.dart +++ b/lib/main/lockDetail/lockDetail/lockDetail_page.dart @@ -1024,7 +1024,7 @@ class _LockDetailPageState extends State Widget widget = getBottomWidget()[index]; return widget; }, - physics: const NeverScrollableScrollPhysics(), + // physics: const NeverScrollableScrollPhysics(), shrinkWrap: true, ) From 80787fd0ea8e93c18d17ddef05744e587670890a Mon Sep 17 00:00:00 2001 From: Liuyf Date: Thu, 10 Apr 2025 09:50:36 +0800 Subject: [PATCH 11/12] =?UTF-8?q?fix:=20=E4=B8=87=E5=B8=88=E5=82=85?= =?UTF-8?q?=E5=85=A5=E5=8F=A3=E9=81=AE=E7=9B=96=E4=BD=8F=E4=BA=86=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E8=B4=A6=E5=8F=B7=E5=8A=9F=E8=83=BD=E5=85=A5=E5=8F=A3?= =?UTF-8?q?=EF=BC=8C=E5=AF=BC=E8=87=B4=E5=AE=A1=E6=A0=B8=E4=B8=8D=E9=80=9A?= =?UTF-8?q?=E8=BF=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/mine/mineSet/mineSet/mineSet_page.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/mine/mineSet/mineSet/mineSet_page.dart b/lib/mine/mineSet/mineSet/mineSet_page.dart index a098bb8b..a2926a55 100755 --- a/lib/mine/mineSet/mineSet/mineSet_page.dart +++ b/lib/mine/mineSet/mineSet/mineSet_page.dart @@ -456,10 +456,10 @@ class _MineSetPageState extends State // showLoginOutAlertTipDialog(); }), Container( - padding: EdgeInsets.only(right: 30.w, top: 30.h), + padding: EdgeInsets.only(left: 30.w, top: 30.h), // color: Colors.red, child: Row( - mainAxisAlignment: MainAxisAlignment.end, + mainAxisAlignment: MainAxisAlignment.start, children: [ TextButton( child: Text( From 49ed1695069bd42d331edcad92c8e8b84e7da017 Mon Sep 17 00:00:00 2001 From: liyi Date: Thu, 10 Apr 2025 11:05:09 +0800 Subject: [PATCH 12/12] =?UTF-8?q?fix:=E8=B0=83=E6=95=B4=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E9=85=8D=E7=BD=91=E4=BF=A1=E6=81=AF=E4=BD=BF=E7=94=A8=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6=E9=80=9A=E7=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/main/lockDetail/lockDetail/lockDetail_logic.dart | 11 +++++++++-- lib/main/lockDetail/lockDetail/lockDetail_page.dart | 1 - .../configuringWifi/configuringWifi_logic.dart | 2 ++ lib/tools/eventBusEventManage.dart | 4 ++++ 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/lib/main/lockDetail/lockDetail/lockDetail_logic.dart b/lib/main/lockDetail/lockDetail/lockDetail_logic.dart index ee7ba5f8..80198af5 100755 --- a/lib/main/lockDetail/lockDetail/lockDetail_logic.dart +++ b/lib/main/lockDetail/lockDetail/lockDetail_logic.dart @@ -285,7 +285,7 @@ class LockDetailLogic extends BaseGetXController { final List publicKeyData = state.keyInfos.value.bluetooth!.publicKey!.cast(); final List saveStrList = changeIntListToStringList(publicKeyData); - await Storage.setStringList(saveBluePublicKey, saveStrList); + await Storage.setStringList(saveBluePublicKey, saveStrList); // 私钥 final List privateKeyData = @@ -298,7 +298,7 @@ class LockDetailLogic extends BaseGetXController { final List signKeyData = state.keyInfos.value.bluetooth!.signKey!.cast(); final List saveSignKeyList = changeIntListToStringList(signKeyData); - await Storage.setStringList(saveBlueSignKey, saveSignKeyList); + await Storage.setStringList(saveBlueSignKey, saveSignKeyList); final bool ifHaveKey = await Storage.ifHaveKey(saveBlueToken); if (!ifHaveKey) { @@ -838,5 +838,12 @@ class LockDetailLogic extends BaseGetXController { state.keyInfos.refresh(); } }); + + eventBus + .on() + .listen((SuccessfulDistributionNetwork event) { + // 配网成功获取一下配网信息 + requestDeviceNetworkInfo(); + }); } } diff --git a/lib/main/lockDetail/lockDetail/lockDetail_page.dart b/lib/main/lockDetail/lockDetail/lockDetail_page.dart index db230836..1040b5ba 100755 --- a/lib/main/lockDetail/lockDetail/lockDetail_page.dart +++ b/lib/main/lockDetail/lockDetail/lockDetail_page.dart @@ -89,7 +89,6 @@ class _LockDetailPageState extends State AppRouteObserver().routeObserver.subscribe(this, ModalRoute.of(context)!); state.isOpenLockNeedOnline.refresh(); - logic.requestDeviceNetworkInfo(); } StreamSubscription? _lockRefreshLockDetailInfoDataEvent; diff --git a/lib/main/lockDetail/lockSet/configuringWifi/configuringWifi/configuringWifi_logic.dart b/lib/main/lockDetail/lockSet/configuringWifi/configuringWifi/configuringWifi_logic.dart index c38d4761..9b25bf55 100755 --- a/lib/main/lockDetail/lockSet/configuringWifi/configuringWifi/configuringWifi_logic.dart +++ b/lib/main/lockDetail/lockSet/configuringWifi/configuringWifi/configuringWifi_logic.dart @@ -484,6 +484,8 @@ class ConfiguringWifiLogic extends BaseGetXController { dismissEasyLoading(); eventBus .fire(PassCurrentLockInformationEvent(state.lockSetInfoData.value)); + eventBus + .fire(SuccessfulDistributionNetwork()); if (state.loadingTimer != null) { state.loadingTimer!.cancel(); state.loadingTimer = null; diff --git a/lib/tools/eventBusEventManage.dart b/lib/tools/eventBusEventManage.dart index a1791c6e..810ad0a6 100755 --- a/lib/tools/eventBusEventManage.dart +++ b/lib/tools/eventBusEventManage.dart @@ -200,3 +200,7 @@ class AgreePrivacyAgreement { AgreePrivacyAgreement(); } +/// 配网成功 +class SuccessfulDistributionNetwork { + SuccessfulDistributionNetwork(); +}