diff --git a/star_lock/lib/main/lockDetail/lockDetail/lockDetail_page.dart b/star_lock/lib/main/lockDetail/lockDetail/lockDetail_page.dart index 62ded510..db14ee45 100644 --- a/star_lock/lib/main/lockDetail/lockDetail/lockDetail_page.dart +++ b/star_lock/lib/main/lockDetail/lockDetail/lockDetail_page.dart @@ -71,7 +71,8 @@ class _LockDetailPageState extends State StreamSubscription? _lockRefreshLockDetailInfoDataEvent; void _initRefreshLockDetailInfoDataEventAction() { // 蓝牙协议通知传输跟蓝牙之外的数据传输类不一样 eventBus - _lockRefreshLockDetailInfoDataEvent = eventBus.on().listen((event) { + _lockRefreshLockDetailInfoDataEvent = + eventBus.on().listen((event) { setState(() {}); }); } @@ -110,12 +111,14 @@ class _LockDetailPageState extends State BlueManage().connectDeviceName = state.keyInfos.value.bluetooth!.bluetoothDeviceName!; - List publicKeyData = state.keyInfos.value.bluetooth!.publicKey!.cast(); + List publicKeyData = + state.keyInfos.value.bluetooth!.publicKey!.cast(); var saveStrList = changeIntListToStringList(publicKeyData); Storage.setStringList(saveBluePublicKey, saveStrList); // 私钥 - List privateKeyData = state.keyInfos.value.bluetooth!.privateKey!.cast(); + List privateKeyData = + state.keyInfos.value.bluetooth!.privateKey!.cast(); var savePrivateKeyList = changeIntListToStringList(privateKeyData); Storage.setStringList(saveBluePrivateKey, savePrivateKeyList); @@ -138,9 +141,19 @@ class _LockDetailPageState extends State children: [ Visibility( visible: - ((state.keyInfos.value.keyType == XSConstantMacro.keyTypeTime || state.keyInfos.value.keyType == XSConstantMacro.keyTypeLoop) && // 限时、循环 - (DateTool().compareTimeGetDaysFromNow(state.keyInfos.value.endDate!) <= 15 && DateTool().compareTimeGetDaysFromNow(state.keyInfos.value.endDate!) >= 0) && // 0到30天 - (state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusNormalUse || state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusWaitReceive) // 正常使用、待接收 + ((state.keyInfos.value.keyType == XSConstantMacro.keyTypeTime || + state.keyInfos.value.keyType == + XSConstantMacro.keyTypeLoop) && // 限时、循环 + (DateTool().compareTimeGetDaysFromNow( + state.keyInfos.value.endDate!) <= + 15 && + DateTool().compareTimeGetDaysFromNow( + state.keyInfos.value.endDate!) >= + 0) && // 0到30天 + (state.keyInfos.value.keyStatus == + XSConstantMacro.keyStatusNormalUse || + state.keyInfos.value.keyStatus == + XSConstantMacro.keyStatusWaitReceive) // 正常使用、待接收 ) ? true : false, @@ -234,9 +247,8 @@ class _LockDetailPageState extends State GestureDetector( onTap: () { // logic.getStarLockStatus(); - ShowTipView().showSureAlertDialog("${"锁更新时间:".tr}${DateTool().dateToYMDHNString(state - .keyInfos.value.electricQuantityDate! - .toString())}"); + ShowTipView().showSureAlertDialog( + "${"锁更新时间:".tr}${DateTool().dateToYMDHNString(state.keyInfos.value.electricQuantityDate!.toString())}"); }, child: Row( mainAxisAlignment: MainAxisAlignment.end, @@ -263,11 +275,16 @@ class _LockDetailPageState extends State Row( mainAxisAlignment: MainAxisAlignment.end, children: [ - Image.asset(showElectricIcon(state.electricQuantity.value), width: 30.w, height: 24.w), + Image.asset(showElectricIcon(state.electricQuantity.value), + width: 30.w, height: 24.w), SizedBox(width: 2.w), - Text("--%", style: TextStyle(fontSize: 18.sp, color: AppColors.darkGrayTextColor)), + Text("--%", + style: TextStyle( + fontSize: 18.sp, + color: AppColors.darkGrayTextColor)), SizedBox(width: 2.w), - Icon(Icons.info, // 使用内置的 warning 图标,它是一个叹号 + Icon( + Icons.info, // 使用内置的 warning 图标,它是一个叹号 color: AppColors.mainColor, // 设置图标颜色为红色 size: 25.w, // 设置图标大小为 30 ), @@ -561,11 +578,8 @@ class _LockDetailPageState extends State })); // 设置 - showWidgetArr.add(bottomItem( - 'images/main/icon_main_set.png', - TranslationLoader.lanKeys!.set!.tr, - true, - true, () { + showWidgetArr.add(bottomItem('images/main/icon_main_set.png', + TranslationLoader.lanKeys!.set!.tr, true, true, () { Get.toNamed(Routers.lockSetPage, arguments: { "lockId": state.keyInfos.value.lockId, "isOnlyOneData": state.isOnlyOneData @@ -729,17 +743,16 @@ class _LockDetailPageState extends State TranslationLoader.lanKeys!.messageReminding!.tr, state.openDoorBtnisUneable.value, state.bottomBtnisEable.value, () { - Get.toNamed(Routers.msgNotificationPage); + Get.toNamed(Routers.msgNotificationPage, arguments: { + "lockId": state.keyInfos.value.lockId, + }); }), ); endWiddget.add( // 设置 - bottomItem( - 'images/main/icon_main_set.png', - TranslationLoader.lanKeys!.set!.tr, - true, - true, () { + bottomItem('images/main/icon_main_set.png', + TranslationLoader.lanKeys!.set!.tr, true, true, () { // logic.clickItemBtnAction(10); Get.toNamed(Routers.lockSetPage, arguments: { "lockId": state.keyInfos.value.lockId, @@ -752,7 +765,8 @@ class _LockDetailPageState extends State } // - Widget bottomItem(String iconUrl, String name, bool openDoorBtnisUneable, bool bottomBtnisEable, Function() onClick) { + Widget bottomItem(String iconUrl, String name, bool openDoorBtnisUneable, + bool bottomBtnisEable, Function() onClick) { var width = 42.w; var height = 42.h; return GestureDetector( diff --git a/star_lock/lib/main/lockDetail/lockSet/lockSet/lockSet_page.dart b/star_lock/lib/main/lockDetail/lockSet/lockSet/lockSet_page.dart index f923f88d..5fc8c9e2 100644 --- a/star_lock/lib/main/lockDetail/lockSet/lockSet/lockSet_page.dart +++ b/star_lock/lib/main/lockDetail/lockSet/lockSet/lockSet_page.dart @@ -371,7 +371,9 @@ class _LockSetPageState extends State with RouteAware { isHaveLine: true, isHaveDirection: true, action: () { - Get.toNamed(Routers.msgNotificationPage); + Get.toNamed(Routers.msgNotificationPage, arguments: { + 'lockSetInfoData': state.lockSetInfoData.value + }); })), //猫眼设置 Visibility( diff --git a/star_lock/lib/main/lockDetail/lockSet/msgNotification/msgNotification/msgNotification_page.dart b/star_lock/lib/main/lockDetail/lockSet/msgNotification/msgNotification/msgNotification_page.dart index d7e02d58..d0ef33b4 100644 --- a/star_lock/lib/main/lockDetail/lockSet/msgNotification/msgNotification/msgNotification_page.dart +++ b/star_lock/lib/main/lockDetail/lockSet/msgNotification/msgNotification/msgNotification_page.dart @@ -67,11 +67,13 @@ class _MsgNotificationPageState extends State { // ), CommonItem( leftTitel: '开门通知', - rightTitle: "已启用", + rightTitle: "", isHaveLine: true, isHaveDirection: true, action: () { - Get.toNamed(Routers.openDoorNotifyPage); + Get.toNamed(Routers.openDoorNotifyPage, arguments: { + 'lockSetInfoData': state.lockSetInfoData.value, + }); }, ), CommonItem( diff --git a/star_lock/lib/main/lockDetail/lockSet/msgNotification/msgNotification/msgNotification_state.dart b/star_lock/lib/main/lockDetail/lockSet/msgNotification/msgNotification/msgNotification_state.dart index d0614ba5..8319dc69 100644 --- a/star_lock/lib/main/lockDetail/lockSet/msgNotification/msgNotification/msgNotification_state.dart +++ b/star_lock/lib/main/lockDetail/lockSet/msgNotification/msgNotification/msgNotification_state.dart @@ -1,9 +1,18 @@ import 'package:get/get.dart'; +import 'package:star_lock/main/lockDetail/lockSet/lockSet/lockSetInfo_entity.dart'; class MsgNotificationState { + var lockSetInfoData = LockSetInfoData().obs; var isCheck = false.obs; var isLeaveHomeOpenDoor = false.obs; //离家开门 var isDoorNotShut = false.obs; //门未关好 var isSomeoneRing = false.obs; //有人按门铃 var isSomeoneAppeared = false.obs; //有人出现在门口 + + MsgNotificationState() { + Map map = Get.arguments; + if (map['lockSetInfoData'] != null) { + lockSetInfoData.value = map['lockSetInfoData']; + } + } } diff --git a/star_lock/lib/main/lockDetail/lockSet/msgNotification/openDoorNotify/openDoorNotify_logic.dart b/star_lock/lib/main/lockDetail/lockSet/msgNotification/openDoorNotify/openDoorNotify_logic.dart index 4bac0f4b..8cc3e58b 100644 --- a/star_lock/lib/main/lockDetail/lockSet/msgNotification/openDoorNotify/openDoorNotify_logic.dart +++ b/star_lock/lib/main/lockDetail/lockSet/msgNotification/openDoorNotify/openDoorNotify_logic.dart @@ -1,7 +1,16 @@ - +import 'package:star_lock/network/api_repository.dart'; import 'package:star_lock/tools/baseGetXController.dart'; +import 'package:star_lock/versionUndate/versionUndate_entity.dart'; import 'openDoorNotify_state.dart'; class OpenDoorNotifyLogic extends BaseGetXController { final OpenDoorNotifyState state = OpenDoorNotifyState(); + + // 获取锁消息设置 + void getLockNoticeSetting() async { + VersionUndateEntity entity = await ApiRepository.to.getLockNoticeSetting( + lockId: state.lockSetInfoData.value.lockId!, + ); + if (entity.errorCode!.codeIsSuccessful) {} + } } diff --git a/star_lock/lib/main/lockDetail/lockSet/msgNotification/openDoorNotify/openDoorNotify_page.dart b/star_lock/lib/main/lockDetail/lockSet/msgNotification/openDoorNotify/openDoorNotify_page.dart index c24a07e3..4d2c39e0 100644 --- a/star_lock/lib/main/lockDetail/lockSet/msgNotification/openDoorNotify/openDoorNotify_page.dart +++ b/star_lock/lib/main/lockDetail/lockSet/msgNotification/openDoorNotify/openDoorNotify_page.dart @@ -22,6 +22,8 @@ class _OpenDoorNotifyPageState extends State { @override void initState() { super.initState(); + + logic.getLockNoticeSetting(); } @override diff --git a/star_lock/lib/main/lockDetail/lockSet/msgNotification/openDoorNotify/openDoorNotify_state.dart b/star_lock/lib/main/lockDetail/lockSet/msgNotification/openDoorNotify/openDoorNotify_state.dart index 1a0e4265..08e520d9 100644 --- a/star_lock/lib/main/lockDetail/lockSet/msgNotification/openDoorNotify/openDoorNotify_state.dart +++ b/star_lock/lib/main/lockDetail/lockSet/msgNotification/openDoorNotify/openDoorNotify_state.dart @@ -1,7 +1,16 @@ import 'package:get/get.dart'; +import 'package:star_lock/main/lockDetail/lockSet/lockSet/lockSetInfo_entity.dart'; class OpenDoorNotifyState { + var lockSetInfoData = LockSetInfoData().obs; var pageNum = 1.obs; //请求页码 final pageSize = 20.obs; //请求每页数据条数 final itemDataList = [].obs; + + OpenDoorNotifyState() { + Map map = Get.arguments; + if (map['lockSetInfoData'] != null) { + lockSetInfoData.value = map['lockSetInfoData']; + } + } } diff --git a/star_lock/lib/network/api.dart b/star_lock/lib/network/api.dart index 11a71eac..a13b55d9 100644 --- a/star_lock/lib/network/api.dart +++ b/star_lock/lib/network/api.dart @@ -190,4 +190,7 @@ abstract class Api { '/lockSetting/updateCatEyeConfig'; //猫眼相关设置 final String updateFaceConfigURL = '/lockSetting/updateFaceConfig'; //面容相关设置 + + final String getLockNoticeSettingURL = + '/lockSetting/getLockNoticeSetting'; //获取锁消息设置 } diff --git a/star_lock/lib/network/api_provider.dart b/star_lock/lib/network/api_provider.dart index fb4b5f74..2b176521 100644 --- a/star_lock/lib/network/api_provider.dart +++ b/star_lock/lib/network/api_provider.dart @@ -1747,6 +1747,13 @@ class ApiProvider extends BaseProvider { 'lockId': lockId, 'faceAutoLightScreen': faceAutoLightScreen, })); + + // 获取锁消息设置 + Future getLockNoticeSetting(int lockId) => post( + getLockNoticeSettingURL.toUrl, + jsonEncode({ + 'lockId': lockId, + })); } extension ExtensionString on String { diff --git a/star_lock/lib/network/api_repository.dart b/star_lock/lib/network/api_repository.dart index 1c8b799e..e366157a 100644 --- a/star_lock/lib/network/api_repository.dart +++ b/star_lock/lib/network/api_repository.dart @@ -1779,4 +1779,11 @@ class ApiRepository { lockId, faceAutoLightScreen); return VersionUndateEntity.fromJson(res.body); } + + // 获取锁消息设置 + Future getLockNoticeSetting( + {required int lockId}) async { + final res = await apiProvider.getLockNoticeSetting(lockId); + return VersionUndateEntity.fromJson(res.body); + } } diff --git a/star_lock/lib/talk/call/callTalk.dart b/star_lock/lib/talk/call/callTalk.dart index d82e31e5..86cd4a5c 100644 --- a/star_lock/lib/talk/call/callTalk.dart +++ b/star_lock/lib/talk/call/callTalk.dart @@ -60,7 +60,7 @@ class CallTalk { } // 视频数据 else { - print('********视频数据来了'); + // print('********视频数据来了'); // 音视频数据开始下标 var bagLen = bb[POS_blen + 2] + bb[POS_blen + 3] * 256; // print('音视频数据开始下标 bagLen:$bagLen'); @@ -101,8 +101,8 @@ class CallTalk { var getList = bb.sublist(POS_data, bb.length); iframe!.bb!.addAll(getList); } - print( - 'iframe.bagNum: ${iframe!.bagNum} iframe.bagReceive: ${iframe!.bagReceive}'); + // print( + // 'iframe.bagNum: ${iframe!.bagNum} iframe.bagReceive: ${iframe!.bagReceive}'); // 如果收到的包数等于总包数,说明这一帧数据已经接收完毕 if (iframe!.bagNum == iframe!.bagReceive) {