From a12c17be7fddc957cecbd44c888919f1bb373c55 Mon Sep 17 00:00:00 2001 From: Liuyf Date: Thu, 13 Feb 2025 15:54:59 +0800 Subject: [PATCH 01/11] =?UTF-8?q?fix=EF=BC=9A=E6=8E=A8=E9=80=81=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E9=85=8D=E7=BD=AE=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ios/Runner/RunnerDebug-dev.entitlements | 2 ++ ios/Runner/RunnerRelease-sky.entitlements | 2 ++ ios/Runner/RunnerRelease-xhj.entitlements | 2 ++ lib/mine/about/about_page.dart | 13 +++++++++++++ 4 files changed, 19 insertions(+) diff --git a/ios/Runner/RunnerDebug-dev.entitlements b/ios/Runner/RunnerDebug-dev.entitlements index d7b50f42..4e8ae9e6 100755 --- a/ios/Runner/RunnerDebug-dev.entitlements +++ b/ios/Runner/RunnerDebug-dev.entitlements @@ -8,6 +8,8 @@ applinks:lock.skychip.top + com.apple.developer.networking.wifi-info + com.apple.external-accessory.wireless-configuration diff --git a/ios/Runner/RunnerRelease-sky.entitlements b/ios/Runner/RunnerRelease-sky.entitlements index d7b50f42..4e8ae9e6 100755 --- a/ios/Runner/RunnerRelease-sky.entitlements +++ b/ios/Runner/RunnerRelease-sky.entitlements @@ -8,6 +8,8 @@ applinks:lock.skychip.top + com.apple.developer.networking.wifi-info + com.apple.external-accessory.wireless-configuration diff --git a/ios/Runner/RunnerRelease-xhj.entitlements b/ios/Runner/RunnerRelease-xhj.entitlements index 66cd751d..82c8924b 100755 --- a/ios/Runner/RunnerRelease-xhj.entitlements +++ b/ios/Runner/RunnerRelease-xhj.entitlements @@ -8,6 +8,8 @@ applinks:lock.xhjcn.ltd + com.apple.developer.networking.wifi-info + com.apple.external-accessory.wireless-configuration diff --git a/lib/mine/about/about_page.dart b/lib/mine/about/about_page.dart index 46632a87..d43ac0f2 100755 --- a/lib/mine/about/about_page.dart +++ b/lib/mine/about/about_page.dart @@ -2,12 +2,15 @@ import 'dart:io'; import 'package:device_info_plus/device_info_plus.dart'; import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:package_info_plus/package_info_plus.dart'; import 'package:star_lock/appRouters.dart'; import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart'; import 'package:star_lock/mine/about/about_console.dart'; +import 'package:star_lock/tools/NativeInteractionTool.dart'; import '../../app_settings/app_colors.dart'; import '../../flavors.dart'; @@ -261,6 +264,16 @@ class _AboutPageState extends State { ), ), GestureDetector( + onLongPress: () async { + final String? bundleIdentifier = + await NativeInteractionTool().getBundleIdentifier(); + final String? registrationId = + await Storage.getString(pushDeviceID); + Clipboard.setData(ClipboardData(text: registrationId ?? '')); + EasyLoading.showToast( + '$bundleIdentifier的registration(${registrationId ?? ''})复制成功' + .tr); + }, onTap: logic.handleTap, child: ClipRRect( borderRadius: BorderRadius.circular(20.r), From ad1ca2ec77c730d5cf9fe79986f41348727e7a60 Mon Sep 17 00:00:00 2001 From: Liuyf Date: Thu, 13 Feb 2025 17:21:14 +0800 Subject: [PATCH 02/11] =?UTF-8?q?fix=EF=BC=9A=E6=8E=A8=E9=80=81=E5=8A=9F?= =?UTF-8?q?=E8=83=BDregistrationId=E6=B2=A1=E6=9C=89=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=EF=BC=8C=E9=80=80=E5=87=BA=E7=99=BB=E5=BD=95=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E6=B8=85=E7=90=86=E6=8E=89=E6=8E=A8=E9=80=81ID?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ios/fastlane/Fastfile | 4 ++-- lib/tools/push/xs_jPhush.dart | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ios/fastlane/Fastfile b/ios/fastlane/Fastfile index 169ea544..3591770d 100644 --- a/ios/fastlane/Fastfile +++ b/ios/fastlane/Fastfile @@ -77,7 +77,7 @@ platform :ios do UI.user_error!("flavor is required") unless flavor UI.user_error!("env is required") unless env print_log "build #{flavor} on #{env}" - build_number = Time.now.strftime("%Y%m%d%H") + build_number = Time.now.strftime("%Y%m%d%H%M") print_log "Build Commits #{build_number}" build_version = $next_version # Time.now.strftime("%Y%m%d%H%M%S") print_log "build_version #{build_version}" @@ -130,7 +130,7 @@ platform :ios do flavor = options[:flavor] UI.user_error!("flavor is required") unless flavor print_log "build flavor: #{flavor}" - build_number = Time.now.strftime("%Y%m%d%H") + build_number = Time.now.strftime("%Y%m%d%H%M") print_log "Build Commits #{build_number}" build_version = $current_tag.match(/^v(\d+\.\d+\.\d+)/).captures[0] print_log "build_version #{build_version}" diff --git a/lib/tools/push/xs_jPhush.dart b/lib/tools/push/xs_jPhush.dart index d21cf996..4b60ab15 100755 --- a/lib/tools/push/xs_jPhush.dart +++ b/lib/tools/push/xs_jPhush.dart @@ -103,9 +103,9 @@ class XSJPushProvider { //绑定设备id final String rid = await jpush.getRegistrationID(); AppLog.log('onConnected registration id : $rid'); - await Storage.setString(pushDeviceID, rid); deviceID = rid; } + await Storage.setString(pushDeviceID, deviceID); final MineUnbindPhoneOrEmailEntity entity = await ApiRepository.to .pushBindAppId(deviceID, Platform.isAndroid ? 10 : 20); if (entity.errorCode!.codeIsSuccessful) { From 7d65c45fa94f8ca69c36d3651d700d3ec5aae2d7 Mon Sep 17 00:00:00 2001 From: Liuyf Date: Fri, 14 Feb 2025 14:14:33 +0800 Subject: [PATCH 03/11] =?UTF-8?q?fix=EF=BC=9A=E6=94=B9=E4=B8=BA=E9=80=9A?= =?UTF-8?q?=E7=94=A8=E6=96=B9=E5=BC=8F=E8=8E=B7=E5=8F=96=E6=8E=A8=E9=80=81?= =?UTF-8?q?=E8=B0=83=E8=AF=95=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/mine/about/about_page.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/mine/about/about_page.dart b/lib/mine/about/about_page.dart index d43ac0f2..ac764871 100755 --- a/lib/mine/about/about_page.dart +++ b/lib/mine/about/about_page.dart @@ -265,13 +265,13 @@ class _AboutPageState extends State { ), GestureDetector( onLongPress: () async { - final String? bundleIdentifier = - await NativeInteractionTool().getBundleIdentifier(); + final PackageInfo packageInfo = + await PackageInfo.fromPlatform(); final String? registrationId = await Storage.getString(pushDeviceID); Clipboard.setData(ClipboardData(text: registrationId ?? '')); EasyLoading.showToast( - '$bundleIdentifier的registration(${registrationId ?? ''})复制成功' + '${packageInfo.packageName}的registration(${registrationId ?? ''})复制成功' .tr); }, onTap: logic.handleTap, From 017b18600b59f43dd00b5e43790c283307a1bf5b Mon Sep 17 00:00:00 2001 From: liyi Date: Mon, 17 Feb 2025 09:51:23 +0800 Subject: [PATCH 04/11] =?UTF-8?q?fix:=E6=8C=82=E6=96=AD=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E4=BD=BF=E7=94=A8=E5=AE=9A=E6=97=B6=E5=99=A8?= =?UTF-8?q?=E9=87=8D=E5=8F=91=E6=9C=BA=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../handle/impl/udp_talk_hangup_handler.dart | 2 + .../handle/impl/udp_talk_reject_handler.dart | 2 + .../talke_data_over_time_timer_manager.dart | 2 +- .../talke_ping_over_time_timer_manager.dart | 2 +- ...talke_request_over_time_timer_manager.dart | 2 +- lib/talk/starChart/star_chart_manage.dart | 46 ++++++++++++++++--- .../views/talkView/talk_view_logic.dart | 4 +- 7 files changed, 48 insertions(+), 12 deletions(-) diff --git a/lib/talk/starChart/handle/impl/udp_talk_hangup_handler.dart b/lib/talk/starChart/handle/impl/udp_talk_hangup_handler.dart index 686b8bc3..c73dcce3 100644 --- a/lib/talk/starChart/handle/impl/udp_talk_hangup_handler.dart +++ b/lib/talk/starChart/handle/impl/udp_talk_hangup_handler.dart @@ -36,6 +36,7 @@ class UdpTalkHangUpHandler extends ScpMessageBaseHandle EasyLoading.showToast('已挂断'.tr); startChartManage.stopSendingRbcuInfoMessages(); startChartManage.stopSendingRbcuProBeMessages(); + startChartManage.stopTalkHangupMessageTimer(); Get.back(); } } @@ -53,6 +54,7 @@ class UdpTalkHangUpHandler extends ScpMessageBaseHandle talkDataOverTimeTimerManager.cancel(); startChartManage.stopSendingRbcuInfoMessages(); startChartManage.stopSendingRbcuProBeMessages(); + startChartManage.stopTalkHangupMessageTimer(); } @override diff --git a/lib/talk/starChart/handle/impl/udp_talk_reject_handler.dart b/lib/talk/starChart/handle/impl/udp_talk_reject_handler.dart index b1fbcb15..15c16a16 100644 --- a/lib/talk/starChart/handle/impl/udp_talk_reject_handler.dart +++ b/lib/talk/starChart/handle/impl/udp_talk_reject_handler.dart @@ -33,6 +33,7 @@ class UdpTalkRejectHandler extends ScpMessageBaseHandle talkDataOverTimeTimerManager.cancel(); startChartManage.stopSendingRbcuInfoMessages(); startChartManage.stopSendingRbcuProBeMessages(); + startChartManage.stopTalkRejectMessageTimer(); } @override @@ -47,6 +48,7 @@ class UdpTalkRejectHandler extends ScpMessageBaseHandle talkDataOverTimeTimerManager.cancel(); startChartManage.stopSendingRbcuInfoMessages(); startChartManage.stopSendingRbcuProBeMessages(); + startChartManage.stopTalkRejectMessageTimer(); } @override diff --git a/lib/talk/starChart/handle/other/talke_data_over_time_timer_manager.dart b/lib/talk/starChart/handle/other/talke_data_over_time_timer_manager.dart index 3fe67456..a988d44a 100644 --- a/lib/talk/starChart/handle/other/talke_data_over_time_timer_manager.dart +++ b/lib/talk/starChart/handle/other/talke_data_over_time_timer_manager.dart @@ -30,7 +30,7 @@ class TalkDataOverTimeTimerManager { static void _handleTalkeDataOverTime() { EasyLoading.showToast('通话连接失败'.tr, duration: 2000.milliseconds); // 没有通话数据,发送挂断数据 - StartChartManage().sendTalkHangupMessage(); + StartChartManage().startTalkHangupMessageTimer(); StartChartManage().stopTalkPingMessageTimer(); StartChartManage().stopTalkExpectMessageTimer(); StartChartManage().stopSendingRbcuInfoMessages(); diff --git a/lib/talk/starChart/handle/other/talke_ping_over_time_timer_manager.dart b/lib/talk/starChart/handle/other/talke_ping_over_time_timer_manager.dart index 4fa9b85a..22632b13 100644 --- a/lib/talk/starChart/handle/other/talke_ping_over_time_timer_manager.dart +++ b/lib/talk/starChart/handle/other/talke_ping_over_time_timer_manager.dart @@ -36,7 +36,7 @@ class TalkePingOverTimeTimerManager { StartChartManage().stopTalkPingMessageTimer(); StartChartManage().stopTalkExpectMessageTimer(); // 如果通话异常,则发送通话中挂断 - StartChartManage().sendTalkHangupMessage(); + StartChartManage().startTalkHangupMessageTimer(); StartChartManage().stopSendingRbcuInfoMessages(); StartChartManage().stopSendingRbcuProBeMessages(); talkStatus.setNotTalkPing(); diff --git a/lib/talk/starChart/handle/other/talke_request_over_time_timer_manager.dart b/lib/talk/starChart/handle/other/talke_request_over_time_timer_manager.dart index 2ec529f6..44bb1630 100644 --- a/lib/talk/starChart/handle/other/talke_request_over_time_timer_manager.dart +++ b/lib/talk/starChart/handle/other/talke_request_over_time_timer_manager.dart @@ -31,7 +31,7 @@ class TalkeRequestOverTimeTimerManager { talkStatus.status == TalkStatus.proactivelyCallWaitingAnswer) { EasyLoading.showToast('通话未接通,已挂断'.tr, duration: 2000.milliseconds); // 超时未接听,发送挂断请求 - StartChartManage().sendTalkRejectMessage(); + StartChartManage().startTalkRejectMessageTimer(); StartChartManage().stopSendingRbcuInfoMessages(); StartChartManage().stopSendingRbcuProBeMessages(); talkStatus.setInitializationCompleted(); diff --git a/lib/talk/starChart/star_chart_manage.dart b/lib/talk/starChart/star_chart_manage.dart index 04457339..3a4fad35 100644 --- a/lib/talk/starChart/star_chart_manage.dart +++ b/lib/talk/starChart/star_chart_manage.dart @@ -97,6 +97,9 @@ class StartChartManage { Timer? rbcuInfoTimer; // p2p地址交换定时器 Timer? rbcuProbeTimer; // p2p打洞包 Timer? rbcuConfirmTimer; // p2p打洞确认包 + Timer? talkHangupTimer; // 添加挂断消息定时器 + Timer? talkRejectTimer; // 添加拒绝接听定时器 + String _rbcuSessionId = ''; // p2p SessionId Timer? talkRequestTimer; // 对讲请求定时器 final int maxAttempts = 15; // 最大执行次数 @@ -570,14 +573,23 @@ class StartChartManage { stopTalkExpectMessageTimer(); } - // 发送拒绝接听消息 - void sendTalkRejectMessage() async { + void _sendTalkRejectMessage() { final message = MessageCommand.talkRejectMessage( ToPeerId: ToPeerId, FromPeerId: FromPeerId, MessageId: MessageCommand.getNextMessageId(ToPeerId, increment: true), ); - await _sendMessage(message: message); + _sendMessage(message: message); + } + + // 发送拒绝接听消息 + void startTalkRejectMessageTimer() async { + talkRejectTimer ??= Timer.periodic( + Duration(seconds: _defaultIntervalTime), + (Timer timer) async { + _sendTalkRejectMessage(); + }, + ); // 设置状态为拒绝 StartChartTalkStatus.instance.setRejected(); @@ -652,14 +664,24 @@ class StartChartManage { // _log(text: '发送通话保持'); } - // 发送通话中挂断消息 - Future sendTalkHangupMessage() async { + void _sendTalkHangupMessage() async { final message = MessageCommand.talkHangupMessage( ToPeerId: ToPeerId, FromPeerId: FromPeerId, MessageId: MessageCommand.getNextMessageId(ToPeerId, increment: true), ); await _sendMessage(message: message); + } + + // 发送通话中挂断消息 + // 启动定时发送挂断消息 + void startTalkHangupMessageTimer() { + talkHangupTimer ??= Timer.periodic( + Duration(seconds: _defaultIntervalTime), + (Timer timer) async { + _sendTalkHangupMessage(); + }, + ); // 设置状态为通话中挂断 StartChartTalkStatus.instance.setHangingUpDuring(); @@ -676,6 +698,18 @@ class StartChartManage { talkDataOverTimeTimerManager.cancel(); } + // 停止发送挂断消息 + void stopTalkHangupMessageTimer() { + talkHangupTimer?.cancel(); + talkHangupTimer = null; + } + + // 停止发送挂断消息 + void stopTalkRejectMessageTimer() { + talkRejectTimer?.cancel(); + talkRejectTimer = null; + } + // 重新上线 Future reStartOnlineStartChartServer() async { if (isOnlineStarChartServer) { @@ -1131,8 +1165,6 @@ class StartChartManage { /// 销毁资源 void destruction() async { - // 发送挂断消息 - sendTalkHangupMessage(); isOnlineStarChartServer = false; // 停止发送心跳消息 stopHeartbeat(); diff --git a/lib/talk/starChart/views/talkView/talk_view_logic.dart b/lib/talk/starChart/views/talkView/talk_view_logic.dart index a7d67466..bbc980c7 100644 --- a/lib/talk/starChart/views/talkView/talk_view_logic.dart +++ b/lib/talk/starChart/views/talkView/talk_view_logic.dart @@ -71,10 +71,10 @@ class TalkViewLogic extends BaseGetXController { void udpHangUpAction() async { if (state.talkStatus.value == TalkStatus.answeredSuccessfully) { // 如果是通话中就挂断 - StartChartManage().sendTalkHangupMessage(); + StartChartManage().startTalkHangupMessageTimer(); } else { // 拒绝 - StartChartManage().sendTalkRejectMessage(); + StartChartManage().startTalkRejectMessageTimer(); } Get.back(); } From e3aa467829b9f545485df0e6888f668e03b0da99 Mon Sep 17 00:00:00 2001 From: liyi Date: Mon, 17 Feb 2025 17:10:11 +0800 Subject: [PATCH 05/11] =?UTF-8?q?fix:=E5=A2=9E=E5=8A=A0=E8=BF=9B=E5=85=A5?= =?UTF-8?q?=E5=90=8E=E5=8F=B0=E6=97=B6=E5=8F=91=E9=80=81=E6=8C=82=E6=96=AD?= =?UTF-8?q?=E6=B6=88=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/talk/starChart/status/appLifecycle_observer.dart | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/talk/starChart/status/appLifecycle_observer.dart b/lib/talk/starChart/status/appLifecycle_observer.dart index d1f55e73..03a0a37f 100644 --- a/lib/talk/starChart/status/appLifecycle_observer.dart +++ b/lib/talk/starChart/status/appLifecycle_observer.dart @@ -1,5 +1,7 @@ import 'package:flutter/widgets.dart'; +import 'package:get/get.dart'; import 'package:star_lock/network/start_chart_api.dart'; +import 'package:star_lock/talk/starChart/constant/talk_status.dart'; import 'package:star_lock/talk/starChart/star_chart_manage.dart'; import 'package:star_lock/tools/storage.dart'; @@ -27,6 +29,15 @@ 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(); + // 如果是等待接听时就退出页面 + Get.back(); + } StartChartManage().destruction(); } From 2f219d1f38bf7be8f1b1393fc29eb15ef067ea65 Mon Sep 17 00:00:00 2001 From: liyi Date: Mon, 17 Feb 2025 17:10:26 +0800 Subject: [PATCH 06/11] =?UTF-8?q?fix:=E5=A2=9E=E5=8A=A0wifi=E6=A0=87?= =?UTF-8?q?=E8=AF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../basicInformation_page.dart | 171 ++++++++++-------- 1 file changed, 94 insertions(+), 77 deletions(-) diff --git a/lib/main/lockDetail/lockSet/basicInformation/basicInformation/basicInformation_page.dart b/lib/main/lockDetail/lockSet/basicInformation/basicInformation/basicInformation_page.dart index d73c4ba2..58c5a9bb 100755 --- a/lib/main/lockDetail/lockSet/basicInformation/basicInformation/basicInformation_page.dart +++ b/lib/main/lockDetail/lockSet/basicInformation/basicInformation/basicInformation_page.dart @@ -1,4 +1,3 @@ - import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; @@ -50,7 +49,7 @@ class _BasicInformationPageState extends State { Obx(() => CommonItem( leftTitel: 'MAC/ID', rightTitle: - "${state.lockBasicInfo.value.mac??""}/${state.lockBasicInfo.value.lockId??""}", + "${state.lockBasicInfo.value.mac ?? ""}/${state.lockBasicInfo.value.lockId ?? ""}", allHeight: 70.h, isHaveLine: true)), // Obx(() => CommonItem( @@ -68,13 +67,15 @@ class _BasicInformationPageState extends State { ), Obx(() => CommonItem( leftTitel: '电量'.tr, - rightTitle: '${state.lockBasicInfo.value.electricQuantity??0}%', + rightTitle: + '${state.lockBasicInfo.value.electricQuantity ?? 0}%', isHaveLine: true, isHaveDirection: true, action: () { - Get.toNamed(Routers.uploadElectricQuantityPage, arguments: { - 'lockSetInfoData': state.lockSetInfoData.value - }); + Get.toNamed(Routers.uploadElectricQuantityPage, + arguments: { + 'lockSetInfoData': state.lockSetInfoData.value + }); })), Obx(() => CommonItem( leftTitel: '有效期'.tr, @@ -85,38 +86,47 @@ class _BasicInformationPageState extends State { allHeight: 70.h, isHaveLine: true)), Obx(() => Visibility( - visible: (state.lockBasicInfo.value.keyType ?? 0) == 4, - child: CommonItem( - leftTitel: '有效日'.tr, - rightTitle: logic.weekDayStr.join(',').toString(), - allHeight: 70.h, - isHaveLine: true), - )), + visible: (state.lockBasicInfo.value.keyType ?? 0) == 4, + child: CommonItem( + leftTitel: '有效日'.tr, + rightTitle: logic.weekDayStr.join(',').toString(), + allHeight: 70.h, + isHaveLine: true), + )), Obx(() => Visibility( - visible: (state.lockBasicInfo.value.keyType ?? 0) == 4, - child: CommonItem( - leftTitel: '有效时间'.tr, - rightTitle: '${DateTool().dateToHNString((state.lockBasicInfo.value.startDate ?? 0).toString())}-${DateTool().dateToHNString((state.lockBasicInfo.value.endDate ?? 0).toString())}', - allHeight: 70.h, - isHaveLine: true), - )), + visible: (state.lockBasicInfo.value.keyType ?? 0) == 4, + child: CommonItem( + leftTitel: '有效时间'.tr, + rightTitle: + '${DateTool().dateToHNString((state.lockBasicInfo.value.startDate ?? 0).toString())}-${DateTool().dateToHNString((state.lockBasicInfo.value.endDate ?? 0).toString())}', + allHeight: 70.h, + isHaveLine: true), + )), SizedBox(height: 10.h), Obx(() => Visibility( - visible: state.lockBasicInfo.value.isLockOwner == 1 || state.lockBasicInfo.value.keyRight == 1, - child: lockDataListItem('名称'.tr, state.lockBasicInfo.value.lockAlias ?? '', () async { - var data = await Get.toNamed(Routers.editLockNamePage, arguments: { - 'lockSetInfoData': state.lockSetInfoData.value - }); - if (data != null) { - setState(() { - state.lockBasicInfo.value = data['lockBasicInfo']; - }); - } - }))), - Obx(() => lockDataListItem('锁分组'.tr, state.lockBasicInfo.value.groupName ?? '', () async { - Get.toNamed(Routers.lockSelectGroupingPage, arguments: { - 'lockSetInfoData': state.lockSetInfoData.value - })!.then((val) { + visible: state.lockBasicInfo.value.isLockOwner == 1 || + state.lockBasicInfo.value.keyRight == 1, + child: lockDataListItem( + '名称'.tr, state.lockBasicInfo.value.lockAlias ?? '', + () async { + var data = await Get.toNamed(Routers.editLockNamePage, + arguments: { + 'lockSetInfoData': state.lockSetInfoData.value + }); + if (data != null) { + setState(() { + state.lockBasicInfo.value = data['lockBasicInfo']; + }); + } + }))), + Obx(() => lockDataListItem( + '锁分组'.tr, state.lockBasicInfo.value.groupName ?? '', + () async { + Get.toNamed(Routers.lockSelectGroupingPage, + arguments: { + 'lockSetInfoData': state.lockSetInfoData.value + })! + .then((val) { if (val != null) { // mockNetworkDataRequest(); setState(() {}); @@ -124,43 +134,47 @@ class _BasicInformationPageState extends State { }); })), Obx(() => Visibility( - visible: state.lockBasicInfo.value.isLockOwner == 1, - child: CommonItem( - leftTitel:'管理员开锁密码'.tr, - rightTitle: - state.lockBasicInfo.value.adminPwd, - isHaveLine: true, - isHaveDirection: true, - action: () { - Get.toNamed(Routers.adminOpenLockPasswordPage, arguments: { - 'lockSetInfoData': state.lockSetInfoData.value - }); - }), - )), + visible: state.lockBasicInfo.value.isLockOwner == 1, + child: CommonItem( + leftTitel: '管理员开锁密码'.tr, + rightTitle: state.lockBasicInfo.value.adminPwd, + isHaveLine: true, + isHaveDirection: true, + action: () { + Get.toNamed(Routers.adminOpenLockPasswordPage, + arguments: { + 'lockSetInfoData': state.lockSetInfoData.value + }); + }), + )), Obx(() => Visibility( - visible: (state.lockBasicInfo.value.lockName ?? '').contains('T9A'), - child: CommonItem( - leftTitel: '当前网络'.tr, - rightTitle: state.lockBasicInfo.value.network ?? '-', - allHeight: 70.h, - isHaveLine: true), - )), + visible: (state.lockBasicInfo.value.lockName ?? '') + .contains('T9A'), + child: CommonItem( + leftTitel: '当前网络'.tr, + rightTitle: + state.lockBasicInfo.value.networkInfo?.wifiName ?? + '-', + allHeight: 70.h, + isHaveLine: true), + )), Obx(() => CommonItem( - leftTitel: '位置信息'.tr, - // rightTitle: state.lockBasicInfo.value.address ?? "-", - allHeight: 80.h, - isHaveLine: false, - isHaveRightWidget: true, - rightWidget: SizedBox( - width: 300.w, - child: Text(state.lockBasicInfo.value.address ?? '无'.tr, - maxLines: 2, - overflow: TextOverflow.ellipsis, - textAlign: TextAlign.end, - style: TextStyle( - fontSize: 22.sp, - color: AppColors.darkGrayTextColor)), - ),)), + leftTitel: '位置信息'.tr, + // rightTitle: state.lockBasicInfo.value.address ?? "-", + allHeight: 80.h, + isHaveLine: false, + isHaveRightWidget: true, + rightWidget: SizedBox( + width: 300.w, + child: Text(state.lockBasicInfo.value.address ?? '无'.tr, + maxLines: 2, + overflow: TextOverflow.ellipsis, + textAlign: TextAlign.end, + style: TextStyle( + fontSize: 22.sp, + color: AppColors.darkGrayTextColor)), + ), + )), /* 2024-01-12 会议确定去掉“微信二维码” by DaisyWu CommonItem( leftTitel: @@ -176,12 +190,14 @@ class _BasicInformationPageState extends State { )); } - Widget lockDataListItem(String leftTitle, String conentStr, Function()? action){ + Widget lockDataListItem( + String leftTitle, String conentStr, Function()? action) { return GestureDetector( onTap: action, child: Container( // height: 70.h, - padding: EdgeInsets.only(left: 20.w, right: 10.w, top: 15.h, bottom: 15.h), + padding: + EdgeInsets.only(left: 20.w, right: 10.w, top: 15.h, bottom: 15.h), decoration: BoxDecoration( color: Colors.white, border: Border( @@ -189,15 +205,17 @@ class _BasicInformationPageState extends State { color: AppColors.greyLineColor, // 设置边框颜色 width: 2.0.h, // 设置边框宽度 ), - ) - ), + )), child: Row( children: [ Text(leftTitle, style: TextStyle(fontSize: 22.sp)), SizedBox(width: 10.w), Expanded( - child: Text(conentStr, textAlign:TextAlign.end, style: TextStyle(fontSize: 22.sp, )) - ), + child: Text(conentStr, + textAlign: TextAlign.end, + style: TextStyle( + fontSize: 22.sp, + ))), SizedBox(width: 10.w), Image.asset( 'images/icon_right_grey.png', @@ -209,5 +227,4 @@ class _BasicInformationPageState extends State { ), ); } - } From cf8bc3ad05946129c4cc1b30099a9d6fcb1392e5 Mon Sep 17 00:00:00 2001 From: liyi Date: Mon, 17 Feb 2025 17:11:16 +0800 Subject: [PATCH 07/11] =?UTF-8?q?fix:=E5=A2=9E=E5=8A=A0wifi=E6=A0=87?= =?UTF-8?q?=E8=AF=86=E3=80=81=E8=AE=BE=E5=A4=87=E4=B8=8D=E5=9C=A8=E7=BA=BF?= =?UTF-8?q?=E6=97=B6=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lan/lan_en.json | 2 ++ lan/lan_keys.json | 2 ++ lan/lan_zh.json | 2 ++ .../lockDetail/lockDetail/lockDetail_page.dart | 15 ++++++++++++--- 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/lan/lan_en.json b/lan/lan_en.json index 54c8f340..e72ecdae 100644 --- a/lan/lan_en.json +++ b/lan/lan_en.json @@ -62,6 +62,7 @@ "批量授权锁": "Grant multiple locks", "授权管理员拥有操作这把锁的重要权限,请确保只发给我你信任的人": "The authorized administrator will have majority permission to operate this lock.", "功能开启后,你将可以通过网关远程开锁。此功能的开启和关闭只能在锁附近通过手机蓝牙进行。": "This feature allows you to Unlock the Smart Lock Remotely via a Gateway.This Feature can ONLY be Turned ON or OFF via Bluetooth.", + "功能开启后,你将可以通过网关远程开锁。": "After the function is enabled, you will be able to remotely unlock through the gateway。", "排列方式": "List Type", "早到榜": "Early List", "迟到榜": "Late List", @@ -1125,6 +1126,7 @@ "通话连接失败": "Call connection failed", "已挂断": "Hanging up", "正在说话...": "Talking now...", + "设备不在线": "The device is not online", "下载完成,请到相册查看": "Download completed, please go to the album to view", "重置后,该锁的遥控都将被删除哦,确认要重置吗?": "After reset, the remote control of the lock will be deleted. Do you want to reset it?", "版本说明": "Version description", diff --git a/lan/lan_keys.json b/lan/lan_keys.json index 2c9cb07e..9a3145af 100755 --- a/lan/lan_keys.json +++ b/lan/lan_keys.json @@ -62,6 +62,7 @@ "批量授权锁": "批量授权锁", "授权管理员拥有操作这把锁的重要权限,请确保只发给我你信任的人": "授权管理员拥有操作这把锁的重要权限,请确保只发给我你信任的人", "功能开启后,你将可以通过网关远程开锁。此功能的开启和关闭只能在锁附近通过手机蓝牙进行。": "功能开启后,你将可以通过网关远程开锁。此功能的开启和关闭只能在锁附近通过手机蓝牙进行。", + "功能开启后,你将可以通过网关远程开锁。": "功能开启后,你将可以通过网关远程开锁。", "排列方式": "排列方式", "早到榜": "早到榜", "迟到榜": "迟到榜", @@ -1126,6 +1127,7 @@ "通话连接失败": "通话连接失败", "已挂断": "已挂断", "正在说话...": "正在说话...", + "设备不在线": "设备不在线", "下载完成,请到相册查看": "下载完成,请到相册查看", "重置后,该锁的遥控都将被删除哦,确认要重置吗?": "重置后,该锁的遥控都将被删除哦,确认要重置吗?", "版本说明": "版本说明" diff --git a/lan/lan_zh.json b/lan/lan_zh.json index 141f90aa..1b455063 100755 --- a/lan/lan_zh.json +++ b/lan/lan_zh.json @@ -62,6 +62,7 @@ "批量授权锁": "批量授权锁", "授权管理员拥有操作这把锁的重要权限,请确保只发给我你信任的人": "授权管理员拥有操作这把锁的重要权限,请确保只发给我你信任的人", "功能开启后,你将可以通过网关远程开锁。此功能的开启和关闭只能在锁附近通过手机蓝牙进行。": "功能开启后,你将可以通过网关远程开锁。此功能的开启和关闭只能在锁附近通过手机蓝牙进行。", + "功能开启后,你将可以通过网关远程开锁。": "功能开启后,你将可以通过网关远程开锁。", "排列方式": "排列方式", "早到榜": "早到榜", "迟到榜": "迟到榜", @@ -1126,6 +1127,7 @@ "通话连接失败": "通话连接失败", "已挂断": "已挂断", "正在说话...": "正在说话...", + "设备不在线": "设备不在线", "下载完成,请到相册查看": "下载完成,请到相册查看", "重置后,该锁的遥控都将被删除哦,确认要重置吗?": "重置后,该锁的遥控都将被删除哦,确认要重置吗?", "版本说明": "版本说明" diff --git a/lib/main/lockDetail/lockDetail/lockDetail_page.dart b/lib/main/lockDetail/lockDetail/lockDetail_page.dart index c57b3cbf..421d0762 100755 --- a/lib/main/lockDetail/lockDetail/lockDetail_page.dart +++ b/lib/main/lockDetail/lockDetail/lockDetail_page.dart @@ -67,8 +67,6 @@ class _LockDetailPageState extends State logic.loadData( lockListInfoItemEntity: widget.lockListInfoItemEntity, isOnlyOneData: widget.isOnlyOneData); - - } @override @@ -618,6 +616,14 @@ class _LockDetailPageState extends State fontSize: 18.sp, color: AppColors.darkGrayTextColor)), SizedBox(width: 2.w), + state.keyInfos.value.network?.isOnline == 1 + ? Icon( + Icons.wifi, + color: AppColors.mainColor, + size: 22.sp, + ) + : SizedBox.shrink(), + SizedBox(width: 4.w), FlavorsImg( child: Icon( Icons.info, // 使用内置的 warning 图标,它是一个叹号 @@ -1164,6 +1170,10 @@ class _LockDetailPageState extends State showWidgetArr.add( bottomItem('images/main/icon_catEyes.png', '监控'.tr, state.bottomBtnisEable.value, () async { + if (state.keyInfos.value.network?.isOnline == 0) { + logic.showToast('设备不在线'.tr); + return; + } logic.sendMonitorMessage(); }), ); @@ -1571,5 +1581,4 @@ class _LockDetailPageState extends State logic.closeLuckStatus(); BlueManage().disconnect(); } - } From 65d853860bc96b7b1fe6f232444215e74c0a5478 Mon Sep 17 00:00:00 2001 From: liyi Date: Mon, 17 Feb 2025 17:13:18 +0800 Subject: [PATCH 08/11] =?UTF-8?q?fix:=E5=A2=9E=E5=8A=A0wifi=E6=A0=87?= =?UTF-8?q?=E8=AF=86=E3=80=81=E8=AE=BE=E5=A4=87=E4=B8=8D=E5=9C=A8=E7=BA=BF?= =?UTF-8?q?=E6=A0=87=E8=AF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lockSet/lockSet/lockSetInfo_entity.dart | 38 +++++++++++++------ .../lockMian/entity/lockListInfo_entity.dart | 9 +++++ 2 files changed, 36 insertions(+), 11 deletions(-) diff --git a/lib/main/lockDetail/lockSet/lockSet/lockSetInfo_entity.dart b/lib/main/lockDetail/lockSet/lockSet/lockSetInfo_entity.dart index 4e01541b..8e1d29d2 100755 --- a/lib/main/lockDetail/lockSet/lockSet/lockSetInfo_entity.dart +++ b/lib/main/lockDetail/lockSet/lockSet/lockSetInfo_entity.dart @@ -1,5 +1,6 @@ -class LockSetInfoEntity { +import 'package:star_lock/main/lockMian/entity/lockListInfo_entity.dart'; +class LockSetInfoEntity { LockSetInfoEntity( {this.errorCode, this.description, this.errorMsg, this.data}); @@ -9,6 +10,7 @@ class LockSetInfoEntity { errorMsg = json['errorMsg']; data = json['data'] != null ? LockSetInfoData.fromJson(json['data']) : null; } + int? errorCode; String? description; String? errorMsg; @@ -27,7 +29,6 @@ class LockSetInfoEntity { } class LockSetInfoData { - LockSetInfoData( {this.lockId, this.lockStatus, @@ -50,6 +51,7 @@ class LockSetInfoData { ? LockSettingInfo.fromJson(json['lockSettingInfo']) : null; } + int? lockId; LockStatus? lockStatus; LockFeature? lockFeature; @@ -76,12 +78,12 @@ class LockSetInfoData { } class LockStatus { - LockStatus({this.roomStatus}); LockStatus.fromJson(Map json) { roomStatus = json['roomStatus']; } + int? roomStatus; Map toJson() { @@ -91,7 +93,8 @@ class LockStatus { } } -class LockFeature { //人脸开关 0:关闭 1:开启 +class LockFeature { + //人脸开关 0:关闭 1:开启 LockFeature({ this.password, @@ -206,6 +209,7 @@ class LockFeature { //人脸开关 0:关闭 1:开启 abnormalWarn = json['abnormalWarn']; isSupportBackupBattery = json['isSupportBackupBattery']; } + int? password; int? icCard; int? fingerprint; @@ -322,7 +326,6 @@ class LockFeature { //人脸开关 0:关闭 1:开启 } class LockBasicInfo { - LockBasicInfo( {this.lockId, this.electricQuantityDate, @@ -348,7 +351,8 @@ class LockBasicInfo { this.weekDays, this.address, this.network, - this.vendor}); + this.vendor, + this.networkInfo}); LockBasicInfo.fromJson(Map json) { lockId = json['lockId']; @@ -381,7 +385,11 @@ class LockBasicInfo { address = json['address']; network = json['network']; vendor = json['vendor']; + networkInfo = json['networkInfo'] != null + ? NetworkInfo.fromJson(json['networkInfo']) + : null; } + int? lockId; int? electricQuantityDate; int? keyId; @@ -407,6 +415,7 @@ class LockBasicInfo { String? address; String? network; String? vendor; + NetworkInfo? networkInfo; Map toJson() { final Map data = {}; @@ -437,18 +446,21 @@ class LockBasicInfo { data['address'] = address; data['network'] = network; data['vendor'] = vendor; + if (networkInfo != null) { + data['networkInfo'] = networkInfo!.toJson(); + } return data; } } class GroupData { - GroupData({this.id, this.name}); GroupData.fromJson(Map json) { id = json['id']; name = json['name']; } + int? id; String? name; @@ -460,7 +472,8 @@ class GroupData { } } -class LockSettingInfo { // 防误开 +class LockSettingInfo { + // 防误开 LockSettingInfo({ this.remoteUnlock, this.autoLock, @@ -540,6 +553,7 @@ class LockSettingInfo { // 防误开 autoLightScreenTime = json['autoLightScreenTime']; faceEnErrUnlock = json['faceEnErrUnlock']; } + int? remoteUnlock; int? autoLock; int? autoLockSecond; @@ -619,7 +633,6 @@ class LockSettingInfo { // 防误开 } class PassageModeConfig { - PassageModeConfig( {this.startDate, this.endDate, this.weekDays, this.isAllDay}); @@ -629,6 +642,7 @@ class PassageModeConfig { weekDays = json['weekDays'].cast(); isAllDay = json['isAllDay']; } + int? startDate; int? endDate; List? weekDays; @@ -645,7 +659,6 @@ class PassageModeConfig { } class CatEyeConfig { - CatEyeConfig({this.catEyeMode, this.catEyeModeConfig}); CatEyeConfig.fromJson(Map json) { @@ -654,6 +667,7 @@ class CatEyeConfig { ? CatEyeModeConfig.fromJson(json['catEyeModeConfig']) : null; } + int? catEyeMode; //1省电模式 2逗留抓拍模式 3实时监控模式 4自定义模式(自定义模式下存在其他设置参数) CatEyeModeConfig? catEyeModeConfig; @@ -667,7 +681,8 @@ class CatEyeConfig { } } -class CatEyeModeConfig { //人体侦测距离 +class CatEyeModeConfig { + //人体侦测距离 CatEyeModeConfig( {this.recordMode, @@ -689,6 +704,7 @@ class CatEyeModeConfig { //人体侦测距离 recordStartTime = json['recordStartTime']; detectionDistance = json['detectionDistance']; } + int? recordMode; //录像时段 0全天 1自定义时间 String? recordTime; //有人出现时录像 int? realTimeMode; //实时画面 0发生事件事查看 1实时查看 diff --git a/lib/main/lockMian/entity/lockListInfo_entity.dart b/lib/main/lockMian/entity/lockListInfo_entity.dart index 2a462bcc..b3b46464 100755 --- a/lib/main/lockMian/entity/lockListInfo_entity.dart +++ b/lib/main/lockMian/entity/lockListInfo_entity.dart @@ -422,17 +422,26 @@ class LockSetting { class NetworkInfo { NetworkInfo({ this.peerId, + this.isOnline, + this.wifiName, + }); NetworkInfo.fromJson(Map json) { peerId = json['peerId']; + isOnline = json['isOnline']; + wifiName = json['wifiName']; } String? peerId; + String? wifiName; + int? isOnline; Map toJson() { final Map data = {}; data['peerId'] = peerId; + data['wifiName'] = wifiName; + data['isOnline'] = isOnline; return data; } } From d68bee7e3451e86dd6d99312a94e1e1a692b9941 Mon Sep 17 00:00:00 2001 From: liyi Date: Mon, 17 Feb 2025 17:13:33 +0800 Subject: [PATCH 09/11] =?UTF-8?q?fix:=E4=BF=AE=E6=94=B9=E8=BF=9C=E7=A8=8B?= =?UTF-8?q?=E5=BC=80=E9=94=81=E6=97=B6=E7=9A=84=E6=96=87=E6=9C=AC=E6=8F=8F?= =?UTF-8?q?=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lockSet/remoteUnlocking/remoteUnlocking_page.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/main/lockDetail/lockSet/remoteUnlocking/remoteUnlocking_page.dart b/lib/main/lockDetail/lockSet/remoteUnlocking/remoteUnlocking_page.dart index 2147a824..3489df75 100755 --- a/lib/main/lockDetail/lockSet/remoteUnlocking/remoteUnlocking_page.dart +++ b/lib/main/lockDetail/lockSet/remoteUnlocking/remoteUnlocking_page.dart @@ -40,7 +40,7 @@ class _RemoteUnlockingPageState extends State with RouteAwa children: [ Expanded( child: Text( - '功能开启后,你将可以通过网关远程开锁。此功能的开启和关闭只能在锁附近通过手机蓝牙进行。'.tr, + '功能开启后,你将可以通过网关远程开锁。'.tr, style: TextStyle( fontSize: 20.sp, color: AppColors.darkGrayTextColor), )), From c9ba5aa7691aeeedc80a95f8e36cb7a99bfb3ee6 Mon Sep 17 00:00:00 2001 From: liyi Date: Mon, 17 Feb 2025 17:15:54 +0800 Subject: [PATCH 10/11] =?UTF-8?q?fix:=E4=BF=AE=E6=94=B9=E9=80=80=E5=87=BA?= =?UTF-8?q?=E8=BF=9C=E7=A8=8B=E6=97=B6=E9=94=80=E6=AF=81=E6=97=B6=E5=81=9C?= =?UTF-8?q?=E6=AD=A2=E5=AE=9A=E6=97=B6=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/talk/starChart/star_chart_manage.dart | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/talk/starChart/star_chart_manage.dart b/lib/talk/starChart/star_chart_manage.dart index 3a4fad35..9fc24737 100644 --- a/lib/talk/starChart/star_chart_manage.dart +++ b/lib/talk/starChart/star_chart_manage.dart @@ -1170,6 +1170,10 @@ class StartChartManage { stopHeartbeat(); // 取消发送期望数据 stopTalkExpectMessageTimer(); + // 取消发送拒绝定时器 + stopTalkRejectMessageTimer(); + // 取消发送挂断定时器 + stopTalkHangupMessageTimer(); // 取消发送通话保持消息 stopTalkPingMessageTimer(); // 取消发送上线消息 From 9cf186dab5049060a67c2fdff893dbfdcee00bf1 Mon Sep 17 00:00:00 2001 From: liyi Date: Tue, 18 Feb 2025 09:59:25 +0800 Subject: [PATCH 11/11] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8D=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E7=94=B5=E6=9C=BA=E5=8A=9F=E7=8E=87=E5=87=BA=E7=8E=B0=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lockSet/lockSet/lockSet_page.dart | 5 +- .../lockSet/motorPower/motorPower_logic.dart | 7 ++ .../lockSet/motorPower/motorPower_page.dart | 75 ++++++++++--------- 3 files changed, 52 insertions(+), 35 deletions(-) diff --git a/lib/main/lockDetail/lockSet/lockSet/lockSet_page.dart b/lib/main/lockDetail/lockSet/lockSet/lockSet_page.dart index 44277007..83fada97 100755 --- a/lib/main/lockDetail/lockSet/lockSet/lockSet_page.dart +++ b/lib/main/lockDetail/lockSet/lockSet/lockSet_page.dart @@ -500,7 +500,10 @@ class _LockSetPageState extends State isHaveLine: true, isHaveDirection: true, action: () { - Get.toNamed(Routers.motorPowerPage); + Get.toNamed(Routers.motorPowerPage, + arguments: { + 'lockSetInfoData': state.lockSetInfoData.value + }); })), // 蓝牙广播(关闭则不能使用蓝牙主动开锁) /* 2024-01-12 会议确定去掉“蓝牙广播” by DaisyWu diff --git a/lib/main/lockDetail/lockSet/motorPower/motorPower_logic.dart b/lib/main/lockDetail/lockSet/motorPower/motorPower_logic.dart index 0085779e..44b72e64 100755 --- a/lib/main/lockDetail/lockSet/motorPower/motorPower_logic.dart +++ b/lib/main/lockDetail/lockSet/motorPower/motorPower_logic.dart @@ -2,6 +2,7 @@ import 'dart:async'; import 'package:flutter_blue_plus/flutter_blue_plus.dart'; import 'package:get/get.dart'; +import 'package:star_lock/blue/io_protocol/io_setSupportFunctionsWithParameters.dart'; import 'package:star_lock/login/login/entity/LoginEntity.dart'; import '../../../../blue/blue_manage.dart'; @@ -28,6 +29,7 @@ class MotorPowerLogic extends BaseGetXController { if (entity.errorCode!.codeIsSuccessful) { state.lockSetInfoData.value.lockSettingInfo!.openDirectionValue = state.motorTorsion.value; + eventBus .fire(PassCurrentLockInformationEvent(state.lockSetInfoData.value)); showToast('操作成功'.tr); @@ -36,6 +38,7 @@ class MotorPowerLogic extends BaseGetXController { // 获取解析后的数据 late StreamSubscription _replySubscription; + void _initReplySubscription() { _replySubscription = EventBusManager().eventBus!.on().listen((Reply reply) { @@ -43,6 +46,10 @@ class MotorPowerLogic extends BaseGetXController { _replySetSupportFunctionsWithParameters(reply); } + if (reply is SetSupportFunctionsWithParametersReply) { + _replySetSupportFunctionsWithParameters(reply); + } + // 读取支持功能(带参数) // if(reply is ReadSupportFunctionsNoParametersReply) { // _readSupportFunctionsWithParametersReply(reply); diff --git a/lib/main/lockDetail/lockSet/motorPower/motorPower_page.dart b/lib/main/lockDetail/lockSet/motorPower/motorPower_page.dart index ac023d66..7aa478c6 100755 --- a/lib/main/lockDetail/lockSet/motorPower/motorPower_page.dart +++ b/lib/main/lockDetail/lockSet/motorPower/motorPower_page.dart @@ -21,53 +21,60 @@ class _MotorPowerPageState extends State { @override Widget build(BuildContext context) { return Scaffold( - backgroundColor: Colors.white, - appBar: TitleAppBar( - barTitle: '电机功率设置'.tr, - haveBack: true, - backgroundColor: AppColors.mainColor), - body: Column( - children: [ - SizedBox( - height: 40.h, + backgroundColor: Colors.white, + appBar: TitleAppBar( + barTitle: '电机功率设置'.tr, + haveBack: true, + backgroundColor: AppColors.mainColor), + body: Column( + children: [ + SizedBox( + height: 40.h, + ), + Container( + margin: EdgeInsets.only(left: 40.w), + alignment: Alignment.centerLeft, + child: Text( + '请根据门锁实际情况,请谨慎选择电机功率:'.tr, + style: TextStyle( + fontSize: 24.sp, + color: Colors.black, + fontWeight: FontWeight.w500), ), - Container( - margin: EdgeInsets.only(left: 40.w), - alignment: Alignment.centerLeft, - child: Text( - '请根据门锁实际情况,请谨慎选择电机功率:'.tr, - style: TextStyle( - fontSize: 24.sp, - color: Colors.black, - fontWeight: FontWeight.w500), - ), - ), - SizedBox( - height: 40.h, - ), - _buildTipsView( + ), + SizedBox( + height: 40.h, + ), + Obx( + () => _buildTipsView( '${'小功率:'.tr}\n', '耗电少'.tr, state.motorTorsion.value == 1, () { state.motorTorsion.value = 1; logic.sendOpenDoorDirection(); }), - SizedBox( - height: 20.h, - ), - _buildTipsView( + ), + SizedBox( + height: 20.h, + ), + Obx( + () => _buildTipsView( '${'中功率'.tr}\n', '常规使用'.tr, state.motorTorsion.value == 2, () { state.motorTorsion.value = 2; logic.sendOpenDoorDirection(); }), - SizedBox( - height: 20.h, - ), - _buildTipsView( + ), + SizedBox( + height: 20.h, + ), + Obx( + () => _buildTipsView( '${'大功率'.tr}\n', '大功率提示'.tr, state.motorTorsion.value == 3, () { state.motorTorsion.value = 3; logic.sendOpenDoorDirection(); }), - ], - )); + ) + ], + ), + ); } Widget _buildTipsView(