From 8593088ab01a045c52542decef694f1767eae0ff Mon Sep 17 00:00:00 2001 From: Daisy <> Date: Fri, 7 Jun 2024 15:58:24 +0800 Subject: [PATCH] =?UTF-8?q?1=EF=BC=8C=E6=96=B0=E5=A2=9E=E4=B8=8E=E5=90=8E?= =?UTF-8?q?=E5=8F=B0=E7=BA=A6=E5=AE=9Acode=E5=80=BC=E5=BC=B9=E5=87=BA?= =?UTF-8?q?=E5=85=AC=E7=94=A8=E7=BB=84=E4=BB=B6=E6=8F=90=E7=A4=BA=202?= =?UTF-8?q?=EF=BC=8C=E4=BF=AE=E5=A4=8D=E5=BC=80=E9=94=81=E9=A1=B5-?= =?UTF-8?q?=E6=B6=88=E6=81=AF=E6=8F=90=E9=86=92-=E5=8D=8A=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E9=94=81=E5=92=8CXHJ=20=E7=9A=84=E9=94=81=E5=BA=94?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E6=9C=89=E4=BA=BA=E5=87=BA=E7=8E=B0=E5=9C=A8?= =?UTF-8?q?=E9=97=A8=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lockDetail/lockDetail_page.dart | 1 + .../msgNotification/msgNotification_page.dart | 16 ++++++++------ .../msgNotification_state.dart | 4 ++++ lib/network/api_provider_base.dart | 4 ++++ lib/tools/showTipView.dart | 22 ++++++++++++++++++- 5 files changed, 39 insertions(+), 8 deletions(-) diff --git a/lib/main/lockDetail/lockDetail/lockDetail_page.dart b/lib/main/lockDetail/lockDetail/lockDetail_page.dart index 099b1b18..196d7ba6 100755 --- a/lib/main/lockDetail/lockDetail/lockDetail_page.dart +++ b/lib/main/lockDetail/lockDetail/lockDetail_page.dart @@ -1160,6 +1160,7 @@ class _LockDetailPageState extends State state.bottomBtnisEable.value, () { Get.toNamed(Routers.msgNotificationPage, arguments: { 'lockId': state.keyInfos.value.lockId, + 'isSupportCatEye': state.keyInfos.value.lockFeature!.isSupportCatEye, }); }), ); diff --git a/lib/main/lockDetail/messageWarn/msgNotification/msgNotification/msgNotification_page.dart b/lib/main/lockDetail/messageWarn/msgNotification/msgNotification/msgNotification_page.dart index 30959240..2d5887d8 100755 --- a/lib/main/lockDetail/messageWarn/msgNotification/msgNotification/msgNotification_page.dart +++ b/lib/main/lockDetail/messageWarn/msgNotification/msgNotification/msgNotification_page.dart @@ -143,13 +143,15 @@ class _MsgNotificationPageState extends State { SizedBox( height: 10.h, ), - Obx(() => CommonItem( - leftTitel: '有人出现在门口'.tr, - rightTitle: "", - isHaveLine: true, - isHaveRightWidget: true, - rightWidget: - SizedBox(width: 60.w, height: 50.h, child: _switch(4)))), + Obx(() => Visibility( + visible: state.isSupportCatEye.value, + child: CommonItem( + leftTitel: '有人出现在门口'.tr, + rightTitle: "", + isHaveLine: true, + isHaveRightWidget: true, + rightWidget: + SizedBox(width: 60.w, height: 50.h, child: _switch(4))))), SizedBox( height: 60.h, ), diff --git a/lib/main/lockDetail/messageWarn/msgNotification/msgNotification/msgNotification_state.dart b/lib/main/lockDetail/messageWarn/msgNotification/msgNotification/msgNotification_state.dart index 41c6ae1e..1ba082ec 100755 --- a/lib/main/lockDetail/messageWarn/msgNotification/msgNotification/msgNotification_state.dart +++ b/lib/main/lockDetail/messageWarn/msgNotification/msgNotification/msgNotification_state.dart @@ -15,12 +15,16 @@ class MsgNotificationState { final String notifyEnable = '已启用'.tr; final String notifyDisable = '未启用'.tr; final String settingSuccess = '设置成功'.tr; + var isSupportCatEye = false.obs; MsgNotificationState() { Map map = Get.arguments; if (map['lockId'] != null) { getLockId.value = map['lockId']; } + if (map['isSupportCatEye'] != null) { + isSupportCatEye.value = map['isSupportCatEye'] == 1; + } nDaysNotOpenDoor.value = notifyEnable; isLowBattery.value = notifyEnable; diff --git a/lib/network/api_provider_base.dart b/lib/network/api_provider_base.dart index 1c29ae6e..c7d3977a 100755 --- a/lib/network/api_provider_base.dart +++ b/lib/network/api_provider_base.dart @@ -2,6 +2,7 @@ import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:get/get.dart'; import 'package:star_lock/app_settings/app_settings.dart'; +import 'package:star_lock/tools/showTipView.dart'; import '../appRouters.dart'; import '../flavors.dart'; import 'api.dart'; @@ -100,6 +101,9 @@ class BaseProvider extends GetConnect with Api { case 10001: EasyLoading.showToast('数据不存在', duration: 2000.milliseconds); break; + case 434: //与后台约定弹出确认框提示 + ShowTipView().showSureBtnTipsAlert(T['errorMsg']); + break; } } } diff --git a/lib/tools/showTipView.dart b/lib/tools/showTipView.dart index 011e1806..d4b14e59 100755 --- a/lib/tools/showTipView.dart +++ b/lib/tools/showTipView.dart @@ -13,7 +13,8 @@ typedef BlockIsHaveAllDataCallback = void Function(bool isAllData); class ShowTipView { // 只有一个确定按钮 - void showSureAlertDialog(String contentStr, {String? tipTitle, String? sureStr}) { + void showSureAlertDialog(String contentStr, + {String? tipTitle, String? sureStr}) { showCupertinoDialog( context: Get.context!, builder: (BuildContext context) { @@ -121,4 +122,23 @@ class ShowTipView { }, ); } + + // 只有一个确定按钮 + void showSureBtnTipsAlert(String tipsText) { + showCupertinoDialog( + context: Get.context!, + builder: (BuildContext context) { + return CupertinoAlertDialog( + content: Text(tipsText), + actions: [ + CupertinoDialogAction( + child: + Text('确定'.tr, style: TextStyle(color: AppColors.mainColor)), + onPressed: Get.back, + ), + ], + ); + }, + ); + } }