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, + ), + ], + ); + }, + ); + } }