Merge remote-tracking branch 'origin/develop_liyi' into develop_liyi
This commit is contained in:
commit
4ec711fcc7
@ -1,5 +1,4 @@
|
||||
class LockUserEntity {
|
||||
|
||||
LockUserEntity({this.errorCode, this.description, this.errorMsg, this.data});
|
||||
|
||||
LockUserEntity.fromJson(Map<String, dynamic> json) {
|
||||
@ -31,7 +30,6 @@ class LockUserEntity {
|
||||
}
|
||||
|
||||
class LockUserData {
|
||||
|
||||
LockUserData({this.openLockType, this.openLockTypeName, this.lockUserList});
|
||||
|
||||
LockUserData.fromJson(Map<String, dynamic> json) {
|
||||
@ -59,7 +57,8 @@ class LockUserData {
|
||||
}
|
||||
}
|
||||
|
||||
class LockUserListKeys { //当前开门ID
|
||||
class LockUserListKeys {
|
||||
//当前开门ID
|
||||
|
||||
LockUserListKeys(
|
||||
{this.id,
|
||||
@ -100,6 +99,7 @@ class LockUserListKeys { //当前开门ID
|
||||
this.fingerprintName,
|
||||
this.cardName,
|
||||
this.faceName,
|
||||
this.faceId,
|
||||
this.keyboardPwd,
|
||||
this.keyboardPwdHash,
|
||||
this.addType,
|
||||
@ -116,6 +116,8 @@ class LockUserListKeys { //当前开门ID
|
||||
this.currentTypeImg,
|
||||
this.currentKeyName,
|
||||
this.isCurrentSelect,
|
||||
this.fingerprintId,
|
||||
this.cardId,
|
||||
this.currentDateType});
|
||||
|
||||
LockUserListKeys.fromJson(Map<String, dynamic> json) {
|
||||
@ -162,6 +164,7 @@ class LockUserListKeys { //当前开门ID
|
||||
fingerprintType = json['fingerprintType'];
|
||||
cardType = json['cardType'];
|
||||
faceType = json['faceType'];
|
||||
faceId = json['faceId'];
|
||||
keyboardPwdStatus = json['keyboardPwdStatus'];
|
||||
keyboardPwdName = json['keyboardPwdName'];
|
||||
fingerprintName = json['fingerprintName'];
|
||||
@ -183,6 +186,8 @@ class LockUserListKeys { //当前开门ID
|
||||
currentTypeImg = json['currentTypeImg'];
|
||||
currentKeyName = json['currentKeyName'];
|
||||
isCurrentSelect = json['isCurrentSelect'];
|
||||
fingerprintId = json['fingerprintId'];
|
||||
cardId = json['cardId'];
|
||||
currentDateType = json['currentDateType'];
|
||||
}
|
||||
int? id;
|
||||
@ -218,6 +223,7 @@ class LockUserListKeys { //当前开门ID
|
||||
int? fingerprintType;
|
||||
int? cardType;
|
||||
int? faceType;
|
||||
int? faceId;
|
||||
int? keyboardPwdStatus;
|
||||
String? keyboardPwdName;
|
||||
String? fingerprintName;
|
||||
@ -235,6 +241,8 @@ class LockUserListKeys { //当前开门ID
|
||||
String? senderUsername;
|
||||
int? keyboardPwdId;
|
||||
int? sendDate;
|
||||
int? fingerprintId;
|
||||
int? cardId;
|
||||
int? currentKeyType; //当前钥匙类型 1:电子钥匙 2:密码钥匙 3:指纹钥匙 4:卡钥匙 5:人脸钥匙
|
||||
String? currentKeyTypeStr; //当前钥匙类型名称
|
||||
String? currentTypeImg; //当前钥匙类型图片
|
||||
@ -286,6 +294,7 @@ class LockUserListKeys { //当前开门ID
|
||||
data['fingerprintType'] = fingerprintType;
|
||||
data['cardType'] = cardType;
|
||||
data['faceType'] = faceType;
|
||||
data['faceId'] = faceId;
|
||||
data['keyboardPwdStatus'] = keyboardPwdStatus;
|
||||
data['keyboardPwdName'] = keyboardPwdName;
|
||||
data['fingerprintName'] = fingerprintName;
|
||||
@ -302,6 +311,7 @@ class LockUserListKeys { //当前开门ID
|
||||
data['pwdUserNo'] = pwdUserNo;
|
||||
data['senderUsername'] = senderUsername;
|
||||
data['keyboardPwdId'] = keyboardPwdId;
|
||||
data['cardId'] = cardId;
|
||||
data['sendDate'] = sendDate;
|
||||
data['currentKeyType'] = currentKeyType;
|
||||
data['currentTypeImg'] = currentTypeImg;
|
||||
@ -314,7 +324,6 @@ class LockUserListKeys { //当前开门ID
|
||||
}
|
||||
|
||||
class UserInfo {
|
||||
|
||||
UserInfo(
|
||||
{this.id,
|
||||
this.clientId,
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
|
||||
import 'package:star_lock/main/lockDetail/messageWarn/lockUser/lockUser_entity.dart';
|
||||
@ -47,6 +46,7 @@ class LockUserLogic extends BaseGetXController {
|
||||
element.currentKeyName = element.fingerprintName;
|
||||
element.isCurrentSelect = false;
|
||||
element.currentDateType = element.fingerprintType;
|
||||
element.currentOpenDoorID = element.fingerprintId;
|
||||
});
|
||||
final LockUserData data4 = entity.data![3];
|
||||
data4.lockUserList?.forEach((LockUserListKeys element) {
|
||||
@ -56,6 +56,7 @@ class LockUserLogic extends BaseGetXController {
|
||||
element.currentKeyName = element.cardName;
|
||||
element.isCurrentSelect = false;
|
||||
element.currentDateType = element.cardType;
|
||||
element.currentOpenDoorID = element.cardId;
|
||||
});
|
||||
final LockUserData data5 = entity.data![4];
|
||||
data5.lockUserList?.forEach((LockUserListKeys element) {
|
||||
@ -65,6 +66,7 @@ class LockUserLogic extends BaseGetXController {
|
||||
element.currentKeyName = element.faceName;
|
||||
element.isCurrentSelect = false;
|
||||
element.currentDateType = element.faceType;
|
||||
element.currentOpenDoorID = element.faceId;
|
||||
});
|
||||
|
||||
state.lockUserList.addAll(data1.lockUserList!);
|
||||
@ -101,9 +103,12 @@ class LockUserLogic extends BaseGetXController {
|
||||
keyDateTypeStr = getfingerprintUseDateStr(itemData);
|
||||
break;
|
||||
case 4: //卡钥匙
|
||||
case 5: //人脸钥匙
|
||||
keyDateTypeStr = getCardAndFaceDateType(itemData);
|
||||
keyDateTypeStr = getCardDateType(itemData);
|
||||
break;
|
||||
case 5: //人脸钥匙
|
||||
keyDateTypeStr = getFaceDateType(itemData);
|
||||
break;
|
||||
|
||||
default:
|
||||
keyDateTypeStr = ''.tr;
|
||||
break;
|
||||
@ -238,8 +243,8 @@ class LockUserLogic extends BaseGetXController {
|
||||
return keyDateTypeStr;
|
||||
}
|
||||
|
||||
//获取卡片/人脸有效期
|
||||
String getCardAndFaceDateType(LockUserListKeys fingerprintItemData) {
|
||||
//获取卡片有效期
|
||||
String getCardDateType(LockUserListKeys fingerprintItemData) {
|
||||
String keyDateTypeStr = ''; // 永久:1;限时2,单次3,循环:4
|
||||
if (fingerprintItemData.cardType! == 1) {
|
||||
keyDateTypeStr = '永久'.tr;
|
||||
@ -252,4 +257,26 @@ class LockUserLogic extends BaseGetXController {
|
||||
}
|
||||
return keyDateTypeStr;
|
||||
}
|
||||
|
||||
//获取人脸有效期
|
||||
String getFaceDateType(LockUserListKeys fingerprintItemData) {
|
||||
String keyDateTypeStr = ''; // 永久:1;限时2,单次3,循环:4
|
||||
if (fingerprintItemData.faceType! == 1) {
|
||||
keyDateTypeStr = '永久'.tr;
|
||||
} else if (fingerprintItemData.faceType! == 2) {
|
||||
keyDateTypeStr =
|
||||
'${DateTool().dateToYMDHNString(fingerprintItemData.startDate.toString())} - ${DateTool().dateToYMDHNString(fingerprintItemData.endDate.toString())} 限时';
|
||||
} else if (fingerprintItemData.faceType! == 4) {
|
||||
keyDateTypeStr =
|
||||
'${DateTool().dateToYMDString(fingerprintItemData.startDate.toString())}-${DateTool().dateToYMDString(fingerprintItemData.endDate.toString())} 循环';
|
||||
}
|
||||
return keyDateTypeStr;
|
||||
}
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
super.onReady();
|
||||
|
||||
getLockKeysList();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
@ -21,13 +20,6 @@ class _LockUserPageState extends State<LockUserPage> {
|
||||
final LockUserLogic logic = Get.put(LockUserLogic());
|
||||
final LockUserState state = Get.find<LockUserLogic>().state;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
||||
logic.getLockKeysList();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
|
||||
@ -16,7 +16,7 @@ class LockUserState {
|
||||
TextEditingController searchController = TextEditingController(); //邮箱/手机号输入框
|
||||
RxBool isSelectUser = false.obs;
|
||||
RxInt selectedOpenDoorId = 0.obs;
|
||||
RxInt isSelectIndex = 0.obs;
|
||||
RxInt isSelectIndex = 999999999.obs;
|
||||
|
||||
RxInt getLockId = 0.obs;
|
||||
RxList<LockUserListKeys> lockUserList = <LockUserListKeys>[].obs;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user