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