1,新增与后台约定code值弹出公用组件提示
2,修复开锁页-消息提醒-半自动锁和XHJ 的锁应没有有人出现在门口
This commit is contained in:
parent
1b4a6aaee3
commit
8593088ab0
@ -1160,6 +1160,7 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
state.bottomBtnisEable.value, () {
|
state.bottomBtnisEable.value, () {
|
||||||
Get.toNamed(Routers.msgNotificationPage, arguments: <String, int?>{
|
Get.toNamed(Routers.msgNotificationPage, arguments: <String, int?>{
|
||||||
'lockId': state.keyInfos.value.lockId,
|
'lockId': state.keyInfos.value.lockId,
|
||||||
|
'isSupportCatEye': state.keyInfos.value.lockFeature!.isSupportCatEye,
|
||||||
});
|
});
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|||||||
@ -143,13 +143,15 @@ class _MsgNotificationPageState extends State<MsgNotificationPage> {
|
|||||||
SizedBox(
|
SizedBox(
|
||||||
height: 10.h,
|
height: 10.h,
|
||||||
),
|
),
|
||||||
Obx(() => CommonItem(
|
Obx(() => Visibility(
|
||||||
leftTitel: '有人出现在门口'.tr,
|
visible: state.isSupportCatEye.value,
|
||||||
rightTitle: "",
|
child: CommonItem(
|
||||||
isHaveLine: true,
|
leftTitel: '有人出现在门口'.tr,
|
||||||
isHaveRightWidget: true,
|
rightTitle: "",
|
||||||
rightWidget:
|
isHaveLine: true,
|
||||||
SizedBox(width: 60.w, height: 50.h, child: _switch(4)))),
|
isHaveRightWidget: true,
|
||||||
|
rightWidget:
|
||||||
|
SizedBox(width: 60.w, height: 50.h, child: _switch(4))))),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 60.h,
|
height: 60.h,
|
||||||
),
|
),
|
||||||
|
|||||||
@ -15,12 +15,16 @@ class MsgNotificationState {
|
|||||||
final String notifyEnable = '已启用'.tr;
|
final String notifyEnable = '已启用'.tr;
|
||||||
final String notifyDisable = '未启用'.tr;
|
final String notifyDisable = '未启用'.tr;
|
||||||
final String settingSuccess = '设置成功'.tr;
|
final String settingSuccess = '设置成功'.tr;
|
||||||
|
var isSupportCatEye = false.obs;
|
||||||
|
|
||||||
MsgNotificationState() {
|
MsgNotificationState() {
|
||||||
Map map = Get.arguments;
|
Map map = Get.arguments;
|
||||||
if (map['lockId'] != null) {
|
if (map['lockId'] != null) {
|
||||||
getLockId.value = map['lockId'];
|
getLockId.value = map['lockId'];
|
||||||
}
|
}
|
||||||
|
if (map['isSupportCatEye'] != null) {
|
||||||
|
isSupportCatEye.value = map['isSupportCatEye'] == 1;
|
||||||
|
}
|
||||||
|
|
||||||
nDaysNotOpenDoor.value = notifyEnable;
|
nDaysNotOpenDoor.value = notifyEnable;
|
||||||
isLowBattery.value = notifyEnable;
|
isLowBattery.value = notifyEnable;
|
||||||
|
|||||||
@ -2,6 +2,7 @@ import 'package:flutter_easyloading/flutter_easyloading.dart';
|
|||||||
|
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:star_lock/app_settings/app_settings.dart';
|
import 'package:star_lock/app_settings/app_settings.dart';
|
||||||
|
import 'package:star_lock/tools/showTipView.dart';
|
||||||
import '../appRouters.dart';
|
import '../appRouters.dart';
|
||||||
import '../flavors.dart';
|
import '../flavors.dart';
|
||||||
import 'api.dart';
|
import 'api.dart';
|
||||||
@ -100,6 +101,9 @@ class BaseProvider extends GetConnect with Api {
|
|||||||
case 10001:
|
case 10001:
|
||||||
EasyLoading.showToast('数据不存在', duration: 2000.milliseconds);
|
EasyLoading.showToast('数据不存在', duration: 2000.milliseconds);
|
||||||
break;
|
break;
|
||||||
|
case 434: //与后台约定弹出确认框提示
|
||||||
|
ShowTipView().showSureBtnTipsAlert(T['errorMsg']);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,7 +13,8 @@ typedef BlockIsHaveAllDataCallback = void Function(bool isAllData);
|
|||||||
|
|
||||||
class ShowTipView {
|
class ShowTipView {
|
||||||
// 只有一个确定按钮
|
// 只有一个确定按钮
|
||||||
void showSureAlertDialog(String contentStr, {String? tipTitle, String? sureStr}) {
|
void showSureAlertDialog(String contentStr,
|
||||||
|
{String? tipTitle, String? sureStr}) {
|
||||||
showCupertinoDialog(
|
showCupertinoDialog(
|
||||||
context: Get.context!,
|
context: Get.context!,
|
||||||
builder: (BuildContext 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: <Widget>[
|
||||||
|
CupertinoDialogAction(
|
||||||
|
child:
|
||||||
|
Text('确定'.tr, style: TextStyle(color: AppColors.mainColor)),
|
||||||
|
onPressed: Get.back,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user