Merge branch 'master' of https://gitee.com/starlock-cn/app-starlock
This commit is contained in:
commit
c505fcd2f3
@ -627,6 +627,7 @@
|
|||||||
"请将您的手指按下": "Please press your finger",
|
"请将您的手指按下": "Please press your finger",
|
||||||
"根据提示,抬起手指后再进行下一次指纹采集": "According to the prompt, lift your finger and then collect the fingerprint again",
|
"根据提示,抬起手指后再进行下一次指纹采集": "According to the prompt, lift your finger and then collect the fingerprint again",
|
||||||
"添加成功": "Add success",
|
"添加成功": "Add success",
|
||||||
|
"更新成功": "Update success",
|
||||||
"搜索": "Search",
|
"搜索": "Search",
|
||||||
"重置后,该锁的卡都将被删除哦,确认要重置吗?": "After resetting, the card of the lock will be deleted, do you want to reset?",
|
"重置后,该锁的卡都将被删除哦,确认要重置吗?": "After resetting, the card of the lock will be deleted, do you want to reset?",
|
||||||
"已失效": "Invalid",
|
"已失效": "Invalid",
|
||||||
|
|||||||
@ -626,6 +626,7 @@
|
|||||||
"请将您的手指按下": "请将您的手指按下",
|
"请将您的手指按下": "请将您的手指按下",
|
||||||
"根据提示,抬起手指后再进行下一次指纹采集": "根据提示,抬起手指后再进行下一次指纹采集",
|
"根据提示,抬起手指后再进行下一次指纹采集": "根据提示,抬起手指后再进行下一次指纹采集",
|
||||||
"添加成功": "添加成功",
|
"添加成功": "添加成功",
|
||||||
|
"更新成功": "更新成功",
|
||||||
"搜索": "搜索",
|
"搜索": "搜索",
|
||||||
"重置后,该锁的卡都将被删除哦,确认要重置吗?": "重置后,该锁的卡都将被删除哦,确认要重置吗?",
|
"重置后,该锁的卡都将被删除哦,确认要重置吗?": "重置后,该锁的卡都将被删除哦,确认要重置吗?",
|
||||||
"已失效": "已失效",
|
"已失效": "已失效",
|
||||||
|
|||||||
@ -628,6 +628,7 @@
|
|||||||
"请将您的手指按下": "请将您的手指按下",
|
"请将您的手指按下": "请将您的手指按下",
|
||||||
"根据提示,抬起手指后再进行下一次指纹采集": "根据提示,抬起手指后再进行下一次指纹采集",
|
"根据提示,抬起手指后再进行下一次指纹采集": "根据提示,抬起手指后再进行下一次指纹采集",
|
||||||
"添加成功": "添加成功",
|
"添加成功": "添加成功",
|
||||||
|
"更新成功": "更新成功",
|
||||||
"搜索": "搜索",
|
"搜索": "搜索",
|
||||||
"重置后,该锁的卡都将被删除哦,确认要重置吗?": "重置后,该锁的卡都将被删除哦,确认要重置吗?",
|
"重置后,该锁的卡都将被删除哦,确认要重置吗?": "重置后,该锁的卡都将被删除哦,确认要重置吗?",
|
||||||
"已失效": "已失效",
|
"已失效": "已失效",
|
||||||
|
|||||||
@ -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/lockSet/openDoorDirection/openDoorDirection_page.dart';
|
||||||
import 'package:star_lock/main/lockDetail/lockDetail/lockDetail_main_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/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/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/coerceFingerprint/coerceFingerprint_page.dart';
|
||||||
import 'package:star_lock/main/lockDetail/messageWarn/msgNotification/coerceOpenDoor/coerceFingerprintList/coerceFingerprintList_page.dart';
|
import 'package:star_lock/main/lockDetail/messageWarn/msgNotification/coerceOpenDoor/coerceFingerprintList/coerceFingerprintList_page.dart';
|
||||||
@ -397,7 +396,6 @@ abstract class Routers {
|
|||||||
static const nDaysUnopenedPage = '/nDaysUnopenedPage'; //N天未开门
|
static const nDaysUnopenedPage = '/nDaysUnopenedPage'; //N天未开门
|
||||||
static const notificationModePage = '/notificationModePage'; //提醒方式
|
static const notificationModePage = '/notificationModePage'; //提醒方式
|
||||||
static const openDoorNotifyPage = '/openDoorNotifyPage'; //家人到家
|
static const openDoorNotifyPage = '/openDoorNotifyPage'; //家人到家
|
||||||
static const familyDetailsPage = '/familyDetailsPage'; // 家人详情
|
|
||||||
static const addFamilyPage = '/addFamilyPage'; //添加家人
|
static const addFamilyPage = '/addFamilyPage'; //添加家人
|
||||||
static const lockUserPage = '/lockUserPage'; //锁用户
|
static const lockUserPage = '/lockUserPage'; //锁用户
|
||||||
static const catEyeSetPage = '/catEyeSetPage'; //猫眼设置
|
static const catEyeSetPage = '/catEyeSetPage'; //猫眼设置
|
||||||
@ -974,8 +972,6 @@ abstract class AppRouters {
|
|||||||
GetPage(
|
GetPage(
|
||||||
name: Routers.openDoorNotifyPage,
|
name: Routers.openDoorNotifyPage,
|
||||||
page: () => const OpenDoorNotifyPage()),
|
page: () => const OpenDoorNotifyPage()),
|
||||||
GetPage(
|
|
||||||
name: Routers.familyDetailsPage, page: () => const FamilyDetailsPage()),
|
|
||||||
GetPage(name: Routers.addFamilyPage, page: () => const AddFamilyPage()),
|
GetPage(name: Routers.addFamilyPage, page: () => const AddFamilyPage()),
|
||||||
GetPage(name: Routers.lockUserPage, page: () => const LockUserPage()),
|
GetPage(name: Routers.lockUserPage, page: () => const LockUserPage()),
|
||||||
GetPage(name: Routers.catEyeSetPage, page: () => const CatEyeSetPage()),
|
GetPage(name: Routers.catEyeSetPage, page: () => const CatEyeSetPage()),
|
||||||
|
|||||||
@ -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 {
|
void deleteLockNoticeSetting() async {
|
||||||
var entity = await ApiRepository.to.deleteLockNoticeSettingAccount(
|
var entity = await ApiRepository.to.deleteLockNoticeSettingAccount(
|
||||||
|
|||||||
@ -1,10 +1,13 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/services.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/addFamily/addFamily_logic.dart';
|
import 'package:star_lock/main/lockDetail/messageWarn/addFamily/addFamily_logic.dart';
|
||||||
import 'package:star_lock/tools/commonItem.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/tools/submitBtn.dart';
|
||||||
|
import 'package:star_lock/translations/trans_lib.dart';
|
||||||
|
|
||||||
import '../../../../../app_settings/app_colors.dart';
|
import '../../../../../app_settings/app_colors.dart';
|
||||||
import '../../../../../tools/titleAppBar.dart';
|
import '../../../../../tools/titleAppBar.dart';
|
||||||
@ -51,50 +54,56 @@ class _AddFamilyPageState extends State<AddFamilyPage> {
|
|||||||
})),
|
})),
|
||||||
Obx(() => CommonItem(
|
Obx(() => CommonItem(
|
||||||
leftTitel: '家人'.tr,
|
leftTitel: '家人'.tr,
|
||||||
rightTitle: state.isDetail.value
|
rightTitle: state.lockUserKeys.value.currentKeyName,
|
||||||
? state.familyData.value.settingValue?.remark
|
|
||||||
: state.lockUserKeys.value.currentKeyName,
|
|
||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
isHaveRightWidget:
|
isHaveRightWidget: state.isDetail.value ? false : true,
|
||||||
state.lockUserKeys.value.currentKeyName == null
|
|
||||||
? true
|
|
||||||
: false,
|
|
||||||
isHaveDirection: false,
|
isHaveDirection: false,
|
||||||
rightWidget: getFamilyWidget('请输入'.tr),
|
rightWidget: getFamilyWidget('请输入'.tr),
|
||||||
|
action: () {
|
||||||
|
if (state.isDetail.value == true) {
|
||||||
|
showCupertinoAlertDialog();
|
||||||
|
}
|
||||||
|
},
|
||||||
)),
|
)),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 20.h,
|
height: 20.h,
|
||||||
),
|
),
|
||||||
Container(
|
GestureDetector(
|
||||||
color: Colors.white,
|
onTap: () {
|
||||||
margin: EdgeInsets.only(bottom: 10.h),
|
Get.toNamed(Routers.notificationModePage,
|
||||||
child: Column(
|
arguments: {'familyData': state.familyData.value})
|
||||||
children: [
|
?.then((val) {
|
||||||
CommonItem(
|
if (val != null) {
|
||||||
leftTitel: '提醒方式'.tr,
|
state.emailListStr.value = logic.getEmailListStr(val);
|
||||||
rightTitle: "",
|
state.phontListStr.value = logic.getPhoneListStr(val);
|
||||||
isHaveLine: false,
|
print(
|
||||||
isHaveRightWidget: false,
|
'emailListStr:${state.emailListStr.value},phontListStr:${state.phontListStr.value}');
|
||||||
isHaveDirection: true,
|
}
|
||||||
action: () {
|
});
|
||||||
Get.toNamed(Routers.notificationModePage)?.then((val) {
|
},
|
||||||
if (val != null) {
|
child: Container(
|
||||||
state.emailListStr.value = logic.getEmailListStr(val);
|
color: Colors.white,
|
||||||
state.phontListStr.value = logic.getPhoneListStr(val);
|
margin: EdgeInsets.only(bottom: 10.h),
|
||||||
print(
|
child: Column(
|
||||||
'emailListStr:${state.emailListStr.value},phontListStr:${state.phontListStr.value}');
|
children: [
|
||||||
}
|
CommonItem(
|
||||||
});
|
leftTitel: '提醒方式'.tr,
|
||||||
},
|
rightTitle: "",
|
||||||
),
|
isHaveLine: false,
|
||||||
_buildNotifyContain('APP推送'.tr, '管理员'.tr),
|
isHaveRightWidget: false,
|
||||||
Obx(() => state.emailListStr.value.isNotEmpty
|
isHaveDirection: true,
|
||||||
? _buildNotifyContain('邮件提醒'.tr, state.emailListStr.value)
|
),
|
||||||
: Container()),
|
_buildNotifyContain('APP推送'.tr, '管理员'.tr),
|
||||||
Obx(() => state.phontListStr.value.isNotEmpty
|
Obx(() => state.emailListStr.value.isNotEmpty
|
||||||
? _buildNotifyContain('短信提醒'.tr, state.phontListStr.value)
|
? _buildNotifyContain(
|
||||||
: Container()),
|
'邮件提醒'.tr, state.emailListStr.value)
|
||||||
],
|
: Container()),
|
||||||
|
Obx(() => state.phontListStr.value.isNotEmpty
|
||||||
|
? _buildNotifyContain(
|
||||||
|
'短信提醒'.tr, state.phontListStr.value)
|
||||||
|
: Container()),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
@ -152,12 +161,36 @@ class _AddFamilyPageState extends State<AddFamilyPage> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 接受者邮箱输入框
|
//修改家人名称弹窗
|
||||||
|
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) {
|
Widget getFamilyWidget(String tfStr) {
|
||||||
TextEditingController emailController = TextEditingController();
|
TextEditingController emailController = TextEditingController();
|
||||||
if (state.isDetail.value) {
|
emailController.text = state.lockUserKeys.value.currentKeyName ?? '';
|
||||||
emailController.text = state.familyData.value.settingValue?.remark ?? '';
|
|
||||||
}
|
|
||||||
return SizedBox(
|
return SizedBox(
|
||||||
height: 50.h,
|
height: 50.h,
|
||||||
width: 360.w,
|
width: 360.w,
|
||||||
@ -168,17 +201,35 @@ class _AddFamilyPageState extends State<AddFamilyPage> {
|
|||||||
controller: emailController,
|
controller: emailController,
|
||||||
//输入框一行
|
//输入框一行
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
|
inputFormatters: <TextInputFormatter>[
|
||||||
|
FilteringTextInputFormatter.deny('\n'),
|
||||||
|
LengthLimitingTextInputFormatter(30),
|
||||||
|
],
|
||||||
autofocus: false,
|
autofocus: false,
|
||||||
textAlign: TextAlign.end,
|
textAlign: TextAlign.end,
|
||||||
style: TextStyle(fontSize: 22.sp),
|
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
//输入里面输入文字内边距设置
|
|
||||||
contentPadding: const EdgeInsets.only(top: -12.0, bottom: 0.0),
|
|
||||||
hintText: tfStr,
|
hintText: tfStr,
|
||||||
hintStyle: TextStyle(fontSize: 22.sp),
|
hintStyle: TextStyle(fontSize: 22.sp),
|
||||||
//不需要输入框下划线
|
focusedBorder: const OutlineInputBorder(
|
||||||
border: InputBorder.none,
|
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();
|
||||||
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
@ -1,8 +1,10 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
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/openDoorNotify/openDoorNotify_entity.dart';
|
import 'package:star_lock/main/lockDetail/messageWarn/msgNotification/openDoorNotify/openDoorNotify_entity.dart';
|
||||||
|
|
||||||
class AddFamilyState {
|
class AddFamilyState {
|
||||||
|
final TextEditingController changeNameController = TextEditingController();
|
||||||
var getLockId = 0.obs;
|
var getLockId = 0.obs;
|
||||||
var lockUserKeys = LockUserListKeys().obs;
|
var lockUserKeys = LockUserListKeys().obs;
|
||||||
var emailReceiverList = [].obs;
|
var emailReceiverList = [].obs;
|
||||||
@ -27,6 +29,8 @@ class AddFamilyState {
|
|||||||
|
|
||||||
if (map['itemData'] != null) {
|
if (map['itemData'] != null) {
|
||||||
familyData.value = map['itemData'];
|
familyData.value = map['itemData'];
|
||||||
|
lockUserKeys.value.currentKeyName =
|
||||||
|
familyData.value.settingValue!.remark!;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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();
|
|
||||||
}
|
|
||||||
@ -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<FamilyDetailsPage> createState() => _FamilyDetailsPageState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _FamilyDetailsPageState extends State<FamilyDetailsPage> {
|
|
||||||
final logic = Get.put(FamilyDetailsLogic());
|
|
||||||
final state = Get.find<FamilyDetailsLogic>().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);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -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'];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -210,6 +210,9 @@ class _NotificationModePageState extends State<NotificationModePage> {
|
|||||||
MsgNoticeModeData msgData = isEmail
|
MsgNoticeModeData msgData = isEmail
|
||||||
? state.emailReceiverList.value[lineIndex]
|
? state.emailReceiverList.value[lineIndex]
|
||||||
: state.phoneReceiverList.value[lineIndex];
|
: state.phoneReceiverList.value[lineIndex];
|
||||||
|
msgData.countryCode = state.countryCode.value;
|
||||||
|
msgData.receiverTF.text =
|
||||||
|
isEmail ? msgData.receiveEmail : msgData.receivePhone;
|
||||||
return SizedBox(
|
return SizedBox(
|
||||||
height: 65.h,
|
height: 65.h,
|
||||||
width: 200.w,
|
width: 200.w,
|
||||||
|
|||||||
@ -1,4 +1,6 @@
|
|||||||
import 'package:get/get.dart';
|
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 {
|
class NotificationModeState {
|
||||||
var emailReceiverList = [].obs;
|
var emailReceiverList = [].obs;
|
||||||
@ -6,4 +8,34 @@ class NotificationModeState {
|
|||||||
|
|
||||||
var countryName = '中国'.obs;
|
var countryName = '中国'.obs;
|
||||||
var countryCode = 86.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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -206,6 +206,8 @@ abstract class Api {
|
|||||||
'/lockNoticeSettingAccount/list'; //开门通知列表
|
'/lockNoticeSettingAccount/list'; //开门通知列表
|
||||||
final String deleteLockNoticeSettingAccountURL =
|
final String deleteLockNoticeSettingAccountURL =
|
||||||
'/lockNoticeSettingAccount/delete'; //删除开门通知
|
'/lockNoticeSettingAccount/delete'; //删除开门通知
|
||||||
|
final String updateLockNoticeSettingAccountURL =
|
||||||
|
'/lockNoticeSettingAccount/update'; //更新开门通知
|
||||||
|
|
||||||
final String setWechatPushSwitchURL =
|
final String setWechatPushSwitchURL =
|
||||||
'/user/setMpWechatPushSwitch'; //设置微信公众号推送
|
'/user/setMpWechatPushSwitch'; //设置微信公众号推送
|
||||||
|
|||||||
@ -1228,18 +1228,17 @@ class ApiProvider extends BaseProvider {
|
|||||||
|
|
||||||
// 更新人脸用户信息--有效期
|
// 更新人脸用户信息--有效期
|
||||||
Future<Response> updateFaceValidity(
|
Future<Response> updateFaceValidity(
|
||||||
int faceId,
|
int faceId,
|
||||||
int lockId,
|
int lockId,
|
||||||
int startDate,
|
int startDate,
|
||||||
int endDate,
|
int endDate,
|
||||||
int startTime,
|
int startTime,
|
||||||
int endTime,
|
int endTime,
|
||||||
int faceType,
|
int faceType,
|
||||||
List weekDay,
|
List weekDay,
|
||||||
String faceName,
|
String faceName,
|
||||||
String addType,
|
String addType,
|
||||||
int isCoerced
|
int isCoerced) =>
|
||||||
) =>
|
|
||||||
post(
|
post(
|
||||||
updateFaceUserInfoURL.toUrl,
|
updateFaceUserInfoURL.toUrl,
|
||||||
jsonEncode({
|
jsonEncode({
|
||||||
@ -1250,7 +1249,7 @@ class ApiProvider extends BaseProvider {
|
|||||||
'startTime': startTime,
|
'startTime': startTime,
|
||||||
'endTime': endTime,
|
'endTime': endTime,
|
||||||
'faceType': faceType,
|
'faceType': faceType,
|
||||||
"weekDay":weekDay,
|
"weekDay": weekDay,
|
||||||
'faceName': faceName,
|
'faceName': faceName,
|
||||||
'addType': addType,
|
'addType': addType,
|
||||||
"isCoerced": isCoerced,
|
"isCoerced": isCoerced,
|
||||||
@ -1914,6 +1913,16 @@ class ApiProvider extends BaseProvider {
|
|||||||
jsonEncode(
|
jsonEncode(
|
||||||
{'lockNoticeSettingAccountId': lockNoticeSettingAccountId}));
|
{'lockNoticeSettingAccountId': lockNoticeSettingAccountId}));
|
||||||
|
|
||||||
|
// 更新开门通知
|
||||||
|
Future<Response> updateLockNoticeSettingAccount(
|
||||||
|
int lockNoticeSettingAccountId, Map settingValue) =>
|
||||||
|
post(
|
||||||
|
updateLockNoticeSettingAccountURL.toUrl,
|
||||||
|
jsonEncode({
|
||||||
|
'lockNoticeSettingAccountId': lockNoticeSettingAccountId,
|
||||||
|
'settingValue': settingValue
|
||||||
|
}));
|
||||||
|
|
||||||
// 设置微信公众号推送
|
// 设置微信公众号推送
|
||||||
Future<Response> setMpWechatPushSwitch(int mpWechatPushSwitch) => post(
|
Future<Response> setMpWechatPushSwitch(int mpWechatPushSwitch) => post(
|
||||||
setWechatPushSwitchURL.toUrl,
|
setWechatPushSwitchURL.toUrl,
|
||||||
|
|||||||
@ -1388,18 +1388,28 @@ class ApiRepository {
|
|||||||
// 更新人脸用户信息--有效期
|
// 更新人脸用户信息--有效期
|
||||||
Future<LoginEntity> updateFaceValidity(
|
Future<LoginEntity> updateFaceValidity(
|
||||||
{required int faceId,
|
{required int faceId,
|
||||||
required int lockId,
|
required int lockId,
|
||||||
required int startDate,
|
required int startDate,
|
||||||
required int endDate,
|
required int endDate,
|
||||||
required int startTime,
|
required int startTime,
|
||||||
required int endTime,
|
required int endTime,
|
||||||
required int faceType,
|
required int faceType,
|
||||||
required List weekDay,
|
required List weekDay,
|
||||||
required String faceName,
|
required String faceName,
|
||||||
required String addType,
|
required String addType,
|
||||||
required int isCoerced}) async {
|
required int isCoerced}) async {
|
||||||
final res = await apiProvider.updateFaceValidity(
|
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);
|
return LoginEntity.fromJson(res.body);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1922,6 +1932,15 @@ class ApiRepository {
|
|||||||
return OpenDoorNotifyEntity.fromJson(res.body);
|
return OpenDoorNotifyEntity.fromJson(res.body);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 更新开门通知
|
||||||
|
Future<OpenDoorNotifyEntity> updateLockNoticeSettingAccount(
|
||||||
|
{required int lockNoticeSettingAccountId,
|
||||||
|
required Map settingValue}) async {
|
||||||
|
final res = await apiProvider.updateLockNoticeSettingAccount(
|
||||||
|
lockNoticeSettingAccountId, settingValue);
|
||||||
|
return OpenDoorNotifyEntity.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