Merge branch 'master' of https://gitee.com/starlock-cn/app-starlock
This commit is contained in:
commit
92d5a3b473
@ -770,6 +770,13 @@
|
|||||||
"短信提醒":"SMS reminder",
|
"短信提醒":"SMS reminder",
|
||||||
"邮件提醒":"Email reminder",
|
"邮件提醒":"Email reminder",
|
||||||
"N天未开门提醒":"N days did not open the door reminder",
|
"N天未开门提醒":"N days did not open the door reminder",
|
||||||
|
"当被胁迫要求强行开锁时,使用胁迫指纹会触发报警,报警消息会推送给管理员,该功能需要锁联网":"When forced to open the lock, the use of coercive fingerprint will trigger the alarm, the alarm message will be pushed to the administrator, the function requires the lock network",
|
||||||
|
"胁迫指纹":"Stress fingerprint",
|
||||||
|
"指纹列表":"Fingerprint list",
|
||||||
|
"经过以上设定的时间,锁没有被开启,系统会给指定对象发送提醒消息,该功能需要锁联网":"After the above set time, the lock is not opened, the system will send a reminder message to the specified object, this function requires the lock network",
|
||||||
|
"打开提醒后,当锁电量低于20%、10%和5%,系统会给指定对象发送提醒消息。电量读取方式:网关读取或APP读取。":"After the reminder is enabled, when the lock power is below 20%, 10%, and 5%, the system will send a reminder message to the specified object. Power reading mode: gateway reading or APP reading.",
|
||||||
|
"门未开时间":"Door not open time",
|
||||||
|
"添加和使用面容开锁时:":"Add and use Face when unlocking:",
|
||||||
"关锁":"close lock",
|
"关锁":"close lock",
|
||||||
"功能":"function",
|
"功能":"function",
|
||||||
"配件":"parts"
|
"配件":"parts"
|
||||||
|
|||||||
@ -771,5 +771,12 @@
|
|||||||
"关锁":"Close Lock",
|
"关锁":"Close Lock",
|
||||||
"功能":"Function",
|
"功能":"Function",
|
||||||
"配件":"Parts",
|
"配件":"Parts",
|
||||||
"N天未开门提醒":"N天未开门提醒"
|
"N天未开门提醒":"N天未开门提醒",
|
||||||
|
"当被胁迫要求强行开锁时,使用胁迫指纹会触发报警,报警消息会推送给管理员,该功能需要锁联网":"当被胁迫要求强行开锁时,使用胁迫指纹会触发报警,报警消息会推送给管理员,该功能需要锁联网",
|
||||||
|
"胁迫指纹":"胁迫指纹",
|
||||||
|
"指纹列表":"指纹列表",
|
||||||
|
"经过以上设定的时间,锁没有被开启,系统会给指定对象发送提醒消息,该功能需要锁联网":"经过以上设定的时间,锁没有被开启,系统会给指定对象发送提醒消息,该功能需要锁联网",
|
||||||
|
"打开提醒后,当锁电量低于20%、10%和5%,系统会给指定对象发送提醒消息。电量读取方式:网关读取或APP读取。":"打开提醒后,当锁电量低于20%、10%和5%,系统会给指定对象发送提醒消息。电量读取方式:网关读取或APP读取。",
|
||||||
|
"门未开时间":"门未开时间",
|
||||||
|
"添加和使用面容开锁时:":"添加和使用面容开锁时:"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -774,5 +774,12 @@
|
|||||||
"关锁":"关锁",
|
"关锁":"关锁",
|
||||||
"功能":"功能",
|
"功能":"功能",
|
||||||
"配件":"配件",
|
"配件":"配件",
|
||||||
"N天未开门提醒":"N天未开门提醒"
|
"N天未开门提醒":"N天未开门提醒",
|
||||||
|
"当被胁迫要求强行开锁时,使用胁迫指纹会触发报警,报警消息会推送给管理员,该功能需要锁联网":"当被胁迫要求强行开锁时,使用胁迫指纹会触发报警,报警消息会推送给管理员,该功能需要锁联网",
|
||||||
|
"胁迫指纹":"胁迫指纹",
|
||||||
|
"指纹列表":"指纹列表",
|
||||||
|
"经过以上设定的时间,锁没有被开启,系统会给指定对象发送提醒消息,该功能需要锁联网":"经过以上设定的时间,锁没有被开启,系统会给指定对象发送提醒消息,该功能需要锁联网",
|
||||||
|
"打开提醒后,当锁电量低于20%、10%和5%,系统会给指定对象发送提醒消息。电量读取方式:网关读取或APP读取。":"打开提醒后,当锁电量低于20%、10%和5%,系统会给指定对象发送提醒消息。电量读取方式:网关读取或APP读取。",
|
||||||
|
"门未开时间":"门未开时间",
|
||||||
|
"添加和使用面容开锁时:":"添加和使用面容开锁时:"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -116,7 +116,6 @@ class _LockUserPageState extends State<LockUserPage> {
|
|||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Row(
|
Row(
|
||||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
lockUserKeys.currentKeyName ?? '',
|
lockUserKeys.currentKeyName ?? '',
|
||||||
|
|||||||
@ -0,0 +1,147 @@
|
|||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:star_lock/main/lockDetail/messageWarn/msgNotification/coerceOpenDoor/coerceFingerprint/coerceFingerprint_state.dart';
|
||||||
|
import 'package:star_lock/main/lockDetail/messageWarn/msgNotification/openDoorNotify/openDoorNotify_entity.dart';
|
||||||
|
import 'package:star_lock/main/lockDetail/messageWarn/notificationMode/notificationMode_data.dart';
|
||||||
|
import 'package:star_lock/network/api_repository.dart';
|
||||||
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
|
|
||||||
|
class CoerceFingerprintLogic extends BaseGetXController {
|
||||||
|
final CoerceFingerprintState state = CoerceFingerprintState();
|
||||||
|
|
||||||
|
//添加胁迫开门通知
|
||||||
|
void addLockNoticeSetting() async {
|
||||||
|
var entity = await ApiRepository.to.addLockNoticeSetting(
|
||||||
|
lockId: state.getLockId.value,
|
||||||
|
noticeType: 20,
|
||||||
|
settingValue: {
|
||||||
|
'openDoorId': state.fingerprintData.value.fingerprintId,
|
||||||
|
'openDoorType': 4,
|
||||||
|
'remark': state.fingerprintData.value.fingerprintName ?? '',
|
||||||
|
'noticeWay': [
|
||||||
|
{'type': 'mail', 'accounts': getEmailAndSMSAccountList(true)},
|
||||||
|
{'type': 'sms', 'accounts': getEmailAndSMSAccountList(false)}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
);
|
||||||
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
|
showToast('添加成功'.tr);
|
||||||
|
Get.back(result: true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//删除开门通知
|
||||||
|
void deleteLockNoticeSetting() async {
|
||||||
|
var entity = await ApiRepository.to.deleteLockNoticeSettingAccount(
|
||||||
|
lockNoticeSettingAccountId: state.familyData.value.id!,
|
||||||
|
);
|
||||||
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
|
showToast('删除成功'.tr);
|
||||||
|
Get.back(result: true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取到家人信息的请求数组
|
||||||
|
List getEmailAndSMSAccountList(bool isEmail) {
|
||||||
|
List list = [];
|
||||||
|
List accountList = [];
|
||||||
|
isEmail
|
||||||
|
? accountList = state.emailReceiverList.value
|
||||||
|
: accountList = state.phoneReceiverList.value;
|
||||||
|
for (int i = 0; i < accountList.length; i++) {
|
||||||
|
MsgNoticeModeData item = accountList[i];
|
||||||
|
Map map = {};
|
||||||
|
map['countryCode'] = isEmail ? 0 : item.countryCode;
|
||||||
|
map['account'] = isEmail ? item.receiveEmail : item.receivePhone;
|
||||||
|
list.add(map);
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
String getEmailListStr(Map val) {
|
||||||
|
String emailListStr = '';
|
||||||
|
if (val['emailReceiverList'] != null) {
|
||||||
|
state.emailReceiverList.value = val['emailReceiverList'];
|
||||||
|
List emailReceiverList = state.emailReceiverList.value;
|
||||||
|
for (int i = 0; i < emailReceiverList.length; i++) {
|
||||||
|
MsgNoticeModeData item = emailReceiverList[i];
|
||||||
|
emailListStr += item.receiveEmail;
|
||||||
|
// 检查是否为最后一个元素
|
||||||
|
if (i < emailReceiverList.length - 1) {
|
||||||
|
emailListStr += ',';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return emailListStr;
|
||||||
|
}
|
||||||
|
|
||||||
|
String getPhoneListStr(Map val) {
|
||||||
|
String phoneListStr = '';
|
||||||
|
|
||||||
|
if (val['phoneReceiverList'] != null) {
|
||||||
|
state.phoneReceiverList.value = val['phoneReceiverList'];
|
||||||
|
List phoneReceiverList = state.phoneReceiverList.value;
|
||||||
|
for (int i = 0; i < phoneReceiverList.length; i++) {
|
||||||
|
MsgNoticeModeData item = phoneReceiverList[i];
|
||||||
|
phoneListStr += item.receivePhone;
|
||||||
|
// 检查是否为最后一个元素
|
||||||
|
if (i < phoneReceiverList.length - 1) {
|
||||||
|
phoneListStr += ',';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return phoneListStr;
|
||||||
|
}
|
||||||
|
|
||||||
|
//检查按钮是否可用
|
||||||
|
bool checkBtnDisable() {
|
||||||
|
// if ((state.emailListStr.value.isEmpty ||
|
||||||
|
// state.phontListStr.value.isEmpty)) {
|
||||||
|
// return false;
|
||||||
|
// } else {
|
||||||
|
// return true;
|
||||||
|
// }
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
//根据列表返回值得到邮箱、手机列表
|
||||||
|
Map<String, List<MsgNoticeModeData>> getAccountsMap() {
|
||||||
|
List<MsgNoticeModeData> mailAccounts = [];
|
||||||
|
List<MsgNoticeModeData> smsAccounts = [];
|
||||||
|
|
||||||
|
if (state.familyData.value.settingValue != null) {
|
||||||
|
for (NoticeWay item
|
||||||
|
in state.familyData.value.settingValue!.noticeWayList!) {
|
||||||
|
if (item.type == 'mail' && item.accounts != null) {
|
||||||
|
for (Accounts account in item.accounts!) {
|
||||||
|
if (account.account != null) {
|
||||||
|
MsgNoticeModeData msgNoticeModeData = MsgNoticeModeData();
|
||||||
|
msgNoticeModeData.receiveEmail = account.account!;
|
||||||
|
mailAccounts.add(msgNoticeModeData);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (item.type == 'sms' && item.accounts != null) {
|
||||||
|
for (Accounts account in item.accounts!) {
|
||||||
|
if (account.account != null && account.countryCode != null) {
|
||||||
|
MsgNoticeModeData msgNoticeModeData = MsgNoticeModeData();
|
||||||
|
msgNoticeModeData.receivePhone = account.account!;
|
||||||
|
msgNoticeModeData.countryCode = account.countryCode!;
|
||||||
|
smsAccounts.add(msgNoticeModeData);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
'emailReceiverList': mailAccounts,
|
||||||
|
'phoneReceiverList': smsAccounts,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
onInit() {
|
||||||
|
super.onInit();
|
||||||
|
state.emailListStr.value = getEmailListStr(getAccountsMap());
|
||||||
|
state.phontListStr.value = getPhoneListStr(getAccountsMap());
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:star_lock/appRouters.dart';
|
import 'package:star_lock/appRouters.dart';
|
||||||
|
import 'package:star_lock/main/lockDetail/messageWarn/msgNotification/coerceOpenDoor/coerceFingerprint/coerceFingerprint_logic.dart';
|
||||||
import 'package:star_lock/tools/commonItem.dart';
|
import 'package:star_lock/tools/commonItem.dart';
|
||||||
import 'package:star_lock/tools/submitBtn.dart';
|
import 'package:star_lock/tools/submitBtn.dart';
|
||||||
|
|
||||||
@ -16,27 +17,39 @@ class CoerceFingerprintPage extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _CoerceFingerprintPageState extends State<CoerceFingerprintPage> {
|
class _CoerceFingerprintPageState extends State<CoerceFingerprintPage> {
|
||||||
|
final logic = Get.put(CoerceFingerprintLogic());
|
||||||
|
final state = Get.find<CoerceFingerprintLogic>().state;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: AppColors.mainBackgroundColor,
|
backgroundColor: AppColors.mainBackgroundColor,
|
||||||
appBar: TitleAppBar(
|
appBar: TitleAppBar(
|
||||||
barTitle: '胁迫指纹',
|
barTitle: state.isDetail.value == true ? '指纹详情'.tr : '胁迫指纹'.tr,
|
||||||
haveBack: true,
|
haveBack: true,
|
||||||
backgroundColor: AppColors.mainColor),
|
backgroundColor: AppColors.mainColor),
|
||||||
body: Container(
|
body: Container(
|
||||||
padding: EdgeInsets.all(30.w),
|
padding: EdgeInsets.all(30.w),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
CommonItem(
|
Obx(() => CommonItem(
|
||||||
leftTitel: '胁迫指纹',
|
leftTitel: '胁迫指纹'.tr,
|
||||||
rightTitle: '请选择',
|
rightTitle: state.isDetail.value == true
|
||||||
isHaveLine: true,
|
? state.familyData.value.settingValue!.remark!
|
||||||
isHaveDirection: true,
|
: state.fingerprintData.value.fingerprintName ?? '请选择'.tr,
|
||||||
action: () {
|
isHaveLine: true,
|
||||||
//锁用户
|
isHaveDirection: true,
|
||||||
Get.toNamed(Routers.coerceFingerprintListPage);
|
action: () {
|
||||||
}),
|
//锁用户
|
||||||
|
Get.toNamed(Routers.coerceFingerprintListPage,
|
||||||
|
arguments: {'lockId': state.getLockId.value})
|
||||||
|
?.then((val) {
|
||||||
|
if (val != null) {
|
||||||
|
state.fingerprintData.value = val;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
)),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 20.h,
|
height: 20.h,
|
||||||
),
|
),
|
||||||
@ -45,29 +58,44 @@ class _CoerceFingerprintPageState extends State<CoerceFingerprintPage> {
|
|||||||
margin: EdgeInsets.only(bottom: 10.h),
|
margin: EdgeInsets.only(bottom: 10.h),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
CommonItem(
|
GestureDetector(
|
||||||
leftTitel: '提醒方式'.tr,
|
onTap: () {
|
||||||
rightTitle: "",
|
Get.toNamed(Routers.notificationModePage,
|
||||||
isHaveLine: false,
|
arguments: {'familyData': state.familyData.value})
|
||||||
isHaveRightWidget: false,
|
?.then((val) {
|
||||||
isHaveDirection: true,
|
if (val != null) {
|
||||||
action: () {
|
state.emailListStr.value = logic.getEmailListStr(val);
|
||||||
Get.toNamed(Routers.notificationModePage);
|
state.phontListStr.value = logic.getPhoneListStr(val);
|
||||||
|
print(
|
||||||
|
'emailListStr:${state.emailListStr.value},phontListStr:${state.phontListStr.value}');
|
||||||
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
child: Container(
|
||||||
|
color: Colors.white,
|
||||||
|
margin: EdgeInsets.only(bottom: 10.h),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
CommonItem(
|
||||||
|
leftTitel: '提醒方式'.tr,
|
||||||
|
rightTitle: "",
|
||||||
|
isHaveLine: false,
|
||||||
|
isHaveRightWidget: false,
|
||||||
|
isHaveDirection: true,
|
||||||
|
),
|
||||||
|
_buildNotifyContain('APP推送'.tr, '管理员'.tr),
|
||||||
|
Obx(() => state.emailListStr.value.isNotEmpty
|
||||||
|
? _buildNotifyContain(
|
||||||
|
'邮件提醒'.tr, state.emailListStr.value)
|
||||||
|
: Container()),
|
||||||
|
Obx(() => state.phontListStr.value.isNotEmpty
|
||||||
|
? _buildNotifyContain(
|
||||||
|
'短信提醒'.tr, state.phontListStr.value)
|
||||||
|
: Container()),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
Container(
|
|
||||||
padding: EdgeInsets.only(
|
|
||||||
left: 10.w, right: 10.w, top: 12.h, bottom: 12.h),
|
|
||||||
margin: EdgeInsets.only(bottom: 20.h, top: 10.h),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: AppColors.mainBackgroundColor,
|
|
||||||
borderRadius: BorderRadius.circular(6.0.w),
|
|
||||||
),
|
|
||||||
child: Text(
|
|
||||||
'APP推送 管理员',
|
|
||||||
style: TextStyle(color: Colors.black, fontSize: 20.sp),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -75,11 +103,20 @@ class _CoerceFingerprintPageState extends State<CoerceFingerprintPage> {
|
|||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
height: 40.h,
|
height: 40.h,
|
||||||
)),
|
)),
|
||||||
SubmitBtn(
|
Obx(() => SubmitBtn(
|
||||||
btnName: '保存',
|
btnName: state.isDetail.value == true ? '删除'.tr : '保存'.tr,
|
||||||
isDisabled: false,
|
isDisabled: state.isDetail.value == true
|
||||||
onClick: () {},
|
? true
|
||||||
),
|
: logic.checkBtnDisable(),
|
||||||
|
isDelete: state.isDetail.value,
|
||||||
|
onClick: () {
|
||||||
|
if (state.isDetail.value) {
|
||||||
|
logic.deleteLockNoticeSetting();
|
||||||
|
} else {
|
||||||
|
logic.addLockNoticeSetting();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
)),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 60.h,
|
height: 60.h,
|
||||||
)
|
)
|
||||||
@ -88,4 +125,32 @@ class _CoerceFingerprintPageState extends State<CoerceFingerprintPage> {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Widget _buildNotifyContain(String notifyTitle, String notifyContent) {
|
||||||
|
return Container(
|
||||||
|
padding:
|
||||||
|
EdgeInsets.only(left: 10.w, right: 10.w, top: 12.h, bottom: 12.h),
|
||||||
|
margin: EdgeInsets.only(bottom: 20.h, top: 10.h, left: 20.w, right: 20.w),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: AppColors.mainBackgroundColor,
|
||||||
|
borderRadius: BorderRadius.circular(6.0.w),
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
notifyTitle,
|
||||||
|
style: TextStyle(color: Colors.black, fontSize: 20.sp),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: SizedBox(
|
||||||
|
width: 20.w,
|
||||||
|
)),
|
||||||
|
Text(notifyContent,
|
||||||
|
textAlign: TextAlign.end,
|
||||||
|
style: TextStyle(
|
||||||
|
color: AppColors.placeholderTextColor, fontSize: 20.sp)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,32 @@
|
|||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:star_lock/main/lockDetail/messageWarn/msgNotification/coerceOpenDoor/coerceFingerprintList/coerceFingerprintList_entity.dart';
|
||||||
|
import 'package:star_lock/main/lockDetail/messageWarn/msgNotification/openDoorNotify/openDoorNotify_entity.dart';
|
||||||
|
|
||||||
|
class CoerceFingerprintState {
|
||||||
|
var pageNum = 1.obs; //请求页码
|
||||||
|
final pageSize = 20.obs; //请求每页数据条数
|
||||||
|
final itemDataList = [].obs;
|
||||||
|
var getLockId = 0.obs;
|
||||||
|
var fingerprintData = CoerceFingerprintItemData().obs;
|
||||||
|
var emailReceiverList = [].obs;
|
||||||
|
var phoneReceiverList = [].obs;
|
||||||
|
var emailListStr = ''.obs;
|
||||||
|
var phontListStr = ''.obs;
|
||||||
|
var isDetail = false.obs;
|
||||||
|
var familyData = DataList().obs;
|
||||||
|
|
||||||
|
CoerceFingerprintState() {
|
||||||
|
Map map = Get.arguments;
|
||||||
|
if (map['lockId'] != null) {
|
||||||
|
getLockId.value = map['lockId'];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (map['isDetail'] != null) {
|
||||||
|
isDetail.value = map['isDetail'];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (map['itemData'] != null) {
|
||||||
|
familyData.value = map['itemData'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,145 @@
|
|||||||
|
import 'dart:core';
|
||||||
|
|
||||||
|
class CoerceFingerprintListEntity {
|
||||||
|
int? errorCode;
|
||||||
|
String? description;
|
||||||
|
String? errorMsg;
|
||||||
|
Data? data;
|
||||||
|
|
||||||
|
CoerceFingerprintListEntity(
|
||||||
|
{this.errorCode, this.description, this.errorMsg, this.data});
|
||||||
|
|
||||||
|
CoerceFingerprintListEntity.fromJson(Map<String, dynamic> json) {
|
||||||
|
errorCode = json['errorCode'];
|
||||||
|
description = json['description'];
|
||||||
|
errorMsg = json['errorMsg'];
|
||||||
|
data = json['data'] != null ? Data.fromJson(json['data']) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
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!.toJson();
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class Data {
|
||||||
|
List<CoerceFingerprintItemData>? list;
|
||||||
|
int? pageNo;
|
||||||
|
int? pageSize;
|
||||||
|
int? pages;
|
||||||
|
int? total;
|
||||||
|
|
||||||
|
Data({this.list, this.pageNo, this.pageSize, this.pages, this.total});
|
||||||
|
|
||||||
|
Data.fromJson(Map<String, dynamic> json) {
|
||||||
|
if (json['list'] != null) {
|
||||||
|
list = <CoerceFingerprintItemData>[];
|
||||||
|
json['list'].forEach((v) {
|
||||||
|
list!.add(CoerceFingerprintItemData.fromJson(v));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
pageNo = json['pageNo'];
|
||||||
|
pageSize = json['pageSize'];
|
||||||
|
pages = json['pages'];
|
||||||
|
total = json['total'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
if (list != null) {
|
||||||
|
data['list'] = list!.map((v) => v.toJson()).toList();
|
||||||
|
}
|
||||||
|
data['pageNo'] = pageNo;
|
||||||
|
data['pageSize'] = pageSize;
|
||||||
|
data['pages'] = pages;
|
||||||
|
data['total'] = total;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class CoerceFingerprintItemData {
|
||||||
|
int? lockId;
|
||||||
|
int? apiUserId;
|
||||||
|
String? fingerprintNumber;
|
||||||
|
int? fingerprintType;
|
||||||
|
String? fingerprintName;
|
||||||
|
int? startDate;
|
||||||
|
int? endDate;
|
||||||
|
List? weekDay;
|
||||||
|
int? fingerprintStatus;
|
||||||
|
int? isCoerced;
|
||||||
|
int? fingerRight;
|
||||||
|
int? fingerprintId;
|
||||||
|
String? senderUsername;
|
||||||
|
int? createDate;
|
||||||
|
String? validTimeStr;
|
||||||
|
bool? isCurrentSelect = false;
|
||||||
|
|
||||||
|
CoerceFingerprintItemData(
|
||||||
|
{this.lockId,
|
||||||
|
this.apiUserId,
|
||||||
|
this.fingerprintNumber,
|
||||||
|
this.fingerprintType,
|
||||||
|
this.fingerprintName,
|
||||||
|
this.startDate,
|
||||||
|
this.endDate,
|
||||||
|
this.weekDay,
|
||||||
|
this.fingerprintStatus,
|
||||||
|
this.isCoerced,
|
||||||
|
this.fingerRight,
|
||||||
|
this.fingerprintId,
|
||||||
|
this.senderUsername,
|
||||||
|
this.createDate,
|
||||||
|
this.validTimeStr});
|
||||||
|
|
||||||
|
CoerceFingerprintItemData.fromJson(Map<String, dynamic> json) {
|
||||||
|
lockId = json['lockId'];
|
||||||
|
apiUserId = json['apiUserId'];
|
||||||
|
fingerprintNumber = json['fingerprintNumber'];
|
||||||
|
fingerprintType = json['fingerprintType'];
|
||||||
|
fingerprintName = json['fingerprintName'];
|
||||||
|
startDate = json['startDate'];
|
||||||
|
endDate = json['endDate'];
|
||||||
|
if (json['weekDay'] != null) {
|
||||||
|
weekDay = [];
|
||||||
|
json['weekDay'].forEach((v) {
|
||||||
|
weekDay!.add(v);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
fingerprintStatus = json['fingerprintStatus'];
|
||||||
|
isCoerced = json['isCoerced'];
|
||||||
|
fingerRight = json['fingerRight'];
|
||||||
|
fingerprintId = json['fingerprintId'];
|
||||||
|
senderUsername = json['senderUsername'];
|
||||||
|
createDate = json['createDate'];
|
||||||
|
validTimeStr = json['validTimeStr'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
data['lockId'] = lockId;
|
||||||
|
data['apiUserId'] = apiUserId;
|
||||||
|
data['fingerprintNumber'] = fingerprintNumber;
|
||||||
|
data['fingerprintType'] = fingerprintType;
|
||||||
|
data['fingerprintName'] = fingerprintName;
|
||||||
|
data['startDate'] = startDate;
|
||||||
|
data['endDate'] = endDate;
|
||||||
|
if (weekDay != null) {
|
||||||
|
data['weekDay'] = weekDay!.map((v) => v.toJson()).toList();
|
||||||
|
}
|
||||||
|
data['fingerprintStatus'] = fingerprintStatus;
|
||||||
|
data['isCoerced'] = isCoerced;
|
||||||
|
data['fingerRight'] = fingerRight;
|
||||||
|
data['fingerprintId'] = fingerprintId;
|
||||||
|
data['senderUsername'] = senderUsername;
|
||||||
|
data['createDate'] = createDate;
|
||||||
|
data['validTimeStr'] = validTimeStr;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,6 +1,39 @@
|
|||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:star_lock/main/lockDetail/messageWarn/msgNotification/coerceOpenDoor/coerceFingerprintList/coerceFingerprintList_entity.dart';
|
||||||
import 'package:star_lock/main/lockDetail/messageWarn/msgNotification/coerceOpenDoor/coerceFingerprintList/coerceFingerprintList_state.dart';
|
import 'package:star_lock/main/lockDetail/messageWarn/msgNotification/coerceOpenDoor/coerceFingerprintList/coerceFingerprintList_state.dart';
|
||||||
|
import 'package:star_lock/network/api_repository.dart';
|
||||||
import 'package:star_lock/tools/baseGetXController.dart';
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
|
import 'package:star_lock/tools/dateTool.dart';
|
||||||
|
|
||||||
class CoerceFingerprintListLogic extends BaseGetXController {
|
class CoerceFingerprintListLogic extends BaseGetXController {
|
||||||
final CoerceFingerprintListState state = CoerceFingerprintListState();
|
final CoerceFingerprintListState state = CoerceFingerprintListState();
|
||||||
|
|
||||||
|
// 锁用户列表
|
||||||
|
void getCoercedFingerprintList() async {
|
||||||
|
var entity = await ApiRepository.to.getCoercedFingerprintList(
|
||||||
|
lockId: state.getLockId.value,
|
||||||
|
pageNo: state.pageNum.value,
|
||||||
|
pageSize: state.pageSize.value,
|
||||||
|
);
|
||||||
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
|
state.fingerprintList.value = entity.data!.list!;
|
||||||
|
state.fingerprintList.refresh();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取指纹有效期
|
||||||
|
String getfingerprintUseDateStr(
|
||||||
|
CoerceFingerprintItemData fingerprintItemData) {
|
||||||
|
var keyDateTypeStr = ""; // 永久:1;限时2,单次3,循环:4
|
||||||
|
if (fingerprintItemData.fingerprintType! == 1) {
|
||||||
|
keyDateTypeStr = "永久".tr;
|
||||||
|
} else if (fingerprintItemData.fingerprintType! == 2) {
|
||||||
|
keyDateTypeStr =
|
||||||
|
"${DateTool().dateToYMDHNString(fingerprintItemData.startDate.toString())} - ${DateTool().dateToYMDHNString(fingerprintItemData.endDate.toString())} 限时";
|
||||||
|
} else if (fingerprintItemData.fingerprintType! == 4) {
|
||||||
|
keyDateTypeStr =
|
||||||
|
"${DateTool().dateToYMDString(fingerprintItemData.startDate.toString())}-${DateTool().dateToYMDString(fingerprintItemData.endDate.toString())} 循环";
|
||||||
|
}
|
||||||
|
return keyDateTypeStr;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,12 +1,13 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:star_lock/main/lockDetail/messageWarn/msgNotification/coerceOpenDoor/coerceFingerprintList/coerceFingerprintList_entity.dart';
|
||||||
import 'package:star_lock/main/lockDetail/messageWarn/msgNotification/coerceOpenDoor/coerceFingerprintList/coerceFingerprintList_logic.dart';
|
import 'package:star_lock/main/lockDetail/messageWarn/msgNotification/coerceOpenDoor/coerceFingerprintList/coerceFingerprintList_logic.dart';
|
||||||
|
import 'package:star_lock/tools/keySearchWidget.dart';
|
||||||
|
|
||||||
import '../../../../../../app_settings/app_colors.dart';
|
import '../../../../../../app_settings/app_colors.dart';
|
||||||
import '../../../../../../tools/submitBtn.dart';
|
import '../../../../../../tools/submitBtn.dart';
|
||||||
import '../../../../../../tools/titleAppBar.dart';
|
import '../../../../../../tools/titleAppBar.dart';
|
||||||
import '../../../../../../translations/trans_lib.dart';
|
|
||||||
|
|
||||||
class CoerceFingerprintListPage extends StatefulWidget {
|
class CoerceFingerprintListPage extends StatefulWidget {
|
||||||
const CoerceFingerprintListPage({Key? key}) : super(key: key);
|
const CoerceFingerprintListPage({Key? key}) : super(key: key);
|
||||||
@ -20,25 +21,41 @@ class _CoerceFingerprintListPageState extends State<CoerceFingerprintListPage> {
|
|||||||
final logic = Get.put(CoerceFingerprintListLogic());
|
final logic = Get.put(CoerceFingerprintListLogic());
|
||||||
final state = Get.find<CoerceFingerprintListLogic>().state;
|
final state = Get.find<CoerceFingerprintListLogic>().state;
|
||||||
|
|
||||||
|
@override
|
||||||
|
initState() {
|
||||||
|
super.initState();
|
||||||
|
logic.getCoercedFingerprintList();
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: AppColors.mainBackgroundColor,
|
backgroundColor: AppColors.mainBackgroundColor,
|
||||||
appBar: TitleAppBar(
|
appBar: TitleAppBar(
|
||||||
barTitle: '指纹列表',
|
barTitle: '指纹列表'.tr,
|
||||||
haveBack: true,
|
haveBack: true,
|
||||||
backgroundColor: AppColors.mainColor,
|
backgroundColor: AppColors.mainColor,
|
||||||
),
|
),
|
||||||
body: Column(
|
body: Column(
|
||||||
children: [
|
children: [
|
||||||
_searchWidget(),
|
KeySearchWidget(
|
||||||
|
editingController: state.searchController,
|
||||||
|
onSubmittedAction: () {
|
||||||
|
logic.pageNo = 1;
|
||||||
|
logic.getCoercedFingerprintList();
|
||||||
|
},
|
||||||
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 20.h,
|
height: 20.h,
|
||||||
),
|
),
|
||||||
Expanded(child: _buildMainUI()),
|
Expanded(child: Obx(() => _buildMainUI())),
|
||||||
SubmitBtn(
|
SubmitBtn(
|
||||||
btnName: '确定',
|
btnName: '确定'.tr,
|
||||||
onClick: () {},
|
onClick: () {
|
||||||
|
Get.back(
|
||||||
|
result:
|
||||||
|
state.fingerprintList.value[state.isSelectIndex.value]);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 64.h,
|
height: 64.h,
|
||||||
@ -47,50 +64,12 @@ class _CoerceFingerprintListPageState extends State<CoerceFingerprintListPage> {
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _searchWidget() {
|
|
||||||
return Container(
|
|
||||||
height: 60.h,
|
|
||||||
margin: EdgeInsets.only(top: 20.w, left: 20.w, right: 10.w),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: Colors.white, borderRadius: BorderRadius.circular(5)),
|
|
||||||
child: TextField(
|
|
||||||
//输入框一行
|
|
||||||
maxLines: 1,
|
|
||||||
// controller: _controller,
|
|
||||||
autofocus: false,
|
|
||||||
controller: state.searchController,
|
|
||||||
onSubmitted: (value) {},
|
|
||||||
decoration: InputDecoration(
|
|
||||||
//输入里面输入文字内边距设置
|
|
||||||
contentPadding: const EdgeInsets.only(
|
|
||||||
top: 12.0, left: -19.0, right: -15.0, bottom: 8.0),
|
|
||||||
hintText: TranslationLoader.lanKeys!.pleaseEnter!.tr,
|
|
||||||
hintStyle: TextStyle(fontSize: 22.sp, height: 3.0),
|
|
||||||
//不需要输入框下划线
|
|
||||||
border: InputBorder.none,
|
|
||||||
//左边图标设置
|
|
||||||
icon: Padding(
|
|
||||||
padding: EdgeInsets.only(
|
|
||||||
top: 20.h, bottom: 20.h, right: 20.w, left: 10.w),
|
|
||||||
child: Image.asset(
|
|
||||||
'images/main/icon_main_search.png',
|
|
||||||
width: 40.w,
|
|
||||||
height: 40.w,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget _buildMainUI() {
|
Widget _buildMainUI() {
|
||||||
return ListView.separated(
|
return ListView.separated(
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
itemCount: 3,
|
itemCount: state.fingerprintList.length,
|
||||||
itemBuilder: (c, index) {
|
itemBuilder: (c, index) {
|
||||||
return _electronicKeyItem('images/icon_fingerprint.png', '我', '永久', () {
|
return _electronicKeyItem(state.fingerprintList[index], index);
|
||||||
state.isCheck.value = !state.isCheck.value;
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
separatorBuilder: (BuildContext context, int index) {
|
separatorBuilder: (BuildContext context, int index) {
|
||||||
return const Divider(
|
return const Divider(
|
||||||
@ -102,9 +81,21 @@ class _CoerceFingerprintListPageState extends State<CoerceFingerprintListPage> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget _electronicKeyItem(
|
Widget _electronicKeyItem(
|
||||||
String avatarURL, String receiveUser, String useDate, Function() action) {
|
CoerceFingerprintItemData itemData, int selectIndex) {
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: action,
|
onTap: () {
|
||||||
|
for (int i = 0; i < state.fingerprintList.value.length; i++) {
|
||||||
|
CoerceFingerprintItemData item = state.fingerprintList.value[i];
|
||||||
|
if (selectIndex == i) {
|
||||||
|
item.isCurrentSelect = true;
|
||||||
|
} else {
|
||||||
|
item.isCurrentSelect = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
setState(() {
|
||||||
|
state.isSelectIndex.value = selectIndex;
|
||||||
|
});
|
||||||
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
height: 90.h,
|
height: 90.h,
|
||||||
@ -114,7 +105,7 @@ class _CoerceFingerprintListPageState extends State<CoerceFingerprintListPage> {
|
|||||||
width: 30.w,
|
width: 30.w,
|
||||||
),
|
),
|
||||||
Image.asset(
|
Image.asset(
|
||||||
avatarURL,
|
'images/icon_fingerprint.png',
|
||||||
width: 60.w,
|
width: 60.w,
|
||||||
height: 60.w,
|
height: 60.w,
|
||||||
),
|
),
|
||||||
@ -126,10 +117,9 @@ class _CoerceFingerprintListPageState extends State<CoerceFingerprintListPage> {
|
|||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Row(
|
Row(
|
||||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
receiveUser,
|
itemData.fingerprintName ?? '',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 24.sp, color: AppColors.blackColor),
|
fontSize: 24.sp, color: AppColors.blackColor),
|
||||||
),
|
),
|
||||||
@ -145,7 +135,7 @@ class _CoerceFingerprintListPageState extends State<CoerceFingerprintListPage> {
|
|||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
useDate,
|
logic.getfingerprintUseDateStr(itemData),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 18.sp,
|
fontSize: 18.sp,
|
||||||
color: AppColors.placeholderTextColor),
|
color: AppColors.placeholderTextColor),
|
||||||
@ -156,13 +146,13 @@ class _CoerceFingerprintListPageState extends State<CoerceFingerprintListPage> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Obx(() => Image.asset(
|
Image.asset(
|
||||||
state.isCheck.value == true
|
state.isSelectIndex.value == selectIndex
|
||||||
? 'images/icon_round_select.png'
|
? 'images/icon_round_select.png'
|
||||||
: 'images/icon_round_unSelect.png',
|
: 'images/icon_round_unSelect.png',
|
||||||
width: 30.w,
|
width: 30.w,
|
||||||
height: 30.w,
|
height: 30.w,
|
||||||
)),
|
),
|
||||||
SizedBox(width: 20.h),
|
SizedBox(width: 20.h),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@ -3,5 +3,16 @@ import 'package:get/get.dart';
|
|||||||
|
|
||||||
class CoerceFingerprintListState {
|
class CoerceFingerprintListState {
|
||||||
TextEditingController searchController = TextEditingController(); //邮箱/手机号输入框
|
TextEditingController searchController = TextEditingController(); //邮箱/手机号输入框
|
||||||
var isCheck = false.obs;
|
var isSelectIndex = 0.obs;
|
||||||
|
var getLockId = 0.obs;
|
||||||
|
var fingerprintList = [].obs; //指纹列表
|
||||||
|
var pageNum = 1.obs; //请求页码
|
||||||
|
var pageSize = 20.obs; //请求每页数据条数
|
||||||
|
|
||||||
|
CoerceFingerprintListState() {
|
||||||
|
Map map = Get.arguments;
|
||||||
|
if (map['lockId'] != null) {
|
||||||
|
getLockId.value = map['lockId'];
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,7 +1,40 @@
|
|||||||
|
import 'package:star_lock/main/lockDetail/messageWarn/msgNotification/openDoorNotify/openDoorNotify_entity.dart';
|
||||||
|
import 'package:star_lock/network/api_repository.dart';
|
||||||
import 'package:star_lock/tools/baseGetXController.dart';
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
|
|
||||||
import 'coerceOpenDoor_state.dart';
|
import 'coerceOpenDoor_state.dart';
|
||||||
|
|
||||||
class CoerceOpenDoorLogic extends BaseGetXController {
|
class CoerceOpenDoorLogic extends BaseGetXController {
|
||||||
final CoerceOpenDoorState state = CoerceOpenDoorState();
|
final CoerceOpenDoorState state = CoerceOpenDoorState();
|
||||||
|
|
||||||
|
void lockNoticeSettingAccountList() async {
|
||||||
|
OpenDoorNotifyEntity entity =
|
||||||
|
await ApiRepository.to.lockNoticeSettingAccountList(
|
||||||
|
lockId: state.getLockId.value,
|
||||||
|
noticeType: 20,
|
||||||
|
);
|
||||||
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
|
state.itemDataList.value = entity.data!.list!;
|
||||||
|
state.itemDataList.refresh();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//当前钥匙类型 1:电子钥匙 2:密码钥匙 3:指纹钥匙 4:卡钥匙 5:人脸钥匙
|
||||||
|
String getKeyTypeStr(DataList itemData) {
|
||||||
|
int keyType = itemData.settingValue!.openDoorType!;
|
||||||
|
switch (keyType) {
|
||||||
|
case 1:
|
||||||
|
return '电子钥匙';
|
||||||
|
case 2:
|
||||||
|
return '密码';
|
||||||
|
case 3:
|
||||||
|
return '指纹';
|
||||||
|
case 4:
|
||||||
|
return '卡';
|
||||||
|
case 5:
|
||||||
|
return '人脸';
|
||||||
|
default:
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,8 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:star_lock/appRouters.dart';
|
import 'package:star_lock/appRouters.dart';
|
||||||
|
import 'package:star_lock/main/lockDetail/messageWarn/msgNotification/openDoorNotify/openDoorNotify_entity.dart';
|
||||||
|
import 'package:star_lock/tools/noData.dart';
|
||||||
|
|
||||||
import '../../../../../../app_settings/app_colors.dart';
|
import '../../../../../../app_settings/app_colors.dart';
|
||||||
import '../../../../../../tools/submitBtn.dart';
|
import '../../../../../../tools/submitBtn.dart';
|
||||||
@ -22,6 +24,8 @@ class _CoerceOpenDoorPageState extends State<CoerceOpenDoorPage> {
|
|||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
|
|
||||||
|
logic.lockNoticeSettingAccountList();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -29,7 +33,7 @@ class _CoerceOpenDoorPageState extends State<CoerceOpenDoorPage> {
|
|||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: AppColors.mainBackgroundColor,
|
backgroundColor: AppColors.mainBackgroundColor,
|
||||||
appBar: TitleAppBar(
|
appBar: TitleAppBar(
|
||||||
barTitle: '胁迫开门',
|
barTitle: '胁迫开门'.tr,
|
||||||
haveBack: true,
|
haveBack: true,
|
||||||
backgroundColor: AppColors.mainColor,
|
backgroundColor: AppColors.mainColor,
|
||||||
),
|
),
|
||||||
@ -39,15 +43,21 @@ class _CoerceOpenDoorPageState extends State<CoerceOpenDoorPage> {
|
|||||||
SizedBox(
|
SizedBox(
|
||||||
height: 20.h,
|
height: 20.h,
|
||||||
),
|
),
|
||||||
Expanded(child: _buildMainUI()),
|
Expanded(
|
||||||
// Expanded(
|
child: Obx(() => state.itemDataList.value.isNotEmpty
|
||||||
// child: Obx(() => state.itemDataList.value.isEmpty
|
? _buildMainUI()
|
||||||
// ? const NoData()
|
: NoData())),
|
||||||
// : _buildMainUI(state.itemDataList.value))),
|
|
||||||
AddBottomWhiteBtn(
|
AddBottomWhiteBtn(
|
||||||
btnName: '胁迫指纹',
|
btnName: '胁迫指纹'.tr,
|
||||||
onClick: () {
|
onClick: () {
|
||||||
Get.toNamed(Routers.coerceFingerprintPage);
|
Get.toNamed(Routers.coerceFingerprintPage, arguments: {
|
||||||
|
'lockId': state.getLockId.value,
|
||||||
|
'isDetail': false,
|
||||||
|
})?.then((value) {
|
||||||
|
if (value != null) {
|
||||||
|
logic.lockNoticeSettingAccountList();
|
||||||
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
@ -62,7 +72,7 @@ class _CoerceOpenDoorPageState extends State<CoerceOpenDoorPage> {
|
|||||||
alignment: Alignment.centerLeft,
|
alignment: Alignment.centerLeft,
|
||||||
margin: EdgeInsets.only(left: 20.w, right: 20.w, top: 20.w),
|
margin: EdgeInsets.only(left: 20.w, right: 20.w, top: 20.w),
|
||||||
child: Text(
|
child: Text(
|
||||||
'当被胁迫要求强行开锁时,使用胁迫指纹会触发报警,报警消息会推送给管理员,该功能需要锁联网',
|
'当被胁迫要求强行开锁时,使用胁迫指纹会触发报警,报警消息会推送给管理员,该功能需要锁联网'.tr,
|
||||||
style: TextStyle(color: AppColors.darkGrayTextColor, fontSize: 20.sp),
|
style: TextStyle(color: AppColors.darkGrayTextColor, fontSize: 20.sp),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
@ -70,12 +80,9 @@ class _CoerceOpenDoorPageState extends State<CoerceOpenDoorPage> {
|
|||||||
Widget _buildMainUI() {
|
Widget _buildMainUI() {
|
||||||
return ListView.separated(
|
return ListView.separated(
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
itemCount: 3,
|
itemCount: state.itemDataList.length,
|
||||||
itemBuilder: (c, index) {
|
itemBuilder: (c, index) {
|
||||||
return _electronicKeyItem(
|
return _electronicKeyItem(state.itemDataList.value[index]);
|
||||||
'images/icon_fingerprint.png', '18682150237', '指纹', () {
|
|
||||||
//指纹详情
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
separatorBuilder: (BuildContext context, int index) {
|
separatorBuilder: (BuildContext context, int index) {
|
||||||
return const Divider(
|
return const Divider(
|
||||||
@ -86,10 +93,19 @@ class _CoerceOpenDoorPageState extends State<CoerceOpenDoorPage> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _electronicKeyItem(String avatarURL, String familyAccount,
|
Widget _electronicKeyItem(DataList itemData) {
|
||||||
String openDoorWay, Function() action) {
|
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: action,
|
onTap: () {
|
||||||
|
Get.toNamed(Routers.coerceFingerprintPage, arguments: {
|
||||||
|
'itemData': itemData,
|
||||||
|
'lockId': state.getLockId.value,
|
||||||
|
'isDetail': true
|
||||||
|
})?.then((value) {
|
||||||
|
if (value != null) {
|
||||||
|
logic.lockNoticeSettingAccountList();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
height: 90.h,
|
height: 90.h,
|
||||||
@ -99,7 +115,7 @@ class _CoerceOpenDoorPageState extends State<CoerceOpenDoorPage> {
|
|||||||
width: 30.w,
|
width: 30.w,
|
||||||
),
|
),
|
||||||
Image.asset(
|
Image.asset(
|
||||||
avatarURL,
|
'images/controls_user.png',
|
||||||
width: 60.w,
|
width: 60.w,
|
||||||
height: 60.w,
|
height: 60.w,
|
||||||
),
|
),
|
||||||
@ -111,10 +127,9 @@ class _CoerceOpenDoorPageState extends State<CoerceOpenDoorPage> {
|
|||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Row(
|
Row(
|
||||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
familyAccount,
|
itemData.settingValue!.remark ?? '',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 24.sp, color: AppColors.blackColor),
|
fontSize: 24.sp, color: AppColors.blackColor),
|
||||||
),
|
),
|
||||||
@ -130,7 +145,7 @@ class _CoerceOpenDoorPageState extends State<CoerceOpenDoorPage> {
|
|||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
openDoorWay,
|
logic.getKeyTypeStr(itemData),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 18.sp,
|
fontSize: 18.sp,
|
||||||
color: AppColors.placeholderTextColor),
|
color: AppColors.placeholderTextColor),
|
||||||
|
|||||||
@ -4,4 +4,12 @@ class CoerceOpenDoorState {
|
|||||||
var pageNum = 1.obs; //请求页码
|
var pageNum = 1.obs; //请求页码
|
||||||
final pageSize = 20.obs; //请求每页数据条数
|
final pageSize = 20.obs; //请求每页数据条数
|
||||||
final itemDataList = [].obs;
|
final itemDataList = [].obs;
|
||||||
|
var getLockId = 0.obs;
|
||||||
|
|
||||||
|
CoerceOpenDoorState() {
|
||||||
|
Map map = Get.arguments;
|
||||||
|
if (map['lockId'] != null) {
|
||||||
|
getLockId.value = map['lockId'];
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,7 +1,118 @@
|
|||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:star_lock/main/lockDetail/messageWarn/msgNotification/openDoorNotify/openDoorNotify_entity.dart';
|
||||||
|
import 'package:star_lock/main/lockDetail/messageWarn/notificationMode/notificationMode_data.dart';
|
||||||
|
import 'package:star_lock/network/api_repository.dart';
|
||||||
import 'package:star_lock/tools/baseGetXController.dart';
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
|
|
||||||
import 'lowBatteryReminder_state.dart';
|
import 'lowBatteryReminder_state.dart';
|
||||||
|
|
||||||
class LowBatteryReminderLogic extends BaseGetXController {
|
class LowBatteryReminderLogic extends BaseGetXController {
|
||||||
LowBatteryReminderState state = LowBatteryReminderState();
|
LowBatteryReminderState state = LowBatteryReminderState();
|
||||||
|
|
||||||
|
void lockNoticeSettingAccountList() async {
|
||||||
|
var entity = await ApiRepository.to.updatelowElecNoticeStateSetting(
|
||||||
|
lockId: state.getLockId.value,
|
||||||
|
lowElecNoticeState: state.isLowBatteryNotify.value == true ? 1 : 0,
|
||||||
|
lowElecNoticeWayList: [
|
||||||
|
{'type': 'mail', 'accounts': getEmailAndSMSAccountList(true)},
|
||||||
|
{'type': 'sms', 'accounts': getEmailAndSMSAccountList(false)}
|
||||||
|
]);
|
||||||
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
|
showToast('设置成功'.tr);
|
||||||
|
Get.back(result: true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取到家人信息的请求数组
|
||||||
|
List getEmailAndSMSAccountList(bool isEmail) {
|
||||||
|
List list = [];
|
||||||
|
List accountList = [];
|
||||||
|
isEmail
|
||||||
|
? accountList = state.emailReceiverList.value
|
||||||
|
: accountList = state.phoneReceiverList.value;
|
||||||
|
for (int i = 0; i < accountList.length; i++) {
|
||||||
|
MsgNoticeModeData item = accountList[i];
|
||||||
|
Map map = {};
|
||||||
|
map['countryCode'] = isEmail ? 0 : item.countryCode;
|
||||||
|
map['account'] = isEmail ? item.receiveEmail : item.receivePhone;
|
||||||
|
list.add(map);
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
String getEmailListStr(Map val) {
|
||||||
|
String emailListStr = '';
|
||||||
|
if (val['emailReceiverList'] != null) {
|
||||||
|
state.emailReceiverList.value = val['emailReceiverList'];
|
||||||
|
List emailReceiverList = state.emailReceiverList.value;
|
||||||
|
for (int i = 0; i < emailReceiverList.length; i++) {
|
||||||
|
MsgNoticeModeData item = emailReceiverList[i];
|
||||||
|
emailListStr += item.receiveEmail;
|
||||||
|
// 检查是否为最后一个元素
|
||||||
|
if (i < emailReceiverList.length - 1) {
|
||||||
|
emailListStr += ',';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return emailListStr;
|
||||||
|
}
|
||||||
|
|
||||||
|
String getPhoneListStr(Map val) {
|
||||||
|
String phoneListStr = '';
|
||||||
|
|
||||||
|
if (val['phoneReceiverList'] != null) {
|
||||||
|
state.phoneReceiverList.value = val['phoneReceiverList'];
|
||||||
|
List phoneReceiverList = state.phoneReceiverList.value;
|
||||||
|
for (int i = 0; i < phoneReceiverList.length; i++) {
|
||||||
|
MsgNoticeModeData item = phoneReceiverList[i];
|
||||||
|
phoneListStr += item.receivePhone;
|
||||||
|
// 检查是否为最后一个元素
|
||||||
|
if (i < phoneReceiverList.length - 1) {
|
||||||
|
phoneListStr += ',';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return phoneListStr;
|
||||||
|
}
|
||||||
|
|
||||||
|
//根据列表返回值得到邮箱、手机列表
|
||||||
|
Map<String, List<MsgNoticeModeData>> getAccountsMap() {
|
||||||
|
List<MsgNoticeModeData> mailAccounts = [];
|
||||||
|
List<MsgNoticeModeData> smsAccounts = [];
|
||||||
|
|
||||||
|
if (state.msgNoticeInfo.value.lowElecNoticeWayList != null) {
|
||||||
|
for (NoticeWay item in state.msgNoticeInfo.value.lowElecNoticeWayList!) {
|
||||||
|
if (item.type == 'mail' && item.accounts != null) {
|
||||||
|
for (Accounts account in item.accounts!) {
|
||||||
|
if (account.account != null) {
|
||||||
|
MsgNoticeModeData msgNoticeModeData = MsgNoticeModeData();
|
||||||
|
msgNoticeModeData.receiveEmail = account.account!;
|
||||||
|
mailAccounts.add(msgNoticeModeData);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (item.type == 'sms' && item.accounts != null) {
|
||||||
|
for (Accounts account in item.accounts!) {
|
||||||
|
if (account.account != null && account.countryCode != null) {
|
||||||
|
MsgNoticeModeData msgNoticeModeData = MsgNoticeModeData();
|
||||||
|
msgNoticeModeData.receivePhone = account.account!;
|
||||||
|
msgNoticeModeData.countryCode = account.countryCode!;
|
||||||
|
smsAccounts.add(msgNoticeModeData);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
'emailReceiverList': mailAccounts,
|
||||||
|
'phoneReceiverList': smsAccounts,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
onInit() {
|
||||||
|
super.onInit();
|
||||||
|
state.emailListStr.value = getEmailListStr(getAccountsMap());
|
||||||
|
state.phontListStr.value = getPhoneListStr(getAccountsMap());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -29,94 +29,138 @@ class _LowBatteryReminderPageState extends State<LowBatteryReminderPage> {
|
|||||||
barTitle: '低电量提醒'.tr,
|
barTitle: '低电量提醒'.tr,
|
||||||
haveBack: true,
|
haveBack: true,
|
||||||
backgroundColor: AppColors.mainColor),
|
backgroundColor: AppColors.mainColor),
|
||||||
body: Container(
|
body: SingleChildScrollView(
|
||||||
padding: EdgeInsets.all(30.w),
|
child: Padding(
|
||||||
child: Column(
|
padding: EdgeInsets.all(30.w),
|
||||||
children: [
|
child: Column(
|
||||||
Row(
|
children: [
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
Row(
|
||||||
children: [
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
Expanded(
|
children: [
|
||||||
child: Text(
|
Expanded(
|
||||||
"打开提醒后,当锁电量低于20%、10%和5%,系统会给指定对象发送提醒消息。电量读取方式:网关读取或APP读取。",
|
child: Text(
|
||||||
style: TextStyle(
|
"打开提醒后,当锁电量低于20%、10%和5%,系统会给指定对象发送提醒消息。电量读取方式:网关读取或APP读取。"
|
||||||
fontSize: 20.sp, color: AppColors.darkGrayTextColor),
|
.tr,
|
||||||
)),
|
style: TextStyle(
|
||||||
],
|
fontSize: 20.sp,
|
||||||
),
|
color: AppColors.darkGrayTextColor,
|
||||||
SizedBox(
|
),
|
||||||
height: 20.h,
|
softWrap: true,
|
||||||
),
|
))
|
||||||
CommonItem(
|
],
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 20.h,
|
||||||
|
),
|
||||||
|
CommonItem(
|
||||||
leftTitel: '低电量提醒'.tr,
|
leftTitel: '低电量提醒'.tr,
|
||||||
rightTitle: '',
|
rightTitle: '',
|
||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
isHaveDirection: false,
|
isHaveDirection: false,
|
||||||
isHaveRightWidget: true,
|
isHaveRightWidget: true,
|
||||||
rightWidget: _unOpenDoorSwitch(),
|
rightWidget: _lowBatterySwitch(),
|
||||||
action: () {}),
|
),
|
||||||
Visibility(
|
Visibility(
|
||||||
visible: state.isLowBatteryNotify.value,
|
visible: state.isLowBatteryNotify.value,
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 20.h,
|
height: 20.h,
|
||||||
),
|
),
|
||||||
Container(
|
GestureDetector(
|
||||||
color: Colors.white,
|
onTap: () {
|
||||||
margin: EdgeInsets.only(bottom: 10.h),
|
Get.toNamed(Routers.notificationModePage, arguments: {
|
||||||
child: Column(
|
'msgNoticeInfo': state.msgNoticeInfo.value,
|
||||||
children: [
|
})?.then((val) {
|
||||||
CommonItem(
|
if (val != null) {
|
||||||
leftTitel: '提醒方式'.tr,
|
state.emailListStr.value =
|
||||||
rightTitle: "",
|
logic.getEmailListStr(val);
|
||||||
isHaveLine: false,
|
state.phontListStr.value =
|
||||||
isHaveRightWidget: false,
|
logic.getPhoneListStr(val);
|
||||||
isHaveDirection: true,
|
}
|
||||||
action: () {
|
});
|
||||||
Get.toNamed(Routers.notificationModePage);
|
},
|
||||||
},
|
child: Container(
|
||||||
),
|
color: Colors.white,
|
||||||
Container(
|
margin: EdgeInsets.only(bottom: 10.h),
|
||||||
padding: EdgeInsets.only(
|
child: Column(
|
||||||
left: 10.w,
|
children: [
|
||||||
right: 10.w,
|
CommonItem(
|
||||||
top: 12.h,
|
leftTitel: '提醒方式'.tr,
|
||||||
bottom: 12.h),
|
rightTitle: "",
|
||||||
margin: EdgeInsets.only(bottom: 20.h, top: 10.h),
|
isHaveLine: false,
|
||||||
decoration: BoxDecoration(
|
isHaveRightWidget: false,
|
||||||
color: AppColors.mainBackgroundColor,
|
isHaveDirection: true,
|
||||||
borderRadius: BorderRadius.circular(6.0.w),
|
|
||||||
),
|
),
|
||||||
child: Text(
|
_buildNotifyContain('APP推送'.tr, '管理员'.tr),
|
||||||
'APP推送 管理员',
|
Obx(() => state.emailListStr.value.isNotEmpty
|
||||||
style: TextStyle(
|
? _buildNotifyContain(
|
||||||
color: Colors.black, fontSize: 20.sp),
|
'邮件提醒'.tr, state.emailListStr.value)
|
||||||
),
|
: Container()),
|
||||||
)
|
Obx(() => state.phontListStr.value.isNotEmpty
|
||||||
],
|
? _buildNotifyContain(
|
||||||
|
'短信提醒'.tr, state.phontListStr.value)
|
||||||
|
: Container()),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
)
|
),
|
||||||
],
|
],
|
||||||
)),
|
),
|
||||||
Expanded(
|
),
|
||||||
child: SizedBox(
|
SizedBox(
|
||||||
height: 20.h,
|
height: 20.h,
|
||||||
)),
|
),
|
||||||
SubmitBtn(
|
SubmitBtn(
|
||||||
btnName: '保存'.tr,
|
btnName: '保存'.tr,
|
||||||
onClick: () {},
|
onClick: () {
|
||||||
),
|
logic.lockNoticeSettingAccountList();
|
||||||
SizedBox(
|
},
|
||||||
height: 60.h,
|
),
|
||||||
)
|
SizedBox(
|
||||||
],
|
height: 60.h,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
CupertinoSwitch _unOpenDoorSwitch() {
|
Widget _buildNotifyContain(String notifyTitle, String notifyContent) {
|
||||||
|
return Container(
|
||||||
|
padding:
|
||||||
|
EdgeInsets.only(left: 10.w, right: 10.w, top: 12.h, bottom: 12.h),
|
||||||
|
margin: EdgeInsets.only(bottom: 20.h, top: 10.h, left: 20.w, right: 20.w),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: AppColors.mainBackgroundColor,
|
||||||
|
borderRadius: BorderRadius.circular(6.0.w),
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
notifyTitle,
|
||||||
|
style: TextStyle(color: Colors.black, fontSize: 20.sp),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: SizedBox(
|
||||||
|
width: 20.w,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
notifyContent,
|
||||||
|
textAlign: TextAlign.end,
|
||||||
|
style: TextStyle(
|
||||||
|
color: AppColors.placeholderTextColor,
|
||||||
|
fontSize: 20.sp,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
CupertinoSwitch _lowBatterySwitch() {
|
||||||
return CupertinoSwitch(
|
return CupertinoSwitch(
|
||||||
activeColor: CupertinoColors.activeBlue,
|
activeColor: CupertinoColors.activeBlue,
|
||||||
trackColor: CupertinoColors.systemGrey5,
|
trackColor: CupertinoColors.systemGrey5,
|
||||||
|
|||||||
@ -1,5 +1,29 @@
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:star_lock/main/lockDetail/messageWarn/lockUser/lockUser_entity.dart';
|
||||||
|
import 'package:star_lock/main/lockDetail/messageWarn/msgNotification/msgNotification/msgNotification_entity.dart';
|
||||||
|
|
||||||
class LowBatteryReminderState {
|
class LowBatteryReminderState {
|
||||||
var isLowBatteryNotify = false.obs; // 是否低电量提醒
|
var isLowBatteryNotify = false.obs; // 是否低电量提醒
|
||||||
|
|
||||||
|
var getLockId = 0.obs;
|
||||||
|
var lockUserKeys = LockUserListKeys().obs;
|
||||||
|
var emailReceiverList = [].obs;
|
||||||
|
var phoneReceiverList = [].obs;
|
||||||
|
var emailListStr = ''.obs;
|
||||||
|
var phontListStr = ''.obs;
|
||||||
|
|
||||||
|
var msgNoticeInfo = MsgNoticeData().obs;
|
||||||
|
|
||||||
|
LowBatteryReminderState() {
|
||||||
|
Map map = Get.arguments;
|
||||||
|
if (map['lockId'] != null) {
|
||||||
|
getLockId.value = map['lockId'];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (map['lockSetInfoData'] != null) {
|
||||||
|
msgNoticeInfo.value = map['lockSetInfoData'];
|
||||||
|
isLowBatteryNotify.value =
|
||||||
|
msgNoticeInfo.value.lowElecNoticeState == 1 ? true : false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -35,7 +35,7 @@ class MsgNoticeData {
|
|||||||
int? doorNotCloseState;
|
int? doorNotCloseState;
|
||||||
int? tamperAlarmState;
|
int? tamperAlarmState;
|
||||||
int? lowElecNoticeState;
|
int? lowElecNoticeState;
|
||||||
List? lowElecNoticeWayList;
|
List<NoticeWay>? lowElecNoticeWayList;
|
||||||
List? coercionOpenDoorNoticeList;
|
List? coercionOpenDoorNoticeList;
|
||||||
int? doorbellNoticeState;
|
int? doorbellNoticeState;
|
||||||
int? someoneAtDoorNoticeState;
|
int? someoneAtDoorNoticeState;
|
||||||
@ -65,11 +65,12 @@ class MsgNoticeData {
|
|||||||
tamperAlarmState = json['tamperAlarmState'];
|
tamperAlarmState = json['tamperAlarmState'];
|
||||||
lowElecNoticeState = json['lowElecNoticeState'];
|
lowElecNoticeState = json['lowElecNoticeState'];
|
||||||
if (json['lowElecNoticeWayList'] != null) {
|
if (json['lowElecNoticeWayList'] != null) {
|
||||||
lowElecNoticeWayList = [];
|
lowElecNoticeWayList = <NoticeWay>[];
|
||||||
json['lowElecNoticeWayList'].forEach((v) {
|
json['lowElecNoticeWayList'].forEach((v) {
|
||||||
lowElecNoticeWayList!.add(v);
|
lowElecNoticeWayList!.add(NoticeWay.fromJson(v));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (json['coercionOpenDoorNoticeList'] != null) {
|
if (json['coercionOpenDoorNoticeList'] != null) {
|
||||||
coercionOpenDoorNoticeList = [];
|
coercionOpenDoorNoticeList = [];
|
||||||
json['coercionOpenDoorNoticeList'].forEach((v) {
|
json['coercionOpenDoorNoticeList'].forEach((v) {
|
||||||
|
|||||||
@ -28,7 +28,7 @@ class _MsgNotificationPageState extends State<MsgNotificationPage> {
|
|||||||
TextStyle(color: AppColors.placeholderTextColor, fontSize: 22.sp);
|
TextStyle(color: AppColors.placeholderTextColor, fontSize: 22.sp);
|
||||||
|
|
||||||
late InlineSpan tipsPreviewSpan = TextSpan(children: [
|
late InlineSpan tipsPreviewSpan = TextSpan(children: [
|
||||||
TextSpan(text: '添加和使用面容开锁时:\n', style: titleStyle),
|
TextSpan(text: '${'添加和使用面容开锁时:'.tr}\n', style: titleStyle),
|
||||||
TextSpan(
|
TextSpan(
|
||||||
text:
|
text:
|
||||||
'\n1、请尽量保持单人在门前操作;\n2、请站立在门锁正前方约0.5~0.8米,面向门锁;\n3、请保持脸部无遮挡,露出五官;\n4、面容识别异常时,可触摸数字键盘任意按键,手动重启人脸识别。',
|
'\n1、请尽量保持单人在门前操作;\n2、请站立在门锁正前方约0.5~0.8米,面向门锁;\n3、请保持脸部无遮挡,露出五官;\n4、面容识别异常时,可触摸数字键盘任意按键,手动重启人脸识别。',
|
||||||
@ -57,20 +57,6 @@ class _MsgNotificationPageState extends State<MsgNotificationPage> {
|
|||||||
Widget _buildMainItem() {
|
Widget _buildMainItem() {
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
// Container(
|
|
||||||
// alignment: Alignment.centerLeft,
|
|
||||||
// margin: EdgeInsets.only(left: 40.w, top: 20.h, bottom: 20.h),
|
|
||||||
// child: Text(
|
|
||||||
// '门锁通知',
|
|
||||||
// style: TextStyle(color: Colors.black, fontSize: 26.sp, fontWeight: FontWeight.w500),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// Divider(
|
|
||||||
// color: AppColors.greyLineColor,
|
|
||||||
// indent: 20.w,
|
|
||||||
// endIndent: 20.w,
|
|
||||||
// height: 1,
|
|
||||||
// ),
|
|
||||||
CommonItem(
|
CommonItem(
|
||||||
leftTitel: '开门通知'.tr,
|
leftTitel: '开门通知'.tr,
|
||||||
rightTitle: "",
|
rightTitle: "",
|
||||||
@ -99,16 +85,6 @@ class _MsgNotificationPageState extends State<MsgNotificationPage> {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
)),
|
)),
|
||||||
// SizedBox(
|
|
||||||
// height: 20.h,
|
|
||||||
// ),
|
|
||||||
// Obx(() => CommonItem(
|
|
||||||
// leftTitel: '离家开门',
|
|
||||||
// rightTitle: "",
|
|
||||||
// isHaveLine: false,
|
|
||||||
// isHaveRightWidget: true,
|
|
||||||
// rightWidget:
|
|
||||||
// SizedBox(width: 60.w, height: 50.h, child: _switch(1)))),
|
|
||||||
Obx(() => CommonItem(
|
Obx(() => CommonItem(
|
||||||
leftTitel: '门未关好'.tr,
|
leftTitel: '门未关好'.tr,
|
||||||
rightTitle: "",
|
rightTitle: "",
|
||||||
@ -132,7 +108,14 @@ class _MsgNotificationPageState extends State<MsgNotificationPage> {
|
|||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () {
|
action: () {
|
||||||
Get.toNamed(Routers.lowBatteryReminderPage);
|
Get.toNamed(Routers.lowBatteryReminderPage, arguments: {
|
||||||
|
'lockSetInfoData': state.msgNoticeInfo.value,
|
||||||
|
'lockId': state.getLockId.value
|
||||||
|
})?.then((value) {
|
||||||
|
if (value != null) {
|
||||||
|
logic.getLockNoticeSetting();
|
||||||
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
)),
|
)),
|
||||||
CommonItem(
|
CommonItem(
|
||||||
@ -141,17 +124,12 @@ class _MsgNotificationPageState extends State<MsgNotificationPage> {
|
|||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () {
|
action: () {
|
||||||
Get.toNamed(Routers.coerceOpenDoorPage);
|
Get.toNamed(Routers.coerceOpenDoorPage, arguments: {
|
||||||
|
'lockSetInfoData': state.msgNoticeInfo.value,
|
||||||
|
'lockId': state.getLockId.value
|
||||||
|
});
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
// Container(
|
|
||||||
// alignment: Alignment.centerLeft,
|
|
||||||
// margin: EdgeInsets.only(left: 40.w, top: 20.h, bottom: 20.h),
|
|
||||||
// child: Text(
|
|
||||||
// '门铃通知',
|
|
||||||
// style: TextStyle(color: Colors.black, fontSize: 26.sp, fontWeight: FontWeight.w500),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 10.h,
|
height: 10.h,
|
||||||
),
|
),
|
||||||
@ -162,14 +140,6 @@ class _MsgNotificationPageState extends State<MsgNotificationPage> {
|
|||||||
isHaveRightWidget: true,
|
isHaveRightWidget: true,
|
||||||
rightWidget:
|
rightWidget:
|
||||||
SizedBox(width: 60.w, height: 50.h, child: _switch(3)))),
|
SizedBox(width: 60.w, height: 50.h, child: _switch(3)))),
|
||||||
// Container(
|
|
||||||
// alignment: Alignment.centerLeft,
|
|
||||||
// margin: EdgeInsets.only(left: 40.w, top: 40.h, bottom: 30.h),
|
|
||||||
// child: Text(
|
|
||||||
// '猫眼通知',
|
|
||||||
// style:TextStyle(color: Colors.black, fontSize: 26.sp, fontWeight: FontWeight.w500)
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 10.h,
|
height: 10.h,
|
||||||
),
|
),
|
||||||
|
|||||||
@ -32,111 +32,110 @@ class _NDaysUnopenedPageState extends State<NDaysUnopenedPage> {
|
|||||||
barTitle: 'N天未开门'.tr,
|
barTitle: 'N天未开门'.tr,
|
||||||
haveBack: true,
|
haveBack: true,
|
||||||
backgroundColor: AppColors.mainColor),
|
backgroundColor: AppColors.mainColor),
|
||||||
body: Container(
|
body: ListView(
|
||||||
padding: EdgeInsets.all(30.w),
|
padding: EdgeInsets.all(30.w),
|
||||||
child: Column(
|
children: [
|
||||||
children: [
|
Row(
|
||||||
Row(
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
children: [
|
||||||
children: [
|
Expanded(
|
||||||
Expanded(
|
child: Text(
|
||||||
child: Text(
|
"经过以上设定的时间,锁没有被开启,系统会给指定对象发送提醒消息,该功能需要锁联网".tr,
|
||||||
"经过以上设定的时间,锁没有被开启,系统会给指定对象发送提醒消息,该功能需要锁联网",
|
style: TextStyle(
|
||||||
style: TextStyle(
|
fontSize: 20.sp, color: AppColors.darkGrayTextColor),
|
||||||
fontSize: 20.sp, color: AppColors.darkGrayTextColor),
|
)),
|
||||||
)),
|
],
|
||||||
],
|
),
|
||||||
),
|
SizedBox(
|
||||||
SizedBox(
|
height: 20.h,
|
||||||
height: 20.h,
|
),
|
||||||
),
|
CommonItem(
|
||||||
CommonItem(
|
leftTitel: 'N天未开门提醒'.tr,
|
||||||
leftTitel: 'N天未开门提醒'.tr,
|
rightTitle: '',
|
||||||
rightTitle: '',
|
isHaveLine: true,
|
||||||
isHaveLine: true,
|
isHaveDirection: false,
|
||||||
isHaveDirection: false,
|
isHaveRightWidget: true,
|
||||||
isHaveRightWidget: true,
|
rightWidget: _unOpenDoorSwitch(),
|
||||||
rightWidget: _unOpenDoorSwitch(),
|
action: () {}),
|
||||||
action: () {}),
|
_buildOpenNoticeWidget(),
|
||||||
Visibility(
|
Expanded(
|
||||||
visible: state.isUnOpenNotice.value,
|
child: SizedBox(
|
||||||
child: Column(
|
height: 20.h,
|
||||||
children: [
|
)),
|
||||||
Obx(() => CommonItem(
|
SubmitBtn(
|
||||||
leftTitel: '门未开时间',
|
btnName: '保存'.tr,
|
||||||
rightTitle: '${state.unOpenDoorTime.value}天',
|
onClick: () {
|
||||||
isHaveLine: true,
|
logic.lockNoticeSettingAccountList();
|
||||||
isHaveRightWidget: false,
|
},
|
||||||
isHaveDirection: true,
|
),
|
||||||
action: () {
|
SizedBox(
|
||||||
_openBottomItemSheet(
|
height: 60.h,
|
||||||
context, state.unopenDoorTimeList);
|
)
|
||||||
},
|
],
|
||||||
)),
|
|
||||||
SizedBox(
|
|
||||||
height: 20.h,
|
|
||||||
),
|
|
||||||
GestureDetector(
|
|
||||||
onTap: () {
|
|
||||||
Get.toNamed(Routers.notificationModePage, arguments: {
|
|
||||||
'msgNoticeInfo': state.msgNoticeInfo.value
|
|
||||||
})?.then((val) {
|
|
||||||
if (val != null) {
|
|
||||||
state.emailListStr.value =
|
|
||||||
logic.getEmailListStr(val);
|
|
||||||
state.phontListStr.value =
|
|
||||||
logic.getPhoneListStr(val);
|
|
||||||
print(
|
|
||||||
'emailListStr:${state.emailListStr.value},phontListStr:${state.phontListStr.value}');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
child: Container(
|
|
||||||
color: Colors.white,
|
|
||||||
margin: EdgeInsets.only(bottom: 10.h),
|
|
||||||
child: Column(
|
|
||||||
children: [
|
|
||||||
CommonItem(
|
|
||||||
leftTitel: '提醒方式'.tr,
|
|
||||||
rightTitle: "",
|
|
||||||
isHaveLine: false,
|
|
||||||
isHaveRightWidget: false,
|
|
||||||
isHaveDirection: true,
|
|
||||||
),
|
|
||||||
_buildNotifyContain('APP推送'.tr, '管理员'.tr),
|
|
||||||
Obx(() => state.emailListStr.value.isNotEmpty
|
|
||||||
? _buildNotifyContain(
|
|
||||||
'邮件提醒'.tr, state.emailListStr.value)
|
|
||||||
: Container()),
|
|
||||||
Obx(() => state.phontListStr.value.isNotEmpty
|
|
||||||
? _buildNotifyContain(
|
|
||||||
'短信提醒'.tr, state.phontListStr.value)
|
|
||||||
: Container()),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
)),
|
|
||||||
Expanded(
|
|
||||||
child: SizedBox(
|
|
||||||
height: 20.h,
|
|
||||||
)),
|
|
||||||
SubmitBtn(
|
|
||||||
btnName: '保存',
|
|
||||||
onClick: () {
|
|
||||||
logic.lockNoticeSettingAccountList();
|
|
||||||
},
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
height: 60.h,
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Widget _buildOpenNoticeWidget() {
|
||||||
|
return Visibility(
|
||||||
|
visible: state.isUnOpenNotice.value,
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Obx(() => CommonItem(
|
||||||
|
leftTitel: '门未开时间'.tr,
|
||||||
|
rightTitle: '${state.unOpenDoorTime.value}${'天'.tr}',
|
||||||
|
isHaveLine: true,
|
||||||
|
isHaveRightWidget: false,
|
||||||
|
isHaveDirection: true,
|
||||||
|
action: () {
|
||||||
|
_openBottomItemSheet(context, state.unopenDoorTimeList);
|
||||||
|
},
|
||||||
|
)),
|
||||||
|
SizedBox(
|
||||||
|
height: 20.h,
|
||||||
|
),
|
||||||
|
GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
Get.toNamed(Routers.notificationModePage,
|
||||||
|
arguments: {'msgNoticeInfo': state.msgNoticeInfo.value})
|
||||||
|
?.then((val) {
|
||||||
|
if (val != null) {
|
||||||
|
state.emailListStr.value = logic.getEmailListStr(val);
|
||||||
|
state.phontListStr.value = logic.getPhoneListStr(val);
|
||||||
|
print(
|
||||||
|
'emailListStr:${state.emailListStr.value},phontListStr:${state.phontListStr.value}');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
color: Colors.white,
|
||||||
|
margin: EdgeInsets.only(bottom: 10.h),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
CommonItem(
|
||||||
|
leftTitel: '提醒方式'.tr,
|
||||||
|
rightTitle: "",
|
||||||
|
isHaveLine: false,
|
||||||
|
isHaveRightWidget: false,
|
||||||
|
isHaveDirection: true,
|
||||||
|
),
|
||||||
|
_buildNotifyContain('APP推送'.tr, '管理员'.tr),
|
||||||
|
Obx(() => state.emailListStr.value.isNotEmpty
|
||||||
|
? _buildNotifyContain(
|
||||||
|
'邮件提醒'.tr, state.emailListStr.value)
|
||||||
|
: Container()),
|
||||||
|
Obx(() => state.phontListStr.value.isNotEmpty
|
||||||
|
? _buildNotifyContain(
|
||||||
|
'短信提醒'.tr, state.phontListStr.value)
|
||||||
|
: Container()),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
Widget _buildNotifyContain(String notifyTitle, String notifyContent) {
|
Widget _buildNotifyContain(String notifyTitle, String notifyContent) {
|
||||||
return Container(
|
return Container(
|
||||||
padding:
|
padding:
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:star_lock/main/lockDetail/messageWarn/lockUser/lockUser_entity.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/messageWarn/msgNotification/msgNotification/msgNotification_entity.dart';
|
||||||
import 'package:star_lock/main/lockDetail/messageWarn/msgNotification/openDoorNotify/openDoorNotify_entity.dart';
|
|
||||||
|
|
||||||
class NDaysUnopenedState {
|
class NDaysUnopenedState {
|
||||||
final List unopenDoorTimeList = [
|
final List unopenDoorTimeList = [
|
||||||
|
|||||||
@ -1,5 +1,3 @@
|
|||||||
import 'package:star_lock/main/lockDetail/messageWarn/msgNotification/msgNotification/msgNotification_entity.dart';
|
|
||||||
|
|
||||||
class OpenDoorNotifyEntity {
|
class OpenDoorNotifyEntity {
|
||||||
int? errorCode;
|
int? errorCode;
|
||||||
String? description;
|
String? description;
|
||||||
|
|||||||
@ -196,7 +196,7 @@ class _NotificationModePageState extends State<NotificationModePage> {
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
: Container(),
|
: Container(),
|
||||||
getReceiverTFWidget(isEmail ? '请输入Email'.tr : '请输入手机号', index,
|
getReceiverTFWidget(isEmail ? '请输入Email'.tr : '请输入手机号'.tr, index,
|
||||||
isEmail: isEmail)
|
isEmail: isEmail)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@ -208,6 +208,8 @@ abstract class Api {
|
|||||||
'/lockNoticeSettingAccount/delete'; //删除开门通知
|
'/lockNoticeSettingAccount/delete'; //删除开门通知
|
||||||
final String updateLockNoticeSettingAccountURL =
|
final String updateLockNoticeSettingAccountURL =
|
||||||
'/lockNoticeSettingAccount/update'; //更新开门通知
|
'/lockNoticeSettingAccount/update'; //更新开门通知
|
||||||
|
final String getCoercedFingerprintListURL =
|
||||||
|
'/fingerprint/getCoercedList'; //获取胁迫指纹列表
|
||||||
|
|
||||||
final String setWechatPushSwitchURL =
|
final String setWechatPushSwitchURL =
|
||||||
'/user/setMpWechatPushSwitch'; //设置微信公众号推送
|
'/user/setMpWechatPushSwitch'; //设置微信公众号推送
|
||||||
|
|||||||
@ -1837,6 +1837,17 @@ class ApiProvider extends BaseProvider {
|
|||||||
'dayNotOpenDoorNoticeWayList': dayNotOpenDoorNoticeWayList
|
'dayNotOpenDoorNoticeWayList': dayNotOpenDoorNoticeWayList
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
// 设置低电量提醒
|
||||||
|
Future<Response> updatelowElecNoticeStateSetting(
|
||||||
|
int lockId, int lowElecNoticeState, List lowElecNoticeWayList) =>
|
||||||
|
post(
|
||||||
|
updateLockNoticeSettingURL.toUrl,
|
||||||
|
jsonEncode({
|
||||||
|
'lockId': lockId,
|
||||||
|
'lowElecNoticeState': lowElecNoticeState,
|
||||||
|
'lowElecNoticeWayList': lowElecNoticeWayList
|
||||||
|
}));
|
||||||
|
|
||||||
// 设置门未关好
|
// 设置门未关好
|
||||||
Future<Response> updateDoorNotCloseSetting(
|
Future<Response> updateDoorNotCloseSetting(
|
||||||
int lockId,
|
int lockId,
|
||||||
@ -1923,6 +1934,14 @@ class ApiProvider extends BaseProvider {
|
|||||||
'settingValue': settingValue
|
'settingValue': settingValue
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
// 获取胁迫指纹列表
|
||||||
|
Future<Response> getCoercedFingerprintList(
|
||||||
|
int lockId, int pageNo, int pageSize) =>
|
||||||
|
post(
|
||||||
|
getCoercedFingerprintListURL.toUrl,
|
||||||
|
jsonEncode(
|
||||||
|
{'lockId': lockId, 'pageNo': pageNo, 'pageSize': pageSize}));
|
||||||
|
|
||||||
// 设置微信公众号推送
|
// 设置微信公众号推送
|
||||||
Future<Response> setMpWechatPushSwitch(int mpWechatPushSwitch) => post(
|
Future<Response> setMpWechatPushSwitch(int mpWechatPushSwitch) => post(
|
||||||
setWechatPushSwitchURL.toUrl,
|
setWechatPushSwitchURL.toUrl,
|
||||||
|
|||||||
@ -8,6 +8,7 @@ import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/ma
|
|||||||
import 'package:star_lock/main/lockDetail/face/addFace/addFace_entity.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/lockSet/basicInformation/basicInformation/KeyDetailEntity.dart';
|
||||||
import 'package:star_lock/main/lockDetail/messageWarn/lockUser/lockUser_entity.dart';
|
import 'package:star_lock/main/lockDetail/messageWarn/lockUser/lockUser_entity.dart';
|
||||||
|
import 'package:star_lock/main/lockDetail/messageWarn/msgNotification/coerceOpenDoor/coerceFingerprintList/coerceFingerprintList_entity.dart';
|
||||||
import 'package:star_lock/main/lockDetail/messageWarn/msgNotification/msgNotification/msgNotification_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/passwordKeyList/passwordKeyListEntity.dart';
|
||||||
import 'package:star_lock/main/lockDetail/passwordKey/passwordKey_perpetual/passwordKeyEntity.dart';
|
import 'package:star_lock/main/lockDetail/passwordKey/passwordKey_perpetual/passwordKeyEntity.dart';
|
||||||
@ -1860,6 +1861,16 @@ class ApiRepository {
|
|||||||
return OpenDoorNotifyEntity.fromJson(res.body);
|
return OpenDoorNotifyEntity.fromJson(res.body);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 设置低电量提醒
|
||||||
|
Future<OpenDoorNotifyEntity> updatelowElecNoticeStateSetting(
|
||||||
|
{required int lockId,
|
||||||
|
required int lowElecNoticeState,
|
||||||
|
required List lowElecNoticeWayList}) async {
|
||||||
|
final res = await apiProvider.updatelowElecNoticeStateSetting(
|
||||||
|
lockId, lowElecNoticeState, lowElecNoticeWayList);
|
||||||
|
return OpenDoorNotifyEntity.fromJson(res.body);
|
||||||
|
}
|
||||||
|
|
||||||
// 设置门未关好
|
// 设置门未关好
|
||||||
Future<MsgNotificationEntity> updateDoorNotCloseSetting({
|
Future<MsgNotificationEntity> updateDoorNotCloseSetting({
|
||||||
required int lockId,
|
required int lockId,
|
||||||
@ -1941,6 +1952,14 @@ class ApiRepository {
|
|||||||
return OpenDoorNotifyEntity.fromJson(res.body);
|
return OpenDoorNotifyEntity.fromJson(res.body);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取胁迫指纹列表
|
||||||
|
Future<CoerceFingerprintListEntity> getCoercedFingerprintList(
|
||||||
|
{required int lockId, required int pageNo, required int pageSize}) async {
|
||||||
|
final res =
|
||||||
|
await apiProvider.getCoercedFingerprintList(lockId, pageNo, pageSize);
|
||||||
|
return CoerceFingerprintListEntity.fromJson(res.body);
|
||||||
|
}
|
||||||
|
|
||||||
// 设置微信公众号推送
|
// 设置微信公众号推送
|
||||||
Future<VersionUndateEntity> setMpWechatPushSwitch(
|
Future<VersionUndateEntity> setMpWechatPushSwitch(
|
||||||
{required int mpWechatPushSwitch}) async {
|
{required int mpWechatPushSwitch}) async {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user