1,新增添加人脸相关
2,新增消息通知相关
This commit is contained in:
parent
624eaf258b
commit
45cc0801e5
@ -7,6 +7,7 @@
|
||||
"card":"Card",
|
||||
"fingerprint":"Fingerprint",
|
||||
"remoteControl":"RemoteControl",
|
||||
"face":"face",
|
||||
"operatingRecord":"Operating Record",
|
||||
"number":"Number",
|
||||
"additive":"Additive",
|
||||
|
||||
@ -7,6 +7,7 @@
|
||||
"card":"card",
|
||||
"fingerprint":"fingerprint",
|
||||
"remoteControl":"remoteControl",
|
||||
"face":"face",
|
||||
"operatingRecord":"operatingRecord",
|
||||
"number":"number",
|
||||
"additive":"additive",
|
||||
|
||||
@ -7,6 +7,7 @@
|
||||
"card":"卡",
|
||||
"fingerprint":"指纹",
|
||||
"remoteControl":"遥控",
|
||||
"face":"人脸",
|
||||
"operatingRecord":"操作记录",
|
||||
"number":"号",
|
||||
"additive":"添加者",
|
||||
|
||||
BIN
star_lock/images/main/icon_main_addFace.png
Normal file
BIN
star_lock/images/main/icon_main_addFace.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 24 KiB |
@ -11,8 +11,10 @@ import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/ma
|
||||
import 'package:star_lock/main/lockDetail/lcokSet/catEyeWorkMode/catEyeWorkMode_page.dart';
|
||||
import 'package:star_lock/main/lockDetail/lcokSet/faceUnlock/faceUnlock_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/openDoorDirection/openDoorDirection_page.dart';
|
||||
import 'package:star_lock/main/lockDetail/lockDetail/lockDetail_main_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/mine/safeVerify/safeVerify_page.dart';
|
||||
import 'package:star_lock/mine/minePersonInfo/minePersonInfoEmail/mineBindPhoneOrEmail_page.dart';
|
||||
@ -346,6 +348,8 @@ abstract class Routers {
|
||||
static const motorPowerPage = '/motorPowerPage'; //电机功率设置
|
||||
static const openDoorDirectionPage = '/openDoorDirectionPage'; //开门方向设置
|
||||
static const catEyeWorkModePage = '/catEyeWorkModePage'; //猫眼工作模式
|
||||
static const msgNotificationPage = '/msgNotificationPage'; //消息通知
|
||||
static const addFaceTipPage = '/addFaceTipPage'; //添加人脸
|
||||
}
|
||||
|
||||
abstract class AppRouters {
|
||||
@ -855,6 +859,10 @@ abstract class AppRouters {
|
||||
page: () => const OpenDoorDirectionPage()),
|
||||
GetPage(
|
||||
name: Routers.catEyeWorkModePage,
|
||||
page: () => const CatEyeWorkModePage())
|
||||
page: () => const CatEyeWorkModePage()),
|
||||
GetPage(
|
||||
name: Routers.msgNotificationPage,
|
||||
page: () => const MsgNotificationPage()),
|
||||
GetPage(name: Routers.addFaceTipPage, page: () => const AddFaceTipPage())
|
||||
];
|
||||
}
|
||||
|
||||
@ -123,5 +123,7 @@ class AppColors {
|
||||
static const toBeReceiveBgColor = Color.fromRGBO(246, 203, 203, 1); //待接收红色背景
|
||||
static const expireTextBgColor = Color.fromRGBO(253, 166, 8, 1); //即将到期时间字体背景色
|
||||
static const blueTextTipsColor = Color.fromRGBO(0, 113, 255, 1); //蓝色字体tips
|
||||
static const blueViewBgColor = Color.fromRGBO(223, 237, 254, 1); //蓝色背景板
|
||||
static const blueViewBgColor =
|
||||
Color.fromRGBO(223, 237, 254, 1); //蓝色背景板 139 148 176
|
||||
static const msgNoticeTextColor = Color.fromRGBO(139, 148, 176, 1); //消息通知字体颜色
|
||||
}
|
||||
|
||||
@ -281,6 +281,16 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
|
||||
Get.toNamed(Routers.faceUnlockPage);
|
||||
})),
|
||||
// ),
|
||||
Visibility(
|
||||
visible: true,
|
||||
child: CommonItem(
|
||||
leftTitel: '消息通知',
|
||||
rightTitle: "",
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
Get.toNamed(Routers.msgNotificationPage);
|
||||
})),
|
||||
Visibility(
|
||||
visible: true,
|
||||
child: CommonItem(
|
||||
|
||||
@ -0,0 +1,253 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:star_lock/tools/custom_bottom_sheet.dart';
|
||||
|
||||
import '../../../../app_settings/app_colors.dart';
|
||||
import '../../../../tools/commonItem.dart';
|
||||
import '../../../../tools/titleAppBar.dart';
|
||||
|
||||
class MsgNotificationPage extends StatefulWidget {
|
||||
const MsgNotificationPage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<MsgNotificationPage> createState() => _MsgNotificationPageState();
|
||||
}
|
||||
|
||||
class _MsgNotificationPageState extends State<MsgNotificationPage> {
|
||||
bool faceOn = false; //面容开锁
|
||||
bool autoBright = false; //自动亮屏
|
||||
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
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.white,
|
||||
appBar: TitleAppBar(
|
||||
barTitle: '消息通知',
|
||||
haveBack: true,
|
||||
backgroundColor: AppColors.mainColor),
|
||||
body: Column(
|
||||
children: [
|
||||
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(
|
||||
String leftStr, String subTitle, String rightStr, Function()? action) {
|
||||
return GestureDetector(
|
||||
onTap: action,
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(left: 20.sp, right: 20.sp, top: 20.h),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
SizedBox(
|
||||
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,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildTipsView() {
|
||||
return Container(
|
||||
width: ScreenUtil().screenWidth - 40.w,
|
||||
margin: EdgeInsets.only(left: 20.w, right: 20.w, bottom: 10.h),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.mainBackgroundColor,
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
),
|
||||
child: Padding(
|
||||
padding:
|
||||
EdgeInsets.only(left: 20.w, top: 30.h, bottom: 40.h, right: 15.w),
|
||||
child: RichText(text: tipsPreviewSpan)),
|
||||
);
|
||||
}
|
||||
|
||||
CupertinoSwitch _switch(int getIndex) {
|
||||
return CupertinoSwitch(
|
||||
activeColor: CupertinoColors.activeBlue,
|
||||
trackColor: CupertinoColors.systemGrey5,
|
||||
thumbColor: CupertinoColors.white,
|
||||
value: getIndex == 1 ? faceOn : autoBright,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
if (getIndex == 1) {
|
||||
faceOn = value;
|
||||
} else {
|
||||
autoBright = value;
|
||||
}
|
||||
});
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
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(() {});
|
||||
},
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -364,9 +364,10 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
if (state.keyInfos.value.lockFeature!.d3Face == 1) {
|
||||
showWidgetArr.add(
|
||||
bottomItem('images/main/icon_face.png', '人脸', () {
|
||||
// Navigator.pushNamed(context, Routers.otherTypeKeyListPage,
|
||||
// arguments: 1);
|
||||
// Toast.show(msg: "功能暂未开放");
|
||||
Get.toNamed(Routers.otherTypeKeyListPage, arguments: {
|
||||
"lockId": widget.lockListInfoItemEntity.lockId,
|
||||
"fromType": 3
|
||||
}); // Toast.show(msg: "功能暂未开放");
|
||||
|
||||
// tokNative('flutter_videoTalk_to_ios',
|
||||
// arguments: {'videoTalk': 'videoTalk'}).then((result) {
|
||||
|
||||
@ -0,0 +1,75 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../../../../../appRouters.dart';
|
||||
import '../../../../../app_settings/app_colors.dart';
|
||||
import '../../../../../tools/submitBtn.dart';
|
||||
import '../../../../../tools/titleAppBar.dart';
|
||||
import '../../../../../translations/trans_lib.dart';
|
||||
|
||||
class AddFaceTipPage extends StatefulWidget {
|
||||
const AddFaceTipPage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<AddFaceTipPage> createState() => _AddFaceTipPageState();
|
||||
}
|
||||
|
||||
class _AddFaceTipPageState extends State<AddFaceTipPage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.white,
|
||||
appBar: TitleAppBar(
|
||||
barTitle: TranslationLoader.lanKeys!.addLock!.tr,
|
||||
haveBack: true,
|
||||
backgroundColor: AppColors.mainColor),
|
||||
body: ListView(
|
||||
// mainAxisAlignment: MainAxisAlignment.center,
|
||||
// crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 50.h,
|
||||
),
|
||||
Image.asset(
|
||||
'images/main/icon_main_addFace.png',
|
||||
width: 100.w,
|
||||
height: 457.h,
|
||||
fit: BoxFit.fitHeight,
|
||||
),
|
||||
SizedBox(
|
||||
height: 60.h,
|
||||
),
|
||||
Container(
|
||||
padding: EdgeInsets.only(left: 20.w, right: 20.w),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
"请单人正对门锁,距离一个成年人手臂长度(约0.6米).\n保持脸部无遮挡,露出五官",
|
||||
// TranslationLoader.lanKeys!.lightTouchScreenTip!.tr,
|
||||
textAlign: TextAlign.center,
|
||||
maxLines: null,
|
||||
style:
|
||||
TextStyle(fontSize: 24.sp, fontWeight: FontWeight.w600),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 120.h,
|
||||
),
|
||||
Container(
|
||||
padding: EdgeInsets.only(left: 20.w, right: 20.w),
|
||||
child: SubmitBtn(
|
||||
btnName: "开始添加", //TranslationLoader.lanKeys!.next!.tr,
|
||||
borderRadius: 20.w,
|
||||
onClick: () {}),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -157,6 +157,12 @@ class OtherTypeAddKeyLogic extends BaseGetXController {
|
||||
case 2:
|
||||
// 遥控
|
||||
|
||||
break;
|
||||
|
||||
case 3:
|
||||
// 人脸
|
||||
Get.toNamed(Routers.addFaceTipPage);
|
||||
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@ -43,10 +43,10 @@ class _OtherTypeKeyListPageState extends State<OtherTypeKeyListPage> {
|
||||
style: TextStyle(color: Colors.white, fontSize: 24.sp),
|
||||
),
|
||||
onPressed: () async {
|
||||
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||
if(isDemoMode == false){
|
||||
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||
if (isDemoMode == false) {
|
||||
showDeletAlertDialog(context);
|
||||
}else{
|
||||
} else {
|
||||
// Get.toNamed(Routers.seletLockTypePage);
|
||||
Toast.show(msg: "演示模式");
|
||||
}
|
||||
@ -62,14 +62,16 @@ class _OtherTypeKeyListPageState extends State<OtherTypeKeyListPage> {
|
||||
),
|
||||
Expanded(child: _buildMainUI(state.fromType.value)),
|
||||
AddBottomWhiteBtn(
|
||||
btnName: '${TranslationLoader.lanKeys!.add!.tr}${getAppBarTitle(state.fromType.value)}',
|
||||
btnName:
|
||||
'${TranslationLoader.lanKeys!.add!.tr}${getAppBarTitle(state.fromType.value)}',
|
||||
onClick: () async {
|
||||
var data = await Get.toNamed(Routers.otherTypeKeyManagePage, arguments: {
|
||||
var data =
|
||||
await Get.toNamed(Routers.otherTypeKeyManagePage, arguments: {
|
||||
"lockId": state.lockId.value,
|
||||
"keyType": state.fromType.value,
|
||||
"fromType": 1 // 1从添加钥匙列表进入 2从考勤添加员工入口进入
|
||||
});
|
||||
if(data != null) {
|
||||
if (data != null) {
|
||||
switch (state.fromType.value) {
|
||||
case 0:
|
||||
// 卡
|
||||
@ -80,7 +82,11 @@ class _OtherTypeKeyListPageState extends State<OtherTypeKeyListPage> {
|
||||
logic.getFingerprintsListData();
|
||||
break;
|
||||
case 2:
|
||||
// 遥控
|
||||
// 遥控
|
||||
|
||||
break;
|
||||
case 3:
|
||||
// 人脸
|
||||
|
||||
break;
|
||||
default:
|
||||
@ -109,6 +115,9 @@ class _OtherTypeKeyListPageState extends State<OtherTypeKeyListPage> {
|
||||
case 2:
|
||||
title = TranslationLoader.lanKeys!.remoteControl!.tr;
|
||||
break;
|
||||
case 3:
|
||||
title = TranslationLoader.lanKeys!.face!.tr;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -126,13 +135,13 @@ class _OtherTypeKeyListPageState extends State<OtherTypeKeyListPage> {
|
||||
maxLines: 1,
|
||||
controller: state.searchController,
|
||||
autofocus: false,
|
||||
onChanged: (value){
|
||||
onChanged: (value) {
|
||||
print("onChanged:$value");
|
||||
},
|
||||
onEditingComplete: (){
|
||||
onEditingComplete: () {
|
||||
print("onEditingComplete:");
|
||||
},
|
||||
onSubmitted: (value){
|
||||
onSubmitted: (value) {
|
||||
switch (state.fromType.value) {
|
||||
case 0:
|
||||
// 卡
|
||||
@ -143,17 +152,21 @@ class _OtherTypeKeyListPageState extends State<OtherTypeKeyListPage> {
|
||||
logic.getFingerprintsListData();
|
||||
break;
|
||||
case 2:
|
||||
// 遥控
|
||||
// 遥控
|
||||
|
||||
break;
|
||||
case 3:
|
||||
// 人脸
|
||||
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
},
|
||||
decoration: InputDecoration(
|
||||
//输入里面输入文字内边距设置
|
||||
contentPadding: const EdgeInsets.only(top: 12.0, left: -19.0, right: -15.0, bottom: 8.0),
|
||||
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),
|
||||
//不需要输入框下划线
|
||||
@ -186,96 +199,130 @@ class _OtherTypeKeyListPageState extends State<OtherTypeKeyListPage> {
|
||||
// typeImgName = 'images/icon_card.png';
|
||||
// }
|
||||
|
||||
return Obx(() => state.fingerprintItemListData.value.isNotEmpty ? ListView.separated(
|
||||
itemCount: state.fingerprintItemListData.value.length,
|
||||
itemBuilder: (c, index) {
|
||||
FingerprintItemData fingerprintItemData = state.fingerprintItemListData.value[index];
|
||||
switch (state.fromType.value) {
|
||||
case 0:
|
||||
// 卡
|
||||
if (index < state.fingerprintItemListData.value.length) {
|
||||
return LeftSlideActions(
|
||||
key: Key(fingerprintItemData.cardName!),
|
||||
actionsWidth: 60,
|
||||
actions: [
|
||||
_buildDeleteBtn(fingerprintItemData.cardId.toString()),
|
||||
],
|
||||
decoration: const BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(1)),
|
||||
),
|
||||
child: _keyItem('images/icon_card.png', fingerprintItemData.cardName!, fingerprintItemData.cardType! == 1 ? "永久" : "${DateTool().dateToYMDHNString(fingerprintItemData.startDate.toString())} - ${DateTool().dateToYMDHNString(fingerprintItemData.endDate.toString())}", () async {
|
||||
var data = await Get.toNamed(Routers.otherTypeKeyDetailPage, arguments: {
|
||||
"fingerprintItemData": fingerprintItemData,
|
||||
"type": type,
|
||||
});
|
||||
if(data != null) {
|
||||
logic.getICCardListData();
|
||||
return Obx(() => state.fingerprintItemListData.value.isNotEmpty
|
||||
? ListView.separated(
|
||||
itemCount: state.fingerprintItemListData.value.length,
|
||||
itemBuilder: (c, index) {
|
||||
FingerprintItemData fingerprintItemData =
|
||||
state.fingerprintItemListData.value[index];
|
||||
switch (state.fromType.value) {
|
||||
case 0:
|
||||
// 卡
|
||||
if (index < state.fingerprintItemListData.value.length) {
|
||||
return LeftSlideActions(
|
||||
key: Key(fingerprintItemData.cardName!),
|
||||
actionsWidth: 60,
|
||||
actions: [
|
||||
_buildDeleteBtn(fingerprintItemData.cardId.toString()),
|
||||
],
|
||||
decoration: const BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(1)),
|
||||
),
|
||||
child: _keyItem(
|
||||
'images/icon_card.png',
|
||||
fingerprintItemData.cardName!,
|
||||
fingerprintItemData.cardType! == 1
|
||||
? "永久"
|
||||
: "${DateTool().dateToYMDHNString(fingerprintItemData.startDate.toString())} - ${DateTool().dateToYMDHNString(fingerprintItemData.endDate.toString())}",
|
||||
() async {
|
||||
var data = await Get.toNamed(
|
||||
Routers.otherTypeKeyDetailPage,
|
||||
arguments: {
|
||||
"fingerprintItemData": fingerprintItemData,
|
||||
"type": type,
|
||||
});
|
||||
if (data != null) {
|
||||
logic.getICCardListData();
|
||||
}
|
||||
}),
|
||||
);
|
||||
}
|
||||
}),
|
||||
);
|
||||
}
|
||||
return const SizedBox.shrink();
|
||||
return const SizedBox.shrink();
|
||||
|
||||
return _keyItem('images/icon_card.png', fingerprintItemData.cardName!, fingerprintItemData.cardType! == 1 ? "永久" : "${DateTool().dateToYMDHNString(fingerprintItemData.startDate.toString())} - ${DateTool().dateToYMDHNString(fingerprintItemData.endDate.toString())}", () async {
|
||||
var data = await Get.toNamed(Routers.otherTypeKeyDetailPage, arguments: {
|
||||
"fingerprintItemData": fingerprintItemData,
|
||||
"type": type,
|
||||
});
|
||||
if(data != null) {
|
||||
logic.getICCardListData();
|
||||
}
|
||||
});
|
||||
break;
|
||||
case 1:
|
||||
// 指纹
|
||||
if (index < state.fingerprintItemListData.value.length) {
|
||||
return LeftSlideActions(
|
||||
key: Key(fingerprintItemData.fingerprintName!),
|
||||
actionsWidth: 60,
|
||||
actions: [
|
||||
_buildDeleteBtn(fingerprintItemData.fingerprintId.toString()),
|
||||
],
|
||||
decoration: const BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(1)),
|
||||
),
|
||||
child: _keyItem('images/icon_fingerprint.png', fingerprintItemData.fingerprintName!, fingerprintItemData.fingerprintType! == 1 ? "永久" : "${DateTool().dateToYMDHNString(fingerprintItemData.startDate.toString())} - ${DateTool().dateToYMDHNString(fingerprintItemData.endDate.toString())}", () async {
|
||||
var data = await Get.toNamed(Routers.otherTypeKeyDetailPage, arguments: {
|
||||
"fingerprintItemData": fingerprintItemData,
|
||||
"type": type,
|
||||
return _keyItem(
|
||||
'images/icon_card.png',
|
||||
fingerprintItemData.cardName!,
|
||||
fingerprintItemData.cardType! == 1
|
||||
? "永久"
|
||||
: "${DateTool().dateToYMDHNString(fingerprintItemData.startDate.toString())} - ${DateTool().dateToYMDHNString(fingerprintItemData.endDate.toString())}",
|
||||
() async {
|
||||
var data = await Get.toNamed(Routers.otherTypeKeyDetailPage,
|
||||
arguments: {
|
||||
"fingerprintItemData": fingerprintItemData,
|
||||
"type": type,
|
||||
});
|
||||
if (data != null) {
|
||||
logic.getICCardListData();
|
||||
}
|
||||
});
|
||||
if(data != null) {
|
||||
logic.getFingerprintsListData();
|
||||
break;
|
||||
case 1:
|
||||
// 指纹
|
||||
if (index < state.fingerprintItemListData.value.length) {
|
||||
return LeftSlideActions(
|
||||
key: Key(fingerprintItemData.fingerprintName!),
|
||||
actionsWidth: 60,
|
||||
actions: [
|
||||
_buildDeleteBtn(
|
||||
fingerprintItemData.fingerprintId.toString()),
|
||||
],
|
||||
decoration: const BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(1)),
|
||||
),
|
||||
child: _keyItem(
|
||||
'images/icon_fingerprint.png',
|
||||
fingerprintItemData.fingerprintName!,
|
||||
fingerprintItemData.fingerprintType! == 1
|
||||
? "永久"
|
||||
: "${DateTool().dateToYMDHNString(fingerprintItemData.startDate.toString())} - ${DateTool().dateToYMDHNString(fingerprintItemData.endDate.toString())}",
|
||||
() async {
|
||||
var data = await Get.toNamed(
|
||||
Routers.otherTypeKeyDetailPage,
|
||||
arguments: {
|
||||
"fingerprintItemData": fingerprintItemData,
|
||||
"type": type,
|
||||
});
|
||||
if (data != null) {
|
||||
logic.getFingerprintsListData();
|
||||
}
|
||||
}),
|
||||
);
|
||||
}
|
||||
}),
|
||||
);
|
||||
}
|
||||
return const SizedBox.shrink();
|
||||
return const SizedBox.shrink();
|
||||
|
||||
return _keyItem('images/icon_fingerprint.png', fingerprintItemData.fingerprintName!, fingerprintItemData.fingerprintType! == 1 ? "永久" : "${DateTool().dateToYMDHNString(fingerprintItemData.startDate.toString())} - ${DateTool().dateToYMDHNString(fingerprintItemData.endDate.toString())}", () async {
|
||||
var data = await Get.toNamed(Routers.otherTypeKeyDetailPage, arguments: {
|
||||
"fingerprintItemData": fingerprintItemData,
|
||||
"type": type,
|
||||
});
|
||||
if(data != null) {
|
||||
logic.getFingerprintsListData();
|
||||
return _keyItem(
|
||||
'images/icon_fingerprint.png',
|
||||
fingerprintItemData.fingerprintName!,
|
||||
fingerprintItemData.fingerprintType! == 1
|
||||
? "永久"
|
||||
: "${DateTool().dateToYMDHNString(fingerprintItemData.startDate.toString())} - ${DateTool().dateToYMDHNString(fingerprintItemData.endDate.toString())}",
|
||||
() async {
|
||||
var data = await Get.toNamed(Routers.otherTypeKeyDetailPage,
|
||||
arguments: {
|
||||
"fingerprintItemData": fingerprintItemData,
|
||||
"type": type,
|
||||
});
|
||||
if (data != null) {
|
||||
logic.getFingerprintsListData();
|
||||
}
|
||||
});
|
||||
break;
|
||||
case 2:
|
||||
// 遥控
|
||||
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
});
|
||||
break;
|
||||
case 2:
|
||||
// 遥控
|
||||
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
},
|
||||
separatorBuilder: (BuildContext context, int index) {
|
||||
return const Divider(
|
||||
height: 1,
|
||||
color: AppColors.greyLineColor,
|
||||
);
|
||||
},
|
||||
) :const NoData());
|
||||
},
|
||||
separatorBuilder: (BuildContext context, int index) {
|
||||
return const Divider(
|
||||
height: 1,
|
||||
color: AppColors.greyLineColor,
|
||||
);
|
||||
},
|
||||
)
|
||||
: const NoData());
|
||||
}
|
||||
|
||||
Widget _buildDeleteBtn(String idStr) {
|
||||
@ -338,7 +385,8 @@ class _OtherTypeKeyListPageState extends State<OtherTypeKeyListPage> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _keyItem(String lockTypeIcon, String lockTypeTitle, String showTime, Function() action) {
|
||||
Widget _keyItem(String lockTypeIcon, String lockTypeTitle, String showTime,
|
||||
Function() action) {
|
||||
return GestureDetector(
|
||||
onTap: action,
|
||||
child: Container(
|
||||
@ -361,7 +409,9 @@ class _OtherTypeKeyListPageState extends State<OtherTypeKeyListPage> {
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Text(lockTypeTitle, style: TextStyle(fontSize: 24.sp, color: AppColors.blackColor)),
|
||||
Text(lockTypeTitle,
|
||||
style: TextStyle(
|
||||
fontSize: 24.sp, color: AppColors.blackColor)),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 5.h),
|
||||
@ -369,7 +419,10 @@ class _OtherTypeKeyListPageState extends State<OtherTypeKeyListPage> {
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Text(showTime, style: TextStyle(fontSize: 18.sp, color: AppColors.placeholderTextColor)),
|
||||
Text(showTime,
|
||||
style: TextStyle(
|
||||
fontSize: 18.sp,
|
||||
color: AppColors.placeholderTextColor)),
|
||||
],
|
||||
),
|
||||
),
|
||||
@ -385,8 +438,8 @@ class _OtherTypeKeyListPageState extends State<OtherTypeKeyListPage> {
|
||||
}
|
||||
|
||||
void showDeletAlertDialog(
|
||||
BuildContext context,
|
||||
) {
|
||||
BuildContext context,
|
||||
) {
|
||||
showCupertinoDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
@ -406,18 +459,18 @@ class _OtherTypeKeyListPageState extends State<OtherTypeKeyListPage> {
|
||||
Navigator.pop(context);
|
||||
switch (state.fromType.value) {
|
||||
case 0:
|
||||
// 卡
|
||||
// 卡
|
||||
state.isDeletICCardData = true;
|
||||
logic.senderAddICCard("1", "DeleteAll!@#", 255);
|
||||
break;
|
||||
case 1:
|
||||
// 指纹
|
||||
// logic.deletAllFingerprintsData();
|
||||
// 指纹
|
||||
// logic.deletAllFingerprintsData();
|
||||
state.isDeletFingerprintData = true;
|
||||
logic.senderAddFingerprint("1", "DeleteAll!@#", 255);
|
||||
break;
|
||||
case 2:
|
||||
// 遥控
|
||||
// 遥控
|
||||
|
||||
break;
|
||||
default:
|
||||
|
||||
@ -36,14 +36,14 @@ class CommonItem extends StatelessWidget {
|
||||
Container(
|
||||
height: allHeight ?? 60.h,
|
||||
color: Colors.white,
|
||||
padding: EdgeInsets.only(left: 20.w, right: 10.w), // , top: 20.w, bottom: 20.w
|
||||
padding: EdgeInsets.only(
|
||||
left: 20.w, right: 10.w), // , top: 20.w, bottom: 20.w
|
||||
child: Row(
|
||||
children: [
|
||||
SizedBox(width: 20.w),
|
||||
SizedBox(
|
||||
width: isHaveRightWidget! ? 100.w : 300.w,
|
||||
child: Text(leftTitel!, style: TextStyle(fontSize: 22.sp))
|
||||
),
|
||||
// width: isHaveRightWidget! ? 100.w : 300.w,
|
||||
child: Text(leftTitel!, style: TextStyle(fontSize: 22.sp))),
|
||||
SizedBox(width: 6.w),
|
||||
isTipsImg == true
|
||||
? Image.asset(
|
||||
|
||||
@ -8,6 +8,7 @@ class LanKeyEntity {
|
||||
this.card,
|
||||
this.fingerprint,
|
||||
this.remoteControl,
|
||||
this.face,
|
||||
this.operatingRecord,
|
||||
this.number,
|
||||
this.additive,
|
||||
@ -415,6 +416,7 @@ class LanKeyEntity {
|
||||
card = json['card'];
|
||||
fingerprint = json['fingerprint'];
|
||||
remoteControl = json['remoteControl'];
|
||||
face = json['face'];
|
||||
operatingRecord = json['operatingRecord'];
|
||||
number = json['number'];
|
||||
additive = json['additive'];
|
||||
@ -850,6 +852,7 @@ class LanKeyEntity {
|
||||
String? card;
|
||||
String? fingerprint;
|
||||
String? remoteControl;
|
||||
String? face;
|
||||
String? operatingRecord;
|
||||
String? number;
|
||||
String? additive;
|
||||
@ -1275,6 +1278,7 @@ class LanKeyEntity {
|
||||
map['card'] = card;
|
||||
map['fingerprint'] = fingerprint;
|
||||
map['remoteControl'] = remoteControl;
|
||||
map['face'] = face;
|
||||
map['operatingRecord'] = operatingRecord;
|
||||
map['number'] = number;
|
||||
map['additive'] = additive;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user