1、修改电子钥匙授权管理员开锁问题。2、修改TAPDbug。3、打包给欧阳回归测试
This commit is contained in:
parent
66a27c00b2
commit
12697dbcd7
@ -680,6 +680,7 @@
|
||||
"型号": "Model",
|
||||
"密码生成后,请在当日23:59前使用一次进行激活,否则过0点后未激活则失效。密码激活后,有效期内不限次数使用。": "After the password is generated, please use it once for activation before 23:59 on the same day, otherwise it will be invalid after 0 o'clock. After the password is activated, it can be used unlimited times within the validity period.",
|
||||
"密码生成后,请在当日23:59前使用,否则过0点后失效。清空码用于清空今天0点之前生成的所有密码。": "After the password is generated, please use it before 23:59 on the same day, otherwise it will be invalid after 0 o'clock. The clear code is used to clear all the passwords generated before 0 o'clock today.",
|
||||
"密码生成后,请在当日23:59前使用,否则过0点后失效。": "After the password is generated, please use it before 23:59 on the same day, otherwise it will be invalid after 0 o'clock.",
|
||||
"相机": "camera",
|
||||
"相册": "photos",
|
||||
"读写": "storage",
|
||||
|
||||
@ -707,6 +707,7 @@
|
||||
"型号": "型号",
|
||||
"密码生成后,请在当日23:59前使用一次进行激活,否则过0点后未激活则失效。密码激活后,有效期内不限次数使用。": "密码生成后,请在当日23:59前使用一次进行激活,否则过0点后未激活则失效。密码激活后,有效期内不限次数使用。",
|
||||
"密码生成后,请在当日23:59前使用,否则过0点后失效。清空码用于清空今天0点之前生成的所有密码。":"密码生成后,请在当日23:59前使用,否则过0点后失效。清空码用于清空今天0点之前生成的所有密码。",
|
||||
"密码生成后,请在当日23:59前使用,否则过0点后失效。": "密码生成后,请在当日23:59前使用,否则过0点后失效。",
|
||||
"密码不一致哦":"密码不一致哦",
|
||||
|
||||
"相机": "相机",
|
||||
|
||||
@ -682,6 +682,7 @@
|
||||
"型号": "型号",
|
||||
"密码生成后,请在当日23:59前使用一次进行激活,否则过0点后未激活则失效。密码激活后,有效期内不限次数使用。": "密码生成后,请在当日23:59前使用一次进行激活,否则过0点后未激活则失效。密码激活后,有效期内不限次数使用。",
|
||||
"密码生成后,请在当日23:59前使用,否则过0点后失效。清空码用于清空今天0点之前生成的所有密码。": "密码生成后,请在当日23:59前使用,否则过0点后失效。清空码用于清空今天0点之前生成的所有密码。",
|
||||
"密码生成后,请在当日23:59前使用,否则过0点后失效。": "密码生成后,请在当日23:59前使用,否则过0点后失效。",
|
||||
"密码不一致哦": "密码不一致哦",
|
||||
"相机": "相机",
|
||||
"相册": "相册",
|
||||
|
||||
@ -322,7 +322,7 @@ SPEC CHECKSUMS:
|
||||
flutter_native_contact_picker: bd430ba0fbf82768bb50c2c52a69a65759a8f907
|
||||
flutter_pcm_sound: de0572ca4f99091cc2abfcc31601b8a4ddd33c0e
|
||||
flutter_voice_processor: 2b89b93d69b02227ae3fd58589ee0bcfa3ca2a82
|
||||
fluttertoast: 31b00dabfa7fb7bacd9e7dbee580d7a2ff4bf265
|
||||
fluttertoast: 9f2f8e81bb5ce18facb9748d7855bf5a756fe3db
|
||||
fluwx: daa284756ce53442b3d0417ceeda66e981906811
|
||||
google_maps_flutter_ios: d1318b4ff711612cab16862d7a87e31a7403d458
|
||||
GoogleMaps: 20d7b12be49a14287f797e88e0e31bc4156aaeb4
|
||||
@ -351,4 +351,4 @@ SPEC CHECKSUMS:
|
||||
|
||||
PODFILE CHECKSUM: 317f9473a5705c6fe4d79d95e81676f248048fdc
|
||||
|
||||
COCOAPODS: 1.14.3
|
||||
COCOAPODS: 1.15.2
|
||||
|
||||
@ -373,7 +373,7 @@ abstract class Routers {
|
||||
static const getDeviceListPage = '/getDeviceListPage'; //设备列表
|
||||
static const getNameListPage = '/getNameListPage'; //姓名列表
|
||||
static const authorityManagementPage = '/authorityManagementPage'; //批量授权
|
||||
static const massSendLockGroupPage = '/massSendLockGroupPage'; //群发锁分组列表
|
||||
static const massSendLockGroupListPage = '/massSendLockGroupListPage'; //群发锁分组列表
|
||||
static const massSendReceiverPage = '/massSendReceiverPage'; //群发接收人
|
||||
static const lockUserListPage = '/lockUserListPage'; //锁用户列表
|
||||
static const administratorDetailsPage = '/administratorDetailsPage'; //管理员详情
|
||||
@ -911,7 +911,7 @@ abstract class AppRouters {
|
||||
name: Routers.configuringWifiPage,
|
||||
page: () => const ConfiguringWifiPage()),
|
||||
GetPage(
|
||||
name: Routers.massSendLockGroupPage,
|
||||
name: Routers.massSendLockGroupListPage,
|
||||
page: () => const MassSendLockGroupListPage()),
|
||||
GetPage(
|
||||
name: Routers.massSendReceiverPage,
|
||||
|
||||
@ -66,8 +66,8 @@ class AddUserCommand extends SenderProtocol {
|
||||
return 'AddUserCommand{lockID: $lockID, authUserID: $authUserID,'
|
||||
'keyID: $keyID, userID: $userID, openMode: $openMode, '
|
||||
'keyType: $keyType, '
|
||||
'startDate:${DateTool().dateIntToYMDHNString(startDate)} , '
|
||||
'expireDate: ${DateTool().dateIntToYMDHNString(expireDate)} , '
|
||||
'startDate:$startDate startDateStr:${ DateTool().dateIntToYMDHNString(startDate)} , '
|
||||
'expireDate:$expireDate expireDateStr: ${DateTool().dateIntToYMDHNString(expireDate)} , '
|
||||
'useCountLimit: $useCountLimit, isRound: $isRound, '
|
||||
'weekRound: $weekRound, startHour: $startHour, '
|
||||
'startMin: $startMin, endHour: $endHour, '
|
||||
|
||||
@ -26,7 +26,7 @@ class GetStarLockStatuInfoCommand extends SenderProtocol {
|
||||
@override
|
||||
String toString() {
|
||||
return 'GetStarLockStatuInfoCommand{lockID: $lockID, '
|
||||
'utcTimeStamp: ${DateTool().dateIntToYMDHNString(utcTimeStamp)}, unixTimeStamp: ${DateTool().dateIntToYMDHNString(unixTimeStamp)}, '
|
||||
'utcTimeStamp:$utcTimeStamp utcTimeStamp: ${DateTool().dateIntToYMDHNString(utcTimeStamp)}, unixTimeStamp:unixTimeStamp unixTimeStamp: ${DateTool().dateIntToYMDHNString(unixTimeStamp)}, '
|
||||
'userID: $userID, privateKey: $privateKey}';
|
||||
}
|
||||
|
||||
|
||||
@ -16,7 +16,6 @@ abstract class Reply{
|
||||
Reply.parseData(this.commandType, List<int> dataDetail);
|
||||
|
||||
void errorWithStstus(int status){
|
||||
|
||||
switch(status){
|
||||
case 0x00:
|
||||
// 成功
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:star_lock/app_settings/app_settings.dart';
|
||||
import 'package:star_lock/blue/io_protocol/io_cleanUpUsers.dart';
|
||||
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
|
||||
import 'package:star_lock/main/lockMian/entity/lockListInfo_entity.dart';
|
||||
@ -156,17 +157,30 @@ class SenderBeforeDataManage {
|
||||
}
|
||||
|
||||
LockListInfoItemEntity currentKeyInfo = CommonDataManage().currentKeyInfo;
|
||||
DateTime startTime = DateTime.fromMillisecondsSinceEpoch(currentKeyInfo.startDate! ~/ 1000);
|
||||
DateTime endTime = DateTime.fromMillisecondsSinceEpoch(currentKeyInfo.endDate! ~/ 1000);
|
||||
bool isRound = currentKeyInfo.keyType == XSConstantMacro.keyTypeLoop;
|
||||
DateTime? startTime;
|
||||
DateTime? endTime;
|
||||
var startDateTime = 0;
|
||||
var endDateTime = 0;
|
||||
bool isRound = false;
|
||||
var useCountLimit = 0xffff;
|
||||
if(currentKeyInfo.keyType == XSConstantMacro.keyTypeTime){
|
||||
// 限时
|
||||
startDateTime = currentKeyInfo.startDate! ~/ 1000;
|
||||
endDateTime = currentKeyInfo.endDate! ~/ 1000;
|
||||
}else if(currentKeyInfo.keyType == XSConstantMacro.keyTypeLoop){
|
||||
// 循环
|
||||
isRound = true;
|
||||
startTime = DateTime.fromMillisecondsSinceEpoch(currentKeyInfo.startDate!);
|
||||
endTime = DateTime.fromMillisecondsSinceEpoch(currentKeyInfo.endDate!);
|
||||
|
||||
var startDateTime = currentKeyInfo.startDate! ~/ 1000;
|
||||
var endDateTime = currentKeyInfo.endDate! ~/ 1000;
|
||||
if (isRound) {
|
||||
// 循环钥匙
|
||||
startDateTime = DateTool().dateToTimestamp(DateTool().dateToYMDString(currentKeyInfo.startDate!.toString()), 1) ~/ 1000;
|
||||
endDateTime = (DateTool().dateToTimestamp(DateTool().dateToYMDString(currentKeyInfo.endDate!.toString()), 1) + CommonDataManage().dayLatestTime) ~/ 1000;
|
||||
}
|
||||
}else if(currentKeyInfo.keyType == XSConstantMacro.keyTypeOnce){
|
||||
// 单次
|
||||
useCountLimit = 1;
|
||||
}
|
||||
|
||||
AppLog.log("startTime.hour:${startTime!.hour} startTime.minute:${startTime!.minute} endTime.hour:${endTime!.hour} endTime.minute:${endTime!.minute}}");
|
||||
var addUserData = AddUserCommand(
|
||||
lockID: BlueManage().connectDeviceName,
|
||||
authUserID: currentKeyInfo.senderUserId!.toString(),
|
||||
@ -176,16 +190,16 @@ class SenderBeforeDataManage {
|
||||
keyType: 0,
|
||||
startDate: startDateTime,
|
||||
expireDate: endDateTime,
|
||||
useCountLimit: 0xFFFF,
|
||||
useCountLimit: useCountLimit,
|
||||
isRound: isRound ? 1 : 0,
|
||||
weekRound: isRound
|
||||
? DateTool().accordingTheCycleIntoTheCorrespondingNumber(
|
||||
currentKeyInfo.weekDays!)
|
||||
: 0,
|
||||
startHour: isRound ? startTime.hour : 0,
|
||||
startMin: isRound ? startTime.minute : 0,
|
||||
endHour: isRound ? endTime.hour : 0,
|
||||
endMin: isRound ? endTime.minute : 0,
|
||||
startHour: isRound ? startTime!.hour : 0,
|
||||
startMin: isRound ? startTime!.minute : 0,
|
||||
endHour: isRound ? endTime!.hour : 0,
|
||||
endMin: isRound ? endTime!.minute : 0,
|
||||
role: currentKeyInfo.keyRight == 1 ? 1 : 0,
|
||||
password: "123456",
|
||||
needAuthor: 1,
|
||||
|
||||
@ -214,8 +214,9 @@ class _VolumeAuthorizationLockPageState extends State<VolumeAuthorizationLockPag
|
||||
: _lockIdList.length.toString(),
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
Navigator.pushNamed(context, Routers.massSendLockGroupPage)
|
||||
.then((value) {
|
||||
Navigator.pushNamed(context, Routers.massSendLockGroupListPage, arguments: {
|
||||
"keyLimits":"1"
|
||||
}).then((value) {
|
||||
//得到选中的锁ID列表
|
||||
if (value != null) {
|
||||
value as Map<String, dynamic>;
|
||||
|
||||
@ -33,13 +33,13 @@ class CardListLogic extends BaseGetXController {
|
||||
_replyAddICCardBegin(reply);
|
||||
}
|
||||
|
||||
if(reply is SenderCheckingCardStatusReply) {
|
||||
_replyReferEventRecordNumber(reply);
|
||||
}
|
||||
|
||||
if(reply is SenderCheckingUserInfoCountReply){
|
||||
_replyCheckingUserInfoCount(reply);
|
||||
}
|
||||
// if(reply is SenderCheckingCardStatusReply) {
|
||||
// _replyReferEventRecordNumber(reply);
|
||||
// }
|
||||
//
|
||||
// if(reply is SenderCheckingUserInfoCountReply){
|
||||
// _replyCheckingUserInfoCount(reply);
|
||||
// }
|
||||
});
|
||||
}
|
||||
|
||||
@ -94,134 +94,134 @@ class CardListLogic extends BaseGetXController {
|
||||
}
|
||||
}
|
||||
|
||||
// 获取卡片状态
|
||||
Future<void> _replyReferEventRecordNumber(Reply reply) async {
|
||||
int status = reply.data[2];
|
||||
switch(status){
|
||||
case 0x00:
|
||||
//成功
|
||||
// _getLockStatus();
|
||||
break;
|
||||
case 0x06:
|
||||
//无权限
|
||||
break;
|
||||
default:
|
||||
//失败
|
||||
break;
|
||||
}
|
||||
}
|
||||
// // 获取卡片状态
|
||||
// Future<void> _replyReferEventRecordNumber(Reply reply) async {
|
||||
// int status = reply.data[2];
|
||||
// switch(status){
|
||||
// case 0x00:
|
||||
// //成功
|
||||
// // _getLockStatus();
|
||||
// break;
|
||||
// case 0x06:
|
||||
// //无权限
|
||||
// break;
|
||||
// default:
|
||||
// //失败
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// // 查询用户、指纹、密码、卡片数量(用于判断是否同步)
|
||||
// Future<void> _replyCheckingUserInfoCount(Reply reply) async {
|
||||
// int status = reply.data[2];
|
||||
//
|
||||
// // 用户数量
|
||||
// int userNum = reply.data[5];
|
||||
//
|
||||
// // 指纹数量
|
||||
// int fingerNum = reply.data[6];
|
||||
//
|
||||
// // 密码数量
|
||||
// int pwdNum = reply.data[7];
|
||||
//
|
||||
// // 卡片数量
|
||||
// int cardNum = reply.data[8];
|
||||
//
|
||||
// // 记录数量
|
||||
// int logsNum = reply.data[9];
|
||||
//
|
||||
// // 版本
|
||||
// int verNo = reply.data[10];
|
||||
//
|
||||
// // 最大管理员指纹数量
|
||||
// int maxAdminFingerNum = reply.data[11];
|
||||
//
|
||||
// // 最大用户指纹数量
|
||||
// int maxUserFingerNum = reply.data[12];
|
||||
//
|
||||
// // 最大管理员密码数量
|
||||
// int maxAdminPassNum = reply.data[13];
|
||||
//
|
||||
// // 最大用户密码数量
|
||||
// int maxUserPassNum = reply.data[14];
|
||||
//
|
||||
// // 最大管理员卡片数量
|
||||
// int maxAdminCardNum = reply.data[15];
|
||||
//
|
||||
// // 最大用户卡片数量
|
||||
// int maxUserCardNum = reply.data[16];
|
||||
//
|
||||
// // 序列号
|
||||
// var serialNo = reply.data.sublist(17, 21);
|
||||
//
|
||||
// switch(status){
|
||||
// case 0x00:
|
||||
// //成功
|
||||
// // _getLockStatus();
|
||||
// break;
|
||||
// case 0x06:
|
||||
// //需要鉴权
|
||||
// break;
|
||||
// default:
|
||||
// //失败
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
|
||||
// 查询用户、指纹、密码、卡片数量(用于判断是否同步)
|
||||
Future<void> _replyCheckingUserInfoCount(Reply reply) async {
|
||||
int status = reply.data[2];
|
||||
|
||||
// 用户数量
|
||||
int userNum = reply.data[5];
|
||||
|
||||
// 指纹数量
|
||||
int fingerNum = reply.data[6];
|
||||
|
||||
// 密码数量
|
||||
int pwdNum = reply.data[7];
|
||||
|
||||
// 卡片数量
|
||||
int cardNum = reply.data[8];
|
||||
|
||||
// 记录数量
|
||||
int logsNum = reply.data[9];
|
||||
|
||||
// 版本
|
||||
int verNo = reply.data[10];
|
||||
|
||||
// 最大管理员指纹数量
|
||||
int maxAdminFingerNum = reply.data[11];
|
||||
|
||||
// 最大用户指纹数量
|
||||
int maxUserFingerNum = reply.data[12];
|
||||
|
||||
// 最大管理员密码数量
|
||||
int maxAdminPassNum = reply.data[13];
|
||||
|
||||
// 最大用户密码数量
|
||||
int maxUserPassNum = reply.data[14];
|
||||
|
||||
// 最大管理员卡片数量
|
||||
int maxAdminCardNum = reply.data[15];
|
||||
|
||||
// 最大用户卡片数量
|
||||
int maxUserCardNum = reply.data[16];
|
||||
|
||||
// 序列号
|
||||
var serialNo = reply.data.sublist(17, 21);
|
||||
|
||||
switch(status){
|
||||
case 0x00:
|
||||
//成功
|
||||
// _getLockStatus();
|
||||
break;
|
||||
case 0x06:
|
||||
//需要鉴权
|
||||
break;
|
||||
default:
|
||||
//失败
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// 查询卡片状态
|
||||
Future<void> senderCheckingCardStatus() async {
|
||||
BlueManage().bludSendData(BlueManage().connectDeviceName, (BluetoothConnectionState state) async {
|
||||
if (state == BluetoothConnectionState.connected) {
|
||||
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
|
||||
var token = await Storage.getStringList(saveBlueToken);
|
||||
List<int> getTokenList = changeStringListToIntList(token!);
|
||||
|
||||
var publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||
List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
|
||||
|
||||
IoSenderManage.senderCheckingCardStatusCommand(
|
||||
keyID:BlueManage().connectDeviceName,
|
||||
userID:await Storage.getUid(),
|
||||
role:0xff,
|
||||
cardCount:20,
|
||||
cardNo:1,
|
||||
token:getTokenList,
|
||||
needAuthor:1,
|
||||
publicKey:getPublicKeyList,
|
||||
privateKey:getPrivateKeyList,
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 查询用户、指纹、密码、卡片数量(用于判断是否同步)
|
||||
Future<void> senderCheckingUserInfoCount() async {
|
||||
BlueManage().bludSendData(BlueManage().connectDeviceName, (BluetoothConnectionState state) async {
|
||||
if (state == BluetoothConnectionState.connected) {
|
||||
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
|
||||
var token = await Storage.getStringList(saveBlueToken);
|
||||
List<int> getTokenList = changeStringListToIntList(token!);
|
||||
|
||||
var publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||
List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
|
||||
|
||||
IoSenderManage.senderCheckingUserInfoCountCommand(
|
||||
keyID:BlueManage().connectDeviceName,
|
||||
userID:await Storage.getUid(),
|
||||
role:0xff,
|
||||
nowTime:DateTime.now().millisecondsSinceEpoch~/1000,
|
||||
token:getTokenList,
|
||||
needAuthor:1,
|
||||
publicKey:getPublicKeyList,
|
||||
privateKey:getPrivateKeyList,
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
// // 查询卡片状态
|
||||
// Future<void> senderCheckingCardStatus() async {
|
||||
// BlueManage().bludSendData(BlueManage().connectDeviceName, (BluetoothConnectionState state) async {
|
||||
// if (state == BluetoothConnectionState.connected) {
|
||||
// var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
// List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
//
|
||||
// var token = await Storage.getStringList(saveBlueToken);
|
||||
// List<int> getTokenList = changeStringListToIntList(token!);
|
||||
//
|
||||
// var publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||
// List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
|
||||
//
|
||||
// IoSenderManage.senderCheckingCardStatusCommand(
|
||||
// keyID:BlueManage().connectDeviceName,
|
||||
// userID:await Storage.getUid(),
|
||||
// role:0xff,
|
||||
// cardCount:20,
|
||||
// cardNo:1,
|
||||
// token:getTokenList,
|
||||
// needAuthor:1,
|
||||
// publicKey:getPublicKeyList,
|
||||
// privateKey:getPrivateKeyList,
|
||||
// );
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
//
|
||||
// // 查询用户、指纹、密码、卡片数量(用于判断是否同步)
|
||||
// Future<void> senderCheckingUserInfoCount() async {
|
||||
// BlueManage().bludSendData(BlueManage().connectDeviceName, (BluetoothConnectionState state) async {
|
||||
// if (state == BluetoothConnectionState.connected) {
|
||||
// var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
// List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
//
|
||||
// var token = await Storage.getStringList(saveBlueToken);
|
||||
// List<int> getTokenList = changeStringListToIntList(token!);
|
||||
//
|
||||
// var publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||
// List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
|
||||
//
|
||||
// IoSenderManage.senderCheckingUserInfoCountCommand(
|
||||
// keyID:BlueManage().connectDeviceName,
|
||||
// userID:await Storage.getUid(),
|
||||
// role:0xff,
|
||||
// nowTime:DateTime.now().millisecondsSinceEpoch~/1000,
|
||||
// token:getTokenList,
|
||||
// needAuthor:1,
|
||||
// publicKey:getPublicKeyList,
|
||||
// privateKey:getPrivateKeyList,
|
||||
// );
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
// 删除卡片
|
||||
Future<void> senderAddICCard() async {
|
||||
@ -262,19 +262,6 @@ class CardListLogic extends BaseGetXController {
|
||||
privateKey:getPrivateKeyList,
|
||||
token: getTokenList,
|
||||
);
|
||||
|
||||
// IoSenderManage.senderAddICCardCommand(
|
||||
// keyID:state.deletKeyID,
|
||||
// userID:state.deletUserID,
|
||||
// cardNo:state.deletCardNo,
|
||||
// useCountLimit:0,
|
||||
// startTime:0x11223344,
|
||||
// endTime:0x11223344,
|
||||
// needAuthor:1,
|
||||
// signKey:signKeyDataList,
|
||||
// privateKey:getPrivateKeyList,
|
||||
// token: getTokenList,
|
||||
// );
|
||||
} else if (deviceConnectionState == BluetoothConnectionState.disconnected) {
|
||||
dismissEasyLoading();
|
||||
cancelBlueConnetctToastTimer();
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/app_settings/app_settings.dart';
|
||||
import '../../../../tools/dateTool.dart';
|
||||
import '../../fingerprint/fingerprintList/fingerprintListData_entity.dart';
|
||||
|
||||
@ -25,7 +26,8 @@ class OtherTypeKeyChangeDateState{
|
||||
fingerprintItemData.value = map["fingerprintItemData"];
|
||||
}
|
||||
|
||||
if(fingerprintItemData.value.startDate == 0 && fingerprintItemData.value.endDate == 0){
|
||||
AppLog.log("fingerprintItemData.value.startDate:${fingerprintItemData.value.startDate} fingerprintItemData.value.endDate:${fingerprintItemData.value.endDate}");
|
||||
if(fingerprintItemData.value.startDate == 0){
|
||||
beginTime.value = DateTool().dateToYMDHNString(DateTime.now().millisecondsSinceEpoch.toString());
|
||||
endTime.value = DateTool().dateToYMDHNString(DateTime.now().millisecondsSinceEpoch.toString());
|
||||
beginTimeTimestamp.value = DateTime.now().millisecondsSinceEpoch;
|
||||
@ -36,5 +38,7 @@ class OtherTypeKeyChangeDateState{
|
||||
beginTimeTimestamp.value = fingerprintItemData.value.startDate!;
|
||||
endTimeTimestamp.value = fingerprintItemData.value.endDate!;
|
||||
}
|
||||
|
||||
AppLog.log("beginTime.value:${beginTime.value} endTime.value:${endTime.value} beginTimeTimestamp.value:${beginTimeTimestamp.value} endTimeTimestamp.value:${endTimeTimestamp.value}");
|
||||
}
|
||||
}
|
||||
@ -227,13 +227,16 @@ class _ElectronicKeyDetailPageState extends State<ElectronicKeyDetailPage> {
|
||||
Obx(
|
||||
() => Visibility(
|
||||
// (state.keyInfo.value.lockSetting!.remoteUnlock == 1 ? true : false
|
||||
visible: CommonDataManage()
|
||||
.currentKeyInfo
|
||||
.lockSetting!
|
||||
.remoteUnlock ==
|
||||
1
|
||||
? true
|
||||
: false,
|
||||
// visible: CommonDataManage()
|
||||
// .currentKeyInfo
|
||||
// .lockSetting!
|
||||
// .remoteUnlock ==
|
||||
// 1
|
||||
// ? true
|
||||
// : false,
|
||||
visible: (CommonDataManage().currentKeyInfo.lockSetting!.remoteUnlock == 1 && state.itemData.value.keyRight != 1)
|
||||
? true
|
||||
: false,
|
||||
child: CommonItem(
|
||||
leftTitel: "远程开锁".tr,
|
||||
rightTitle: "",
|
||||
|
||||
@ -201,8 +201,9 @@ class _MassSendElectronicKeyPageState extends State<MassSendElectronicKeyPage> {
|
||||
: state.lockIdList.length.toString(),
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
Navigator.pushNamed(context, Routers.massSendLockGroupPage)
|
||||
.then((value) {
|
||||
Navigator.pushNamed(context, Routers.massSendLockGroupListPage, arguments:{
|
||||
"keyLimits":"2",
|
||||
}).then((value) {
|
||||
//得到选中的锁ID列表
|
||||
if (value != null) {
|
||||
value as Map<String, dynamic>;
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
|
||||
|
||||
import 'package:flutter_native_contact_picker/flutter_native_contact_picker.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
@ -25,5 +24,4 @@ class MassSendElectronicKeyState{
|
||||
|
||||
var isDemoMode = false;
|
||||
final sendSucceedType = 0.obs;
|
||||
|
||||
}
|
||||
@ -10,7 +10,7 @@ class MassSendLockGroupListLogic extends BaseGetXController {
|
||||
//分组列表请求
|
||||
Future<void> mockNetworkDataRequest() async {
|
||||
MassSendLockGroupListEntity entity =
|
||||
await ApiRepository.to.lockGroupList('2');
|
||||
await ApiRepository.to.lockGroupList(state.keyLimits);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
if (entity.data != null) {
|
||||
state.lockGroupList.value = entity.data!.groupList!;
|
||||
|
||||
@ -4,4 +4,12 @@ class MassSendLockGroupListState {
|
||||
var lockGroupList = [].obs;
|
||||
var selectLockIdList = [].obs;
|
||||
var isVip = false.obs;
|
||||
|
||||
var keyLimits = '';// 1管理员(包括超级管理员跟管理员) 2普通用户
|
||||
MassSendLockGroupListState(){
|
||||
Map map = Get.arguments;
|
||||
if(map["keyLimits"] != null){
|
||||
keyLimits = map['keyLimits'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -28,18 +28,18 @@ class FaceListLogic extends BaseGetXController {
|
||||
_replySubscription =
|
||||
EventBusManager().eventBus!.on<Reply>().listen((reply) {
|
||||
// 添加人脸开始(此处用作删除人脸)
|
||||
if ((reply is SenderAddFaceReply) && (state.ifCurrentScreen == true)) {
|
||||
if ((reply is SenderAddFaceReply) && (state.ifCurrentScreen.value == true)) {
|
||||
_replyAddFaceBegin(reply);
|
||||
}
|
||||
|
||||
if (reply is SenderQueryingFaceStatusReply) {
|
||||
// 获取人脸状态
|
||||
_replyQueryingFaceStatus(reply);
|
||||
}
|
||||
|
||||
if (reply is SenderCheckingUserInfoCountReply) {
|
||||
_replyCheckingUserInfoCount(reply);
|
||||
}
|
||||
// if (reply is SenderQueryingFaceStatusReply) {
|
||||
// // 获取人脸状态
|
||||
// _replyQueryingFaceStatus(reply);
|
||||
// }
|
||||
//
|
||||
// if (reply is SenderCheckingUserInfoCountReply) {
|
||||
// _replyCheckingUserInfoCount(reply);
|
||||
// }
|
||||
});
|
||||
}
|
||||
|
||||
@ -89,19 +89,6 @@ class FaceListLogic extends BaseGetXController {
|
||||
privateKey:getPrivateKeyList,
|
||||
token: token,
|
||||
);
|
||||
|
||||
// IoSenderManage.senderAddFaceCommand(
|
||||
// keyID: state.deletKeyID,
|
||||
// userID: state.deletUserID,
|
||||
// faceNo: state.deletFaceNo,
|
||||
// useCountLimit: 0,
|
||||
// startTime: 0x11223344,
|
||||
// endTime: 0x11223344,
|
||||
// needAuthor: 1,
|
||||
// publicKey: publicKeyDataList,
|
||||
// privateKey: getPrivateKeyList,
|
||||
// token: getTokenList,
|
||||
// );
|
||||
break;
|
||||
default:
|
||||
//失败
|
||||
@ -109,158 +96,158 @@ class FaceListLogic extends BaseGetXController {
|
||||
}
|
||||
}
|
||||
|
||||
// 获取人脸状态
|
||||
Future<void> _replyQueryingFaceStatus(Reply reply) async {
|
||||
int status = reply.data[2];
|
||||
// // 获取人脸状态
|
||||
// Future<void> _replyQueryingFaceStatus(Reply reply) async {
|
||||
// int status = reply.data[2];
|
||||
//
|
||||
// switch (status) {
|
||||
// case 0x00:
|
||||
// //成功
|
||||
// // _getLockStatus();
|
||||
// break;
|
||||
// case 0x06:
|
||||
// //无权限
|
||||
//
|
||||
// break;
|
||||
// default:
|
||||
// //失败
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
|
||||
switch (status) {
|
||||
case 0x00:
|
||||
//成功
|
||||
// _getLockStatus();
|
||||
break;
|
||||
case 0x06:
|
||||
//无权限
|
||||
// // 获取卡片状态
|
||||
// Future<void> _replyReferEventRecordNumber(Reply reply) async {
|
||||
// int status = reply.data[2];
|
||||
// switch (status) {
|
||||
// case 0x00:
|
||||
// //成功
|
||||
//
|
||||
// // _getLockStatus();
|
||||
// break;
|
||||
// case 0x06:
|
||||
// //无权限 需要鉴权
|
||||
//
|
||||
// break;
|
||||
// default:
|
||||
// //失败
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
|
||||
break;
|
||||
default:
|
||||
//失败
|
||||
break;
|
||||
}
|
||||
}
|
||||
// // 查询用户、指纹、密码、卡片数量(用于判断是否同步)
|
||||
// Future<void> _replyCheckingUserInfoCount(Reply reply) async {
|
||||
// int status = reply.data[2];
|
||||
//
|
||||
// // 用户数量
|
||||
// int userNum = reply.data[5];
|
||||
//
|
||||
// // 指纹数量
|
||||
// int fingerNum = reply.data[6];
|
||||
//
|
||||
// // 密码数量
|
||||
// int pwdNum = reply.data[7];
|
||||
//
|
||||
// // 卡片数量
|
||||
// int cardNum = reply.data[8];
|
||||
//
|
||||
// // 记录数量
|
||||
// int logsNum = reply.data[9];
|
||||
//
|
||||
// // 版本
|
||||
// int verNo = reply.data[10];
|
||||
//
|
||||
// // 最大管理员指纹数量
|
||||
// int maxAdminFingerNum = reply.data[11];
|
||||
//
|
||||
// // 最大用户指纹数量
|
||||
// int maxUserFingerNum = reply.data[12];
|
||||
//
|
||||
// // 最大管理员密码数量
|
||||
// int maxAdminPassNum = reply.data[13];
|
||||
//
|
||||
// // 最大用户密码数量
|
||||
// int maxUserPassNum = reply.data[14];
|
||||
//
|
||||
// // 最大管理员卡片数量
|
||||
// int maxAdminCardNum = reply.data[15];
|
||||
//
|
||||
// // 最大用户卡片数量
|
||||
// int maxUserCardNum = reply.data[16];
|
||||
//
|
||||
// // 序列号
|
||||
// var serialNo = reply.data.sublist(17, 21);
|
||||
//
|
||||
// switch (status) {
|
||||
// case 0x00:
|
||||
// //成功
|
||||
// // _getLockStatus();
|
||||
// break;
|
||||
// case 0x06:
|
||||
// //无权限
|
||||
//
|
||||
// break;
|
||||
// default:
|
||||
// //失败
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
|
||||
// 获取卡片状态
|
||||
Future<void> _replyReferEventRecordNumber(Reply reply) async {
|
||||
int status = reply.data[2];
|
||||
switch (status) {
|
||||
case 0x00:
|
||||
//成功
|
||||
// // 获取人脸状态
|
||||
// Future<void> senderQueryingFaceStatus() async {
|
||||
// BlueManage().bludSendData(BlueManage().connectDeviceName,
|
||||
// (BluetoothConnectionState state) async {
|
||||
// if (state == BluetoothConnectionState.connected) {
|
||||
// var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
// List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
//
|
||||
// var token = await Storage.getStringList(saveBlueToken);
|
||||
// List<int> getTokenList = changeStringListToIntList(token!);
|
||||
//
|
||||
// var publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||
// List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
|
||||
//
|
||||
// IoSenderManage.senderQueryingFaceStatusCommand(
|
||||
// keyID: BlueManage().connectDeviceName,
|
||||
// userID: await Storage.getUid(),
|
||||
// role: 0xff,
|
||||
// faceCount: 20,
|
||||
// faceNo: 1,
|
||||
// token: getTokenList,
|
||||
// needAuthor: 1,
|
||||
// publicKey: getPublicKeyList,
|
||||
// privateKey: getPrivateKeyList,
|
||||
// );
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
// _getLockStatus();
|
||||
break;
|
||||
case 0x06:
|
||||
//无权限 需要鉴权
|
||||
|
||||
break;
|
||||
default:
|
||||
//失败
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// 查询用户、指纹、密码、卡片数量(用于判断是否同步)
|
||||
Future<void> _replyCheckingUserInfoCount(Reply reply) async {
|
||||
int status = reply.data[2];
|
||||
|
||||
// 用户数量
|
||||
int userNum = reply.data[5];
|
||||
|
||||
// 指纹数量
|
||||
int fingerNum = reply.data[6];
|
||||
|
||||
// 密码数量
|
||||
int pwdNum = reply.data[7];
|
||||
|
||||
// 卡片数量
|
||||
int cardNum = reply.data[8];
|
||||
|
||||
// 记录数量
|
||||
int logsNum = reply.data[9];
|
||||
|
||||
// 版本
|
||||
int verNo = reply.data[10];
|
||||
|
||||
// 最大管理员指纹数量
|
||||
int maxAdminFingerNum = reply.data[11];
|
||||
|
||||
// 最大用户指纹数量
|
||||
int maxUserFingerNum = reply.data[12];
|
||||
|
||||
// 最大管理员密码数量
|
||||
int maxAdminPassNum = reply.data[13];
|
||||
|
||||
// 最大用户密码数量
|
||||
int maxUserPassNum = reply.data[14];
|
||||
|
||||
// 最大管理员卡片数量
|
||||
int maxAdminCardNum = reply.data[15];
|
||||
|
||||
// 最大用户卡片数量
|
||||
int maxUserCardNum = reply.data[16];
|
||||
|
||||
// 序列号
|
||||
var serialNo = reply.data.sublist(17, 21);
|
||||
|
||||
switch (status) {
|
||||
case 0x00:
|
||||
//成功
|
||||
// _getLockStatus();
|
||||
break;
|
||||
case 0x06:
|
||||
//无权限
|
||||
|
||||
break;
|
||||
default:
|
||||
//失败
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// 获取人脸状态
|
||||
Future<void> senderQueryingFaceStatus() async {
|
||||
BlueManage().bludSendData(BlueManage().connectDeviceName,
|
||||
(BluetoothConnectionState state) async {
|
||||
if (state == BluetoothConnectionState.connected) {
|
||||
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
|
||||
var token = await Storage.getStringList(saveBlueToken);
|
||||
List<int> getTokenList = changeStringListToIntList(token!);
|
||||
|
||||
var publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||
List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
|
||||
|
||||
IoSenderManage.senderQueryingFaceStatusCommand(
|
||||
keyID: BlueManage().connectDeviceName,
|
||||
userID: await Storage.getUid(),
|
||||
role: 0xff,
|
||||
faceCount: 20,
|
||||
faceNo: 1,
|
||||
token: getTokenList,
|
||||
needAuthor: 1,
|
||||
publicKey: getPublicKeyList,
|
||||
privateKey: getPrivateKeyList,
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 查询用户、指纹、密码、卡片数量(用于判断是否同步)
|
||||
Future<void> senderCheckingUserInfoCount() async {
|
||||
BlueManage().bludSendData(BlueManage().connectDeviceName,
|
||||
(BluetoothConnectionState state) async {
|
||||
if (state == BluetoothConnectionState.connected) {
|
||||
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
|
||||
var token = await Storage.getStringList(saveBlueToken);
|
||||
List<int> getTokenList = changeStringListToIntList(token!);
|
||||
|
||||
var publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||
List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
|
||||
|
||||
IoSenderManage.senderCheckingUserInfoCountCommand(
|
||||
keyID: BlueManage().connectDeviceName,
|
||||
userID: await Storage.getUid(),
|
||||
role: 0xff,
|
||||
nowTime: DateTime.now().millisecondsSinceEpoch ~/ 1000,
|
||||
token: getTokenList,
|
||||
needAuthor: 1,
|
||||
publicKey: getPublicKeyList,
|
||||
privateKey: getPrivateKeyList,
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
// // 查询用户、指纹、密码、卡片数量(用于判断是否同步)
|
||||
// Future<void> senderCheckingUserInfoCount() async {
|
||||
// BlueManage().bludSendData(BlueManage().connectDeviceName,
|
||||
// (BluetoothConnectionState state) async {
|
||||
// if (state == BluetoothConnectionState.connected) {
|
||||
// var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
// List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
//
|
||||
// var token = await Storage.getStringList(saveBlueToken);
|
||||
// List<int> getTokenList = changeStringListToIntList(token!);
|
||||
//
|
||||
// var publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||
// List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
|
||||
//
|
||||
// IoSenderManage.senderCheckingUserInfoCountCommand(
|
||||
// keyID: BlueManage().connectDeviceName,
|
||||
// userID: await Storage.getUid(),
|
||||
// role: 0xff,
|
||||
// nowTime: DateTime.now().millisecondsSinceEpoch ~/ 1000,
|
||||
// token: getTokenList,
|
||||
// needAuthor: 1,
|
||||
// publicKey: getPublicKeyList,
|
||||
// privateKey: getPrivateKeyList,
|
||||
// );
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
// 删除人脸
|
||||
Future<void> senderAddFace() async {
|
||||
@ -311,16 +298,26 @@ class FaceListLogic extends BaseGetXController {
|
||||
}
|
||||
|
||||
// 获取人脸列表
|
||||
void getFaceListData() async {
|
||||
Future<FingerprintListDataEntity> getFaceListData() async {
|
||||
var entity = await ApiRepository.to.getFaceListData(
|
||||
lockId: state.lockId.value.toString(),
|
||||
pageNo: '1',
|
||||
pageSize: '20',
|
||||
pageNo: pageNo.toString(),
|
||||
pageSize: pageSize.toString(),
|
||||
searchStr: state.searchController.text,
|
||||
);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
state.faceItemListData.value = entity.data!.list!;
|
||||
// state.faceItemListData.value = entity.data!.list!;
|
||||
if (pageNo == 1) {
|
||||
state.faceItemListData.value = entity.data!.list!;
|
||||
pageNo++;
|
||||
} else {
|
||||
if (entity.data!.list!.isNotEmpty) {
|
||||
state.faceItemListData.value.addAll(entity.data!.list!);
|
||||
pageNo++;
|
||||
}
|
||||
}
|
||||
}
|
||||
return entity;
|
||||
}
|
||||
|
||||
// 删除的人脸
|
||||
@ -336,8 +333,10 @@ class FaceListLogic extends BaseGetXController {
|
||||
lockId: state.lockId.value,
|
||||
);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
showToast("删除成功");
|
||||
getFaceListData();
|
||||
showToast("删除成功", something: (){
|
||||
pageNo = 1;
|
||||
getFaceListData();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -353,8 +352,10 @@ class FaceListLogic extends BaseGetXController {
|
||||
lockId: state.lockId.value,
|
||||
);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
showToast("重置成功");
|
||||
getFaceListData();
|
||||
showToast("重置成功", something: (){
|
||||
pageNo = 1;
|
||||
getFaceListData();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -388,6 +389,7 @@ class FaceListLogic extends BaseGetXController {
|
||||
late StreamSubscription _teamEvent;
|
||||
void _initRefreshAction() {
|
||||
_teamEvent = eventBus.on<OtherTypeRefreshListEvent>().listen((event) {
|
||||
pageNo = 1;
|
||||
getFaceListData();
|
||||
});
|
||||
}
|
||||
@ -403,8 +405,6 @@ class FaceListLogic extends BaseGetXController {
|
||||
_initReplySubscription();
|
||||
|
||||
_initRefreshAction();
|
||||
|
||||
getFaceListData();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -10,6 +10,7 @@ import 'package:star_lock/tools/showTipView.dart';
|
||||
|
||||
import '../../../../appRouters.dart';
|
||||
import '../../../../app_settings/app_colors.dart';
|
||||
import '../../../../tools/EasyRefreshTool.dart';
|
||||
import '../../../../tools/appRouteObserver.dart';
|
||||
import '../../../../tools/noData.dart';
|
||||
import '../../../../tools/storage.dart';
|
||||
@ -29,6 +30,23 @@ class _FaceListPageState extends State<FaceListPage> with RouteAware {
|
||||
final logic = Get.put(FaceListLogic());
|
||||
final state = Get.find<FaceListLogic>().state;
|
||||
|
||||
Future<void> getHttpData() async {
|
||||
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||
if (isDemoMode == false) {
|
||||
logic.getFaceListData().then((FingerprintListDataEntity value){
|
||||
if(mounted) setState(() {});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
||||
getHttpData();
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
@ -62,34 +80,45 @@ class _FaceListPageState extends State<FaceListPage> with RouteAware {
|
||||
),
|
||||
],
|
||||
),
|
||||
body: Column(
|
||||
children: [
|
||||
KeySearchWidget(
|
||||
editingController: state.searchController,
|
||||
onSubmittedAction: () {
|
||||
logic.getFaceListData();
|
||||
},
|
||||
),
|
||||
SizedBox(
|
||||
height: 20.h,
|
||||
),
|
||||
Expanded(child: _buildMainUI()),
|
||||
AddBottomWhiteBtn(
|
||||
btnName:
|
||||
'${TranslationLoader.lanKeys!.add!.tr}${TranslationLoader.lanKeys!.face!.tr}',
|
||||
onClick: () async {
|
||||
var data =
|
||||
await Get.toNamed(Routers.addFaceTypePage, arguments: {
|
||||
"lockId": state.lockId.value,
|
||||
"fromType": 1 // 1从添加钥匙列表进入 2从考勤添加员工入口进入
|
||||
});
|
||||
if (data != null) {
|
||||
logic.getFaceListData();
|
||||
}
|
||||
},
|
||||
),
|
||||
SizedBox(height: 64.h)
|
||||
],
|
||||
body: EasyRefreshTool(
|
||||
onRefresh: (){
|
||||
logic.pageNo = 1;
|
||||
getHttpData();
|
||||
},
|
||||
onLoad: (){
|
||||
getHttpData();
|
||||
},
|
||||
child: Column(
|
||||
children: [
|
||||
KeySearchWidget(
|
||||
editingController: state.searchController,
|
||||
onSubmittedAction: () {
|
||||
logic.pageNo = 1;
|
||||
getHttpData();
|
||||
},
|
||||
),
|
||||
SizedBox(
|
||||
height: 20.h,
|
||||
),
|
||||
Expanded(child: _buildMainUI()),
|
||||
AddBottomWhiteBtn(
|
||||
btnName:
|
||||
'${TranslationLoader.lanKeys!.add!.tr}${TranslationLoader.lanKeys!.face!.tr}',
|
||||
onClick: () async {
|
||||
var data =
|
||||
await Get.toNamed(Routers.addFaceTypePage, arguments: {
|
||||
"lockId": state.lockId.value,
|
||||
"fromType": 1 // 1从添加钥匙列表进入 2从考勤添加员工入口进入
|
||||
});
|
||||
if (data != null) {
|
||||
logic.pageNo = 1;
|
||||
getHttpData();
|
||||
}
|
||||
},
|
||||
),
|
||||
SizedBox(height: 64.h)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@ -33,33 +33,17 @@ class LockDetailLogic extends BaseGetXController {
|
||||
|
||||
// 监听设备返回的数据
|
||||
void initReplySubscription() {
|
||||
state.replySubscription =
|
||||
EventBusManager().eventBus!.on<Reply>().listen((reply) async {
|
||||
state.replySubscription = EventBusManager().eventBus!.on<Reply>().listen((reply) async {
|
||||
// 开门
|
||||
if (reply is OpenDoorReply && state.ifCurrentScreen.value == true) {
|
||||
_replyOpenLock(reply);
|
||||
}
|
||||
|
||||
// 编辑锁用户
|
||||
// if(reply is EditUserReply){
|
||||
// _replyEditUserKey(reply);
|
||||
// }
|
||||
|
||||
// 获取星锁状态信息
|
||||
// if (reply is GetStarLockStatuInfoReply && state.ifCurrentScreen.value == true) {
|
||||
// _replyGetStarLockStatusInfo(reply);
|
||||
// }
|
||||
|
||||
// 开完锁之后上传记录
|
||||
if (reply is SenderReferEventRecordTimeReply &&
|
||||
state.ifCurrentScreen.value == true) {
|
||||
_replyReferEventRecordTime(reply);
|
||||
}
|
||||
|
||||
// 添加用户
|
||||
// if ((reply is AddUserReply) && (state.ifCurrentScreen.value == true)) {
|
||||
// _replyAddUserKey(reply);
|
||||
// }
|
||||
});
|
||||
}
|
||||
|
||||
@ -98,9 +82,7 @@ class LockDetailLogic extends BaseGetXController {
|
||||
uploadElectricQuantityRequest();
|
||||
|
||||
getLockRecordLastUploadDataTime();
|
||||
state.openLockBtnState.value = 0;
|
||||
|
||||
eventBus.fire(RefreshLockDetailInfoDataEvent());
|
||||
resetOpenDoorState();
|
||||
break;
|
||||
case 0x06:
|
||||
//无权限
|
||||
@ -128,50 +110,70 @@ class LockDetailLogic extends BaseGetXController {
|
||||
break;
|
||||
case 0x16:
|
||||
// 正在开锁中...
|
||||
state.openLockBtnState.value = 0;
|
||||
eventBus.fire(RefreshLockDetailInfoDataEvent());
|
||||
resetOpenDoorState();
|
||||
showToast("正在开锁中...".tr, something: () {
|
||||
cancelBlueConnetctToastTimer();
|
||||
});
|
||||
break;
|
||||
case 0x0d:
|
||||
// 正在开锁中...
|
||||
// 钥匙无效
|
||||
showToast('钥匙无效'.tr);
|
||||
state.openLockBtnState.value = 0;
|
||||
state.openDoorBtnisUneable.value = false;
|
||||
state.animationController!.stop();
|
||||
// state.animationController!.stop();
|
||||
resetOpenDoorState();
|
||||
cancelBlueConnetctToastTimer();
|
||||
BlueManage().disconnect();
|
||||
break;
|
||||
case 0x0b:
|
||||
// 钥匙无效
|
||||
showToast('钥匙过期'.tr);
|
||||
resetOpenDoorState();
|
||||
|
||||
cancelBlueConnetctToastTimer();
|
||||
BlueManage().disconnect();
|
||||
break;
|
||||
case 0x0a:
|
||||
// 钥匙不存在
|
||||
showToast("钥匙不存在");
|
||||
resetOpenDoorState();
|
||||
|
||||
cancelBlueConnetctToastTimer();
|
||||
BlueManage().disconnect();
|
||||
break;
|
||||
case 0x0c:
|
||||
// 钥匙数量已到上限
|
||||
showToast("钥匙数量已到上限");
|
||||
resetOpenDoorState();
|
||||
|
||||
cancelBlueConnetctToastTimer();
|
||||
BlueManage().disconnect();
|
||||
break;
|
||||
case 0x0e:
|
||||
// 钥匙已存在
|
||||
showToast("钥匙已存在");
|
||||
resetOpenDoorState();
|
||||
|
||||
cancelBlueConnetctToastTimer();
|
||||
BlueManage().disconnect();
|
||||
break;
|
||||
case 0x0f:
|
||||
// 用户已存在
|
||||
showToast("用户已存在");
|
||||
resetOpenDoorState();
|
||||
|
||||
cancelBlueConnetctToastTimer();
|
||||
BlueManage().disconnect();
|
||||
break;
|
||||
default:
|
||||
//失败
|
||||
state.openLockBtnState.value = 0;
|
||||
state.openDoorBtnisUneable.value = false;
|
||||
state.animationController!.stop();
|
||||
AppLog.log("开锁失败");
|
||||
// state.animationController!.stop();
|
||||
resetOpenDoorState();
|
||||
cancelBlueConnetctToastTimer();
|
||||
BlueManage().disconnect();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// 获取锁状态数据解析
|
||||
// Future<void> _replyGetStarLockStatusInfo(Reply reply) async {
|
||||
// int status = reply.data[2];
|
||||
// switch (status) {
|
||||
// case 0x00:
|
||||
// //成功
|
||||
// dismissEasyLoading();
|
||||
// cancelBlueConnetctToastTimer();
|
||||
//
|
||||
// break;
|
||||
// case 0x06:
|
||||
// //无权限
|
||||
//
|
||||
// break;
|
||||
// default:
|
||||
// //失败
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
|
||||
// 根据时间查解析数据
|
||||
Future<void> _replyReferEventRecordTime(Reply reply) async {
|
||||
int status = reply.data[2];
|
||||
@ -234,123 +236,12 @@ class LockDetailLogic extends BaseGetXController {
|
||||
}
|
||||
}
|
||||
|
||||
// // 添加用户
|
||||
// Future<void> _replyAddUserKey(Reply reply) async {
|
||||
// var lockId = reply.data.sublist(2, 42);
|
||||
//
|
||||
// var token = reply.data.sublist(42, 46);
|
||||
// List<String> strTokenList = changeIntListToStringList(token);
|
||||
// Storage.setStringList(saveBlueToken, strTokenList);
|
||||
//
|
||||
// int status = reply.data[46];
|
||||
//
|
||||
// switch (status) {
|
||||
// case 0x00:
|
||||
// //成功
|
||||
// cancelBlueConnetctToastTimer();
|
||||
// state.lockUserNo = reply.data[47];
|
||||
// _updateLockUserNo();
|
||||
//
|
||||
// break;
|
||||
// case 0x06:
|
||||
// //无权限
|
||||
// var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
// List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
//
|
||||
// var publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||
// List<int> publicKeyDataList = changeStringListToIntList(publicKey!);
|
||||
//
|
||||
// IoSenderManage.senderAddUser(
|
||||
// lockID: BlueManage().connectDeviceName,
|
||||
// authUserID: state.senderUserId.toString(),
|
||||
// keyID: state.keyInfos.value.keyId.toString(),
|
||||
// userID: await Storage.getUid(),
|
||||
// openMode: 1,
|
||||
// keyType: 0,
|
||||
// startDate: state.keyInfos.value.startDate!~/10000,
|
||||
// expireDate: state.keyInfos.value.endDate!~/10000,
|
||||
// role: state.keyInfos.value.keyRight == 1 ? 1 : 0,
|
||||
// password: "0",
|
||||
// needAuthor: 1,
|
||||
// publicKey: publicKeyDataList,
|
||||
// privateKey: getPrivateKeyList,
|
||||
// token: token);
|
||||
// break;
|
||||
// default:
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
|
||||
// 添加用户(普通用户接收电子钥匙)
|
||||
// Future<void> addUserConnectBlue() async {
|
||||
// showBlueConnetctToastTimer(action: () {
|
||||
// state.openLockBtnState.value = 0;
|
||||
// eventBus.fire(RefreshLockDetailInfoDataEvent());
|
||||
// });
|
||||
//
|
||||
// // var listData = AddUserCommand(
|
||||
// // lockID: BlueManage().connectDeviceName,
|
||||
// // authUserID: state.senderUserId.toString(),
|
||||
// // keyID: state.keyInfos.value.keyId.toString(),
|
||||
// // userID: await Storage.getUid(),
|
||||
// // openMode: 1,
|
||||
// // keyType: 0,
|
||||
// // startDate: state.keyInfos.value.startDate!~/10000,
|
||||
// // expireDate: state.keyInfos.value.endDate!~/10000,
|
||||
// // role: state.keyInfos.value.keyRight == 1 ? 1 : 0,
|
||||
// // password: "123456",
|
||||
// // needAuthor: 1,
|
||||
// // publicKey: publicKeyDataList,
|
||||
// // privateKey: getPrivateKeyList,
|
||||
// // token: getTokenList).packageData();
|
||||
// BlueManage().bludSendData(state.keyInfos.value.bluetooth!.bluetoothDeviceName!, (BluetoothConnectionState deviceConnectionState) async {
|
||||
// if (deviceConnectionState == BluetoothConnectionState.connected) {
|
||||
// // 私钥
|
||||
// var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
// List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
//
|
||||
// var publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||
// List<int> publicKeyDataList = changeStringListToIntList(publicKey!);
|
||||
//
|
||||
// var token = await Storage.getStringList(saveBlueToken);
|
||||
// List<int> getTokenList = [0, 0, 0, 0];
|
||||
// if (token != null) {
|
||||
// getTokenList = changeStringListToIntList(token);
|
||||
// }
|
||||
//
|
||||
// IoSenderManage.senderAddUser(
|
||||
// lockID: BlueManage().connectDeviceName,
|
||||
// authUserID: state.senderUserId.toString(),
|
||||
// keyID: state.keyInfos.value.keyId.toString(),
|
||||
// userID: await Storage.getUid(),
|
||||
// openMode: 1,
|
||||
// keyType: 0,
|
||||
// startDate: state.keyInfos.value.startDate!~/10000,
|
||||
// expireDate: state.keyInfos.value.endDate!~/10000,
|
||||
// role: state.keyInfos.value.keyRight == 1 ? 1 : 0,
|
||||
// password: "0",
|
||||
// needAuthor: 1,
|
||||
// publicKey: publicKeyDataList,
|
||||
// privateKey: getPrivateKeyList,
|
||||
// token: getTokenList);
|
||||
// } else if (deviceConnectionState == BluetoothConnectionState.disconnected) {
|
||||
// cancelBlueConnetctToastTimer();
|
||||
// if (state.ifCurrentScreen.value == true) {
|
||||
// showBlueConnetctToast();
|
||||
// }
|
||||
//
|
||||
// state.openLockBtnState.value = 0;
|
||||
// eventBus.fire(RefreshLockDetailInfoDataEvent());
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
// 点击开门事件
|
||||
Future<void> openDoorAction() async {
|
||||
showBlueConnetctToastTimer(action: () {
|
||||
state.openLockBtnState.value = 0;
|
||||
resetOpenDoorState();
|
||||
// BlueManage().stopScan();
|
||||
eventBus.fire(RefreshLockDetailInfoDataEvent());
|
||||
BlueManage().disconnect();
|
||||
});
|
||||
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
@ -376,15 +267,13 @@ class LockDetailLogic extends BaseGetXController {
|
||||
signKey: signKeyDataList,
|
||||
privateKey: getPrivateKeyList,
|
||||
);
|
||||
} else if (deviceConnectionState ==
|
||||
BluetoothConnectionState.disconnected) {
|
||||
} else if (deviceConnectionState == BluetoothConnectionState.disconnected) {
|
||||
cancelBlueConnetctToastTimer();
|
||||
if (state.ifCurrentScreen.value == true) {
|
||||
showBlueConnetctToast();
|
||||
}
|
||||
|
||||
state.openLockBtnState.value = 0;
|
||||
eventBus.fire(RefreshLockDetailInfoDataEvent());
|
||||
resetOpenDoorState();
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -448,8 +337,7 @@ class LockDetailLogic extends BaseGetXController {
|
||||
openDoorAction();
|
||||
} else {
|
||||
showToast("网络访问失败,请检查网络是否正常".tr, something: () {
|
||||
state.openLockBtnState.value = 0;
|
||||
state.animationController!.forward();
|
||||
resetOpenDoorState();
|
||||
cancelBlueConnetctToastTimer();
|
||||
state.lockNetToken = "0";
|
||||
openDoorAction();
|
||||
@ -473,25 +361,6 @@ class LockDetailLogic extends BaseGetXController {
|
||||
}
|
||||
}
|
||||
|
||||
// 普通用户接收电子钥匙之后 更新锁用户NO
|
||||
// void _updateLockUserNo() async {
|
||||
// LockNetTokenEntity entity = await ApiRepository.to.updateLockUserNo(
|
||||
// keyId: state.keyInfos.value.keyId.toString(),
|
||||
// lockUserNo: state.lockUserNo.toString()
|
||||
// );
|
||||
// if (entity.errorCode!.codeIsSuccessful) {
|
||||
// eventBus.fire(RefreshLockDetailInfoDataEvent());
|
||||
// SchedulerBinding.instance.addPostFrameCallback((_) {
|
||||
// eventBus.fire(RefreshLockListInfoDataEvent());
|
||||
// });
|
||||
// if (state.isOpenLockNeedOnline.value == 0) {
|
||||
// openDoorAction();
|
||||
// } else {
|
||||
// getLockNetToken();
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// 查询锁记录最后时间
|
||||
void getLockRecordLastUploadDataTime() async {
|
||||
LockOperatingRecordGetLastRecordTimeEntity entity = await ApiRepository.to
|
||||
@ -599,6 +468,14 @@ class LockDetailLogic extends BaseGetXController {
|
||||
return formattedTime;
|
||||
}
|
||||
|
||||
void resetOpenDoorState(){
|
||||
state.openLockBtnState.value = 0;
|
||||
state.openDoorBtnisUneable.value = false;
|
||||
state.animationController!.reset();
|
||||
state.animationController!.forward();
|
||||
eventBus.fire(RefreshLockDetailInfoDataEvent());
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> onReady() async {
|
||||
super.onReady();
|
||||
|
||||
@ -94,8 +94,10 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusDeleted ||
|
||||
state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusReset) {
|
||||
state.openDoorBtnisUneable.value = false;
|
||||
state.bottomBtnisEable.value = false;
|
||||
} else {
|
||||
state.openDoorBtnisUneable.value = true;
|
||||
state.bottomBtnisEable.value = true;
|
||||
}
|
||||
|
||||
state.isOnlyOneData = widget.isOnlyOneData;
|
||||
@ -400,9 +402,8 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
children: [
|
||||
Visibility(
|
||||
visible:
|
||||
((state.keyInfos.value.keyType == XSConstantMacro.keyTypeTime ||
|
||||
state.keyInfos.value.keyType ==
|
||||
XSConstantMacro.keyTypeLoop) && // 限时、循环
|
||||
((state.keyInfos.value.keyType == XSConstantMacro.keyTypeTime || state.keyInfos.value.keyType == XSConstantMacro.keyTypeLoop)
|
||||
&& // 限时、循环
|
||||
(DateTool().compareTimeGetDaysFromNow(
|
||||
state.keyInfos.value.endDate!) <=
|
||||
15 &&
|
||||
@ -875,7 +876,7 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
|
||||
// 新增配件
|
||||
showWidgetArr.add(bottomItem('images/main/icon_main_addLock.png', '新增配件'.tr,
|
||||
state.openDoorBtnisUneable.value, state.bottomBtnisEable.value, () {
|
||||
state.bottomBtnisEable.value, () {
|
||||
Navigator.pushNamed(context, Routers.accessoriesListPage);
|
||||
}));
|
||||
|
||||
@ -914,7 +915,6 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
showWidgetArr.add(bottomItem(
|
||||
'images/main/icon_main_clockingIn.png',
|
||||
TranslationLoader.lanKeys!.checkingIn!.tr,
|
||||
state.openDoorBtnisUneable.value,
|
||||
state.bottomBtnisEable.value, () {
|
||||
Get.toNamed(Routers.checkingInListPage,
|
||||
arguments: state.keyInfos.value);
|
||||
@ -924,7 +924,6 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
showWidgetArr.add(bottomItem(
|
||||
'images/main/icon_main_operatingRecord.png',
|
||||
TranslationLoader.lanKeys!.operatingRecord!.tr,
|
||||
state.openDoorBtnisUneable.value,
|
||||
state.bottomBtnisEable.value, () {
|
||||
Get.toNamed(Routers.lockOperatingRecordPage,
|
||||
arguments: {"keyInfo": state.keyInfos.value});
|
||||
@ -932,7 +931,7 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
|
||||
// 设置
|
||||
showWidgetArr.add(bottomItem('images/main/icon_main_set.png',
|
||||
TranslationLoader.lanKeys!.set!.tr, true, true, () {
|
||||
TranslationLoader.lanKeys!.set!.tr, true, () {
|
||||
Get.toNamed(Routers.lockSetPage, arguments: {
|
||||
"lockId": state.keyInfos.value.lockId,
|
||||
"isOnlyOneData": state.isOnlyOneData
|
||||
@ -950,7 +949,6 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
showWidgetArr.add(bottomItem(
|
||||
'images/main/icon_main_clockingIn.png',
|
||||
TranslationLoader.lanKeys!.checkingIn!.tr,
|
||||
state.openDoorBtnisUneable.value,
|
||||
state.bottomBtnisEable.value, () {
|
||||
Get.toNamed(Routers.checkingInListPage,
|
||||
arguments: state.keyInfos.value);
|
||||
@ -961,7 +959,6 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
showWidgetArr.add(bottomItem(
|
||||
'images/main/icon_main_electronicKey.png',
|
||||
TranslationLoader.lanKeys!.electronicKey!.tr,
|
||||
state.openDoorBtnisUneable.value,
|
||||
state.bottomBtnisEable.value, () {
|
||||
Get.toNamed(Routers.electronicKeyListPage);
|
||||
}));
|
||||
@ -970,7 +967,6 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
showWidgetArr.add(bottomItem(
|
||||
'images/main/icon_main_password.png',
|
||||
TranslationLoader.lanKeys!.password!.tr,
|
||||
state.openDoorBtnisUneable.value,
|
||||
state.bottomBtnisEable.value, () {
|
||||
Get.toNamed(Routers.passwordKeyListPage,
|
||||
arguments: {"keyInfo": state.keyInfos.value});
|
||||
@ -981,7 +977,6 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
showWidgetArr.add(bottomItem(
|
||||
'images/main/icon_main_icCard.png',
|
||||
TranslationLoader.lanKeys!.card!.tr,
|
||||
state.openDoorBtnisUneable.value,
|
||||
state.bottomBtnisEable.value, () {
|
||||
Get.toNamed(Routers.cardListPage, arguments: {
|
||||
"lockId": state.keyInfos.value.lockId,
|
||||
@ -994,7 +989,6 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
showWidgetArr.add(bottomItem(
|
||||
'images/main/icon_main_fingerprint.png',
|
||||
TranslationLoader.lanKeys!.fingerprint!.tr,
|
||||
state.openDoorBtnisUneable.value,
|
||||
state.bottomBtnisEable.value, () {
|
||||
Get.toNamed(Routers.fingerprintListPage, arguments: {
|
||||
"lockId": state.keyInfos.value.lockId,
|
||||
@ -1007,7 +1001,6 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
showWidgetArr.add(bottomItem(
|
||||
'images/main/icon_main_remoteControl.png',
|
||||
TranslationLoader.lanKeys!.remoteControl!.tr,
|
||||
state.openDoorBtnisUneable.value,
|
||||
state.bottomBtnisEable.value, () {
|
||||
Get.toNamed(Routers.remoteControlListPage);
|
||||
}));
|
||||
@ -1019,7 +1012,6 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
bottomItem(
|
||||
'images/main/icon_face.png',
|
||||
TranslationLoader.lanKeys!.humanFace!.tr,
|
||||
state.openDoorBtnisUneable.value,
|
||||
state.bottomBtnisEable.value, () {
|
||||
Get.toNamed(Routers.faceListPage, arguments: {
|
||||
"lockId": state.keyInfos.value.lockId,
|
||||
@ -1031,7 +1023,7 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
if (state.keyInfos.value.lockFeature!.isSupportIris == 1) {
|
||||
showWidgetArr.add(
|
||||
bottomItem('images/main/icon_iris.png', '虹膜'.tr,
|
||||
state.openDoorBtnisUneable.value, state.bottomBtnisEable.value, () {
|
||||
state.bottomBtnisEable.value, () {
|
||||
Get.toNamed(Routers.irisListPage, arguments: {
|
||||
"lockId": state.keyInfos.value.lockId,
|
||||
});
|
||||
@ -1042,7 +1034,7 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
if (state.keyInfos.value.lockFeature!.palmVein == 1) {
|
||||
showWidgetArr.add(
|
||||
bottomItem('images/main/icon_palm.png', '手掌'.tr,
|
||||
state.openDoorBtnisUneable.value, state.bottomBtnisEable.value, () {
|
||||
state.bottomBtnisEable.value, () {
|
||||
Get.toNamed(Routers.palmListPage, arguments: {
|
||||
"lockId": state.keyInfos.value.lockId,
|
||||
});
|
||||
@ -1056,7 +1048,6 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
bottomItem(
|
||||
'images/main/icon_catEyes.png',
|
||||
TranslationLoader.lanKeys!.monitoring!.tr,
|
||||
state.openDoorBtnisUneable.value,
|
||||
state.bottomBtnisEable.value, () {
|
||||
Get.toNamed(Routers.realTimePicturePage, arguments: {
|
||||
"lockName": state.keyInfos.value.lockName,
|
||||
@ -1071,7 +1062,6 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
showWidgetArr.add(bottomItem(
|
||||
'images/main/icon_main_authorizedAdmin.png',
|
||||
TranslationLoader.lanKeys!.authorizedAdmin!.tr,
|
||||
state.openDoorBtnisUneable.value,
|
||||
state.bottomBtnisEable.value, () {
|
||||
Get.toNamed(Routers.authorizedAdminListPage,
|
||||
arguments: {"keyInfo": state.keyInfos.value});
|
||||
@ -1084,7 +1074,6 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
bottomItem(
|
||||
'images/main/icon_main_operatingRecord.png',
|
||||
TranslationLoader.lanKeys!.operatingRecord!.tr,
|
||||
state.openDoorBtnisUneable.value,
|
||||
state.bottomBtnisEable.value, () {
|
||||
// Get.toNamed(Routers.lockOperatingRecordPage,
|
||||
// arguments: {"keyInfo": state.keyInfos.value});
|
||||
@ -1098,7 +1087,6 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
endWiddget.add(bottomItem(
|
||||
'images/main/icon_lockDetail_videoLog.png',
|
||||
TranslationLoader.lanKeys!.videoLog!.tr,
|
||||
state.openDoorBtnisUneable.value,
|
||||
state.bottomBtnisEable.value, () {
|
||||
Get.toNamed(Routers.videoLogPage, arguments: {
|
||||
"lockId": state.keyInfos.value.lockId,
|
||||
@ -1110,7 +1098,6 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
bottomItem(
|
||||
'images/main/icon_lockDetail_messageReminding.png',
|
||||
TranslationLoader.lanKeys!.messageReminding!.tr,
|
||||
state.openDoorBtnisUneable.value,
|
||||
state.bottomBtnisEable.value, () {
|
||||
Get.toNamed(Routers.msgNotificationPage, arguments: {
|
||||
"lockId": state.keyInfos.value.lockId,
|
||||
@ -1121,7 +1108,7 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
endWiddget.add(
|
||||
// 设置
|
||||
bottomItem('images/main/icon_main_set.png',
|
||||
TranslationLoader.lanKeys!.set!.tr, true, true, () {
|
||||
TranslationLoader.lanKeys!.set!.tr, true, () {
|
||||
// logic.clickItemBtnAction(10);
|
||||
Get.toNamed(Routers.lockSetPage, arguments: {
|
||||
"lockId": state.keyInfos.value.lockId,
|
||||
@ -1133,8 +1120,7 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
return showWidgetArr;
|
||||
}
|
||||
|
||||
Widget bottomItem(String iconUrl, String name, bool openDoorBtnisUneable,
|
||||
bool bottomBtnisEable, Function() onClick) {
|
||||
Widget bottomItem(String iconUrl, String name, bool bottomBtnisEable, Function() onClick) {
|
||||
Widget child = F.sw(
|
||||
defaultCall: () => Container(
|
||||
color: Colors.white,
|
||||
@ -1149,10 +1135,8 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
child: Image.asset(iconUrl,
|
||||
width: 42.w,
|
||||
height: 42.w,
|
||||
color: openDoorBtnisUneable
|
||||
? (bottomBtnisEable
|
||||
? AppColors.mainColor
|
||||
: AppColors.lockDetailBottomBtnUneable)
|
||||
color: bottomBtnisEable
|
||||
? AppColors.mainColor
|
||||
: AppColors.lockDetailBottomBtnUneable,
|
||||
fit: BoxFit.fitWidth),
|
||||
),
|
||||
@ -1162,11 +1146,7 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
child: Text(name,
|
||||
style: TextStyle(
|
||||
fontSize: 20.sp,
|
||||
color: openDoorBtnisUneable
|
||||
? (bottomBtnisEable
|
||||
? AppColors.blackColor
|
||||
: AppColors.lockDetailBottomBtnUneable)
|
||||
: AppColors.lockDetailBottomBtnUneable),
|
||||
color: bottomBtnisEable ? AppColors.blackColor : AppColors.lockDetailBottomBtnUneable),
|
||||
textAlign: TextAlign.center))
|
||||
],
|
||||
),
|
||||
@ -1186,10 +1166,8 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
child: Image.asset(iconUrl,
|
||||
width: 42.w,
|
||||
height: 42.w,
|
||||
color: openDoorBtnisUneable
|
||||
? (bottomBtnisEable
|
||||
? AppColors.mainColor
|
||||
: AppColors.lockDetailBottomBtnUneable)
|
||||
color: bottomBtnisEable
|
||||
? AppColors.mainColor
|
||||
: AppColors.lockDetailBottomBtnUneable,
|
||||
fit: BoxFit.fitWidth),
|
||||
),
|
||||
@ -1199,23 +1177,19 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
name,
|
||||
style: TextStyle(
|
||||
fontSize: 20.sp,
|
||||
color: openDoorBtnisUneable
|
||||
? (bottomBtnisEable
|
||||
? AppColors.blackColor
|
||||
: AppColors.lockDetailBottomBtnUneable)
|
||||
color: bottomBtnisEable
|
||||
? AppColors.blackColor
|
||||
: AppColors.lockDetailBottomBtnUneable),
|
||||
),
|
||||
],
|
||||
),
|
||||
));
|
||||
return GestureDetector(
|
||||
onTap: openDoorBtnisUneable
|
||||
? (bottomBtnisEable
|
||||
? onClick
|
||||
: () {
|
||||
logic.showToast("请在锁旁边完成第一次开锁".tr);
|
||||
})
|
||||
: null,
|
||||
onTap: bottomBtnisEable
|
||||
? onClick
|
||||
: () {
|
||||
logic.showToast("请在锁旁边完成第一次开锁".tr);
|
||||
},
|
||||
child: child,
|
||||
);
|
||||
}
|
||||
@ -1345,7 +1319,7 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
state.iSOpenLock.value = true;
|
||||
state.iSClosedUnlockSuccessfulPopup.value = false;
|
||||
state.openLockBtnState.value = 1;
|
||||
// state.animationController!.forward();
|
||||
state.animationController!.forward();
|
||||
|
||||
AppLog.log("点击开锁");
|
||||
if (state.isOpenLockNeedOnline.value == 0) {
|
||||
|
||||
@ -38,7 +38,7 @@ class LockOperatingRecordLogic extends BaseGetXController {
|
||||
case 0x00:
|
||||
//成功
|
||||
int dataLength = (reply.data[5] << 8) + reply.data[6];
|
||||
// AppLog.log("dataLength:$dataLength");
|
||||
AppLog.log("dataLength:$dataLength");
|
||||
// var dataLength = reply.data[5];
|
||||
if (dataLength > 0) {
|
||||
reply.data.removeRange(0, 7);
|
||||
@ -186,10 +186,12 @@ class LockOperatingRecordLogic extends BaseGetXController {
|
||||
|
||||
//清空操作记录
|
||||
void clearOperationRecordRequest() async {
|
||||
KeyOperationRecordEntity entity =
|
||||
await ApiRepository.to.clearOperationRecord('28');
|
||||
KeyOperationRecordEntity entity = await ApiRepository.to.clearOperationRecord(CommonDataManage().currentKeyInfo.lockId.toString());
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
showToast("清除数据成功");
|
||||
showToast("清除数据成功", something: (){
|
||||
pageNo = 1;
|
||||
mockNetworkDataRequest();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -113,7 +113,7 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage>
|
||||
}
|
||||
})),
|
||||
Obx(() => Visibility(
|
||||
visible: state.isCirculation.value,
|
||||
visible: state.isCirculation.value == false,
|
||||
child: CommonItem(
|
||||
leftTitel: "结束时间",
|
||||
rightTitle: DateTool().dateToYMDHNString(
|
||||
@ -157,6 +157,10 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage>
|
||||
'id': state.itemData.value.keyboardPwdId.toString()
|
||||
});
|
||||
}),
|
||||
Visibility(
|
||||
visible: state.itemData.value.isCustom == 0 && state.itemData.value.keyboardPwdType != 1 && state.itemData.value.keyboardPwdType != 4,
|
||||
child:bottomTip()
|
||||
),
|
||||
Container(height: 40.h),
|
||||
SizedBox(
|
||||
width: ScreenUtil().screenWidth - 40.w,
|
||||
@ -243,6 +247,27 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage>
|
||||
));
|
||||
}
|
||||
|
||||
Widget bottomTip(){
|
||||
return Column(
|
||||
children: [
|
||||
Container(
|
||||
padding: EdgeInsets.all(20.w),
|
||||
child: Row(
|
||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
"密码生成后,请在当日23:59前使用一次进行激活,否则过0点后未激活则失效。".tr,
|
||||
textAlign: TextAlign.start,
|
||||
style: TextStyle(fontSize: 20.sp),
|
||||
)),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
// 是否为管理员
|
||||
CupertinoSwitch _isAdmin() {
|
||||
return CupertinoSwitch(
|
||||
|
||||
@ -272,7 +272,7 @@ class PasswordKeyListLogic extends BaseGetXController {
|
||||
switch (getPwdType) {
|
||||
case 1:
|
||||
//单次 1 只能在开始时间后6小时内使用一次
|
||||
useDateStr = '${sendDateStr.toLocal().toString().substring(0, 16)} ${"单次".tr}';
|
||||
useDateStr = '${startDateStr.toLocal().toString().substring(0, 16)} ${"单次".tr}';
|
||||
break;
|
||||
case 2:
|
||||
//永久 2 从开始时间开始永久有效,必需在开始时间24小时内使用一次,否则将失效
|
||||
@ -285,7 +285,7 @@ class PasswordKeyListLogic extends BaseGetXController {
|
||||
break;
|
||||
case 4:
|
||||
//删除 4 在锁上使用后会删除之前在锁上使用过的密码
|
||||
useDateStr = '${endDateStr.toLocal().toString().substring(0, 16)} ${"清空码".tr}';
|
||||
useDateStr = '${startDateStr.toLocal().toString().substring(0, 16)} ${"清空码".tr}';
|
||||
break;
|
||||
case 5:
|
||||
//周未循环 5 在周未开始和结束时间指定时间段内有效
|
||||
|
||||
@ -78,7 +78,7 @@ class NearbyLockLogic extends BaseGetXController {
|
||||
}
|
||||
|
||||
// 获取锁状态信息
|
||||
if (reply is GetStarLockStatuInfoReply) {
|
||||
if (reply is GetStarLockStatuInfoReply && state.ifCurrentScreen.value) {
|
||||
_replyGetStarLockStatusInfo(reply);
|
||||
}
|
||||
|
||||
|
||||
@ -233,7 +233,7 @@ class SaveLockLogic extends BaseGetXController {
|
||||
userID: await Storage.getUid(),
|
||||
openMode: 1,
|
||||
keyType: 1,
|
||||
startDate: DateTime.now().millisecondsSinceEpoch,
|
||||
startDate: DateTime.now().millisecondsSinceEpoch ~/ 1000,
|
||||
expireDate: 0x11223344,
|
||||
useCountLimit: 0xFFFF,
|
||||
isRound: 0,
|
||||
|
||||
@ -67,8 +67,9 @@ class _AddAuthorizedAdministratorPageState
|
||||
: state.lockIdList.value.length.toString(),
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
Navigator.pushNamed(context, Routers.massSendLockGroupPage)
|
||||
.then((value) {
|
||||
Navigator.pushNamed(context, Routers.massSendLockGroupListPage, arguments: {
|
||||
"keyLimits":"1"
|
||||
}).then((value) {
|
||||
//得到选中的锁ID列表
|
||||
if (value != null) {
|
||||
value as Map<String, dynamic>;
|
||||
@ -109,8 +110,9 @@ class _AddAuthorizedAdministratorPageState
|
||||
: state.lockIdList.value.length.toString(),
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
Navigator.pushNamed(context, Routers.massSendLockGroupPage)
|
||||
.then((value) {
|
||||
Navigator.pushNamed(context, Routers.massSendLockGroupListPage,arguments:{
|
||||
"keyLimits":"1",
|
||||
}).then((value) {
|
||||
//得到选中的锁ID列表
|
||||
if (value != null) {
|
||||
value as Map<String, dynamic>;
|
||||
|
||||
@ -35,9 +35,9 @@ class BaseProvider extends GetConnect with Api {
|
||||
bool? isUnShowLoading = false, // 是否显示loading
|
||||
bool? isUserBaseUrl = true, // 文件上传不使用baseUrl
|
||||
}) async {
|
||||
AppLog.log("post: url:$url body:$body contentType:$contentType");
|
||||
AppLog.log("post: url:$url body:$body");
|
||||
if (isUnShowLoading == false){
|
||||
AppLog.log("post: url:$url show loading");
|
||||
// AppLog.log("post: url:$url show loading");
|
||||
EasyLoading.show();
|
||||
}
|
||||
if (isUserBaseUrl == false) {
|
||||
|
||||
@ -42,8 +42,9 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
||||
# 1.0.32+2024051001:打包给欧阳回归测试
|
||||
# 1.0.33+2024051401:打包给欧阳回归测试
|
||||
# 1.0.34+2024051402:打包给欧阳回归测试
|
||||
# 1.0.35+2024051501:打包给欧阳回归测试
|
||||
|
||||
version: 1.0.34+2024051402
|
||||
version: 1.0.35+2024051501
|
||||
|
||||
environment:
|
||||
sdk: '>=2.12.0 <3.0.0'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user