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