1,新增设置有人按门铃接口对接

2,新增设置有人出现在门口接口对接
3,新增设置防撬报警通知接口对接
4,锁用户列表文件结构调整
This commit is contained in:
Daisy 2024-04-19 13:47:56 +08:00
parent 8534596be1
commit c4739c9f46
26 changed files with 577 additions and 56 deletions

View File

@ -726,5 +726,7 @@
"微信公众号推送":"Wechat public account",
"开启微信接收报警消息需要先关注斯凯智能锁微信公众号,请保存二维码并使用微信扫一扫设置":"To open wechat to receive alarm messages, you need to pay attention to Skye Smart Lock wechat public account first, please save the QR code and use wechat to scan the Settings",
"蓝牙":"Bluetooth",
"需要访问蓝牙权限才能使用添加钥匙功能的位置信息":"Access to Bluetooth permissions is required to use the location information of the add key function"
"需要访问蓝牙权限才能使用添加钥匙功能的位置信息":"Access to Bluetooth permissions is required to use the location information of the add key function",
"请输入Email":"Please enter Email",
"请输入手机号":"Please enter mobile phone number"
}

View File

@ -725,7 +725,7 @@
"微信公众号推送":"微信公众号推送",
"开启微信接收报警消息需要先关注斯凯智能锁微信公众号,请保存二维码并使用微信扫一扫设置":"开启微信接收报警消息需要先关注斯凯智能锁微信公众号,请保存二维码并使用微信扫一扫设置",
"蓝牙":"蓝牙",
"需要访问蓝牙权限才能使用添加钥匙功能的位置信息":"需要访问蓝牙权限才能使用添加钥匙功能的位置信息"
"需要访问蓝牙权限才能使用添加钥匙功能的位置信息":"需要访问蓝牙权限才能使用添加钥匙功能的位置信息",
"请输入Email":"请输入Email",
"请输入手机号":"请输入手机号"
}

View File

@ -727,6 +727,7 @@
"微信公众号推送":"微信公众号推送",
"开启微信接收报警消息需要先关注斯凯智能锁微信公众号,请保存二维码并使用微信扫一扫设置":"开启微信接收报警消息需要先关注斯凯智能锁微信公众号,请保存二维码并使用微信扫一扫设置",
"蓝牙":"蓝牙",
"需要访问蓝牙权限才能使用添加钥匙功能的位置信息":"需要访问蓝牙权限才能使用添加钥匙功能的位置信息"
"需要访问蓝牙权限才能使用添加钥匙功能的位置信息":"需要访问蓝牙权限才能使用添加钥匙功能的位置信息",
"请输入Email":"请输入Email",
"请输入手机号":"请输入手机号"
}

View File

@ -18,12 +18,12 @@ import 'package:star_lock/main/lockDetail/lockSet/catEyeSet/catEyeSet/catEyeSet_
import 'package:star_lock/main/lockDetail/lockSet/catEyeSet/videoSlot/videoSlot_page.dart';
import 'package:star_lock/main/lockDetail/lockSet/faceUnlock/faceUnlock_page.dart';
import 'package:star_lock/main/lockDetail/lockSet/liveVideo/liveVideo_page.dart';
import 'package:star_lock/main/lockDetail/lockSet/lockUser/lockUser_page.dart';
import 'package:star_lock/main/lockDetail/lockSet/motorPower/motorPower_page.dart';
import 'package:star_lock/main/lockDetail/lockSet/openDoorDirection/openDoorDirection_page.dart';
import 'package:star_lock/main/lockDetail/lockDetail/lockDetail_main_page.dart';
import 'package:star_lock/main/lockDetail/messageWarn/addFamily/addFamily_page.dart';
import 'package:star_lock/main/lockDetail/messageWarn/familyDetails/familyDetails_page.dart';
import 'package:star_lock/main/lockDetail/messageWarn/lockUser/lockUser_page.dart';
import 'package:star_lock/main/lockDetail/messageWarn/msgNotification/coerceOpenDoor/coerceFingerprint/coerceFingerprint_page.dart';
import 'package:star_lock/main/lockDetail/messageWarn/msgNotification/coerceOpenDoor/coerceFingerprintList/coerceFingerprintList_page.dart';
import 'package:star_lock/main/lockDetail/messageWarn/msgNotification/coerceOpenDoor/coerceOpenDoor/coerceOpenDoor_page.dart';

View File

@ -1,6 +0,0 @@
import 'package:star_lock/main/lockDetail/lockSet/lockUser/lockUser_state.dart';
import 'package:star_lock/tools/baseGetXController.dart';
class LockUserLogic extends BaseGetXController {
final LockUserState state = LockUserState();
}

View File

@ -0,0 +1,6 @@
import 'package:star_lock/main/lockDetail/messageWarn/addFamily/addFamily_state.dart';
import 'package:star_lock/tools/baseGetXController.dart';
class AddFamilyLogic extends BaseGetXController {
final AddFamilyState state = AddFamilyState();
}

View File

@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:star_lock/appRouters.dart';
import 'package:star_lock/main/lockDetail/messageWarn/addFamily/addFamily_logic.dart';
import 'package:star_lock/tools/commonItem.dart';
import 'package:star_lock/tools/submitBtn.dart';
@ -16,6 +17,9 @@ class AddFamilyPage extends StatefulWidget {
}
class _AddFamilyPageState extends State<AddFamilyPage> {
final logic = Get.put(AddFamilyLogic());
final state = Get.find<AddFamilyLogic>().state;
@override
Widget build(BuildContext context) {
return Scaffold(
@ -35,7 +39,8 @@ class _AddFamilyPageState extends State<AddFamilyPage> {
isHaveDirection: true,
action: () {
//
Get.toNamed(Routers.lockUserPage);
Get.toNamed(Routers.lockUserPage,
arguments: {'getLockId': state.getLockId.value});
}),
CommonItem(
leftTitel: '家人',

View File

@ -0,0 +1,12 @@
import 'package:get/get.dart';
class AddFamilyState {
var getLockId = 0.obs;
AddFamilyState() {
Map map = Get.arguments;
if (map['getLockId'] != null) {
getLockId.value = map['getLockId'];
}
}
}

View File

@ -4,4 +4,12 @@ import 'package:get/get.dart';
class FamilyDetailsState {
TextEditingController changeNameController = TextEditingController(); //
var familyName = ''.obs;
var getLockId = 0.obs;
FamilyDetailsState() {
Map map = Get.arguments;
if (map['lockId'] != null) {
getLockId.value = map['lockId'];
}
}
}

View File

@ -0,0 +1,312 @@
class LockUserEntity {
int? errorCode;
String? description;
String? errorMsg;
List<LockUserData>? data;
LockUserEntity({this.errorCode, this.description, this.errorMsg, this.data});
LockUserEntity.fromJson(Map<String, dynamic> json) {
errorCode = json['errorCode'];
description = json['description'];
errorMsg = json['errorMsg'];
if (json['data'] != null) {
data = <LockUserData>[];
json['data'].forEach((v) {
data!.add(LockUserData.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['errorCode'] = errorCode;
data['description'] = description;
data['errorMsg'] = errorMsg;
if (this.data != null) {
data['data'] = this.data!.map((v) => v.toJson()).toList();
}
return data;
}
}
class LockUserData {
int? openLockType;
String? openLockTypeName;
List<LockUserListKeys>? lockUserList;
LockUserData({this.openLockType, this.openLockTypeName, this.lockUserList});
LockUserData.fromJson(Map<String, dynamic> json) {
openLockType = json['openLockType'];
openLockTypeName = json['openLockTypeName'];
if (json['keys'] != null) {
lockUserList = <LockUserListKeys>[];
json['keys'].forEach((v) {
lockUserList!.add(LockUserListKeys.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['openLockType'] = openLockType;
data['openLockTypeName'] = openLockTypeName;
if (lockUserList != null) {
data['keys'] = lockUserList!.map((v) => v.toJson()).toList();
}
return data;
}
}
class LockUserListKeys {
int? id;
String? clientId;
int? lockOwnerId;
int? apiUserId;
int? lockId;
int? senderUserId;
int? receiverUsernameType;
String? keyName;
int? keyType;
int? startDate;
int? endDate;
List? weekDays;
String? remarks;
int? remoteEnable;
int? isCameraEnable;
int? faceAuthentication;
int? lastFaceValidateTime;
int? keyRight;
int? remoteUnlockSwitch;
int? userType;
int? keyStatus;
int? groupId;
int? lockUserNo;
int? businessId;
String? createdAt;
String? updatedAt;
int? isOnlyManageSelf;
UserInfo? userInfo;
UserInfo? userSender;
int? keyboardPwdType;
int? keyboardPwdStatus;
String? keyboardPwdName;
String? keyboardPwd;
String? keyboardPwdHash;
int? addType;
int? pwdRight;
int? isCustom;
int? isCoerced;
int? hoursStart;
int? hoursEnd;
int? pwdUserNo;
String? senderUsername;
int? keyboardPwdId;
int? sendDate;
LockUserListKeys(
{this.id,
this.clientId,
this.lockOwnerId,
this.apiUserId,
this.lockId,
this.senderUserId,
this.receiverUsernameType,
this.keyName,
this.keyType,
this.startDate,
this.endDate,
this.weekDays,
this.remarks,
this.remoteEnable,
this.isCameraEnable,
this.faceAuthentication,
this.lastFaceValidateTime,
this.keyRight,
this.remoteUnlockSwitch,
this.userType,
this.keyStatus,
this.groupId,
this.lockUserNo,
this.businessId,
this.createdAt,
this.updatedAt,
this.isOnlyManageSelf,
this.userInfo,
this.userSender,
this.keyboardPwdType,
this.keyboardPwdStatus,
this.keyboardPwdName,
this.keyboardPwd,
this.keyboardPwdHash,
this.addType,
this.pwdRight,
this.isCustom,
this.isCoerced,
this.hoursStart,
this.hoursEnd,
this.pwdUserNo,
this.senderUsername,
this.keyboardPwdId,
this.sendDate});
LockUserListKeys.fromJson(Map<String, dynamic> json) {
id = json['id'];
clientId = json['clientId'];
lockOwnerId = json['lockOwnerId'];
apiUserId = json['apiUserId'];
lockId = json['lockId'];
senderUserId = json['senderUserId'];
receiverUsernameType = json['receiverUsernameType'];
keyName = json['keyName'];
keyType = json['keyType'];
startDate = json['startDate'];
endDate = json['endDate'];
if (json['weekDays'] != null) {
weekDays = [];
json['weekDays'].forEach((v) {
weekDays!.add(v);
});
}
remarks = json['remarks'];
remoteEnable = json['remoteEnable'];
isCameraEnable = json['isCameraEnable'];
faceAuthentication = json['faceAuthentication'];
lastFaceValidateTime = json['lastFaceValidateTime'];
keyRight = json['keyRight'];
remoteUnlockSwitch = json['remoteUnlockSwitch'];
userType = json['userType'];
keyStatus = json['keyStatus'];
groupId = json['groupId'];
lockUserNo = json['lockUserNo'];
businessId = json['businessId'];
createdAt = json['created_at'];
updatedAt = json['updated_at'];
isOnlyManageSelf = json['isOnlyManageSelf'];
userInfo =
json['user_info'] != null ? UserInfo.fromJson(json['user_info']) : null;
userSender = json['user_sender'] != null
? UserInfo.fromJson(json['user_sender'])
: null;
keyboardPwdType = json['keyboardPwdType'];
keyboardPwdStatus = json['keyboardPwdStatus'];
keyboardPwdName = json['keyboardPwdName'];
keyboardPwd = json['keyboardPwd'];
keyboardPwdHash = json['keyboardPwdHash'];
addType = json['addType'];
pwdRight = json['pwdRight'];
isCustom = json['isCustom'];
isCoerced = json['isCoerced'];
hoursStart = json['hoursStart'];
hoursEnd = json['hoursEnd'];
pwdUserNo = json['pwdUserNo'];
senderUsername = json['senderUsername'];
keyboardPwdId = json['keyboardPwdId'];
sendDate = json['sendDate'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['id'] = id;
data['clientId'] = clientId;
data['lockOwnerId'] = lockOwnerId;
data['apiUserId'] = apiUserId;
data['lockId'] = lockId;
data['senderUserId'] = senderUserId;
data['receiverUsernameType'] = receiverUsernameType;
data['keyName'] = keyName;
data['keyType'] = keyType;
data['startDate'] = startDate;
data['endDate'] = endDate;
if (weekDays != null) {
data['weekDays'] = weekDays!.map((v) => v).toList();
}
data['remarks'] = remarks;
data['remoteEnable'] = remoteEnable;
data['isCameraEnable'] = isCameraEnable;
data['faceAuthentication'] = faceAuthentication;
data['lastFaceValidateTime'] = lastFaceValidateTime;
data['keyRight'] = keyRight;
data['remoteUnlockSwitch'] = remoteUnlockSwitch;
data['userType'] = userType;
data['keyStatus'] = keyStatus;
data['groupId'] = groupId;
data['lockUserNo'] = lockUserNo;
data['businessId'] = businessId;
data['created_at'] = createdAt;
data['updated_at'] = updatedAt;
data['isOnlyManageSelf'] = isOnlyManageSelf;
if (userInfo != null) {
data['user_info'] = userInfo!.toJson();
}
if (userSender != null) {
data['user_sender'] = userSender!.toJson();
}
data['keyboardPwdType'] = keyboardPwdType;
data['keyboardPwdStatus'] = keyboardPwdStatus;
data['keyboardPwdName'] = keyboardPwdName;
data['keyboardPwd'] = keyboardPwd;
data['keyboardPwdHash'] = keyboardPwdHash;
data['addType'] = addType;
data['pwdRight'] = pwdRight;
data['isCustom'] = isCustom;
data['isCoerced'] = isCoerced;
data['hoursStart'] = hoursStart;
data['hoursEnd'] = hoursEnd;
data['pwdUserNo'] = pwdUserNo;
data['senderUsername'] = senderUsername;
data['keyboardPwdId'] = keyboardPwdId;
data['sendDate'] = sendDate;
return data;
}
}
class UserInfo {
int? id;
String? clientId;
String? username;
String? accountName;
String? businessQueryStr;
String? password;
int? date;
String? createdAt;
String? updatedAt;
UserInfo(
{this.id,
this.clientId,
this.username,
this.accountName,
this.businessQueryStr,
this.password,
this.date,
this.createdAt,
this.updatedAt});
UserInfo.fromJson(Map<String, dynamic> json) {
id = json['id'];
clientId = json['client_id'];
username = json['username'];
accountName = json['account_name'];
businessQueryStr = json['businessQueryStr'];
password = json['password'];
date = json['date'];
createdAt = json['created_at'];
updatedAt = json['updated_at'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['id'] = id;
data['client_id'] = clientId;
data['username'] = username;
data['account_name'] = accountName;
data['businessQueryStr'] = businessQueryStr;
data['password'] = password;
data['date'] = date;
data['created_at'] = createdAt;
data['updated_at'] = updatedAt;
return data;
}
}

View File

@ -0,0 +1,16 @@
import 'package:star_lock/main/lockDetail/messageWarn/lockUser/lockUser_entity.dart';
import 'package:star_lock/main/lockDetail/messageWarn/lockUser/lockUser_state.dart';
import 'package:star_lock/network/api_repository.dart';
import 'package:star_lock/tools/baseGetXController.dart';
class LockUserLogic extends BaseGetXController {
final LockUserState state = LockUserState();
//
void getLockNoticeSetting() async {
LockUserEntity entity = await ApiRepository.to.getLockKeysList(
lockId: state.getLockId.value,
);
if (entity.errorCode!.codeIsSuccessful) {}
}
}

View File

@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:star_lock/main/lockDetail/lockSet/lockUser/lockUser_logic.dart';
import 'package:star_lock/main/lockDetail/messageWarn/lockUser/lockUser_logic.dart';
import '../../../../app_settings/app_colors.dart';
import '../../../../tools/submitBtn.dart';
import '../../../../tools/titleAppBar.dart';
@ -18,6 +18,13 @@ class _LockUserPageState extends State<LockUserPage> {
final logic = Get.put(LockUserLogic());
final state = Get.find<LockUserLogic>().state;
@override
initState() {
super.initState();
logic.getLockNoticeSetting();
}
@override
Widget build(BuildContext context) {
return Scaffold(

View File

@ -4,4 +4,12 @@ import 'package:get/get.dart';
class LockUserState {
TextEditingController searchController = TextEditingController(); ///
var isCheck = false.obs;
var getLockId = 0.obs;
LockUserState() {
Map map = Get.arguments;
if (map['getLockId'] != null) {
getLockId.value = map['getLockId'];
}
}
}

View File

@ -0,0 +1,6 @@
import 'package:star_lock/main/lockDetail/messageWarn/msgNotification/coerceOpenDoor/coerceFingerprintList/coerceFingerprintList_state.dart';
import 'package:star_lock/tools/baseGetXController.dart';
class CoerceFingerprintListLogic extends BaseGetXController {
final CoerceFingerprintListState state = CoerceFingerprintListState();
}

View File

@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:star_lock/main/lockDetail/lockSet/lockUser/lockUser_logic.dart';
import 'package:star_lock/main/lockDetail/messageWarn/msgNotification/coerceOpenDoor/coerceFingerprintList/coerceFingerprintList_logic.dart';
import '../../../../../../app_settings/app_colors.dart';
import '../../../../../../tools/submitBtn.dart';
@ -17,8 +17,8 @@ class CoerceFingerprintListPage extends StatefulWidget {
}
class _CoerceFingerprintListPageState extends State<CoerceFingerprintListPage> {
final logic = Get.put(LockUserLogic());
final state = Get.find<LockUserLogic>().state;
final logic = Get.put(CoerceFingerprintListLogic());
final state = Get.find<CoerceFingerprintListLogic>().state;
@override
Widget build(BuildContext context) {

View File

@ -0,0 +1,7 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
class CoerceFingerprintListState {
TextEditingController searchController = TextEditingController(); ///
var isCheck = false.obs;
}

View File

@ -2,7 +2,7 @@ class MsgNotificationEntity {
int? errorCode;
String? description;
String? errorMsg;
Data? data;
MsgNoticeData? data;
MsgNotificationEntity(
{this.errorCode, this.description, this.errorMsg, this.data});
@ -11,7 +11,7 @@ class MsgNotificationEntity {
errorCode = json['errorCode'];
description = json['description'];
errorMsg = json['errorMsg'];
data = json['data'] != null ? Data.fromJson(json['data']) : null;
data = json['data'] != null ? MsgNoticeData.fromJson(json['data']) : null;
}
Map<String, dynamic> toJson() {
@ -26,7 +26,7 @@ class MsgNotificationEntity {
}
}
class Data {
class MsgNoticeData {
List? openDoorNoticeList;
int? dayNotOpenDoorState;
int? dayNotOpenDoorValue;
@ -39,7 +39,7 @@ class Data {
int? doorbellNoticeState;
int? someoneAtDoorNoticeState;
Data(
MsgNoticeData(
{this.openDoorNoticeList,
this.dayNotOpenDoorState,
this.dayNotOpenDoorValue,
@ -52,7 +52,7 @@ class Data {
this.doorbellNoticeState,
this.someoneAtDoorNoticeState});
Data.fromJson(Map<String, dynamic> json) {
MsgNoticeData.fromJson(Map<String, dynamic> json) {
if (json['openDoorNoticeList'] != null) {
openDoorNoticeList = [];
json['openDoorNoticeList'].forEach((v) {

View File

@ -12,14 +12,15 @@ class MsgNotificationLogic extends BaseGetXController {
lockId: state.getLockId.value,
);
if (entity.errorCode!.codeIsSuccessful) {
state.msgNoticeInfo.value = entity.data!;
state.nDaysNotOpenDoor.value =
entity.data!.dayNotOpenDoorState! == 0 ? '未启用' : '已启用';
entity.data!.dayNotOpenDoorState! == 0 ? '未启用' : '已启用'; //N天未开门
state.isDoorNotShut.value =
entity.data!.doorNotCloseState! == 0 ? false : true;
entity.data!.doorNotCloseState! == 0 ? false : true; //
state.isTamperAlarm.value =
entity.data!.tamperAlarmState! == 0 ? '未启用' : '已启用';
entity.data!.tamperAlarmState! == 0 ? false : true; //
state.isLowBattery.value =
entity.data!.lowElecNoticeState! == 0 ? '未启用' : '已启用';
entity.data!.lowElecNoticeState! == 0 ? '未启用' : '已启用'; //
state.isSomeoneRing.value =
entity.data!.doorbellNoticeState! == 0 ? false : true; //
state.isSomeoneAppeared.value =
@ -38,4 +39,40 @@ class MsgNotificationLogic extends BaseGetXController {
showToast('设置成功');
}
}
//
void updateDoorbellNoticeStateSetting() async {
MsgNotificationEntity entity =
await ApiRepository.to.updateDoorbellNoticeStateSetting(
lockId: state.getLockId.value,
doorbellNoticeState: state.isSomeoneRing.value ? 1 : 0,
);
if (entity.errorCode!.codeIsSuccessful) {
showToast('设置成功');
}
}
//
void updateSomeoneAtDoorNoticeStateSetting() async {
MsgNotificationEntity entity =
await ApiRepository.to.updateSomeoneAtDoorNoticeStateSetting(
lockId: state.getLockId.value,
someoneAtDoorNoticeState: state.isSomeoneAppeared.value ? 1 : 0,
);
if (entity.errorCode!.codeIsSuccessful) {
showToast('设置成功');
}
}
//
void updateTamperAlarmStateSetting() async {
MsgNotificationEntity entity =
await ApiRepository.to.updateTamperAlarmStateSetting(
lockId: state.getLockId.value,
tamperAlarmState: state.isTamperAlarm.value ? 1 : 0,
);
if (entity.errorCode!.codeIsSuccessful) {
showToast('设置成功');
}
}
}

View File

@ -77,7 +77,10 @@ class _MsgNotificationPageState extends State<MsgNotificationPage> {
isHaveLine: true,
isHaveDirection: true,
action: () {
Get.toNamed(Routers.openDoorNotifyPage);
Get.toNamed(Routers.openDoorNotifyPage, arguments: {
'lockSetInfoData': state.msgNoticeInfo.value,
'lockId': state.getLockId.value
});
},
),
Obx(() => CommonItem(
@ -107,11 +110,15 @@ class _MsgNotificationPageState extends State<MsgNotificationPage> {
rightWidget:
SizedBox(width: 60.w, height: 50.h, child: _switch(2)))),
Obx(() => CommonItem(
leftTitel: '防拆报警',
rightTitle: state.isTamperAlarm.value,
isHaveLine: true,
isHaveDirection: true,
)),
leftTitel: '防拆报警',
rightTitle: '',
isHaveLine: true,
isHaveRightWidget: true,
rightWidget: SizedBox(
width: 60.w,
height: 50.h,
child: _switch(5),
))),
Obx(() => CommonItem(
leftTitel: '低电量提醒',
rightTitle: state.isLowBattery.value,
@ -192,6 +199,11 @@ class _MsgNotificationPageState extends State<MsgNotificationPage> {
case 4:
isCheck = state.isSomeoneAppeared.value;
break;
//
case 5:
isCheck = state.isTamperAlarm.value;
break;
//
default:
}
@ -215,11 +227,24 @@ class _MsgNotificationPageState extends State<MsgNotificationPage> {
break;
//
case 3:
state.isSomeoneRing.value = value;
{
state.isSomeoneRing.value = value;
logic.updateDoorbellNoticeStateSetting();
}
break;
//
case 4:
state.isSomeoneAppeared.value = value;
{
state.isSomeoneAppeared.value = value;
logic.updateSomeoneAtDoorNoticeStateSetting();
}
break;
//
case 5:
{
state.isTamperAlarm.value = value;
logic.updateTamperAlarmStateSetting();
}
break;
default:

View File

@ -1,11 +1,12 @@
import 'package:get/get.dart';
import 'package:star_lock/main/lockDetail/messageWarn/msgNotification/msgNotification/msgNotification_entity.dart';
class MsgNotificationState {
// var lockSetInfoData = LockSetInfoData().obs;
var msgNoticeInfo = MsgNoticeData().obs;
var getLockId = 0.obs;
var isCheck = false.obs;
var nDaysNotOpenDoor = '已启用'.obs; //N天未开门
var isTamperAlarm = '已启用'.obs; //
var isTamperAlarm = false.obs; //
var isLowBattery = '已启用'.obs; //
var isLeaveHomeOpenDoor = false.obs; //
var isDoorNotShut = false.obs; //

View File

@ -40,14 +40,11 @@ class _OpenDoorNotifyPageState extends State<OpenDoorNotifyPage> {
height: 20.h,
),
Expanded(child: _buildMainUI()),
// Expanded(
// child: Obx(() => state.itemDataList.value.isEmpty
// ? const NoData()
// : _buildMainUI(state.itemDataList.value))),
AddBottomWhiteBtn(
btnName: '添加家人',
onClick: () {
Get.toNamed(Routers.addFamilyPage);
Get.toNamed(Routers.addFamilyPage,
arguments: {'getLockId': state.getLockId.value});
},
),
SizedBox(
@ -70,7 +67,7 @@ class _OpenDoorNotifyPageState extends State<OpenDoorNotifyPage> {
Widget _buildMainUI() {
return ListView.separated(
shrinkWrap: true,
itemCount: 3,
itemCount: state.msgNoticeInfo.value.openDoorNoticeList?.length ?? 0,
itemBuilder: (c, index) {
return _electronicKeyItem(
'images/controls_user.png', '18682150237', '电子钥匙', () {
@ -111,7 +108,6 @@ class _OpenDoorNotifyPageState extends State<OpenDoorNotifyPage> {
mainAxisAlignment: MainAxisAlignment.center,
children: [
Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
familyAccount,

View File

@ -1,16 +1,20 @@
import 'package:get/get.dart';
import 'package:star_lock/main/lockDetail/lockSet/lockSet/lockSetInfo_entity.dart';
import 'package:star_lock/main/lockDetail/messageWarn/msgNotification/msgNotification/msgNotification_entity.dart';
class OpenDoorNotifyState {
var lockSetInfoData = LockSetInfoData().obs;
var msgNoticeInfo = MsgNoticeData().obs;
var pageNum = 1.obs; //
final pageSize = 20.obs; //
final itemDataList = [].obs;
var itemDataList = [].obs;
var getLockId = 0.obs;
OpenDoorNotifyState() {
Map map = Get.arguments;
if (map['lockSetInfoData'] != null) {
lockSetInfoData.value = map['lockSetInfoData'];
if (map['msgNoticeInfo'] != null) {
msgNoticeInfo.value = map['msgNoticeInfo'];
}
if (map['lockId'] != null) {
getLockId.value = map['lockId'];
}
}
}

View File

@ -128,7 +128,7 @@ class _NotificationModePageState extends State<NotificationModePage> {
height: 60.h,
),
SubmitBtn(
btnName: '确定',
btnName: '确定'.tr,
onClick: () {},
)
],
@ -175,8 +175,8 @@ class _NotificationModePageState extends State<NotificationModePage> {
isHaveLine: true,
isHaveRightWidget: true,
rightWidget: isEmail
? getEmailTFWidget('请输入Email', 1)
: getPhoneWidget('请输入手机号', 1)),
? getEmailTFWidget('请输入Email'.tr, 1)
: getPhoneWidget('请输入手机号'.tr, 1)),
Divider(
color: AppColors.greyLineColor,
indent: 20.w,
@ -216,8 +216,6 @@ class _NotificationModePageState extends State<NotificationModePage> {
autofocus: false,
textAlign: TextAlign.end,
decoration: InputDecoration(
//
contentPadding: const EdgeInsets.only(top: -12.0, bottom: 0.0),
hintText: tfStr,
hintStyle: TextStyle(fontSize: 22.sp),
//线
@ -282,8 +280,6 @@ class _NotificationModePageState extends State<NotificationModePage> {
autofocus: false,
textAlign: TextAlign.end,
decoration: InputDecoration(
//
contentPadding: const EdgeInsets.only(top: -12.0, bottom: 0.0),
hintText: tfStr,
hintStyle: TextStyle(fontSize: 22.sp),
//线

View File

@ -198,6 +198,7 @@ abstract class Api {
'/lockSetting/getLockNoticeSetting'; //
final String updateLockNoticeSettingURL =
'/lockSetting/updateLockNoticeSetting'; //
final String lockKeysListURL = '/lock/lockKeysList'; //
final String setWechatPushSwitchURL =
'/user/setMpWechatPushSwitch'; //

View File

@ -1813,6 +1813,46 @@ class ApiProvider extends BaseProvider {
'doorNotCloseState': doorNotCloseState,
}));
//
Future<Response> updateDoorbellNoticeStateSetting(
int lockId,
int doorbellNoticeState,
) =>
post(
updateLockNoticeSettingURL.toUrl,
jsonEncode({
'lockId': lockId,
'doorbellNoticeState': doorbellNoticeState,
}));
//
Future<Response> updateSomeoneAtDoorNoticeStateSetting(
int lockId,
int someoneAtDoorNoticeState,
) =>
post(
updateLockNoticeSettingURL.toUrl,
jsonEncode({
'lockId': lockId,
'someoneAtDoorNoticeState': someoneAtDoorNoticeState,
}));
//
Future<Response> updaTetamperAlarmStateSetting(
int lockId,
int tamperAlarmState,
) =>
post(
updateLockNoticeSettingURL.toUrl,
jsonEncode({
'lockId': lockId,
'tamperAlarmState': tamperAlarmState,
}));
//
Future<Response> getLockKeysList(int lockId) =>
post(lockKeysListURL.toUrl, jsonEncode({'lockId': lockId}));
//
Future<Response> setMpWechatPushSwitch(int mpWechatPushSwitch) => post(
setWechatPushSwitchURL.toUrl,

View File

@ -7,6 +7,7 @@ import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/ma
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupListEntity.dart';
import 'package:star_lock/main/lockDetail/face/addFace/addFace_entity.dart';
import 'package:star_lock/main/lockDetail/lockSet/basicInformation/basicInformation/KeyDetailEntity.dart';
import 'package:star_lock/main/lockDetail/messageWarn/lockUser/lockUser_entity.dart';
import 'package:star_lock/main/lockDetail/messageWarn/msgNotification/msgNotification/msgNotification_entity.dart';
import 'package:star_lock/main/lockDetail/passwordKey/passwordKeyList/passwordKeyListEntity.dart';
import 'package:star_lock/main/lockDetail/passwordKey/passwordKey_perpetual/passwordKeyEntity.dart';
@ -1839,6 +1840,42 @@ class ApiRepository {
return MsgNotificationEntity.fromJson(res.body);
}
//
Future<MsgNotificationEntity> updateDoorbellNoticeStateSetting({
required int lockId,
required int doorbellNoticeState,
}) async {
final res = await apiProvider.updateDoorbellNoticeStateSetting(
lockId, doorbellNoticeState);
return MsgNotificationEntity.fromJson(res.body);
}
//
Future<MsgNotificationEntity> updateSomeoneAtDoorNoticeStateSetting({
required int lockId,
required int someoneAtDoorNoticeState,
}) async {
final res = await apiProvider.updateSomeoneAtDoorNoticeStateSetting(
lockId, someoneAtDoorNoticeState);
return MsgNotificationEntity.fromJson(res.body);
}
//
Future<MsgNotificationEntity> updateTamperAlarmStateSetting({
required int lockId,
required int tamperAlarmState,
}) async {
final res = await apiProvider.updaTetamperAlarmStateSetting(
lockId, tamperAlarmState);
return MsgNotificationEntity.fromJson(res.body);
}
//
Future<LockUserEntity> getLockKeysList({required int lockId}) async {
final res = await apiProvider.getLockKeysList(lockId);
return LockUserEntity.fromJson(res.body);
}
//
Future<VersionUndateEntity> setMpWechatPushSwitch(
{required int mpWechatPushSwitch}) async {