新增消息提醒模块
This commit is contained in:
parent
5e920b9ada
commit
e63b7eb07f
@ -6,12 +6,23 @@ import 'package:star_lock/login/register/starLock_register_binding.dart';
|
|||||||
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserList_page.dart';
|
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserList_page.dart';
|
||||||
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupList_page.dart';
|
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupList_page.dart';
|
||||||
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendReceiver/massSendReceiver_page.dart';
|
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendReceiver/massSendReceiver_page.dart';
|
||||||
|
import 'package:star_lock/main/lockDetail/lcokSet/addFamily/addFamily_page.dart';
|
||||||
|
import 'package:star_lock/main/lockDetail/lcokSet/catEyeSet/catEyeSet_page.dart';
|
||||||
import 'package:star_lock/main/lockDetail/lcokSet/catEyeWorkMode/catEyeWorkMode_page.dart';
|
import 'package:star_lock/main/lockDetail/lcokSet/catEyeWorkMode/catEyeWorkMode_page.dart';
|
||||||
|
import 'package:star_lock/main/lockDetail/lcokSet/coerceFingerprint/coerceFingerprint_page.dart';
|
||||||
|
import 'package:star_lock/main/lockDetail/lcokSet/coerceFingerprintList/coerceFingerprintList_page.dart';
|
||||||
|
import 'package:star_lock/main/lockDetail/lcokSet/coerceOpenDoor/coerceOpenDoor_page.dart';
|
||||||
import 'package:star_lock/main/lockDetail/lcokSet/faceUnlock/faceUnlock_page.dart';
|
import 'package:star_lock/main/lockDetail/lcokSet/faceUnlock/faceUnlock_page.dart';
|
||||||
|
import 'package:star_lock/main/lockDetail/lcokSet/familyDetails/familyDetails_page.dart';
|
||||||
|
import 'package:star_lock/main/lockDetail/lcokSet/lockUser/lockUser_page.dart';
|
||||||
|
import 'package:star_lock/main/lockDetail/lcokSet/lowBatteryReminder/lowBatteryReminder_page.dart';
|
||||||
import 'package:star_lock/main/lockDetail/lcokSet/motorPower/motorPower_page.dart';
|
import 'package:star_lock/main/lockDetail/lcokSet/motorPower/motorPower_page.dart';
|
||||||
import 'package:star_lock/main/lockDetail/lcokSet/msgNotification/msgNotification_page.dart';
|
import 'package:star_lock/main/lockDetail/lcokSet/msgNotification/msgNotification_page.dart';
|
||||||
|
import 'package:star_lock/main/lockDetail/lcokSet/notificationMode/notificationMode_page.dart';
|
||||||
import 'package:star_lock/main/lockDetail/lcokSet/openDoorDirection/openDoorDirection_page.dart';
|
import 'package:star_lock/main/lockDetail/lcokSet/openDoorDirection/openDoorDirection_page.dart';
|
||||||
|
import 'package:star_lock/main/lockDetail/lcokSet/openDoorNotify/openDoorNotify_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/lcokSet/nDaysUnopened/nDaysUnopened_page.dart';
|
||||||
import 'package:star_lock/main/lockDetail/otherTypeKey/addFace/addFace_page.dart';
|
import 'package:star_lock/main/lockDetail/otherTypeKey/addFace/addFace_page.dart';
|
||||||
import 'package:star_lock/mine/about/webviewShow_page.dart';
|
import 'package:star_lock/mine/about/webviewShow_page.dart';
|
||||||
import 'package:star_lock/mine/mine/safeVerify/safeVerify_page.dart';
|
import 'package:star_lock/mine/mine/safeVerify/safeVerify_page.dart';
|
||||||
@ -346,8 +357,19 @@ abstract class Routers {
|
|||||||
static const motorPowerPage = '/motorPowerPage'; //电机功率设置
|
static const motorPowerPage = '/motorPowerPage'; //电机功率设置
|
||||||
static const openDoorDirectionPage = '/openDoorDirectionPage'; //开门方向设置
|
static const openDoorDirectionPage = '/openDoorDirectionPage'; //开门方向设置
|
||||||
static const catEyeWorkModePage = '/catEyeWorkModePage'; //猫眼工作模式
|
static const catEyeWorkModePage = '/catEyeWorkModePage'; //猫眼工作模式
|
||||||
static const msgNotificationPage = '/msgNotificationPage'; //消息通知
|
static const msgNotificationPage = '/msgNotificationPage'; //消息提醒
|
||||||
static const addFaceTipPage = '/addFaceTipPage'; //添加人脸
|
static const addFaceTipPage = '/addFaceTipPage'; //添加人脸
|
||||||
|
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'; //猫眼设置
|
||||||
|
static const coerceOpenDoorPage = '/coerceOpenDoorPage'; //胁迫开门
|
||||||
|
static const coerceFingerprintPage = '/coerceFingerprintPage'; //胁迫指纹
|
||||||
|
static const lowBatteryReminderPage = '/lowBatteryReminderPage'; //低电量提醒
|
||||||
|
static const coerceFingerprintListPage = '/coerceFingerprintListPage'; //指纹列表
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract class AppRouters {
|
abstract class AppRouters {
|
||||||
@ -861,6 +883,31 @@ abstract class AppRouters {
|
|||||||
GetPage(
|
GetPage(
|
||||||
name: Routers.msgNotificationPage,
|
name: Routers.msgNotificationPage,
|
||||||
page: () => const MsgNotificationPage()),
|
page: () => const MsgNotificationPage()),
|
||||||
GetPage(name: Routers.addFaceTipPage, page: () => const AddFaceTipPage())
|
GetPage(name: Routers.addFaceTipPage, page: () => const AddFaceTipPage()),
|
||||||
|
GetPage(
|
||||||
|
name: Routers.nDaysUnopenedPage, page: () => const NDaysUnopenedPage()),
|
||||||
|
GetPage(
|
||||||
|
name: Routers.notificationModePage,
|
||||||
|
page: () => const NotificationModePage()),
|
||||||
|
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()),
|
||||||
|
GetPage(
|
||||||
|
name: Routers.coerceOpenDoorPage,
|
||||||
|
page: () => const CoerceOpenDoorPage()),
|
||||||
|
GetPage(
|
||||||
|
name: Routers.coerceFingerprintPage,
|
||||||
|
page: () => const CoerceFingerprintPage()),
|
||||||
|
GetPage(
|
||||||
|
name: Routers.lowBatteryReminderPage,
|
||||||
|
page: () => const LowBatteryReminderPage()),
|
||||||
|
GetPage(
|
||||||
|
name: Routers.coerceFingerprintListPage,
|
||||||
|
page: () => const CoerceFingerprintListPage())
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@ -125,5 +125,5 @@ class AppColors {
|
|||||||
static const blueTextTipsColor = Color.fromRGBO(0, 113, 255, 1); //蓝色字体tips
|
static const blueTextTipsColor = Color.fromRGBO(0, 113, 255, 1); //蓝色字体tips
|
||||||
static const blueViewBgColor =
|
static const blueViewBgColor =
|
||||||
Color.fromRGBO(223, 237, 254, 1); //蓝色背景板 139 148 176
|
Color.fromRGBO(223, 237, 254, 1); //蓝色背景板 139 148 176
|
||||||
static const msgNoticeTextColor = Color.fromRGBO(139, 148, 176, 1); //消息通知字体颜色
|
static const msgNoticeTextColor = Color.fromRGBO(139, 148, 176, 1); //消息提醒字体颜色
|
||||||
}
|
}
|
||||||
|
|||||||
@ -86,7 +86,7 @@ class _AuthorizedAdminListPageState extends State<AuthorizedAdminListPage> {
|
|||||||
List<ElectronicKeyListItem> getItemData = itemData;
|
List<ElectronicKeyListItem> getItemData = itemData;
|
||||||
return getItemData.isEmpty
|
return getItemData.isEmpty
|
||||||
? const NoData()
|
? const NoData()
|
||||||
: ListView.builder(
|
: ListView.separated(
|
||||||
itemCount: getItemData.length,
|
itemCount: getItemData.length,
|
||||||
itemBuilder: (c, index) {
|
itemBuilder: (c, index) {
|
||||||
ElectronicKeyListItem indexEntity = getItemData[index];
|
ElectronicKeyListItem indexEntity = getItemData[index];
|
||||||
@ -117,20 +117,32 @@ class _AuthorizedAdminListPageState extends State<AuthorizedAdminListPage> {
|
|||||||
decoration: const BoxDecoration(
|
decoration: const BoxDecoration(
|
||||||
borderRadius: BorderRadius.all(Radius.circular(1)),
|
borderRadius: BorderRadius.all(Radius.circular(1)),
|
||||||
),
|
),
|
||||||
child: _electronicKeyItem('images/controls_user.png',
|
child: _electronicKeyItem(
|
||||||
indexEntity.keyName!, useDateStr, keyStatus, isAdminKey, () {
|
'images/controls_user.png',
|
||||||
Navigator.pushNamed(context, Routers.electronicKeyDetailPage,
|
indexEntity.keyName!,
|
||||||
arguments: {'itemData': indexEntity}).then((val) {
|
useDateStr,
|
||||||
if (val != null) {
|
keyStatus,
|
||||||
logic.mockNetworkDataRequest();
|
isAdminKey, () {
|
||||||
setState(() {});
|
Navigator.pushNamed(
|
||||||
}
|
context, Routers.electronicKeyDetailPage,
|
||||||
});
|
arguments: {'itemData': indexEntity}).then((val) {
|
||||||
}),
|
if (val != null) {
|
||||||
|
logic.mockNetworkDataRequest();
|
||||||
|
setState(() {});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return const SizedBox.shrink();
|
return const SizedBox.shrink();
|
||||||
});
|
},
|
||||||
|
separatorBuilder: (BuildContext context, int index) {
|
||||||
|
return Divider(
|
||||||
|
height: 1.h,
|
||||||
|
color: AppColors.greyLineColor,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildDeleteBtn(ElectronicKeyListItem passwordKeyListItem) {
|
Widget _buildDeleteBtn(ElectronicKeyListItem passwordKeyListItem) {
|
||||||
@ -156,7 +168,8 @@ class _AuthorizedAdminListPageState extends State<AuthorizedAdminListPage> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void showIosTipViewDialog(BuildContext context, ElectronicKeyListItem passwordKeyListItem) {
|
void showIosTipViewDialog(
|
||||||
|
BuildContext context, ElectronicKeyListItem passwordKeyListItem) {
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
@ -171,8 +184,7 @@ class _AuthorizedAdminListPageState extends State<AuthorizedAdminListPage> {
|
|||||||
Get.back();
|
Get.back();
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
});
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//使用期限
|
//使用期限
|
||||||
@ -270,8 +282,8 @@ class _AuthorizedAdminListPageState extends State<AuthorizedAdminListPage> {
|
|||||||
// : Container(),
|
// : Container(),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
width: 20.w,
|
width: 20.w,
|
||||||
)),
|
)),
|
||||||
// Text(
|
// Text(
|
||||||
// keyStatus,
|
// keyStatus,
|
||||||
// style: TextStyle(fontSize: 18.sp, color: Colors.red),
|
// style: TextStyle(fontSize: 18.sp, color: Colors.red),
|
||||||
|
|||||||
@ -0,0 +1,129 @@
|
|||||||
|
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/tools/commonItem.dart';
|
||||||
|
import 'package:star_lock/tools/submitBtn.dart';
|
||||||
|
|
||||||
|
import '../../../../../app_settings/app_colors.dart';
|
||||||
|
import '../../../../../tools/titleAppBar.dart';
|
||||||
|
|
||||||
|
class AddFamilyPage extends StatefulWidget {
|
||||||
|
const AddFamilyPage({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<AddFamilyPage> createState() => _AddFamilyPageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _AddFamilyPageState extends State<AddFamilyPage> {
|
||||||
|
@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);
|
||||||
|
}),
|
||||||
|
CommonItem(
|
||||||
|
leftTitel: '家人',
|
||||||
|
rightTitle: '',
|
||||||
|
isHaveLine: true,
|
||||||
|
isHaveRightWidget: true,
|
||||||
|
isHaveDirection: false,
|
||||||
|
rightWidget: getFamilyWidget('请输入'),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 20.h,
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
color: Colors.white,
|
||||||
|
margin: EdgeInsets.only(bottom: 10.h),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
CommonItem(
|
||||||
|
leftTitel: '提醒方式',
|
||||||
|
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: '保存',
|
||||||
|
isDisabled: false,
|
||||||
|
onClick: () {},
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 60.h,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 接受者邮箱输入框
|
||||||
|
Widget getFamilyWidget(String tfStr) {
|
||||||
|
TextEditingController emailController = TextEditingController();
|
||||||
|
return SizedBox(
|
||||||
|
height: 50.h,
|
||||||
|
width: 360.w,
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: TextField(
|
||||||
|
controller: emailController,
|
||||||
|
//输入框一行
|
||||||
|
maxLines: 1,
|
||||||
|
autofocus: false,
|
||||||
|
textAlign: TextAlign.end,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
//输入里面输入文字内边距设置
|
||||||
|
contentPadding: const EdgeInsets.only(top: -12.0, bottom: 0.0),
|
||||||
|
hintText: tfStr,
|
||||||
|
hintStyle: TextStyle(fontSize: 22.sp),
|
||||||
|
//不需要输入框下划线
|
||||||
|
border: InputBorder.none,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,6 @@
|
|||||||
|
import 'package:star_lock/main/lockDetail/lcokSet/catEyeSet/catEyeSet_state.dart';
|
||||||
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
|
|
||||||
|
class CatEyeSetLogic extends BaseGetXController {
|
||||||
|
final CatEyeSetState state = CatEyeSetState();
|
||||||
|
}
|
||||||
@ -0,0 +1,125 @@
|
|||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:star_lock/appRouters.dart';
|
||||||
|
import 'package:star_lock/main/lockDetail/lcokSet/catEyeSet/catEyeSet_logic.dart';
|
||||||
|
import 'package:star_lock/tools/commonItem.dart';
|
||||||
|
import 'package:star_lock/tools/custom_bottom_sheet.dart';
|
||||||
|
|
||||||
|
import '../../../../app_settings/app_colors.dart';
|
||||||
|
import '../../../../tools/titleAppBar.dart';
|
||||||
|
|
||||||
|
class CatEyeSetPage extends StatefulWidget {
|
||||||
|
const CatEyeSetPage({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<CatEyeSetPage> createState() => _CatEyeSetPageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _CatEyeSetPageState extends State<CatEyeSetPage> {
|
||||||
|
final logic = Get.put(CatEyeSetLogic());
|
||||||
|
final state = Get.find<CatEyeSetLogic>().state;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
backgroundColor: Colors.white,
|
||||||
|
appBar: TitleAppBar(
|
||||||
|
barTitle: '猫眼设置',
|
||||||
|
haveBack: true,
|
||||||
|
backgroundColor: AppColors.mainColor),
|
||||||
|
body: Column(
|
||||||
|
children: [
|
||||||
|
CommonItem(
|
||||||
|
leftTitel: '猫眼工作模式',
|
||||||
|
rightTitle: "",
|
||||||
|
isHaveLine: true,
|
||||||
|
isHaveDirection: true,
|
||||||
|
action: () {
|
||||||
|
Get.toNamed(Routers.catEyeWorkModePage);
|
||||||
|
}),
|
||||||
|
Obx(() => CommonItem(
|
||||||
|
leftTitel: '自动亮屏',
|
||||||
|
rightTitle: "",
|
||||||
|
isHaveLine: true,
|
||||||
|
isHaveDirection: false,
|
||||||
|
isHaveRightWidget: true,
|
||||||
|
rightWidget: _otherToDoSwitch(1))),
|
||||||
|
Obx(() => CommonItem(
|
||||||
|
leftTitel: '亮屏持续时间',
|
||||||
|
rightTitle: state.selectBrightDuration.value,
|
||||||
|
isHaveLine: true,
|
||||||
|
isHaveDirection: true,
|
||||||
|
action: () {
|
||||||
|
_openBottomItemSheet();
|
||||||
|
})),
|
||||||
|
Obx(() => CommonItem(
|
||||||
|
leftTitel: '逗留警告',
|
||||||
|
rightTitle: "",
|
||||||
|
isHaveLine: true,
|
||||||
|
isHaveRightWidget: true,
|
||||||
|
rightWidget: _otherToDoSwitch(2),
|
||||||
|
)),
|
||||||
|
Obx(() => CommonItem(
|
||||||
|
leftTitel: '异常警告',
|
||||||
|
rightTitle: "",
|
||||||
|
isHaveLine: true,
|
||||||
|
isHaveRightWidget: true,
|
||||||
|
rightWidget: _otherToDoSwitch(3))),
|
||||||
|
],
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
CupertinoSwitch _otherToDoSwitch(int clickIndex) {
|
||||||
|
bool isCheck = false;
|
||||||
|
switch (clickIndex) {
|
||||||
|
case 1: //自动亮屏
|
||||||
|
isCheck = state.isAutoBright.value;
|
||||||
|
break;
|
||||||
|
case 2: //逗留警告
|
||||||
|
isCheck = state.isStayWarning.value;
|
||||||
|
break;
|
||||||
|
case 3: //异常警告
|
||||||
|
isCheck = state.isExceptionWarning.value;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
}
|
||||||
|
return CupertinoSwitch(
|
||||||
|
activeColor: CupertinoColors.activeBlue,
|
||||||
|
trackColor: CupertinoColors.systemGrey5,
|
||||||
|
thumbColor: CupertinoColors.white,
|
||||||
|
value: isCheck,
|
||||||
|
onChanged: (value) {
|
||||||
|
switch (clickIndex) {
|
||||||
|
case 1: //自动亮屏
|
||||||
|
state.isAutoBright.value = value;
|
||||||
|
break;
|
||||||
|
case 2: //逗留警告
|
||||||
|
state.isStayWarning.value = value;
|
||||||
|
break;
|
||||||
|
case 3: //异常警告
|
||||||
|
state.isExceptionWarning.value = value;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
}
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future _openBottomItemSheet() async {
|
||||||
|
showModalBottomSheet(
|
||||||
|
context: context,
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadiusDirectional.circular(10)),
|
||||||
|
builder: (BuildContext context) {
|
||||||
|
return AlertBottomWidget(
|
||||||
|
topTitle: '',
|
||||||
|
items: state.brightDurationTimeList,
|
||||||
|
chooseCallback: (value) {
|
||||||
|
state.selectBrightDuration.value =
|
||||||
|
state.brightDurationTimeList[value];
|
||||||
|
},
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,9 @@
|
|||||||
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
class CatEyeSetState {
|
||||||
|
var brightDurationTimeList = ['10秒', '15秒', '20秒'].obs;
|
||||||
|
var selectBrightDuration = '10 秒'.obs; //选中的亮屏持续时间
|
||||||
|
var isAutoBright = false.obs; //自动亮屏
|
||||||
|
var isStayWarning = false.obs; //逗留警告
|
||||||
|
var isExceptionWarning = false.obs; //异常警告
|
||||||
|
}
|
||||||
@ -0,0 +1,91 @@
|
|||||||
|
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/tools/commonItem.dart';
|
||||||
|
import 'package:star_lock/tools/submitBtn.dart';
|
||||||
|
|
||||||
|
import '../../../../../app_settings/app_colors.dart';
|
||||||
|
import '../../../../../tools/titleAppBar.dart';
|
||||||
|
|
||||||
|
class CoerceFingerprintPage extends StatefulWidget {
|
||||||
|
const CoerceFingerprintPage({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<CoerceFingerprintPage> createState() => _CoerceFingerprintPageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _CoerceFingerprintPageState extends State<CoerceFingerprintPage> {
|
||||||
|
@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.coerceFingerprintListPage);
|
||||||
|
}),
|
||||||
|
SizedBox(
|
||||||
|
height: 20.h,
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
color: Colors.white,
|
||||||
|
margin: EdgeInsets.only(bottom: 10.h),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
CommonItem(
|
||||||
|
leftTitel: '提醒方式',
|
||||||
|
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: '保存',
|
||||||
|
isDisabled: false,
|
||||||
|
onClick: () {},
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 60.h,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,171 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:star_lock/main/lockDetail/lcokSet/lockUser/lockUser_logic.dart';
|
||||||
|
import '../../../../app_settings/app_colors.dart';
|
||||||
|
import '../../../../tools/submitBtn.dart';
|
||||||
|
import '../../../../tools/titleAppBar.dart';
|
||||||
|
import '../../../../translations/trans_lib.dart';
|
||||||
|
|
||||||
|
class CoerceFingerprintListPage extends StatefulWidget {
|
||||||
|
const CoerceFingerprintListPage({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<CoerceFingerprintListPage> createState() =>
|
||||||
|
_CoerceFingerprintListPageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _CoerceFingerprintListPageState extends State<CoerceFingerprintListPage> {
|
||||||
|
final logic = Get.put(LockUserLogic());
|
||||||
|
final state = Get.find<LockUserLogic>().state;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
backgroundColor: AppColors.mainBackgroundColor,
|
||||||
|
appBar: TitleAppBar(
|
||||||
|
barTitle: '指纹列表',
|
||||||
|
haveBack: true,
|
||||||
|
backgroundColor: AppColors.mainColor,
|
||||||
|
),
|
||||||
|
body: Column(
|
||||||
|
children: [
|
||||||
|
_searchWidget(),
|
||||||
|
SizedBox(
|
||||||
|
height: 20.h,
|
||||||
|
),
|
||||||
|
Expanded(child: _buildMainUI()),
|
||||||
|
SubmitBtn(
|
||||||
|
btnName: '确定',
|
||||||
|
onClick: () {},
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 64.h,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
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() {
|
||||||
|
return ListView.separated(
|
||||||
|
shrinkWrap: true,
|
||||||
|
itemCount: 3,
|
||||||
|
itemBuilder: (c, index) {
|
||||||
|
return _electronicKeyItem('images/icon_fingerprint.png', '我', '永久', () {
|
||||||
|
state.isCheck.value = !state.isCheck.value;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
separatorBuilder: (BuildContext context, int index) {
|
||||||
|
return const Divider(
|
||||||
|
height: 1,
|
||||||
|
color: AppColors.greyLineColor,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _electronicKeyItem(
|
||||||
|
String avatarURL, String receiveUser, String useDate, Function() action) {
|
||||||
|
return GestureDetector(
|
||||||
|
onTap: action,
|
||||||
|
child: Container(
|
||||||
|
color: Colors.white,
|
||||||
|
height: 90.h,
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
SizedBox(
|
||||||
|
width: 30.w,
|
||||||
|
),
|
||||||
|
Image.asset(
|
||||||
|
avatarURL,
|
||||||
|
width: 60.w,
|
||||||
|
height: 60.w,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: 20.w,
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
receiveUser,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 24.sp, color: AppColors.blackColor),
|
||||||
|
),
|
||||||
|
SizedBox(width: 10.w),
|
||||||
|
Expanded(
|
||||||
|
child: SizedBox(
|
||||||
|
width: 20.w,
|
||||||
|
)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
SizedBox(height: 10.h),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
useDate,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 18.sp,
|
||||||
|
color: AppColors.placeholderTextColor),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
SizedBox(width: 20.h),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Obx(() => Image.asset(
|
||||||
|
state.isCheck.value == true
|
||||||
|
? 'images/icon_round_selet.png'
|
||||||
|
: 'images/icon_round_unSelet.png',
|
||||||
|
width: 30.w,
|
||||||
|
height: 30.w,
|
||||||
|
)),
|
||||||
|
SizedBox(width: 20.h),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,6 @@
|
|||||||
|
import 'package:star_lock/main/lockDetail/lcokSet/coerceOpenDoor/coerceOpenDoor_state.dart';
|
||||||
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
|
|
||||||
|
class CoerceOpenDoorLogic extends BaseGetXController {
|
||||||
|
final CoerceOpenDoorState state = CoerceOpenDoorState();
|
||||||
|
}
|
||||||
@ -0,0 +1,154 @@
|
|||||||
|
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/lcokSet/coerceOpenDoor/coerceOpenDoor_logic.dart';
|
||||||
|
import '../../../../app_settings/app_colors.dart';
|
||||||
|
import '../../../../tools/submitBtn.dart';
|
||||||
|
import '../../../../tools/titleAppBar.dart';
|
||||||
|
|
||||||
|
class CoerceOpenDoorPage extends StatefulWidget {
|
||||||
|
const CoerceOpenDoorPage({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<CoerceOpenDoorPage> createState() => _CoerceOpenDoorPageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _CoerceOpenDoorPageState extends State<CoerceOpenDoorPage> {
|
||||||
|
final logic = Get.put(CoerceOpenDoorLogic());
|
||||||
|
final state = Get.find<CoerceOpenDoorLogic>().state;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
backgroundColor: AppColors.mainBackgroundColor,
|
||||||
|
appBar: TitleAppBar(
|
||||||
|
barTitle: '胁迫开门',
|
||||||
|
haveBack: true,
|
||||||
|
backgroundColor: AppColors.mainColor,
|
||||||
|
),
|
||||||
|
body: Column(
|
||||||
|
children: [
|
||||||
|
_topTipsWidget(),
|
||||||
|
SizedBox(
|
||||||
|
height: 20.h,
|
||||||
|
),
|
||||||
|
Expanded(child: _buildMainUI()),
|
||||||
|
// Expanded(
|
||||||
|
// child: Obx(() => state.itemDataList.value.isEmpty
|
||||||
|
// ? const NoData()
|
||||||
|
// : _buildMainUI(state.itemDataList.value))),
|
||||||
|
AddBottomWhiteBtn(
|
||||||
|
btnName: '胁迫指纹',
|
||||||
|
onClick: () {
|
||||||
|
Get.toNamed(Routers.coerceFingerprintPage);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 64.h,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _topTipsWidget() {
|
||||||
|
return Container(
|
||||||
|
alignment: Alignment.centerLeft,
|
||||||
|
margin: EdgeInsets.only(left: 20.w, right: 20.w, top: 20.w),
|
||||||
|
child: Text(
|
||||||
|
'当被胁迫要求强行开锁时,使用胁迫指纹会触发报警,报警消息会推送给管理员,该功能需要锁联网',
|
||||||
|
style: TextStyle(color: AppColors.darkGrayTextColor, fontSize: 20.sp),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildMainUI() {
|
||||||
|
return ListView.separated(
|
||||||
|
shrinkWrap: true,
|
||||||
|
itemCount: 3,
|
||||||
|
itemBuilder: (c, index) {
|
||||||
|
return _electronicKeyItem(
|
||||||
|
'images/icon_fingerprint.png', '18682150237', '指纹', () {
|
||||||
|
//指纹详情
|
||||||
|
});
|
||||||
|
},
|
||||||
|
separatorBuilder: (BuildContext context, int index) {
|
||||||
|
return const Divider(
|
||||||
|
height: 1,
|
||||||
|
color: AppColors.greyLineColor,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _electronicKeyItem(String avatarURL, String familyAccount,
|
||||||
|
String openDoorWay, Function() action) {
|
||||||
|
return GestureDetector(
|
||||||
|
onTap: action,
|
||||||
|
child: Container(
|
||||||
|
color: Colors.white,
|
||||||
|
height: 90.h,
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
SizedBox(
|
||||||
|
width: 30.w,
|
||||||
|
),
|
||||||
|
Image.asset(
|
||||||
|
avatarURL,
|
||||||
|
width: 60.w,
|
||||||
|
height: 60.w,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: 20.w,
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
familyAccount,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 24.sp, color: AppColors.blackColor),
|
||||||
|
),
|
||||||
|
SizedBox(width: 10.w),
|
||||||
|
Expanded(
|
||||||
|
child: SizedBox(
|
||||||
|
width: 20.w,
|
||||||
|
))
|
||||||
|
],
|
||||||
|
),
|
||||||
|
SizedBox(height: 10.h),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
openDoorWay,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 18.sp,
|
||||||
|
color: AppColors.placeholderTextColor),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
SizedBox(width: 20.h),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Image.asset(
|
||||||
|
'images/icon_right_grey.png',
|
||||||
|
width: 26.w,
|
||||||
|
height: 20.h,
|
||||||
|
),
|
||||||
|
SizedBox(width: 20.h),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
class CoerceOpenDoorState {
|
||||||
|
var pageNum = 1.obs; //请求页码
|
||||||
|
final pageSize = 20.obs; //请求每页数据条数
|
||||||
|
final itemDataList = [].obs;
|
||||||
|
}
|
||||||
@ -0,0 +1,6 @@
|
|||||||
|
import 'package:star_lock/main/lockDetail/lcokSet/faceUnlock/faceUnlock_state.dart';
|
||||||
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
|
|
||||||
|
class FaceUnlockLogic extends BaseGetXController {
|
||||||
|
final FaceUnlockState state = FaceUnlockState();
|
||||||
|
}
|
||||||
@ -1,6 +1,8 @@
|
|||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
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:star_lock/main/lockDetail/lcokSet/faceUnlock/faceUnlock_logic.dart';
|
||||||
import 'package:star_lock/tools/custom_bottom_sheet.dart';
|
import 'package:star_lock/tools/custom_bottom_sheet.dart';
|
||||||
|
|
||||||
import '../../../../app_settings/app_colors.dart';
|
import '../../../../app_settings/app_colors.dart';
|
||||||
@ -15,27 +17,8 @@ class FaceUnlockPage extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _FaceUnlockPageState extends State<FaceUnlockPage> {
|
class _FaceUnlockPageState extends State<FaceUnlockPage> {
|
||||||
bool faceOn = false; //面容开锁
|
final logic = Get.put(FaceUnlockLogic());
|
||||||
bool autoBright = false; //自动亮屏
|
final state = Get.find<FaceUnlockLogic>().state;
|
||||||
String senseDistance = '远距离'; //感应距离
|
|
||||||
String antiMisoperation = '关闭'; //防误开
|
|
||||||
List<String> senseDistanceList = ['远距离', '近距离'];
|
|
||||||
List<String> antiMisoperationList = ['关闭', '5秒', '10秒', '15秒', '30秒', '60秒'];
|
|
||||||
|
|
||||||
//高亮样式
|
|
||||||
final TextStyle titleStyle = TextStyle(
|
|
||||||
color: Colors.black, fontSize: 24.sp, fontWeight: FontWeight.w500);
|
|
||||||
//默认样式
|
|
||||||
final TextStyle subTipsStyle =
|
|
||||||
TextStyle(color: AppColors.placeholderTextColor, fontSize: 22.sp);
|
|
||||||
|
|
||||||
late InlineSpan tipsPreviewSpan = TextSpan(children: [
|
|
||||||
TextSpan(text: '添加和使用面容开锁时:\n', style: titleStyle),
|
|
||||||
TextSpan(
|
|
||||||
text:
|
|
||||||
'\n1、请尽量保持单人在门前操作;\n2、请站立在门锁正前方约0.5~0.8米,面向门锁;\n3、请保持脸部无遮挡,露出五官;\n4、面容识别异常时,可触摸数字键盘任意按键,手动重启人脸识别。',
|
|
||||||
style: subTipsStyle),
|
|
||||||
]);
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@ -62,15 +45,16 @@ class _FaceUnlockPageState extends State<FaceUnlockPage> {
|
|||||||
rightWidget:
|
rightWidget:
|
||||||
SizedBox(width: 60.w, height: 50.h, child: _switch(2))),
|
SizedBox(width: 60.w, height: 50.h, child: _switch(2))),
|
||||||
_buildSubTitleItem(
|
_buildSubTitleItem(
|
||||||
'感应距离', '感应到门前约1.5米有人时,将自动启动面部识别开锁。', senseDistance, () {
|
'感应距离', '感应到门前约1.5米有人时,将自动启动面部识别开锁。', state.senseDistance.value,
|
||||||
_openBottomItemSheet(senseDistanceList, 0);
|
() {
|
||||||
|
_openBottomItemSheet(state.senseDistanceList.value, 0);
|
||||||
}),
|
}),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 30.h,
|
height: 30.h,
|
||||||
),
|
),
|
||||||
_buildSubTitleItem('防误开', '防误开已关闭,关门后仍可使用面容开锁', antiMisoperation,
|
_buildSubTitleItem(
|
||||||
() {
|
'防误开', '防误开已关闭,关门后仍可使用面容开锁', state.antiMisoperation.value, () {
|
||||||
_openBottomItemSheet(antiMisoperationList, 1);
|
_openBottomItemSheet(state.antiMisoperationList.value, 1);
|
||||||
}),
|
}),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
@ -155,7 +139,7 @@ class _FaceUnlockPageState extends State<FaceUnlockPage> {
|
|||||||
child: Padding(
|
child: Padding(
|
||||||
padding:
|
padding:
|
||||||
EdgeInsets.only(left: 20.w, top: 30.h, bottom: 40.h, right: 15.w),
|
EdgeInsets.only(left: 20.w, top: 30.h, bottom: 40.h, right: 15.w),
|
||||||
child: RichText(text: tipsPreviewSpan)),
|
child: RichText(text: state.tipsPreviewSpan)),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -164,13 +148,13 @@ class _FaceUnlockPageState extends State<FaceUnlockPage> {
|
|||||||
activeColor: CupertinoColors.activeBlue,
|
activeColor: CupertinoColors.activeBlue,
|
||||||
trackColor: CupertinoColors.systemGrey5,
|
trackColor: CupertinoColors.systemGrey5,
|
||||||
thumbColor: CupertinoColors.white,
|
thumbColor: CupertinoColors.white,
|
||||||
value: getIndex == 1 ? faceOn : autoBright,
|
value: getIndex == 1 ? state.faceOn.value : state.autoBright.value,
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
setState(() {
|
setState(() {
|
||||||
if (getIndex == 1) {
|
if (getIndex == 1) {
|
||||||
faceOn = value;
|
state.faceOn.value = value;
|
||||||
} else {
|
} else {
|
||||||
autoBright = value;
|
state.autoBright.value = value;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -190,10 +174,12 @@ class _FaceUnlockPageState extends State<FaceUnlockPage> {
|
|||||||
chooseCallback: (value) {
|
chooseCallback: (value) {
|
||||||
if (clickIndex == 0) {
|
if (clickIndex == 0) {
|
||||||
//感应距离
|
//感应距离
|
||||||
senseDistance = senseDistanceList[value];
|
state.senseDistance.value =
|
||||||
|
state.senseDistanceList.value[value];
|
||||||
} else if (clickIndex == 1) {
|
} else if (clickIndex == 1) {
|
||||||
//防误开
|
//防误开
|
||||||
antiMisoperation = antiMisoperationList[value];
|
state.antiMisoperation.value =
|
||||||
|
state.antiMisoperationList.value[value];
|
||||||
}
|
}
|
||||||
|
|
||||||
setState(() {});
|
setState(() {});
|
||||||
|
|||||||
@ -0,0 +1,30 @@
|
|||||||
|
import 'dart:ui';
|
||||||
|
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:star_lock/app_settings/app_colors.dart';
|
||||||
|
|
||||||
|
class FaceUnlockState {
|
||||||
|
var isCheck = false.obs;
|
||||||
|
var faceOn = false.obs; //面容开锁
|
||||||
|
var autoBright = false.obs; //自动亮屏
|
||||||
|
var senseDistance = '远距离'.obs; //感应距离
|
||||||
|
var antiMisoperation = '关闭'.obs; //防误开
|
||||||
|
var senseDistanceList = ['远距离', '近距离'].obs;
|
||||||
|
var antiMisoperationList = ['关闭', '5秒', '10秒', '15秒', '30秒', '60秒'].obs;
|
||||||
|
//高亮样式
|
||||||
|
final TextStyle titleStyle = TextStyle(
|
||||||
|
color: Colors.black, fontSize: 24.sp, fontWeight: FontWeight.w500);
|
||||||
|
//默认样式
|
||||||
|
final TextStyle subTipsStyle =
|
||||||
|
TextStyle(color: AppColors.placeholderTextColor, fontSize: 22.sp);
|
||||||
|
|
||||||
|
late InlineSpan tipsPreviewSpan = TextSpan(children: [
|
||||||
|
TextSpan(text: '添加和使用面容开锁时:\n', style: titleStyle),
|
||||||
|
TextSpan(
|
||||||
|
text:
|
||||||
|
'\n1、请尽量保持单人在门前操作;\n2、请站立在门锁正前方约0.5~0.8米,面向门锁;\n3、请保持脸部无遮挡,露出五官;\n4、面容识别异常时,可触摸数字键盘任意按键,手动重启人脸识别。',
|
||||||
|
style: subTipsStyle),
|
||||||
|
]);
|
||||||
|
}
|
||||||
@ -0,0 +1,6 @@
|
|||||||
|
import 'package:star_lock/main/lockDetail/lcokSet/familyDetails/familyDetails_state.dart';
|
||||||
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
|
|
||||||
|
class FamilyDetailsLogic extends BaseGetXController {
|
||||||
|
final FamilyDetailsState state = FamilyDetailsState();
|
||||||
|
}
|
||||||
@ -0,0 +1,167 @@
|
|||||||
|
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/lcokSet/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: '提醒方式',
|
||||||
|
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);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
class FamilyDetailsState {
|
||||||
|
TextEditingController changeNameController = TextEditingController(); //修改名称
|
||||||
|
var familyName = '我'.obs;
|
||||||
|
}
|
||||||
@ -27,8 +27,6 @@ class LockSetPage extends StatefulWidget {
|
|||||||
class _LockSetPageState extends State<LockSetPage> with RouteAware {
|
class _LockSetPageState extends State<LockSetPage> with RouteAware {
|
||||||
final logic = Get.put(LockSetLogic());
|
final logic = Get.put(LockSetLogic());
|
||||||
final state = Get.find<LockSetLogic>().state;
|
final state = Get.find<LockSetLogic>().state;
|
||||||
bool isClick1 = false;
|
|
||||||
bool isClick2 = false;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
@ -209,7 +207,9 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
|
|||||||
SizedBox(height: 10.h),
|
SizedBox(height: 10.h),
|
||||||
// 常开模式
|
// 常开模式
|
||||||
Obx(() => Visibility(
|
Obx(() => Visibility(
|
||||||
visible: state.lockFeature.value.passageMode == 1 ? true : false,
|
visible: state.lockFeature.value.passageMode == 1
|
||||||
|
? true
|
||||||
|
: false,
|
||||||
// visible:true,
|
// visible:true,
|
||||||
child: CommonItem(
|
child: CommonItem(
|
||||||
leftTitel:
|
leftTitel:
|
||||||
@ -284,7 +284,7 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
|
|||||||
Visibility(
|
Visibility(
|
||||||
visible: true,
|
visible: true,
|
||||||
child: CommonItem(
|
child: CommonItem(
|
||||||
leftTitel: '消息通知',
|
leftTitel: '消息提醒',
|
||||||
rightTitle: "",
|
rightTitle: "",
|
||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
@ -294,12 +294,12 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
|
|||||||
Visibility(
|
Visibility(
|
||||||
visible: true,
|
visible: true,
|
||||||
child: CommonItem(
|
child: CommonItem(
|
||||||
leftTitel: '猫眼工作模式',
|
leftTitel: '猫眼设置',
|
||||||
rightTitle: "",
|
rightTitle: "",
|
||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () {
|
action: () {
|
||||||
Get.toNamed(Routers.catEyeWorkModePage);
|
Get.toNamed(Routers.catEyeSetPage);
|
||||||
})),
|
})),
|
||||||
// Obx(() =>
|
// Obx(() =>
|
||||||
//自动亮屏已包括至面容开锁模块
|
//自动亮屏已包括至面容开锁模块
|
||||||
@ -352,27 +352,7 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
|
|||||||
Get.toNamed(Routers.motorPowerPage);
|
Get.toNamed(Routers.motorPowerPage);
|
||||||
})),
|
})),
|
||||||
// ),
|
// ),
|
||||||
// Obx(() =>
|
|
||||||
Visibility(
|
|
||||||
visible: true,
|
|
||||||
child: CommonItem(
|
|
||||||
leftTitel: '逗留警告',
|
|
||||||
rightTitle: "",
|
|
||||||
isHaveLine: true,
|
|
||||||
isHaveRightWidget: true,
|
|
||||||
rightWidget: _otherToDoSwitch(0),
|
|
||||||
)),
|
|
||||||
// ),
|
|
||||||
// Obx(() =>
|
|
||||||
Visibility(
|
|
||||||
visible: true,
|
|
||||||
child: CommonItem(
|
|
||||||
leftTitel: '异常警告',
|
|
||||||
rightTitle: "",
|
|
||||||
isHaveLine: true,
|
|
||||||
isHaveRightWidget: true,
|
|
||||||
rightWidget: _otherToDoSwitch(1))),
|
|
||||||
// ),
|
|
||||||
SizedBox(height: 10.h),
|
SizedBox(height: 10.h),
|
||||||
//-----新增至此
|
//-----新增至此
|
||||||
// 标记房态
|
// 标记房态
|
||||||
@ -384,7 +364,9 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
|
|||||||
title = TranslationLoader.lanKeys!.leisure!.tr;
|
title = TranslationLoader.lanKeys!.leisure!.tr;
|
||||||
}
|
}
|
||||||
return Visibility(
|
return Visibility(
|
||||||
visible: state.lockStatus.value.roomStatus == 1 ? true : false,
|
visible: state.lockStatus.value.roomStatus == 1
|
||||||
|
? true
|
||||||
|
: false,
|
||||||
child: CommonItem(
|
child: CommonItem(
|
||||||
leftTitel:
|
leftTitel:
|
||||||
TranslationLoader.lanKeys!.markedHouseState!.tr,
|
TranslationLoader.lanKeys!.markedHouseState!.tr,
|
||||||
@ -392,9 +374,11 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
|
|||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () {
|
action: () {
|
||||||
Get.toNamed(Routers.markedHouseStatePage, arguments: {
|
Get.toNamed(Routers.markedHouseStatePage,
|
||||||
'lockSetInfoData': state.lockSetInfoData.value
|
arguments: {
|
||||||
});
|
'lockSetInfoData':
|
||||||
|
state.lockSetInfoData.value
|
||||||
|
});
|
||||||
}));
|
}));
|
||||||
}),
|
}),
|
||||||
// 考勤
|
// 考勤
|
||||||
@ -542,20 +526,21 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
|
|||||||
}
|
}
|
||||||
|
|
||||||
CupertinoSwitch _openCheckInSwitch() {
|
CupertinoSwitch _openCheckInSwitch() {
|
||||||
print("111111state.lockSettingInfo.value.attendance:${state.lockSettingInfo.value.attendance}");
|
print(
|
||||||
|
"111111state.lockSettingInfo.value.attendance:${state.lockSettingInfo.value.attendance}");
|
||||||
return CupertinoSwitch(
|
return CupertinoSwitch(
|
||||||
activeColor: CupertinoColors.activeBlue,
|
activeColor: CupertinoColors.activeBlue,
|
||||||
trackColor: CupertinoColors.systemGrey5,
|
trackColor: CupertinoColors.systemGrey5,
|
||||||
thumbColor: CupertinoColors.white,
|
thumbColor: CupertinoColors.white,
|
||||||
value: ((state.isAttendance.value) == 1) ? true : false,
|
value: ((state.isAttendance.value) == 1) ? true : false,
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
logic.openCheckingInData((checkingInInfoDataEntity) {
|
logic.openCheckingInData((checkingInInfoDataEntity) {
|
||||||
if (checkingInInfoDataEntity.data!.companyId == 0) {
|
if (checkingInInfoDataEntity.data!.companyId == 0) {
|
||||||
showCupertinoAlertDialog(context);
|
showCupertinoAlertDialog(context);
|
||||||
} else {
|
} else {
|
||||||
logic.setLockSetGeneralSetting();
|
logic.setLockSetGeneralSetting();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -586,24 +571,6 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
CupertinoSwitch _otherToDoSwitch(int clickIndex) {
|
|
||||||
return CupertinoSwitch(
|
|
||||||
activeColor: CupertinoColors.activeBlue,
|
|
||||||
trackColor: CupertinoColors.systemGrey5,
|
|
||||||
thumbColor: CupertinoColors.white,
|
|
||||||
value: clickIndex == 0 ? isClick1 : isClick2,
|
|
||||||
onChanged: (value) {
|
|
||||||
setState(() {
|
|
||||||
if (clickIndex == 0) {
|
|
||||||
isClick1 = value;
|
|
||||||
} else {
|
|
||||||
isClick2 = value;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
//确认弹窗
|
//确认弹窗
|
||||||
void showCupertinoAlertDialog(widgetContext) {
|
void showCupertinoAlertDialog(widgetContext) {
|
||||||
showCupertinoDialog(
|
showCupertinoDialog(
|
||||||
|
|||||||
@ -0,0 +1,6 @@
|
|||||||
|
import 'package:star_lock/main/lockDetail/lcokSet/lockUser/lockUser_state.dart';
|
||||||
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
|
|
||||||
|
class LockUserLogic extends BaseGetXController {
|
||||||
|
final LockUserState state = LockUserState();
|
||||||
|
}
|
||||||
@ -0,0 +1,170 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:star_lock/main/lockDetail/lcokSet/lockUser/lockUser_logic.dart';
|
||||||
|
import '../../../../app_settings/app_colors.dart';
|
||||||
|
import '../../../../tools/submitBtn.dart';
|
||||||
|
import '../../../../tools/titleAppBar.dart';
|
||||||
|
import '../../../../translations/trans_lib.dart';
|
||||||
|
|
||||||
|
class LockUserPage extends StatefulWidget {
|
||||||
|
const LockUserPage({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<LockUserPage> createState() => _LockUserPageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _LockUserPageState extends State<LockUserPage> {
|
||||||
|
final logic = Get.put(LockUserLogic());
|
||||||
|
final state = Get.find<LockUserLogic>().state;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
backgroundColor: AppColors.mainBackgroundColor,
|
||||||
|
appBar: TitleAppBar(
|
||||||
|
barTitle: '锁用户',
|
||||||
|
haveBack: true,
|
||||||
|
backgroundColor: AppColors.mainColor,
|
||||||
|
),
|
||||||
|
body: Column(
|
||||||
|
children: [
|
||||||
|
_searchWidget(),
|
||||||
|
SizedBox(
|
||||||
|
height: 20.h,
|
||||||
|
),
|
||||||
|
Expanded(child: _buildMainUI()),
|
||||||
|
SubmitBtn(
|
||||||
|
btnName: '确定',
|
||||||
|
onClick: () {},
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 64.h,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
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() {
|
||||||
|
return ListView.separated(
|
||||||
|
shrinkWrap: true,
|
||||||
|
itemCount: 3,
|
||||||
|
itemBuilder: (c, index) {
|
||||||
|
return _electronicKeyItem('images/controls_user.png', '我', '永久', () {
|
||||||
|
state.isCheck.value = !state.isCheck.value;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
separatorBuilder: (BuildContext context, int index) {
|
||||||
|
return const Divider(
|
||||||
|
height: 1,
|
||||||
|
color: AppColors.greyLineColor,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _electronicKeyItem(
|
||||||
|
String avatarURL, String receiveUser, String useDate, Function() action) {
|
||||||
|
return GestureDetector(
|
||||||
|
onTap: action,
|
||||||
|
child: Container(
|
||||||
|
color: Colors.white,
|
||||||
|
height: 90.h,
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
SizedBox(
|
||||||
|
width: 30.w,
|
||||||
|
),
|
||||||
|
Image.asset(
|
||||||
|
avatarURL,
|
||||||
|
width: 60.w,
|
||||||
|
height: 60.w,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: 20.w,
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
receiveUser,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 24.sp, color: AppColors.blackColor),
|
||||||
|
),
|
||||||
|
SizedBox(width: 10.w),
|
||||||
|
Expanded(
|
||||||
|
child: SizedBox(
|
||||||
|
width: 20.w,
|
||||||
|
)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
SizedBox(height: 10.h),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
useDate,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 18.sp,
|
||||||
|
color: AppColors.placeholderTextColor),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
SizedBox(width: 20.h),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Obx(() => Image.asset(
|
||||||
|
state.isCheck.value == true
|
||||||
|
? 'images/icon_round_selet.png'
|
||||||
|
: 'images/icon_round_unSelet.png',
|
||||||
|
width: 30.w,
|
||||||
|
height: 30.w,
|
||||||
|
)),
|
||||||
|
SizedBox(width: 20.h),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
class LockUserState {
|
||||||
|
TextEditingController searchController = TextEditingController(); //邮箱/手机号输入框
|
||||||
|
var isCheck = false.obs;
|
||||||
|
}
|
||||||
@ -0,0 +1,6 @@
|
|||||||
|
import 'package:star_lock/main/lockDetail/lcokSet/lowBatteryReminder/lowBatteryReminder_state.dart';
|
||||||
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
|
|
||||||
|
class LowBatteryReminderLogic extends BaseGetXController {
|
||||||
|
LowBatteryReminderState state = LowBatteryReminderState();
|
||||||
|
}
|
||||||
@ -0,0 +1,132 @@
|
|||||||
|
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/lcokSet/lowBatteryReminder/lowBatteryReminder_logic.dart';
|
||||||
|
import 'package:star_lock/tools/commonItem.dart';
|
||||||
|
import 'package:star_lock/tools/submitBtn.dart';
|
||||||
|
|
||||||
|
import '../../../../../app_settings/app_colors.dart';
|
||||||
|
import '../../../../../tools/titleAppBar.dart';
|
||||||
|
|
||||||
|
class LowBatteryReminderPage extends StatefulWidget {
|
||||||
|
const LowBatteryReminderPage({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<LowBatteryReminderPage> createState() => _LowBatteryReminderPageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _LowBatteryReminderPageState extends State<LowBatteryReminderPage> {
|
||||||
|
final logic = Get.put(LowBatteryReminderLogic());
|
||||||
|
final state = Get.find<LowBatteryReminderLogic>().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: [
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: Text(
|
||||||
|
"打开提醒后,当锁电量低于20%、10%和5%,系统会给指定对象发送提醒消息。电量读取方式:网关读取或APP读取。",
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 20.sp, color: AppColors.darkGrayTextColor),
|
||||||
|
)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 20.h,
|
||||||
|
),
|
||||||
|
CommonItem(
|
||||||
|
leftTitel: '低电量提醒',
|
||||||
|
rightTitle: '',
|
||||||
|
isHaveLine: true,
|
||||||
|
isHaveDirection: false,
|
||||||
|
isHaveRightWidget: true,
|
||||||
|
rightWidget: _unOpenDoorSwitch(),
|
||||||
|
action: () {}),
|
||||||
|
Visibility(
|
||||||
|
visible: state.isLowBatteryNotify.value,
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
SizedBox(
|
||||||
|
height: 20.h,
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
color: Colors.white,
|
||||||
|
margin: EdgeInsets.only(bottom: 10.h),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
CommonItem(
|
||||||
|
leftTitel: '提醒方式',
|
||||||
|
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: 20.h,
|
||||||
|
)),
|
||||||
|
SubmitBtn(
|
||||||
|
btnName: '保存',
|
||||||
|
onClick: () {},
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 60.h,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
CupertinoSwitch _unOpenDoorSwitch() {
|
||||||
|
return CupertinoSwitch(
|
||||||
|
activeColor: CupertinoColors.activeBlue,
|
||||||
|
trackColor: CupertinoColors.systemGrey5,
|
||||||
|
thumbColor: CupertinoColors.white,
|
||||||
|
value: state.isLowBatteryNotify.value,
|
||||||
|
onChanged: (value) {
|
||||||
|
setState(() {
|
||||||
|
state.isLowBatteryNotify.value = value;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,5 @@
|
|||||||
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
class LowBatteryReminderState {
|
||||||
|
var isLowBatteryNotify = false.obs; // 是否低电量提醒
|
||||||
|
}
|
||||||
@ -0,0 +1,6 @@
|
|||||||
|
import 'package:star_lock/main/lockDetail/lcokSet/msgNotification/msgNotification_state.dart';
|
||||||
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
|
|
||||||
|
class MsgNotificationLogic extends BaseGetXController {
|
||||||
|
final MsgNotificationState state = MsgNotificationState();
|
||||||
|
}
|
||||||
@ -1,7 +1,9 @@
|
|||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
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:star_lock/tools/custom_bottom_sheet.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:star_lock/appRouters.dart';
|
||||||
|
import 'package:star_lock/main/lockDetail/lcokSet/msgNotification/msgNotification_logic.dart';
|
||||||
|
|
||||||
import '../../../../app_settings/app_colors.dart';
|
import '../../../../app_settings/app_colors.dart';
|
||||||
import '../../../../tools/commonItem.dart';
|
import '../../../../tools/commonItem.dart';
|
||||||
@ -15,12 +17,8 @@ class MsgNotificationPage extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _MsgNotificationPageState extends State<MsgNotificationPage> {
|
class _MsgNotificationPageState extends State<MsgNotificationPage> {
|
||||||
bool faceOn = false; //面容开锁
|
final logic = Get.put(MsgNotificationLogic());
|
||||||
bool autoBright = false; //自动亮屏
|
final state = Get.find<MsgNotificationLogic>().state;
|
||||||
String senseDistance = '远距离'; //感应距离
|
|
||||||
String antiMisoperation = '关闭'; //防误开
|
|
||||||
List<String> senseDistanceList = ['远距离', '近距离'];
|
|
||||||
List<String> antiMisoperationList = ['关闭', '5秒', '10秒', '15秒', '30秒', '60秒'];
|
|
||||||
|
|
||||||
//高亮样式
|
//高亮样式
|
||||||
final TextStyle titleStyle = TextStyle(
|
final TextStyle titleStyle = TextStyle(
|
||||||
@ -42,212 +40,194 @@ class _MsgNotificationPageState extends State<MsgNotificationPage> {
|
|||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: Colors.white,
|
backgroundColor: Colors.white,
|
||||||
appBar: TitleAppBar(
|
appBar: TitleAppBar(
|
||||||
barTitle: '消息通知',
|
barTitle: '消息提醒',
|
||||||
haveBack: true,
|
haveBack: true,
|
||||||
backgroundColor: AppColors.mainColor),
|
backgroundColor: AppColors.mainColor),
|
||||||
body: Column(
|
body: SingleChildScrollView(
|
||||||
children: [
|
child: _buildMainItem(),
|
||||||
Container(
|
|
||||||
alignment: Alignment.centerLeft,
|
|
||||||
margin: EdgeInsets.only(left: 40.w, top: 40.h, bottom: 30.h),
|
|
||||||
child: Text(
|
|
||||||
'门锁通知',
|
|
||||||
style: TextStyle(
|
|
||||||
color: AppColors.msgNoticeTextColor, fontSize: 24.sp),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
CommonItem(
|
|
||||||
leftTitel: '回家开门',
|
|
||||||
rightTitle: "已启用",
|
|
||||||
isHaveLine: false,
|
|
||||||
isHaveDirection: true,
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
height: 20.h,
|
|
||||||
),
|
|
||||||
CommonItem(
|
|
||||||
leftTitel: '离家开门',
|
|
||||||
rightTitle: "",
|
|
||||||
isHaveLine: false,
|
|
||||||
isHaveRightWidget: true,
|
|
||||||
rightWidget:
|
|
||||||
SizedBox(width: 60.w, height: 50.h, child: _switch(2))),
|
|
||||||
SizedBox(
|
|
||||||
height: 20.h,
|
|
||||||
),
|
|
||||||
CommonItem(
|
|
||||||
leftTitel: '关门',
|
|
||||||
rightTitle: "",
|
|
||||||
isHaveLine: false,
|
|
||||||
isHaveRightWidget: true,
|
|
||||||
rightWidget:
|
|
||||||
SizedBox(width: 60.w, height: 50.h, child: _switch(2))),
|
|
||||||
SizedBox(
|
|
||||||
height: 20.h,
|
|
||||||
),
|
|
||||||
CommonItem(
|
|
||||||
leftTitel: '异常',
|
|
||||||
rightTitle: "已启用",
|
|
||||||
isHaveLine: true,
|
|
||||||
isHaveDirection: true,
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
height: 30.h,
|
|
||||||
),
|
|
||||||
Container(
|
|
||||||
alignment: Alignment.centerLeft,
|
|
||||||
margin: EdgeInsets.only(left: 40.w, top: 40.h, bottom: 30.h),
|
|
||||||
child: Text(
|
|
||||||
'门铃通知',
|
|
||||||
style: TextStyle(
|
|
||||||
color: AppColors.msgNoticeTextColor, fontSize: 24.sp),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
CommonItem(
|
|
||||||
leftTitel: '有人按门铃',
|
|
||||||
rightTitle: "",
|
|
||||||
isHaveLine: false,
|
|
||||||
isHaveRightWidget: true,
|
|
||||||
rightWidget:
|
|
||||||
SizedBox(width: 60.w, height: 50.h, child: _switch(2))),
|
|
||||||
SizedBox(
|
|
||||||
height: 30.h,
|
|
||||||
),
|
|
||||||
Container(
|
|
||||||
alignment: Alignment.centerLeft,
|
|
||||||
margin: EdgeInsets.only(left: 40.w, top: 40.h, bottom: 30.h),
|
|
||||||
child: Text(
|
|
||||||
'猫眼通知',
|
|
||||||
style: TextStyle(
|
|
||||||
color: AppColors.msgNoticeTextColor, fontSize: 24.sp),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
CommonItem(
|
|
||||||
leftTitel: '有人出现在门口',
|
|
||||||
rightTitle: "",
|
|
||||||
isHaveLine: false,
|
|
||||||
isHaveRightWidget: true,
|
|
||||||
rightWidget:
|
|
||||||
SizedBox(width: 60.w, height: 50.h, child: _switch(2))),
|
|
||||||
],
|
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildSubTitleItem(
|
Widget _buildMainItem() {
|
||||||
String leftStr, String subTitle, String rightStr, Function()? action) {
|
return Column(
|
||||||
return GestureDetector(
|
children: [
|
||||||
onTap: action,
|
Container(
|
||||||
child: Container(
|
alignment: Alignment.centerLeft,
|
||||||
margin: EdgeInsets.only(left: 20.sp, right: 20.sp, top: 20.h),
|
margin: EdgeInsets.only(left: 40.w, top: 40.h, bottom: 30.h),
|
||||||
child: Row(
|
child: Text(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
'门锁通知',
|
||||||
children: [
|
style:
|
||||||
SizedBox(
|
TextStyle(color: AppColors.msgNoticeTextColor, fontSize: 24.sp),
|
||||||
width: 20.w,
|
),
|
||||||
),
|
|
||||||
Expanded(
|
|
||||||
child: Column(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
Container(
|
|
||||||
alignment: Alignment.centerLeft,
|
|
||||||
child: Text(
|
|
||||||
leftStr,
|
|
||||||
style: TextStyle(fontSize: 24.sp, color: Colors.black),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
height: 10.h,
|
|
||||||
),
|
|
||||||
Container(
|
|
||||||
alignment: Alignment.centerLeft,
|
|
||||||
child: Text(
|
|
||||||
subTitle,
|
|
||||||
maxLines: 2,
|
|
||||||
overflow: TextOverflow.ellipsis,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 20.sp, color: AppColors.btnDisableColor),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
)),
|
|
||||||
SizedBox(
|
|
||||||
width: 20.w,
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
rightStr,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 22.sp, color: AppColors.darkGrayTextColor),
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
width: 10.w,
|
|
||||||
),
|
|
||||||
Image.asset(
|
|
||||||
'images/icon_right_grey.png',
|
|
||||||
width: 12.w,
|
|
||||||
height: 21.w,
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
CommonItem(
|
||||||
);
|
leftTitel: '开门通知',
|
||||||
}
|
rightTitle: "已启用",
|
||||||
|
isHaveLine: false,
|
||||||
Widget _buildTipsView() {
|
isHaveDirection: true,
|
||||||
return Container(
|
action: () {
|
||||||
width: ScreenUtil().screenWidth - 40.w,
|
Get.toNamed(Routers.openDoorNotifyPage);
|
||||||
margin: EdgeInsets.only(left: 20.w, right: 20.w, bottom: 10.h),
|
},
|
||||||
decoration: BoxDecoration(
|
),
|
||||||
color: AppColors.mainBackgroundColor,
|
SizedBox(
|
||||||
borderRadius: BorderRadius.circular(10.0),
|
height: 20.h,
|
||||||
),
|
),
|
||||||
child: Padding(
|
CommonItem(
|
||||||
padding:
|
leftTitel: 'N天未开门',
|
||||||
EdgeInsets.only(left: 20.w, top: 30.h, bottom: 40.h, right: 15.w),
|
rightTitle: "已启用",
|
||||||
child: RichText(text: tipsPreviewSpan)),
|
isHaveLine: false,
|
||||||
|
isHaveDirection: true,
|
||||||
|
action: () {
|
||||||
|
Get.toNamed(Routers.nDaysUnopenedPage);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 20.h,
|
||||||
|
),
|
||||||
|
Obx(() => CommonItem(
|
||||||
|
leftTitel: '离家开门',
|
||||||
|
rightTitle: "",
|
||||||
|
isHaveLine: false,
|
||||||
|
isHaveRightWidget: true,
|
||||||
|
rightWidget:
|
||||||
|
SizedBox(width: 60.w, height: 50.h, child: _switch(1)))),
|
||||||
|
SizedBox(
|
||||||
|
height: 20.h,
|
||||||
|
),
|
||||||
|
Obx(() => CommonItem(
|
||||||
|
leftTitel: '门未关好',
|
||||||
|
rightTitle: "",
|
||||||
|
isHaveLine: false,
|
||||||
|
isHaveRightWidget: true,
|
||||||
|
rightWidget:
|
||||||
|
SizedBox(width: 60.w, height: 50.h, child: _switch(2)))),
|
||||||
|
SizedBox(
|
||||||
|
height: 20.h,
|
||||||
|
),
|
||||||
|
CommonItem(
|
||||||
|
leftTitel: '防拆报警',
|
||||||
|
rightTitle: "已启用",
|
||||||
|
isHaveLine: false,
|
||||||
|
isHaveDirection: true,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 20.h,
|
||||||
|
),
|
||||||
|
CommonItem(
|
||||||
|
leftTitel: '低电量提醒',
|
||||||
|
rightTitle: "已启用",
|
||||||
|
isHaveLine: false,
|
||||||
|
isHaveDirection: true,
|
||||||
|
action: () {
|
||||||
|
Get.toNamed(Routers.lowBatteryReminderPage);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 20.h,
|
||||||
|
),
|
||||||
|
CommonItem(
|
||||||
|
leftTitel: '胁迫开门',
|
||||||
|
rightTitle: "",
|
||||||
|
isHaveLine: true,
|
||||||
|
isHaveDirection: true,
|
||||||
|
action: () {
|
||||||
|
Get.toNamed(Routers.coerceOpenDoorPage);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 30.h,
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
alignment: Alignment.centerLeft,
|
||||||
|
margin: EdgeInsets.only(left: 40.w, top: 40.h, bottom: 30.h),
|
||||||
|
child: Text(
|
||||||
|
'门铃通知',
|
||||||
|
style:
|
||||||
|
TextStyle(color: AppColors.msgNoticeTextColor, fontSize: 24.sp),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Obx(() => CommonItem(
|
||||||
|
leftTitel: '有人按门铃',
|
||||||
|
rightTitle: "",
|
||||||
|
isHaveLine: true,
|
||||||
|
isHaveRightWidget: true,
|
||||||
|
rightWidget:
|
||||||
|
SizedBox(width: 60.w, height: 50.h, child: _switch(3)))),
|
||||||
|
SizedBox(
|
||||||
|
height: 30.h,
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
alignment: Alignment.centerLeft,
|
||||||
|
margin: EdgeInsets.only(left: 40.w, top: 40.h, bottom: 30.h),
|
||||||
|
child: Text(
|
||||||
|
'猫眼通知',
|
||||||
|
style:
|
||||||
|
TextStyle(color: AppColors.msgNoticeTextColor, fontSize: 24.sp),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Obx(() => CommonItem(
|
||||||
|
leftTitel: '有人出现在门口',
|
||||||
|
rightTitle: "",
|
||||||
|
isHaveLine: false,
|
||||||
|
isHaveRightWidget: true,
|
||||||
|
rightWidget:
|
||||||
|
SizedBox(width: 60.w, height: 50.h, child: _switch(4)))),
|
||||||
|
SizedBox(
|
||||||
|
height: 60.h,
|
||||||
|
)
|
||||||
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
CupertinoSwitch _switch(int getIndex) {
|
CupertinoSwitch _switch(int getIndex) {
|
||||||
|
bool isCheck = false;
|
||||||
|
switch (getIndex) {
|
||||||
|
//离家开门
|
||||||
|
case 1:
|
||||||
|
isCheck = state.isLeaveHomeOpenDoor.value;
|
||||||
|
break;
|
||||||
|
//门未关好
|
||||||
|
case 2:
|
||||||
|
isCheck = state.isDoorNotShut.value;
|
||||||
|
break;
|
||||||
|
//有人按门铃
|
||||||
|
case 3:
|
||||||
|
isCheck = state.isSomeoneRing.value;
|
||||||
|
break;
|
||||||
|
//有人出现在门口
|
||||||
|
case 4:
|
||||||
|
isCheck = state.isSomeoneAppeared.value;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
}
|
||||||
return CupertinoSwitch(
|
return CupertinoSwitch(
|
||||||
activeColor: CupertinoColors.activeBlue,
|
activeColor: CupertinoColors.activeBlue,
|
||||||
trackColor: CupertinoColors.systemGrey5,
|
trackColor: CupertinoColors.systemGrey5,
|
||||||
thumbColor: CupertinoColors.white,
|
thumbColor: CupertinoColors.white,
|
||||||
value: getIndex == 1 ? faceOn : autoBright,
|
value: isCheck,
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
setState(() {
|
switch (getIndex) {
|
||||||
if (getIndex == 1) {
|
//离家开门
|
||||||
faceOn = value;
|
case 1:
|
||||||
} else {
|
state.isLeaveHomeOpenDoor.value = value;
|
||||||
autoBright = value;
|
break;
|
||||||
}
|
//门未关好
|
||||||
});
|
case 2:
|
||||||
|
state.isDoorNotShut.value = value;
|
||||||
|
break;
|
||||||
|
//有人按门铃
|
||||||
|
case 3:
|
||||||
|
state.isSomeoneRing.value = value;
|
||||||
|
break;
|
||||||
|
//有人出现在门口
|
||||||
|
case 4:
|
||||||
|
state.isSomeoneAppeared.value = value;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
}
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future _openBottomItemSheet(
|
|
||||||
List<String> bottomItemList, int clickIndex) async {
|
|
||||||
showModalBottomSheet(
|
|
||||||
context: context,
|
|
||||||
shape: RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadiusDirectional.circular(10)),
|
|
||||||
builder: (BuildContext context) {
|
|
||||||
return AlertBottomWidget(
|
|
||||||
topTitle: '',
|
|
||||||
items: bottomItemList,
|
|
||||||
chooseCallback: (value) {
|
|
||||||
if (clickIndex == 0) {
|
|
||||||
//感应距离
|
|
||||||
senseDistance = senseDistanceList[value];
|
|
||||||
} else if (clickIndex == 1) {
|
|
||||||
//防误开
|
|
||||||
antiMisoperation = antiMisoperationList[value];
|
|
||||||
}
|
|
||||||
|
|
||||||
setState(() {});
|
|
||||||
},
|
|
||||||
);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,9 @@
|
|||||||
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
class MsgNotificationState {
|
||||||
|
var isCheck = false.obs;
|
||||||
|
var isLeaveHomeOpenDoor = false.obs; //离家开门
|
||||||
|
var isDoorNotShut = false.obs; //门未关好
|
||||||
|
var isSomeoneRing = false.obs; //有人按门铃
|
||||||
|
var isSomeoneAppeared = false.obs; //有人出现在门口
|
||||||
|
}
|
||||||
@ -0,0 +1,6 @@
|
|||||||
|
import 'package:star_lock/main/lockDetail/lcokSet/nDaysUnopened/nDaysUnopened_state.dart';
|
||||||
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
|
|
||||||
|
class NDaysUnopenedLogic extends BaseGetXController {
|
||||||
|
NDaysUnopenedState state = NDaysUnopenedState();
|
||||||
|
}
|
||||||
@ -0,0 +1,154 @@
|
|||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_pickers/pickers.dart';
|
||||||
|
import 'package:flutter_pickers/style/default_style.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/lcokSet/nDaysUnopened/nDaysUnopened_logic.dart';
|
||||||
|
import 'package:star_lock/tools/commonItem.dart';
|
||||||
|
import 'package:star_lock/tools/submitBtn.dart';
|
||||||
|
|
||||||
|
import '../../../../../app_settings/app_colors.dart';
|
||||||
|
import '../../../../../tools/titleAppBar.dart';
|
||||||
|
|
||||||
|
class NDaysUnopenedPage extends StatefulWidget {
|
||||||
|
const NDaysUnopenedPage({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<NDaysUnopenedPage> createState() => _NDaysUnopenedPageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _NDaysUnopenedPageState extends State<NDaysUnopenedPage> {
|
||||||
|
final logic = Get.put(NDaysUnopenedLogic());
|
||||||
|
final state = Get.find<NDaysUnopenedLogic>().state;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
backgroundColor: AppColors.mainBackgroundColor,
|
||||||
|
appBar: TitleAppBar(
|
||||||
|
barTitle: 'N天未开门',
|
||||||
|
haveBack: true,
|
||||||
|
backgroundColor: AppColors.mainColor),
|
||||||
|
body: Container(
|
||||||
|
padding: EdgeInsets.all(30.w),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: Text(
|
||||||
|
"经过以上设定的时间,锁没有被开启,系统会给指定对象发送提醒消息,该功能需要锁联网",
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 20.sp, color: AppColors.darkGrayTextColor),
|
||||||
|
)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 20.h,
|
||||||
|
),
|
||||||
|
CommonItem(
|
||||||
|
leftTitel: 'N天未开门提醒',
|
||||||
|
rightTitle: '',
|
||||||
|
isHaveLine: true,
|
||||||
|
isHaveDirection: false,
|
||||||
|
isHaveRightWidget: true,
|
||||||
|
rightWidget: _unOpenDoorSwitch(),
|
||||||
|
action: () {}),
|
||||||
|
Visibility(
|
||||||
|
visible: state.isunOpenNotice.value,
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Obx(() => CommonItem(
|
||||||
|
leftTitel: '门未开时间',
|
||||||
|
rightTitle: state.unOpenDoorTime.value,
|
||||||
|
isHaveLine: true,
|
||||||
|
isHaveRightWidget: false,
|
||||||
|
isHaveDirection: true,
|
||||||
|
action: () {
|
||||||
|
_openBottomItemSheet(
|
||||||
|
context, state.unopenDoorTimeList);
|
||||||
|
},
|
||||||
|
)),
|
||||||
|
SizedBox(
|
||||||
|
height: 20.h,
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
color: Colors.white,
|
||||||
|
margin: EdgeInsets.only(bottom: 10.h),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
CommonItem(
|
||||||
|
leftTitel: '提醒方式',
|
||||||
|
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: 20.h,
|
||||||
|
)),
|
||||||
|
SubmitBtn(
|
||||||
|
btnName: '保存',
|
||||||
|
onClick: () {},
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 60.h,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
CupertinoSwitch _unOpenDoorSwitch() {
|
||||||
|
return CupertinoSwitch(
|
||||||
|
activeColor: CupertinoColors.activeBlue,
|
||||||
|
trackColor: CupertinoColors.systemGrey5,
|
||||||
|
thumbColor: CupertinoColors.white,
|
||||||
|
value: state.isunOpenNotice.value,
|
||||||
|
onChanged: (value) {
|
||||||
|
setState(() {
|
||||||
|
state.isunOpenNotice.value = value;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
//底部选择pickerView
|
||||||
|
_openBottomItemSheet(BuildContext context, List dataList) {
|
||||||
|
Pickers.showSinglePicker(context,
|
||||||
|
data: dataList,
|
||||||
|
pickerStyle: DefaultPickerStyle(), onConfirm: (p, position) {
|
||||||
|
state.unOpenDoorTime.value = p;
|
||||||
|
}, onChanged: (p, position) {});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,24 @@
|
|||||||
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
class NDaysUnopenedState {
|
||||||
|
final List<String> unopenDoorTimeList = [
|
||||||
|
'1天',
|
||||||
|
'2天',
|
||||||
|
'3天',
|
||||||
|
'4天',
|
||||||
|
'5天',
|
||||||
|
'6天',
|
||||||
|
'7天',
|
||||||
|
'8天',
|
||||||
|
'9天',
|
||||||
|
'10天',
|
||||||
|
'11天',
|
||||||
|
'12天',
|
||||||
|
'13天',
|
||||||
|
'14天',
|
||||||
|
'15天',
|
||||||
|
];
|
||||||
|
|
||||||
|
var isunOpenNotice = false.obs; // 是否N天未开门提醒
|
||||||
|
var unOpenDoorTime = '1天'.obs; // 未开门时间
|
||||||
|
}
|
||||||
@ -0,0 +1,6 @@
|
|||||||
|
import 'package:star_lock/main/lockDetail/lcokSet/notificationMode/notificationMode_state.dart';
|
||||||
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
|
|
||||||
|
class NotificationModeLogic extends BaseGetXController {
|
||||||
|
NotificationModeState state = NotificationModeState();
|
||||||
|
}
|
||||||
@ -0,0 +1,343 @@
|
|||||||
|
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/lcokSet/notificationMode/notificationMode_logic.dart';
|
||||||
|
import 'package:star_lock/tools/commonItem.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 NotificationModePage extends StatefulWidget {
|
||||||
|
const NotificationModePage({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<NotificationModePage> createState() => _NotificationModePageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _NotificationModePageState extends State<NotificationModePage> {
|
||||||
|
final logic = Get.put(NotificationModeLogic());
|
||||||
|
final state = Get.find<NotificationModeLogic>().state;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
backgroundColor: AppColors.mainBackgroundColor,
|
||||||
|
appBar: TitleAppBar(
|
||||||
|
barTitle: '提醒方式',
|
||||||
|
haveBack: true,
|
||||||
|
backgroundColor: AppColors.mainColor),
|
||||||
|
body: SingleChildScrollView(
|
||||||
|
child: _buildMainView(),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildMainView() {
|
||||||
|
return Column(
|
||||||
|
children: [
|
||||||
|
CommonItem(
|
||||||
|
leftTitel: 'APP推送',
|
||||||
|
rightTitle: '管理员',
|
||||||
|
isHaveLine: true,
|
||||||
|
isHaveDirection: false,
|
||||||
|
action: () {}),
|
||||||
|
SizedBox(
|
||||||
|
height: 10.h,
|
||||||
|
),
|
||||||
|
CommonItem(
|
||||||
|
leftTitel: '邮件提醒',
|
||||||
|
rightTitle: '',
|
||||||
|
isHaveLine: true,
|
||||||
|
isHaveDirection: false,
|
||||||
|
isHaveRightWidget: true,
|
||||||
|
rightWidget: state.emailReceiverList.value.length < 3
|
||||||
|
? Image.asset(
|
||||||
|
'images/icon_btn_add.png',
|
||||||
|
width: 32.w,
|
||||||
|
height: 32.w,
|
||||||
|
)
|
||||||
|
: Container(),
|
||||||
|
action: () {
|
||||||
|
if (state.emailReceiverList.value.length < 3) {
|
||||||
|
setState(() {
|
||||||
|
state.emailReceiverList.value.add(1);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
Obx(() => SizedBox(
|
||||||
|
height: state.emailReceiverList.value.length * 62.h,
|
||||||
|
child: ListView.separated(
|
||||||
|
itemCount: state.emailReceiverList.value.length,
|
||||||
|
itemBuilder: (BuildContext context, int index) {
|
||||||
|
return _buildReceiverItem(index, true);
|
||||||
|
},
|
||||||
|
separatorBuilder: (BuildContext context, int index) {
|
||||||
|
return Divider(
|
||||||
|
height: 1.h,
|
||||||
|
color: AppColors.greyBackgroundColor,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
SizedBox(
|
||||||
|
height: 10.h,
|
||||||
|
),
|
||||||
|
CommonItem(
|
||||||
|
leftTitel: '短信提醒',
|
||||||
|
rightTitle: '',
|
||||||
|
isHaveLine: true,
|
||||||
|
isHaveDirection: false,
|
||||||
|
isHaveRightWidget: true,
|
||||||
|
rightWidget: state.phoneReceiverList.value.length < 3
|
||||||
|
? Image.asset(
|
||||||
|
'images/icon_btn_add.png',
|
||||||
|
width: 32.w,
|
||||||
|
height: 32.w,
|
||||||
|
)
|
||||||
|
: Container(),
|
||||||
|
action: () {
|
||||||
|
if (state.phoneReceiverList.value.length < 3) {
|
||||||
|
setState(() {
|
||||||
|
state.phoneReceiverList.value.add(1);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
SizedBox(
|
||||||
|
height: state.phoneReceiverList.value.length * 62.h,
|
||||||
|
child: ListView.separated(
|
||||||
|
itemCount: state.phoneReceiverList.value.length,
|
||||||
|
itemBuilder: (BuildContext context, int index) {
|
||||||
|
return _buildReceiverItem(index, false);
|
||||||
|
},
|
||||||
|
separatorBuilder: (BuildContext context, int index) {
|
||||||
|
return Divider(
|
||||||
|
height: 1.h,
|
||||||
|
color: AppColors.greyBackgroundColor,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 60.h,
|
||||||
|
),
|
||||||
|
SubmitBtn(
|
||||||
|
btnName: '确定',
|
||||||
|
onClick: () {},
|
||||||
|
)
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildReceiverItem(int index, bool isEmail) {
|
||||||
|
return Container(
|
||||||
|
color: Colors.white,
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
GestureDetector(
|
||||||
|
child: SizedBox(
|
||||||
|
// width: 40.w,
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
SizedBox(
|
||||||
|
width: 20.w,
|
||||||
|
),
|
||||||
|
Image.asset(
|
||||||
|
'images/icon_massSend_delete.png',
|
||||||
|
width: 26.w,
|
||||||
|
height: 26.w,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
onTap: () {
|
||||||
|
setState(() {
|
||||||
|
if (isEmail) {
|
||||||
|
state.emailReceiverList.value.removeAt(index);
|
||||||
|
} else {
|
||||||
|
state.phoneReceiverList.value.removeAt(index);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
massSendReceiverCellWidget(
|
||||||
|
leftTitel: TranslationLoader.lanKeys!.receiver!.tr,
|
||||||
|
rightTitle: state.inputEmailStr.value,
|
||||||
|
isHaveLine: true,
|
||||||
|
isHaveRightWidget: true,
|
||||||
|
rightWidget: isEmail
|
||||||
|
? getEmailTFWidget('请输入Email', 1)
|
||||||
|
: getPhoneWidget('请输入手机号', 1)),
|
||||||
|
Divider(
|
||||||
|
color: AppColors.greyLineColor,
|
||||||
|
indent: 20.w,
|
||||||
|
endIndent: 20.w,
|
||||||
|
height: 1,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
))
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// TextEditingController _receiverController(String getStr) {
|
||||||
|
// TextEditingController controller = TextEditingController(text: getStr);
|
||||||
|
// controller.addListener(() {
|
||||||
|
// state.inputEmailStr.value = controller.text;
|
||||||
|
// print(controller.text);
|
||||||
|
// });
|
||||||
|
|
||||||
|
// return controller;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// 接受者邮箱输入框
|
||||||
|
Widget getEmailTFWidget(String tfStr, int lineIndex) {
|
||||||
|
TextEditingController emailController = TextEditingController();
|
||||||
|
return SizedBox(
|
||||||
|
height: 50.h,
|
||||||
|
width: 360.w,
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: TextField(
|
||||||
|
controller: emailController,
|
||||||
|
//输入框一行
|
||||||
|
maxLines: 1,
|
||||||
|
autofocus: false,
|
||||||
|
textAlign: TextAlign.end,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
//输入里面输入文字内边距设置
|
||||||
|
contentPadding: const EdgeInsets.only(top: -12.0, bottom: 0.0),
|
||||||
|
hintText: tfStr,
|
||||||
|
hintStyle: TextStyle(fontSize: 22.sp),
|
||||||
|
//不需要输入框下划线
|
||||||
|
border: InputBorder.none,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 接受者手机号输入框
|
||||||
|
Widget getPhoneWidget(String tfStr, int lineIndex) {
|
||||||
|
TextEditingController phoneController = TextEditingController();
|
||||||
|
|
||||||
|
return SizedBox(
|
||||||
|
height: 50.h,
|
||||||
|
width: 360.w,
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: GestureDetector(
|
||||||
|
child: Container(
|
||||||
|
width: 90.w,
|
||||||
|
color: Colors.white,
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
|
children: [
|
||||||
|
Obx(() => Text(
|
||||||
|
'+${state.countryCode}',
|
||||||
|
style: TextStyle(
|
||||||
|
color: AppColors.darkGrayTextColor,
|
||||||
|
fontSize: 20.sp),
|
||||||
|
)),
|
||||||
|
Image.asset(
|
||||||
|
'images/icon_grayPullDown.png',
|
||||||
|
width: 20.w,
|
||||||
|
height: 20.w,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
onTap: () async {
|
||||||
|
var result = await Get.toNamed(Routers.seletCountryRegionPage);
|
||||||
|
if (result != null) {
|
||||||
|
result as Map<String, dynamic>;
|
||||||
|
state.countryCode.value = result['code'];
|
||||||
|
state.countryName.value = result['countryName'];
|
||||||
|
}
|
||||||
|
},
|
||||||
|
)),
|
||||||
|
SizedBox(
|
||||||
|
width: 5.w,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: 180.w,
|
||||||
|
child: TextField(
|
||||||
|
controller: phoneController,
|
||||||
|
//输入框一行
|
||||||
|
maxLines: 1,
|
||||||
|
autofocus: false,
|
||||||
|
textAlign: TextAlign.end,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
//输入里面输入文字内边距设置
|
||||||
|
contentPadding: const EdgeInsets.only(top: -12.0, bottom: 0.0),
|
||||||
|
hintText: tfStr,
|
||||||
|
hintStyle: TextStyle(fontSize: 22.sp),
|
||||||
|
//不需要输入框下划线
|
||||||
|
border: InputBorder.none,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget massSendReceiverCellWidget({
|
||||||
|
String? leftTitel,
|
||||||
|
String? rightTitle,
|
||||||
|
bool? isHaveDirection,
|
||||||
|
bool? isHaveLine,
|
||||||
|
bool? isHaveRightWidget,
|
||||||
|
Widget? rightWidget,
|
||||||
|
Function()? action,
|
||||||
|
double? allHeight,
|
||||||
|
}) {
|
||||||
|
return Column(
|
||||||
|
// mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
height: 60.h,
|
||||||
|
color: Colors.white,
|
||||||
|
padding: EdgeInsets.only(right: 20.w), // , top: 20.w, bottom: 20.w
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
SizedBox(width: 20.w),
|
||||||
|
Text(leftTitel!, style: TextStyle(fontSize: 22.sp)),
|
||||||
|
Expanded(child: SizedBox(width: 10.w)),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
|
children: [
|
||||||
|
isHaveRightWidget!
|
||||||
|
? rightWidget!
|
||||||
|
: Text(
|
||||||
|
rightTitle ?? "",
|
||||||
|
textAlign: TextAlign.end,
|
||||||
|
// overflow: TextOverflow.ellipsis,
|
||||||
|
// maxLines: 1,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 22.sp,
|
||||||
|
color: AppColors.darkGrayTextColor),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,9 @@
|
|||||||
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
class NotificationModeState {
|
||||||
|
var inputEmailStr = ''.obs; // 输入的邮箱地址
|
||||||
|
var emailReceiverList = [].obs;
|
||||||
|
var phoneReceiverList = [].obs;
|
||||||
|
var countryName = '中国'.obs;
|
||||||
|
var countryCode = '86'.obs;
|
||||||
|
}
|
||||||
@ -0,0 +1,6 @@
|
|||||||
|
import 'package:star_lock/main/lockDetail/lcokSet/openDoorNotify/openDoorNotify_state.dart';
|
||||||
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
|
|
||||||
|
class OpenDoorNotifyLogic extends BaseGetXController {
|
||||||
|
final OpenDoorNotifyState state = OpenDoorNotifyState();
|
||||||
|
}
|
||||||
@ -0,0 +1,154 @@
|
|||||||
|
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/lcokSet/openDoorNotify/openDoorNotify_logic.dart';
|
||||||
|
import '../../../../app_settings/app_colors.dart';
|
||||||
|
import '../../../../tools/submitBtn.dart';
|
||||||
|
import '../../../../tools/titleAppBar.dart';
|
||||||
|
|
||||||
|
class OpenDoorNotifyPage extends StatefulWidget {
|
||||||
|
const OpenDoorNotifyPage({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<OpenDoorNotifyPage> createState() => _OpenDoorNotifyPageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _OpenDoorNotifyPageState extends State<OpenDoorNotifyPage> {
|
||||||
|
final logic = Get.put(OpenDoorNotifyLogic());
|
||||||
|
final state = Get.find<OpenDoorNotifyLogic>().state;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
backgroundColor: AppColors.mainBackgroundColor,
|
||||||
|
appBar: TitleAppBar(
|
||||||
|
barTitle: '家人到家',
|
||||||
|
haveBack: true,
|
||||||
|
backgroundColor: AppColors.mainColor,
|
||||||
|
),
|
||||||
|
body: Column(
|
||||||
|
children: [
|
||||||
|
_topTipsWidget(),
|
||||||
|
SizedBox(
|
||||||
|
height: 20.h,
|
||||||
|
),
|
||||||
|
Expanded(child: _buildMainUI()),
|
||||||
|
// Expanded(
|
||||||
|
// child: Obx(() => state.itemDataList.value.isEmpty
|
||||||
|
// ? const NoData()
|
||||||
|
// : _buildMainUI(state.itemDataList.value))),
|
||||||
|
AddBottomWhiteBtn(
|
||||||
|
btnName: '添加家人',
|
||||||
|
onClick: () {
|
||||||
|
Get.toNamed(Routers.addFamilyPage);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 64.h,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _topTipsWidget() {
|
||||||
|
return Container(
|
||||||
|
alignment: Alignment.centerLeft,
|
||||||
|
margin: EdgeInsets.only(left: 20.w, right: 20.w, top: 20.w),
|
||||||
|
child: Text(
|
||||||
|
'若锁没有联网,除电子钥匙外,密码、卡、指纹等开门提醒无法及时发送,请根据你的实际情况选择',
|
||||||
|
style: TextStyle(color: AppColors.darkGrayTextColor, fontSize: 20.sp),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildMainUI() {
|
||||||
|
return ListView.separated(
|
||||||
|
shrinkWrap: true,
|
||||||
|
itemCount: 3,
|
||||||
|
itemBuilder: (c, index) {
|
||||||
|
return _electronicKeyItem(
|
||||||
|
'images/controls_user.png', '18682150237', '电子钥匙', () {
|
||||||
|
Get.toNamed(Routers.familyDetailsPage);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
separatorBuilder: (BuildContext context, int index) {
|
||||||
|
return const Divider(
|
||||||
|
height: 1,
|
||||||
|
color: AppColors.greyLineColor,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _electronicKeyItem(String avatarURL, String familyAccount,
|
||||||
|
String openDoorWay, Function() action) {
|
||||||
|
return GestureDetector(
|
||||||
|
onTap: action,
|
||||||
|
child: Container(
|
||||||
|
color: Colors.white,
|
||||||
|
height: 90.h,
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
SizedBox(
|
||||||
|
width: 30.w,
|
||||||
|
),
|
||||||
|
Image.asset(
|
||||||
|
avatarURL,
|
||||||
|
width: 60.w,
|
||||||
|
height: 60.w,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: 20.w,
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
familyAccount,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 24.sp, color: AppColors.blackColor),
|
||||||
|
),
|
||||||
|
SizedBox(width: 10.w),
|
||||||
|
Expanded(
|
||||||
|
child: SizedBox(
|
||||||
|
width: 20.w,
|
||||||
|
))
|
||||||
|
],
|
||||||
|
),
|
||||||
|
SizedBox(height: 10.h),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
openDoorWay,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 18.sp,
|
||||||
|
color: AppColors.placeholderTextColor),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
SizedBox(width: 20.h),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Image.asset(
|
||||||
|
'images/icon_right_grey.png',
|
||||||
|
width: 26.w,
|
||||||
|
height: 20.h,
|
||||||
|
),
|
||||||
|
SizedBox(width: 20.h),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,7 @@
|
|||||||
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
class OpenDoorNotifyState {
|
||||||
|
var pageNum = 1.obs; //请求页码
|
||||||
|
final pageSize = 20.obs; //请求每页数据条数
|
||||||
|
final itemDataList = [].obs;
|
||||||
|
}
|
||||||
@ -401,6 +401,14 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
Get.toNamed(Routers.lockOperatingRecordPage,
|
Get.toNamed(Routers.lockOperatingRecordPage,
|
||||||
arguments: {"keyInfo": widget.lockListInfoItemEntity});
|
arguments: {"keyInfo": widget.lockListInfoItemEntity});
|
||||||
}),
|
}),
|
||||||
|
// 视频日志
|
||||||
|
bottomItem('images/main/icon_main_set.png', "视频日志", () {
|
||||||
|
//视频日志
|
||||||
|
}),
|
||||||
|
// 消息提醒
|
||||||
|
bottomItem('images/main/icon_main_set.png', "消息提醒", () {
|
||||||
|
Get.toNamed(Routers.msgNotificationPage);
|
||||||
|
}),
|
||||||
// 设置
|
// 设置
|
||||||
bottomItem(
|
bottomItem(
|
||||||
'images/main/icon_main_set.png', TranslationLoader.lanKeys!.set!.tr,
|
'images/main/icon_main_set.png', TranslationLoader.lanKeys!.set!.tr,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user