diff --git a/star_lock/images/lan/lan_en.json b/star_lock/images/lan/lan_en.json index 6b0d0e08..02973a34 100644 --- a/star_lock/images/lan/lan_en.json +++ b/star_lock/images/lan/lan_en.json @@ -627,6 +627,7 @@ "请将您的手指按下": "Please press your finger", "根据提示,抬起手指后再进行下一次指纹采集": "According to the prompt, lift your finger and then collect the fingerprint again", "添加成功": "Add success", + "更新成功": "Update success", "搜索": "Search", "重置后,该锁的卡都将被删除哦,确认要重置吗?": "After resetting, the card of the lock will be deleted, do you want to reset?", "已失效": "Invalid", diff --git a/star_lock/images/lan/lan_keys.json b/star_lock/images/lan/lan_keys.json index 6e2cb604..68bff2cc 100644 --- a/star_lock/images/lan/lan_keys.json +++ b/star_lock/images/lan/lan_keys.json @@ -626,6 +626,7 @@ "请将您的手指按下": "请将您的手指按下", "根据提示,抬起手指后再进行下一次指纹采集": "根据提示,抬起手指后再进行下一次指纹采集", "添加成功": "添加成功", + "更新成功": "更新成功", "搜索": "搜索", "重置后,该锁的卡都将被删除哦,确认要重置吗?": "重置后,该锁的卡都将被删除哦,确认要重置吗?", "已失效": "已失效", diff --git a/star_lock/images/lan/lan_zh.json b/star_lock/images/lan/lan_zh.json index f2c861e7..72573a1a 100644 --- a/star_lock/images/lan/lan_zh.json +++ b/star_lock/images/lan/lan_zh.json @@ -628,6 +628,7 @@ "请将您的手指按下": "请将您的手指按下", "根据提示,抬起手指后再进行下一次指纹采集": "根据提示,抬起手指后再进行下一次指纹采集", "添加成功": "添加成功", + "更新成功": "更新成功", "搜索": "搜索", "重置后,该锁的卡都将被删除哦,确认要重置吗?": "重置后,该锁的卡都将被删除哦,确认要重置吗?", "已失效": "已失效", diff --git a/star_lock/lib/appRouters.dart b/star_lock/lib/appRouters.dart index f7e1ef52..9b54cce3 100644 --- a/star_lock/lib/appRouters.dart +++ b/star_lock/lib/appRouters.dart @@ -22,7 +22,6 @@ import 'package:star_lock/main/lockDetail/lockSet/motorPower/motorPower_page.dar 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'; @@ -397,7 +396,6 @@ abstract class Routers { static const nDaysUnopenedPage = '/nDaysUnopenedPage'; //N天未开门 static const notificationModePage = '/notificationModePage'; //提醒方式 static const openDoorNotifyPage = '/openDoorNotifyPage'; //家人到家 - static const familyDetailsPage = '/familyDetailsPage'; // 家人详情 static const addFamilyPage = '/addFamilyPage'; //添加家人 static const lockUserPage = '/lockUserPage'; //锁用户 static const catEyeSetPage = '/catEyeSetPage'; //猫眼设置 @@ -974,8 +972,6 @@ abstract class AppRouters { GetPage( name: Routers.openDoorNotifyPage, page: () => const OpenDoorNotifyPage()), - GetPage( - name: Routers.familyDetailsPage, page: () => const FamilyDetailsPage()), GetPage(name: Routers.addFamilyPage, page: () => const AddFamilyPage()), GetPage(name: Routers.lockUserPage, page: () => const LockUserPage()), GetPage(name: Routers.catEyeSetPage, page: () => const CatEyeSetPage()), diff --git a/star_lock/lib/main/lockDetail/messageWarn/addFamily/addFamily_logic.dart b/star_lock/lib/main/lockDetail/messageWarn/addFamily/addFamily_logic.dart index 71217497..16979fee 100644 --- a/star_lock/lib/main/lockDetail/messageWarn/addFamily/addFamily_logic.dart +++ b/star_lock/lib/main/lockDetail/messageWarn/addFamily/addFamily_logic.dart @@ -29,6 +29,24 @@ class AddFamilyLogic extends BaseGetXController { } } + //更新开门通知 + void updateLockNoticeSetting() async { + var entity = await ApiRepository.to.updateLockNoticeSettingAccount( + lockNoticeSettingAccountId: state.familyData.value.id!, + settingValue: { + 'openDoorId': state.familyData.value.settingValue!.openDoorId!, + 'openDoorType': state.familyData.value.settingValue!.openDoorType!, + 'remark': state.changeNameController.text, + 'noticeWay': state.familyData.value.settingValue!.noticeWayList, + }, + ); + if (entity.errorCode!.codeIsSuccessful) { + showToast('更新成功'.tr); + state.lockUserKeys.value.currentKeyName = state.changeNameController.text; + Get.back(result: true); + } + } + //删除开门通知 void deleteLockNoticeSetting() async { var entity = await ApiRepository.to.deleteLockNoticeSettingAccount( diff --git a/star_lock/lib/main/lockDetail/messageWarn/addFamily/addFamily_page.dart b/star_lock/lib/main/lockDetail/messageWarn/addFamily/addFamily_page.dart index bc34102e..bd6b522e 100644 --- a/star_lock/lib/main/lockDetail/messageWarn/addFamily/addFamily_page.dart +++ b/star_lock/lib/main/lockDetail/messageWarn/addFamily/addFamily_page.dart @@ -1,10 +1,13 @@ import 'package:flutter/material.dart'; +import 'package:flutter/services.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/showTFView.dart'; import 'package:star_lock/tools/submitBtn.dart'; +import 'package:star_lock/translations/trans_lib.dart'; import '../../../../../app_settings/app_colors.dart'; import '../../../../../tools/titleAppBar.dart'; @@ -51,50 +54,56 @@ class _AddFamilyPageState extends State { })), Obx(() => CommonItem( leftTitel: '家人'.tr, - rightTitle: state.isDetail.value - ? state.familyData.value.settingValue?.remark - : state.lockUserKeys.value.currentKeyName, + rightTitle: state.lockUserKeys.value.currentKeyName, isHaveLine: true, - isHaveRightWidget: - state.lockUserKeys.value.currentKeyName == null - ? true - : false, + isHaveRightWidget: state.isDetail.value ? false : true, isHaveDirection: false, rightWidget: getFamilyWidget('请输入'.tr), + action: () { + if (state.isDetail.value == true) { + showCupertinoAlertDialog(); + } + }, )), SizedBox( height: 20.h, ), - Container( - color: Colors.white, - margin: EdgeInsets.only(bottom: 10.h), - child: Column( - children: [ - CommonItem( - leftTitel: '提醒方式'.tr, - rightTitle: "", - isHaveLine: false, - isHaveRightWidget: false, - isHaveDirection: true, - action: () { - Get.toNamed(Routers.notificationModePage)?.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}'); - } - }); - }, - ), - _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()), - ], + GestureDetector( + onTap: () { + Get.toNamed(Routers.notificationModePage, + arguments: {'familyData': state.familyData.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( @@ -152,12 +161,36 @@ class _AddFamilyPageState extends State { ); } - // 接受者邮箱输入框 +//修改家人名称弹窗 + void showCupertinoAlertDialog() { + showDialog( + context: context, + builder: (BuildContext context) { + return ShowTFView( + title: + "${TranslationLoader.lanKeys!.amend!.tr}${TranslationLoader.lanKeys!.name!.tr}", + tipTitle: "请输入".tr, + controller: state.changeNameController, + sureClick: () { + //发送编辑钥匙名称请求 + if (state.changeNameController.text.isNotEmpty) { + logic.updateLockNoticeSetting(); + } else { + logic.showToast('请输入'.tr); + } + }, + cancelClick: () { + Navigator.pop(context); + }, + ); + }, + ); + } + + // 接受者信息输入框 Widget getFamilyWidget(String tfStr) { TextEditingController emailController = TextEditingController(); - if (state.isDetail.value) { - emailController.text = state.familyData.value.settingValue?.remark ?? ''; - } + emailController.text = state.lockUserKeys.value.currentKeyName ?? ''; return SizedBox( height: 50.h, width: 360.w, @@ -168,17 +201,35 @@ class _AddFamilyPageState extends State { controller: emailController, //输入框一行 maxLines: 1, + inputFormatters: [ + FilteringTextInputFormatter.deny('\n'), + LengthLimitingTextInputFormatter(30), + ], autofocus: false, textAlign: TextAlign.end, - style: TextStyle(fontSize: 22.sp), decoration: InputDecoration( - //输入里面输入文字内边距设置 - contentPadding: const EdgeInsets.only(top: -12.0, bottom: 0.0), hintText: tfStr, hintStyle: TextStyle(fontSize: 22.sp), - //不需要输入框下划线 - border: InputBorder.none, + focusedBorder: const OutlineInputBorder( + borderSide: + BorderSide(width: 0, color: Colors.transparent)), + disabledBorder: const OutlineInputBorder( + borderSide: + BorderSide(width: 0, color: Colors.transparent)), + enabledBorder: const OutlineInputBorder( + borderSide: + BorderSide(width: 0, color: Colors.transparent)), + border: const OutlineInputBorder( + borderSide: + BorderSide(width: 0, color: Colors.transparent)), + contentPadding: const EdgeInsets.symmetric(vertical: 0), ), + style: TextStyle( + fontSize: 22.sp, textBaseline: TextBaseline.alphabetic), + onChanged: (value) { + state.lockUserKeys.value.currentKeyName = value; + state.lockUserKeys.refresh(); + }, ), ), ], diff --git a/star_lock/lib/main/lockDetail/messageWarn/addFamily/addFamily_state.dart b/star_lock/lib/main/lockDetail/messageWarn/addFamily/addFamily_state.dart index 79d4ea97..a8bfce2b 100644 --- a/star_lock/lib/main/lockDetail/messageWarn/addFamily/addFamily_state.dart +++ b/star_lock/lib/main/lockDetail/messageWarn/addFamily/addFamily_state.dart @@ -1,8 +1,10 @@ +import 'package:flutter/material.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/openDoorNotify/openDoorNotify_entity.dart'; class AddFamilyState { + final TextEditingController changeNameController = TextEditingController(); var getLockId = 0.obs; var lockUserKeys = LockUserListKeys().obs; var emailReceiverList = [].obs; @@ -27,6 +29,8 @@ class AddFamilyState { if (map['itemData'] != null) { familyData.value = map['itemData']; + lockUserKeys.value.currentKeyName = + familyData.value.settingValue!.remark!; } } } diff --git a/star_lock/lib/main/lockDetail/messageWarn/familyDetails/familyDetails_logic.dart b/star_lock/lib/main/lockDetail/messageWarn/familyDetails/familyDetails_logic.dart deleted file mode 100644 index 3bf4eb49..00000000 --- a/star_lock/lib/main/lockDetail/messageWarn/familyDetails/familyDetails_logic.dart +++ /dev/null @@ -1,6 +0,0 @@ -import 'package:star_lock/main/lockDetail/messageWarn/familyDetails/familyDetails_state.dart'; -import 'package:star_lock/tools/baseGetXController.dart'; - -class FamilyDetailsLogic extends BaseGetXController { - final FamilyDetailsState state = FamilyDetailsState(); -} diff --git a/star_lock/lib/main/lockDetail/messageWarn/familyDetails/familyDetails_page.dart b/star_lock/lib/main/lockDetail/messageWarn/familyDetails/familyDetails_page.dart deleted file mode 100644 index 7d237ae6..00000000 --- a/star_lock/lib/main/lockDetail/messageWarn/familyDetails/familyDetails_page.dart +++ /dev/null @@ -1,167 +0,0 @@ -import 'package:flutter/cupertino.dart'; -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/familyDetails/familyDetails_logic.dart'; -import 'package:star_lock/tools/commonItem.dart'; -import 'package:star_lock/tools/showTFView.dart'; -import 'package:star_lock/tools/submitBtn.dart'; -import 'package:star_lock/translations/trans_lib.dart'; - -import '../../../../../app_settings/app_colors.dart'; -import '../../../../../tools/titleAppBar.dart'; - -class FamilyDetailsPage extends StatefulWidget { - const FamilyDetailsPage({Key? key}) : super(key: key); - - @override - State createState() => _FamilyDetailsPageState(); -} - -class _FamilyDetailsPageState extends State { - final logic = Get.put(FamilyDetailsLogic()); - final state = Get.find().state; - - @override - Widget build(BuildContext context) { - return Scaffold( - backgroundColor: AppColors.mainBackgroundColor, - appBar: TitleAppBar( - barTitle: '家人详情', - haveBack: true, - backgroundColor: AppColors.mainColor), - body: Container( - padding: EdgeInsets.all(30.w), - child: Column( - children: [ - CommonItem( - leftTitel: '开门方式', - rightTitle: '电子钥匙', - isHaveLine: true, - isHaveDirection: true, - action: () { - //锁用户 - Get.toNamed(Routers.lockUserPage); - }), - Obx(() => CommonItem( - leftTitel: '家人', - rightTitle: state.familyName.value, - isHaveLine: true, - isHaveRightWidget: false, - isHaveDirection: true, - action: () { - state.changeNameController.text = state.familyName.value; - _showEditNameAlert(context); - }, - )), - SizedBox( - height: 20.h, - ), - Container( - color: Colors.white, - margin: EdgeInsets.only(bottom: 10.h), - child: Column( - children: [ - CommonItem( - leftTitel: '提醒方式'.tr, - rightTitle: "", - isHaveLine: false, - isHaveRightWidget: false, - isHaveDirection: true, - action: () { - Get.toNamed(Routers.notificationModePage); - }, - ), - 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), - ), - ) - ], - ), - ), - Expanded( - child: SizedBox( - height: 40.h, - )), - SubmitBtn( - btnName: '删除', - isDelete: true, - onClick: () { - _showDialog(context); - }, - ), - SizedBox( - height: 60.h, - ) - ], - ), - ), - ); - } - - //确认弹窗 - void _showDialog(widgetContext) { - showCupertinoDialog( - context: widgetContext, - builder: (context) { - return CupertinoAlertDialog( - title: Text( - '是否删除家人', - style: TextStyle(color: Colors.black, fontSize: 24.sp), - ), - content: Text('删除家人后,你将不会收到他到家的消息。', - style: TextStyle( - color: AppColors.darkGrayTextColor, fontSize: 22.sp)), - actions: [ - CupertinoDialogAction( - child: Text( - '取消', - style: TextStyle(color: AppColors.mainColor), - ), - onPressed: () { - Navigator.of(context).pop(); - }, - ), - CupertinoDialogAction( - child: Text('删除', style: TextStyle(color: AppColors.mainColor)), - onPressed: () { - Navigator.of(context).pop(); - }, - ), - ], - ); - }, - ); - } - - void _showEditNameAlert(BuildContext context) { - showDialog( - context: context, - builder: (BuildContext context) { - return ShowTFView( - title: - "${TranslationLoader.lanKeys!.amend!.tr}${TranslationLoader.lanKeys!.name!.tr}", - tipTitle: "请输入", - controller: state.changeNameController, - sureClick: () { - Navigator.pop(context); - state.familyName.value = state.changeNameController.text; - }, - cancelClick: () { - Navigator.pop(context); - }, - ); - }, - ); - } -} diff --git a/star_lock/lib/main/lockDetail/messageWarn/familyDetails/familyDetails_state.dart b/star_lock/lib/main/lockDetail/messageWarn/familyDetails/familyDetails_state.dart deleted file mode 100644 index f397f63e..00000000 --- a/star_lock/lib/main/lockDetail/messageWarn/familyDetails/familyDetails_state.dart +++ /dev/null @@ -1,21 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:get/get.dart'; -import 'package:star_lock/main/lockDetail/messageWarn/msgNotification/openDoorNotify/openDoorNotify_entity.dart'; - -class FamilyDetailsState { - TextEditingController changeNameController = TextEditingController(); //修改名称 - var familyName = '我'.obs; - var getLockId = 0.obs; - var familyData = DataList().obs; - - FamilyDetailsState() { - Map map = Get.arguments; - if (map['lockId'] != null) { - getLockId.value = map['lockId']; - } - - if (map['itemData'] != null) { - familyData.value = map['itemData']; - } - } -} diff --git a/star_lock/lib/main/lockDetail/messageWarn/notificationMode/notificationMode_page.dart b/star_lock/lib/main/lockDetail/messageWarn/notificationMode/notificationMode_page.dart index d5653eb2..c4dea969 100644 --- a/star_lock/lib/main/lockDetail/messageWarn/notificationMode/notificationMode_page.dart +++ b/star_lock/lib/main/lockDetail/messageWarn/notificationMode/notificationMode_page.dart @@ -210,6 +210,9 @@ class _NotificationModePageState extends State { MsgNoticeModeData msgData = isEmail ? state.emailReceiverList.value[lineIndex] : state.phoneReceiverList.value[lineIndex]; + msgData.countryCode = state.countryCode.value; + msgData.receiverTF.text = + isEmail ? msgData.receiveEmail : msgData.receivePhone; return SizedBox( height: 65.h, width: 200.w, diff --git a/star_lock/lib/main/lockDetail/messageWarn/notificationMode/notificationMode_state.dart b/star_lock/lib/main/lockDetail/messageWarn/notificationMode/notificationMode_state.dart index 6b228506..bf7eeb80 100644 --- a/star_lock/lib/main/lockDetail/messageWarn/notificationMode/notificationMode_state.dart +++ b/star_lock/lib/main/lockDetail/messageWarn/notificationMode/notificationMode_state.dart @@ -1,4 +1,6 @@ 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'; class NotificationModeState { var emailReceiverList = [].obs; @@ -6,4 +8,34 @@ class NotificationModeState { var countryName = '中国'.obs; var countryCode = 86.obs; + var familyData = DataList().obs; + + NotificationModeState() { + Map map = Get.arguments; + if (map['familyData'] != null) { + familyData.value = map['familyData']; + if (familyData.value.settingValue != null) { + for (NoticeWay item in 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!; + emailReceiverList.value.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!; + phoneReceiverList.value.add(msgNoticeModeData); + } + } + } + } + } + } + } } diff --git a/star_lock/lib/network/api.dart b/star_lock/lib/network/api.dart index 10bdf951..121bc19e 100644 --- a/star_lock/lib/network/api.dart +++ b/star_lock/lib/network/api.dart @@ -206,6 +206,8 @@ abstract class Api { '/lockNoticeSettingAccount/list'; //开门通知列表 final String deleteLockNoticeSettingAccountURL = '/lockNoticeSettingAccount/delete'; //删除开门通知 + final String updateLockNoticeSettingAccountURL = + '/lockNoticeSettingAccount/update'; //更新开门通知 final String setWechatPushSwitchURL = '/user/setMpWechatPushSwitch'; //设置微信公众号推送 diff --git a/star_lock/lib/network/api_provider.dart b/star_lock/lib/network/api_provider.dart index bce7e4aa..6bac8a11 100644 --- a/star_lock/lib/network/api_provider.dart +++ b/star_lock/lib/network/api_provider.dart @@ -1228,18 +1228,17 @@ class ApiProvider extends BaseProvider { // 更新人脸用户信息--有效期 Future updateFaceValidity( - int faceId, - int lockId, - int startDate, - int endDate, - int startTime, - int endTime, - int faceType, - List weekDay, - String faceName, - String addType, - int isCoerced - ) => + int faceId, + int lockId, + int startDate, + int endDate, + int startTime, + int endTime, + int faceType, + List weekDay, + String faceName, + String addType, + int isCoerced) => post( updateFaceUserInfoURL.toUrl, jsonEncode({ @@ -1250,7 +1249,7 @@ class ApiProvider extends BaseProvider { 'startTime': startTime, 'endTime': endTime, 'faceType': faceType, - "weekDay":weekDay, + "weekDay": weekDay, 'faceName': faceName, 'addType': addType, "isCoerced": isCoerced, @@ -1914,6 +1913,16 @@ class ApiProvider extends BaseProvider { jsonEncode( {'lockNoticeSettingAccountId': lockNoticeSettingAccountId})); + // 更新开门通知 + Future updateLockNoticeSettingAccount( + int lockNoticeSettingAccountId, Map settingValue) => + post( + updateLockNoticeSettingAccountURL.toUrl, + jsonEncode({ + 'lockNoticeSettingAccountId': lockNoticeSettingAccountId, + 'settingValue': settingValue + })); + // 设置微信公众号推送 Future setMpWechatPushSwitch(int mpWechatPushSwitch) => post( setWechatPushSwitchURL.toUrl, diff --git a/star_lock/lib/network/api_repository.dart b/star_lock/lib/network/api_repository.dart index 581f7e92..8971d845 100644 --- a/star_lock/lib/network/api_repository.dart +++ b/star_lock/lib/network/api_repository.dart @@ -1388,18 +1388,28 @@ class ApiRepository { // 更新人脸用户信息--有效期 Future updateFaceValidity( {required int faceId, - required int lockId, - required int startDate, - required int endDate, - required int startTime, - required int endTime, - required int faceType, - required List weekDay, - required String faceName, - required String addType, - required int isCoerced}) async { + required int lockId, + required int startDate, + required int endDate, + required int startTime, + required int endTime, + required int faceType, + required List weekDay, + required String faceName, + required String addType, + required int isCoerced}) async { final res = await apiProvider.updateFaceValidity( - faceId, lockId, startDate, endDate, startTime, endTime, faceType, weekDay, faceName, addType, isCoerced); + faceId, + lockId, + startDate, + endDate, + startTime, + endTime, + faceType, + weekDay, + faceName, + addType, + isCoerced); return LoginEntity.fromJson(res.body); } @@ -1922,6 +1932,15 @@ class ApiRepository { return OpenDoorNotifyEntity.fromJson(res.body); } + // 更新开门通知 + Future updateLockNoticeSettingAccount( + {required int lockNoticeSettingAccountId, + required Map settingValue}) async { + final res = await apiProvider.updateLockNoticeSettingAccount( + lockNoticeSettingAccountId, settingValue); + return OpenDoorNotifyEntity.fromJson(res.body); + } + // 设置微信公众号推送 Future setMpWechatPushSwitch( {required int mpWechatPushSwitch}) async {