1,锁用户管理—即将到期列表—密码模块新增循环显示

2,锁用户管理—即将到期列表—修改已过期显示逻辑
3,锁用户管理—即将到期列表--删除指纹的文字提示要对应为确定删除指纹吗
This commit is contained in:
Daisy 2024-05-14 14:29:56 +08:00
parent 76347a27ee
commit 78581d580f
3 changed files with 163 additions and 164 deletions

View File

@ -1,4 +1,3 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_slidable/flutter_slidable.dart';
@ -45,13 +44,17 @@ class _ExpireFingerprintPageState extends State<ExpireFingerprintPage> {
onLoad: () {
getHttpData();
},
child: Obx(() => _buildMainUI())
);
child: Obx(() => _buildMainUI()));
}
Widget _buildMainUI() {
return state.dataList.isEmpty
? NoData(noDataHeight: 1.sh - ScreenUtil().statusBarHeight - ScreenUtil().bottomBarHeight - 190.h - 64.h)
? NoData(
noDataHeight: 1.sh -
ScreenUtil().statusBarHeight -
ScreenUtil().bottomBarHeight -
190.h -
64.h)
: SlidableAutoCloseBehavior(
child: ListView.separated(
itemCount: state.dataList.length,
@ -65,8 +68,10 @@ class _ExpireFingerprintPageState extends State<ExpireFingerprintPage> {
children: [
SlidableAction(
onPressed: (BuildContext context) {
ShowTipView().showIosTipWithContentDialog("确定删除卡吗?", (){
state.deletExpireFingerprintItemEntity = indexEntity;
ShowTipView().showIosTipWithContentDialog("确定删除指纹吗?",
() {
state.deletExpireFingerprintItemEntity =
indexEntity;
logic.senderAddFingerprint();
});
},
@ -216,8 +221,7 @@ class _ExpireFingerprintPageState extends State<ExpireFingerprintPage> {
),
child: Text(
'${itemData.expireDate.toString()}',
style: TextStyle(
color: Colors.white, fontSize: 13.sp),
style: TextStyle(color: Colors.white, fontSize: 13.sp),
),
);
} else {
@ -229,12 +233,10 @@ class _ExpireFingerprintPageState extends State<ExpireFingerprintPage> {
),
child: Text(
'已过期',
style: TextStyle(
color: Colors.white, fontSize: 13.sp),
style: TextStyle(color: Colors.white, fontSize: 13.sp),
),
);
}
// }
}
}

View File

@ -1,4 +1,3 @@
import 'package:star_lock/tools/baseGetXController.dart';
import 'package:star_lock/tools/dateTool.dart';
@ -13,7 +12,8 @@ class ExpirePasswordLogic extends BaseGetXController {
//
Future<ExpirePasswordEntity> expirePasswordListRequest() async {
ExpirePasswordEntity entity = await ApiRepository.to.expirePasswordList(pageNo.toString(), pageSize.toString());
ExpirePasswordEntity entity = await ApiRepository.to
.expirePasswordList(pageNo.toString(), pageSize.toString());
if (entity.errorCode!.codeIsSuccessful) {
if (pageNo == 1) {
state.dataList.value = entity.data!.list!;
@ -29,7 +29,8 @@ class ExpirePasswordLogic extends BaseGetXController {
}
// deleteType:1- 2-
Future<void> deletePwdRequest(ExpirePasswordItemData expirePasswordItemData) async {
Future<void> deletePwdRequest(
ExpirePasswordItemData expirePasswordItemData) async {
PasswordKeyEntity entity = await ApiRepository.to.deleteKeyboardPwd(
lockId: expirePasswordItemData.lockId.toString(),
keyboardPwdId: expirePasswordItemData.pwdId.toString(),
@ -46,12 +47,13 @@ class ExpirePasswordLogic extends BaseGetXController {
//使
String getExpireDateStr(ExpirePasswordItemData itemData) {
String useDateStr = '';
if(itemData.keyboardPwdType == 4){
//* getKeyType 1 2 3 4 5 6 7 8 9 10 11 12 13 14
if (itemData.keyboardPwdType! > 4) {
useDateStr = '循环';
} else {
useDateStr = '${DateTool().dateToYMDString(itemData.startDate.toString())}-${DateTool().dateToYMDString(itemData.endDate.toString())}';
useDateStr =
'${DateTool().dateToYMDString(itemData.startDate.toString())}-${DateTool().dateToYMDString(itemData.endDate.toString())}';
}
return useDateStr;
}
}

View File

@ -1,10 +1,10 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_slidable/flutter_slidable.dart';
import 'package:get/get.dart';
import 'package:star_lock/appRouters.dart';
import 'package:star_lock/app_settings/app_colors.dart';
import 'package:star_lock/main/lockDetail/passwordKey/passwordKeyList/passwordKeyListEntity.dart';
import 'package:star_lock/tools/EasyRefreshTool.dart';
import 'package:star_lock/tools/noData.dart';
@ -46,13 +46,17 @@ class _ExpirePasswordPageState extends State<ExpirePasswordPage> {
onLoad: () {
getHttpData();
},
child: Obx(() => _buildMainUI())
);
child: Obx(() => _buildMainUI()));
}
Widget _buildMainUI() {
return state.dataList.isEmpty
? NoData(noDataHeight: 1.sh - ScreenUtil().statusBarHeight - ScreenUtil().bottomBarHeight - 190.h - 64.h)
? NoData(
noDataHeight: 1.sh -
ScreenUtil().statusBarHeight -
ScreenUtil().bottomBarHeight -
190.h -
64.h)
: SlidableAutoCloseBehavior(
child: ListView.separated(
itemCount: state.dataList.length,
@ -66,7 +70,8 @@ class _ExpirePasswordPageState extends State<ExpirePasswordPage> {
children: [
SlidableAction(
onPressed: (BuildContext context) {
ShowTipView().showIosTipWithContentDialog("确定删除该密码吗?", (){
ShowTipView().showIosTipWithContentDialog("确定删除该密码吗?",
() {
logic.deletePwdRequest(indexEntity);
});
},
@ -93,11 +98,12 @@ class _ExpirePasswordPageState extends State<ExpirePasswordPage> {
Widget _electronicKeyItem(ExpirePasswordItemData itemData) {
return GestureDetector(
onTap: () async {
// if(itemData.keyboardPwdType! == 4){
// if (itemData.keyboardPwdType! > 4) {
// //
// var data = await Get.toNamed(Routers.electronicKeyPeriodValidityPage, arguments: {
// var data = await Get.toNamed(Routers.electronicKeyPeriodValidityPage,
// arguments: {
// "pushType": 0,
// "expireLockItem": itemData,
// "expirePasswordItem": itemData,
// });
// if (data != null) {
// // setState(() {
@ -111,18 +117,19 @@ class _ExpirePasswordPageState extends State<ExpirePasswordPage> {
// getHttpData();
// }
// } else {
// var data = await Get.toNamed(Routers.electronicKeyDetailChangeDate, arguments: {
// "pushType": 0,
// "expireLockItem": itemData,
// });
// if(data != null) {
// setState(() {
// // state.starDate.value = data["beginTimeTimestamp"].toString();
// // state.endDate.value = data["endTimeTimestamp"].toString();
// // state.keyType.value = 2;
// logic.pageNo = 1;
// getHttpData();
// var backData = await Get.toNamed(
// Routers.passwordKeyDetailChangeDatePage,
// arguments: {
// 'itemData': itemData,
// });
// if (backData != null) {
// itemData.startDate =
// int.parse(backData["beginTimeTimestamp"]) * 1000;
// itemData.endDate = int.parse(backData["endTimeTimestamp"]) * 1000;
// //
// itemData.keyboardPwdType = 3;
// setState(() {});
// }
// }
},
@ -193,22 +200,12 @@ class _ExpirePasswordPageState extends State<ExpirePasswordPage> {
}
Widget getStatus(ExpirePasswordItemData itemData) {
// if (itemData.keyboardPwdStatus! == 1) {
// return Container(
// padding: EdgeInsets.only(left: 5.w, right: 5.w),
// decoration: BoxDecoration(
// color: Colors.red,
// borderRadius: BorderRadius.circular(2.0),
// ),
// child: Text(
// '未生效',
// style: TextStyle(
// color: Colors.white, fontSize: 13.sp),
// ),
// );
// } else {
if (itemData.expireDate! > 0) {
return Container(
//keyboardPwdStatus 1 2
return Row(
children: [
Visibility(
visible: itemData.expireDate! > 0 ? true : false,
child: Container(
padding: EdgeInsets.only(left: 5.w, right: 5.w),
decoration: BoxDecoration(
color: AppColors.expireTextBgColor,
@ -216,25 +213,23 @@ class _ExpirePasswordPageState extends State<ExpirePasswordPage> {
),
child: Text(
'${itemData.expireDate.toString()}',
style: TextStyle(
color: Colors.white, fontSize: 13.sp),
style: TextStyle(color: Colors.white, fontSize: 13.sp),
),
);
} else {
return Container(
)),
Visibility(
visible: itemData.keyboardPwdStatus! == 2 ? true : false,
child: Container(
padding: EdgeInsets.only(left: 5.w, right: 5.w),
decoration: BoxDecoration(
color: Colors.red,
borderRadius: BorderRadius.circular(2.0),
),
child: Text(
'已过期',
style: TextStyle(
color: Colors.white, fontSize: 13.sp),
'已过期'.tr,
style: TextStyle(color: Colors.white, fontSize: 13.sp),
),
))
],
);
}
// }
}
}