1、卡跟指纹循环、胁迫、限时协议的删除逻辑的修改。
2、添加部分模块国际化 3、修改锁详情获取位置权限请求逻辑
This commit is contained in:
parent
c2a3879eee
commit
f00022b770
@ -666,6 +666,25 @@
|
||||
"邮箱绑定成功": "Email binding success",
|
||||
"手机绑定成功": "Mobile phone binding success",
|
||||
"网络访问失败,请检查网络是否正常": "网络访问失败,请检查网络是否正常",
|
||||
"清空": "Clear",
|
||||
"是否清空?": "Whether to empty?",
|
||||
"消息详情": "Message details",
|
||||
"创建时间": "Creation time",
|
||||
"管理员详情": "Administrator details",
|
||||
"当被胁迫要求强行开锁时,使用胁迫卡会触发报警,报警信息回推送给管理员,该功能需要锁联网。": "When being coerced to forcibly unlock, using a coercion card will trigger an alarm, and the alarm information will be pushed to the administrator. This function requires the lock to be networked.",
|
||||
"请不要将胁迫卡用于日常开锁": "Please do not use coercion cards for daily unlocking",
|
||||
"当被胁迫要求强行开锁时,使用胁迫指纹会触发报警,报警信息回推送给管理员,该功能需要锁联网。": "When being coerced to forcibly unlock, using coercion fingerprints will trigger an alarm, and the alarm information will be pushed to the administrator. This function requires the lock to be networked.",
|
||||
"请不要将胁迫指纹用于日常开锁": "Please do not use coercion fingerprints for daily unlocking",
|
||||
"创建公司": "Create company",
|
||||
"公司名称不能超过30个字符": "Company name cannot exceed 30 characters",
|
||||
"公司名称不能小于6个字符": "Company name cannot be less than 6 characters",
|
||||
"WIFI列表": "WIFI list",
|
||||
"刷新": "Refresh",
|
||||
"手动配网": "Manual distribution network",
|
||||
"远距离": "Long distance",
|
||||
"近距离": "Short distance",
|
||||
"锁时间更新成功": "Lock time update success",
|
||||
"锁用户": "Lock user",
|
||||
|
||||
"相机": "camera",
|
||||
"相册": "photos",
|
||||
|
||||
@ -665,6 +665,25 @@
|
||||
"邮箱绑定成功": "邮箱绑定成功",
|
||||
"手机绑定成功": "手机绑定成功",
|
||||
"网络访问失败,请检查网络是否正常": "网络访问失败,请检查网络是否正常",
|
||||
"清空": "清空",
|
||||
"是否清空?": "是否清空?",
|
||||
"消息详情": "消息详情",
|
||||
"创建时间": "创建时间",
|
||||
"管理员详情": "管理员详情",
|
||||
"当被胁迫要求强行开锁时,使用胁迫卡会触发报警,报警信息回推送给管理员,该功能需要锁联网。": "当被胁迫要求强行开锁时,使用胁迫卡会触发报警,报警信息回推送给管理员,该功能需要锁联网。",
|
||||
"请不要将胁迫卡用于日常开锁": "请不要将胁迫卡用于日常开锁",
|
||||
"当被胁迫要求强行开锁时,使用胁迫指纹会触发报警,报警信息回推送给管理员,该功能需要锁联网。": "当被胁迫要求强行开锁时,使用胁迫指纹会触发报警,报警信息回推送给管理员,该功能需要锁联网。",
|
||||
"请不要将胁迫指纹用于日常开锁": "请不要将胁迫指纹用于日常开锁",
|
||||
"创建公司": "创建公司",
|
||||
"公司名称不能超过30个字符": "公司名称不能超过30个字符",
|
||||
"公司名称不能小于6个字符": "公司名称不能小于6个字符",
|
||||
"WIFI列表": "WIFI列表",
|
||||
"刷新": "刷新",
|
||||
"手动配网": "手动配网",
|
||||
"远距离": "远距离",
|
||||
"近距离": "近距离",
|
||||
"锁时间更新成功": "锁时间更新成功",
|
||||
"锁用户": "锁用户",
|
||||
|
||||
"相机": "相机",
|
||||
"相册": "相册",
|
||||
|
||||
@ -667,6 +667,25 @@
|
||||
"邮箱绑定成功": "邮箱绑定成功",
|
||||
"手机绑定成功": "手机绑定成功",
|
||||
"网络访问失败,请检查网络是否正常": "网络访问失败,请检查网络是否正常",
|
||||
"清空": "清空",
|
||||
"是否清空?": "是否清空?",
|
||||
"消息详情": "消息详情",
|
||||
"创建时间": "创建时间",
|
||||
"管理员详情": "管理员详情",
|
||||
"当被胁迫要求强行开锁时,使用胁迫卡会触发报警,报警信息回推送给管理员,该功能需要锁联网。": "当被胁迫要求强行开锁时,使用胁迫卡会触发报警,报警信息回推送给管理员,该功能需要锁联网。",
|
||||
"请不要将胁迫卡用于日常开锁": "请不要将胁迫卡用于日常开锁",
|
||||
"当被胁迫要求强行开锁时,使用胁迫指纹会触发报警,报警信息回推送给管理员,该功能需要锁联网。": "当被胁迫要求强行开锁时,使用胁迫指纹会触发报警,报警信息回推送给管理员,该功能需要锁联网。",
|
||||
"请不要将胁迫指纹用于日常开锁": "请不要将胁迫指纹用于日常开锁",
|
||||
"创建公司": "创建公司",
|
||||
"公司名称不能超过30个字符": "公司名称不能超过30个字符",
|
||||
"公司名称不能小于6个字符": "公司名称不能小于6个字符",
|
||||
"WIFI列表": "WIFI列表",
|
||||
"刷新": "刷新",
|
||||
"手动配网": "手动配网",
|
||||
"远距离": "远距离",
|
||||
"近距离": "近距离",
|
||||
"锁时间更新成功": "锁时间更新成功",
|
||||
"锁用户": "锁用户",
|
||||
|
||||
"相机": "相机",
|
||||
"相册": "相册",
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
import '../io_reply.dart';
|
||||
@ -9,13 +8,14 @@ import 'package:crypto/crypto.dart' as crypto;
|
||||
|
||||
import '../sm4Encipher/sm4.dart';
|
||||
|
||||
///TODO:该协议已弃用 使用新协议SenderAddICCardWithTimeCycleCoercionCommand 2024.4.16 addby 魏少阳
|
||||
///
|
||||
///TODO:设置自定义密码
|
||||
/*
|
||||
备注:
|
||||
删除单个指纹规则:UseCountLimit 设置为 0。删除全部指纹规则: UseCountLimit 设置为 0,FingerNo 设置为 255,userId 设置为“Delete All !@#”,只有门锁管理员才有权限
|
||||
**/
|
||||
class SenderAddICCardCommand extends SenderProtocol {
|
||||
|
||||
String? keyID;
|
||||
String? userID;
|
||||
int? cardNo;
|
||||
@ -92,7 +92,7 @@ class SenderAddICCardCommand extends SenderProtocol {
|
||||
subData.add((endTime! & 0xff00) >> 8);
|
||||
subData.add((endTime! & 0xff));
|
||||
|
||||
if(needAuthor == 0){
|
||||
if (needAuthor == 0) {
|
||||
//AuthCodeLen 1
|
||||
subData.add(0);
|
||||
} else {
|
||||
@ -141,7 +141,8 @@ class SenderAddICCardReply extends Reply {
|
||||
}
|
||||
|
||||
class SenderAddICCardConfirmationReply extends Reply {
|
||||
SenderAddICCardConfirmationReply.parseData(CommandType commandType, List<int> dataDetail)
|
||||
SenderAddICCardConfirmationReply.parseData(
|
||||
CommandType commandType, List<int> dataDetail)
|
||||
: super.parseData(commandType, dataDetail) {
|
||||
data = dataDetail;
|
||||
}
|
||||
|
||||
@ -8,6 +8,8 @@ import '../io_sender.dart';
|
||||
import '../io_type.dart';
|
||||
import 'package:crypto/crypto.dart' as crypto;
|
||||
|
||||
///TODO:该协议已弃用 使用新协议SenderAddICCardWithTimeCycleCoercionCommand 2024.4.16 addby 魏少阳
|
||||
///
|
||||
///TODO:添加胁迫卡片
|
||||
/*
|
||||
备注:
|
||||
|
||||
@ -25,7 +25,7 @@ import 'io_protocol/io_addFingerprintWithTimeCycleCoercion.dart';
|
||||
// import 'io_protocol/io_addICCard.dart';
|
||||
import 'io_protocol/io_addICCardWithTimeCycleCoercion.dart';
|
||||
import 'io_protocol/io_addStressFingerprint.dart';
|
||||
import 'io_protocol/io_addStressICCard.dart';
|
||||
// import 'io_protocol/io_addStressICCard.dart';
|
||||
import 'io_protocol/io_addStressPassword.dart';
|
||||
import 'io_protocol/io_addUser.dart';
|
||||
import 'io_protocol/io_automaticPadlock.dart';
|
||||
@ -329,13 +329,13 @@ class CommandReciverManager {
|
||||
SenderAddStressPasswordReply.parseData(commandType, data);
|
||||
}
|
||||
break;
|
||||
case 61:
|
||||
{
|
||||
// 注册胁迫卡片
|
||||
reply =
|
||||
SenderAddStressICCardReply.parseData(commandType, data);
|
||||
}
|
||||
break;
|
||||
// case 61:
|
||||
// {
|
||||
// // 注册胁迫卡片
|
||||
// reply =
|
||||
// SenderAddStressICCardReply.parseData(commandType, data);
|
||||
// }
|
||||
// break;
|
||||
case 62:
|
||||
{
|
||||
// 注册胁迫指纹
|
||||
|
||||
@ -1,19 +1,17 @@
|
||||
import 'package:star_lock/blue/io_protocol/io_addFace.dart';
|
||||
import 'package:star_lock/blue/io_protocol/io_addICCard.dart';
|
||||
import 'package:star_lock/blue/io_protocol/io_addStressICCard.dart';
|
||||
// import 'package:star_lock/blue/io_protocol/io_addICCard.dart';
|
||||
// import 'package:star_lock/blue/io_protocol/io_addStressICCard.dart';
|
||||
import 'package:star_lock/blue/io_protocol/io_changeAdministratorPassword.dart';
|
||||
import 'package:star_lock/blue/io_protocol/io_deletUser.dart';
|
||||
import 'package:star_lock/blue/io_protocol/io_getLockStatu.dart';
|
||||
import 'package:star_lock/blue/io_protocol/io_queryingFaceStatus.dart';
|
||||
import 'package:star_lock/blue/io_protocol/io_readAdminPassword.dart';
|
||||
|
||||
import 'io_protocol/io_addFingerprint.dart';
|
||||
import 'io_protocol/io_addFingerprintWithTimeCycleCoercion.dart';
|
||||
import 'io_protocol/io_addICCardWithTimeCycleCoercion.dart';
|
||||
import 'io_protocol/io_addStressFingerprint.dart';
|
||||
import 'io_protocol/io_addStressPassword.dart';
|
||||
import 'io_protocol/io_addUser.dart';
|
||||
import 'io_protocol/io_automaticPadlock.dart';
|
||||
import 'io_protocol/io_checkingCardStatus.dart';
|
||||
import 'io_protocol/io_checkingUserInfoCount.dart';
|
||||
import 'io_protocol/io_configuringWifi.dart';
|
||||
@ -330,34 +328,34 @@ class IoSenderManage {
|
||||
callBack: callBack);
|
||||
}
|
||||
|
||||
//todo:添加指纹开始
|
||||
static void senderAddFingerprintCommand(
|
||||
{required String? keyID,
|
||||
required String? userID,
|
||||
required int? fingerNo,
|
||||
required int? useCountLimit,
|
||||
required List<int>? token,
|
||||
required int? startTime,
|
||||
required int? endTime,
|
||||
required int? needAuthor,
|
||||
required List<int>? signKey,
|
||||
required List<int>? privateKey,
|
||||
CommandSendCallBack? callBack}) {
|
||||
CommandSenderManager().managerSendData(
|
||||
command: SenderAddFingerprintCommand(
|
||||
keyID: keyID,
|
||||
userID: userID,
|
||||
fingerNo: fingerNo,
|
||||
useCountLimit: useCountLimit,
|
||||
token: token,
|
||||
startTime: startTime,
|
||||
endTime: endTime,
|
||||
needAuthor: needAuthor,
|
||||
signKey: signKey,
|
||||
privateKey: privateKey,
|
||||
),
|
||||
callBack: callBack);
|
||||
}
|
||||
//todo:添加指纹开始 弃用
|
||||
// static void senderAddFingerprintCommand(
|
||||
// {required String? keyID,
|
||||
// required String? userID,
|
||||
// required int? fingerNo,
|
||||
// required int? useCountLimit,
|
||||
// required List<int>? token,
|
||||
// required int? startTime,
|
||||
// required int? endTime,
|
||||
// required int? needAuthor,
|
||||
// required List<int>? signKey,
|
||||
// required List<int>? privateKey,
|
||||
// CommandSendCallBack? callBack}) {
|
||||
// CommandSenderManager().managerSendData(
|
||||
// command: SenderAddFingerprintCommand(
|
||||
// keyID: keyID,
|
||||
// userID: userID,
|
||||
// fingerNo: fingerNo,
|
||||
// useCountLimit: useCountLimit,
|
||||
// token: token,
|
||||
// startTime: startTime,
|
||||
// endTime: endTime,
|
||||
// needAuthor: needAuthor,
|
||||
// signKey: signKey,
|
||||
// privateKey: privateKey,
|
||||
// ),
|
||||
// callBack: callBack);
|
||||
// }
|
||||
|
||||
//todo:添加指纹开始(带限时、循环、胁迫...)
|
||||
static void senderAddFingerprintWithTimeCycleCoercionCommand(
|
||||
@ -399,34 +397,34 @@ class IoSenderManage {
|
||||
callBack: callBack);
|
||||
}
|
||||
|
||||
//todo:添加卡开始
|
||||
static void senderAddICCardCommand(
|
||||
{required String? keyID,
|
||||
required String? userID,
|
||||
required int? cardNo,
|
||||
required int? useCountLimit,
|
||||
required List<int>? token,
|
||||
required int? startTime,
|
||||
required int? endTime,
|
||||
required int? needAuthor,
|
||||
required List<int>? signKey,
|
||||
required List<int>? privateKey,
|
||||
CommandSendCallBack? callBack}) {
|
||||
CommandSenderManager().managerSendData(
|
||||
command: SenderAddICCardCommand(
|
||||
keyID: keyID,
|
||||
userID: userID,
|
||||
cardNo: cardNo,
|
||||
useCountLimit: useCountLimit,
|
||||
token: token,
|
||||
startTime: startTime,
|
||||
endTime: endTime,
|
||||
needAuthor: needAuthor,
|
||||
signKey: signKey,
|
||||
privateKey: privateKey,
|
||||
),
|
||||
callBack: callBack);
|
||||
}
|
||||
//todo:添加卡开始旧版
|
||||
// static void senderAddICCardCommand(
|
||||
// {required String? keyID,
|
||||
// required String? userID,
|
||||
// required int? cardNo,
|
||||
// required int? useCountLimit,
|
||||
// required List<int>? token,
|
||||
// required int? startTime,
|
||||
// required int? endTime,
|
||||
// required int? needAuthor,
|
||||
// required List<int>? signKey,
|
||||
// required List<int>? privateKey,
|
||||
// CommandSendCallBack? callBack}) {
|
||||
// CommandSenderManager().managerSendData(
|
||||
// command: SenderAddICCardCommand(
|
||||
// keyID: keyID,
|
||||
// userID: userID,
|
||||
// cardNo: cardNo,
|
||||
// useCountLimit: useCountLimit,
|
||||
// token: token,
|
||||
// startTime: startTime,
|
||||
// endTime: endTime,
|
||||
// needAuthor: needAuthor,
|
||||
// signKey: signKey,
|
||||
// privateKey: privateKey,
|
||||
// ),
|
||||
// callBack: callBack);
|
||||
// }
|
||||
|
||||
//todo:添加卡开始(带限时、循环、胁迫...)
|
||||
static void senderAddCardWithTimeCycleCoercionCommand(
|
||||
@ -785,36 +783,36 @@ class IoSenderManage {
|
||||
}
|
||||
|
||||
//todo:添加胁迫卡片
|
||||
static void senderAddStressICCardCommand(
|
||||
{required String? keyID,
|
||||
required String? userID,
|
||||
required int? icCardNo,
|
||||
required int? cardType,
|
||||
required int? useCountLimit,
|
||||
required List<int>? token,
|
||||
required int? startTime,
|
||||
required int? endTime,
|
||||
required int? needAuthor,
|
||||
required List<int>? publicKey,
|
||||
required List<int>? privateKey,
|
||||
required List<int>? signKey,
|
||||
CommandSendCallBack? callBack}) {
|
||||
CommandSenderManager().managerSendData(
|
||||
command: SenderAddStressICCardCommand(
|
||||
keyID: keyID,
|
||||
userID: userID,
|
||||
icCardNo: icCardNo,
|
||||
cardType: cardType,
|
||||
useCountLimit: useCountLimit,
|
||||
token: token,
|
||||
startTime: startTime,
|
||||
endTime: endTime,
|
||||
needAuthor: needAuthor,
|
||||
publicKey: publicKey,
|
||||
privateKey: privateKey,
|
||||
signKey: signKey),
|
||||
callBack: callBack);
|
||||
}
|
||||
// static void senderAddStressICCardCommand(
|
||||
// {required String? keyID,
|
||||
// required String? userID,
|
||||
// required int? icCardNo,
|
||||
// required int? cardType,
|
||||
// required int? useCountLimit,
|
||||
// required List<int>? token,
|
||||
// required int? startTime,
|
||||
// required int? endTime,
|
||||
// required int? needAuthor,
|
||||
// required List<int>? publicKey,
|
||||
// required List<int>? privateKey,
|
||||
// required List<int>? signKey,
|
||||
// CommandSendCallBack? callBack}) {
|
||||
// CommandSenderManager().managerSendData(
|
||||
// command: SenderAddStressICCardCommand(
|
||||
// keyID: keyID,
|
||||
// userID: userID,
|
||||
// icCardNo: icCardNo,
|
||||
// cardType: cardType,
|
||||
// useCountLimit: useCountLimit,
|
||||
// token: token,
|
||||
// startTime: startTime,
|
||||
// endTime: endTime,
|
||||
// needAuthor: needAuthor,
|
||||
// publicKey: publicKey,
|
||||
// privateKey: privateKey,
|
||||
// signKey: signKey),
|
||||
// callBack: callBack);
|
||||
// }
|
||||
|
||||
//todo:添加胁迫密码
|
||||
static void senderAddStressPasswordCommand(
|
||||
|
||||
@ -126,7 +126,7 @@ class _StarLockLoginPageState extends State<StarLockLoginPage> {
|
||||
inputFormatters: [
|
||||
LengthLimitingTextInputFormatter(20),
|
||||
]),
|
||||
SizedBox(height: 20.h),
|
||||
// SizedBox(height: 15.h),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
@ -135,16 +135,20 @@ class _StarLockLoginPageState extends State<StarLockLoginPage> {
|
||||
state.agree.value = !state.agree.value;
|
||||
logic.changeAgreeState();
|
||||
},
|
||||
child: Image.asset(
|
||||
state.agree.value
|
||||
? 'images/icon_round_select.png'
|
||||
: 'images/icon_round_unSelect.png',
|
||||
width: 30.w,
|
||||
height: 30.w,
|
||||
child: Container(
|
||||
// color: Colors.red,
|
||||
padding: EdgeInsets.only(left: 5.w, top:20.w, right: 10.w, bottom:20.h),
|
||||
child: Image.asset(
|
||||
state.agree.value
|
||||
? 'images/icon_round_select.png'
|
||||
: 'images/icon_round_unSelect.png',
|
||||
width: 35.w,
|
||||
height: 35.w,
|
||||
),
|
||||
))),
|
||||
SizedBox(
|
||||
width: 15.w,
|
||||
),
|
||||
// SizedBox(
|
||||
// width: 5.w,
|
||||
// ),
|
||||
Flexible(
|
||||
child: RichText(
|
||||
text: TextSpan(
|
||||
|
||||
@ -77,8 +77,7 @@ class _StarLockRegisterPageState extends State<StarLockRegisterPage> {
|
||||
// color: Colors.red,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(30.h)),
|
||||
border:
|
||||
Border.all(width: 1.0, color: AppColors.greyLineColor)),
|
||||
border: Border.all(width: 1.0, color: AppColors.greyLineColor)),
|
||||
child: Row(
|
||||
children: [
|
||||
GestureDetector(
|
||||
|
||||
@ -17,6 +17,7 @@ import '../../../../blue/sender_manage.dart';
|
||||
import '../../../../network/api_repository.dart';
|
||||
import '../../../../tools/baseGetXController.dart';
|
||||
import '../../../../tools/eventBusEventManage.dart';
|
||||
import '../../../../tools/showTipView.dart';
|
||||
import '../../../../tools/storage.dart';
|
||||
import 'authorizedAdmin_state.dart';
|
||||
|
||||
@ -299,7 +300,10 @@ class AuthorizedAdminLogic extends BaseGetXController {
|
||||
if (entity.errorCode == 425) {
|
||||
//用户未注册
|
||||
state.isCreateUser.value = true;
|
||||
_showDialog('${entity.errorMsg}');
|
||||
// _showDialog('${entity.errorMsg}');
|
||||
ShowTipView().showIosTipWithContentDialog('${"是否发送授权管理员给未注册账号".tr}\n${state.emailOrPhoneController.text}', (){
|
||||
sendElectronicKeyRequest();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -316,39 +320,39 @@ class AuthorizedAdminLogic extends BaseGetXController {
|
||||
}
|
||||
|
||||
//用户未注册确认弹窗
|
||||
void _showDialog(String errMsg) {
|
||||
showCupertinoDialog(
|
||||
context: Get.context!,
|
||||
builder: (context) {
|
||||
return CupertinoAlertDialog(
|
||||
title: const Text('接收者号码未注册,请重新发送'),
|
||||
actions: [
|
||||
CupertinoDialogAction(
|
||||
child: Text(TranslationLoader.lanKeys!.cancel!.tr),
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
CupertinoDialogAction(
|
||||
child: Text(TranslationLoader.lanKeys!.sure!.tr),
|
||||
onPressed: () async {
|
||||
//选择国家代码
|
||||
Get.back();
|
||||
|
||||
// var result = await Get.toNamed(Routers.selectCountryRegionPage);
|
||||
// if (result != null) {
|
||||
// result as Map<String, dynamic>;
|
||||
// state.countryCode.value = result['code'];
|
||||
// state.countryName.value = result['countryName'];
|
||||
// }
|
||||
sendElectronicKeyRequest();
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
// void _showDialog(String errMsg) {
|
||||
// showCupertinoDialog(
|
||||
// context: Get.context!,
|
||||
// builder: (context) {
|
||||
// return CupertinoAlertDialog(
|
||||
// title: const Text('接收者号码未注册,请重新发送'),
|
||||
// actions: [
|
||||
// CupertinoDialogAction(
|
||||
// child: Text(TranslationLoader.lanKeys!.cancel!.tr),
|
||||
// onPressed: () {
|
||||
// Get.back();
|
||||
// },
|
||||
// ),
|
||||
// CupertinoDialogAction(
|
||||
// child: Text(TranslationLoader.lanKeys!.sure!.tr),
|
||||
// onPressed: () async {
|
||||
// //选择国家代码
|
||||
// Get.back();
|
||||
//
|
||||
// // var result = await Get.toNamed(Routers.selectCountryRegionPage);
|
||||
// // if (result != null) {
|
||||
// // result as Map<String, dynamic>;
|
||||
// // state.countryCode.value = result['code'];
|
||||
// // state.countryName.value = result['countryName'];
|
||||
// // }
|
||||
// sendElectronicKeyRequest();
|
||||
// },
|
||||
// ),
|
||||
// ],
|
||||
// );
|
||||
// },
|
||||
// );
|
||||
// }
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
|
||||
@ -248,8 +248,7 @@ class _AddCardPageState extends State<AddCardPage> {
|
||||
rightTitle: "",
|
||||
isTipsImg: false,
|
||||
isHaveRightWidget: true,
|
||||
rightWidget:
|
||||
SizedBox(width: 60.w, height: 50.h, child: _isAdmin()))),
|
||||
rightWidget: SizedBox(width: 60.w, height: 50.h, child: _isAdmin()))),
|
||||
SizedBox(height: 10.h),
|
||||
Obx(() => CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.stressCard!.tr,
|
||||
@ -258,6 +257,15 @@ class _AddCardPageState extends State<AddCardPage> {
|
||||
isHaveRightWidget: true,
|
||||
rightWidget: SizedBox(
|
||||
width: 60.w, height: 50.h, child: _isStressFingerprint()))),
|
||||
Container(
|
||||
color: Colors.white,
|
||||
padding: EdgeInsets.only(left:20.w, right: 20.w, bottom: 20.h),
|
||||
child: Text(
|
||||
"${"当被胁迫要求强行开锁时,使用胁迫卡会触发报警,报警信息回推送给管理员,该功能需要锁联网。".tr}\n${"请不要将胁迫卡用于日常开锁".tr}",
|
||||
style: TextStyle(
|
||||
fontSize: 22.sp, color: AppColors.darkGrayTextColor),
|
||||
)
|
||||
),
|
||||
SizedBox(height: 30.h),
|
||||
SubmitBtn(
|
||||
btnName: TranslationLoader.lanKeys!.next!.tr,
|
||||
|
||||
@ -8,7 +8,7 @@ import 'package:star_lock/tools/baseGetXController.dart';
|
||||
|
||||
import '../../../../blue/blue_manage.dart';
|
||||
import '../../../../blue/io_protocol/io_addICCardWithTimeCycleCoercion.dart';
|
||||
import '../../../../blue/io_protocol/io_addStressICCard.dart';
|
||||
// import '../../../../blue/io_protocol/io_addStressICCard.dart';
|
||||
import '../../../../blue/io_reply.dart';
|
||||
import '../../../../blue/io_tool/io_tool.dart';
|
||||
import '../../../../blue/io_tool/manager_event_bus.dart';
|
||||
@ -26,7 +26,7 @@ class AddICCardLogic extends BaseGetXController{
|
||||
void _initReplySubscription() {
|
||||
_replySubscription = EventBusManager().eventBus!.on<Reply>().listen((reply) async {
|
||||
// 添加IC卡开始
|
||||
if(reply is SenderAddICCardWithTimeCycleCoercionReply) {
|
||||
if((reply is SenderAddICCardWithTimeCycleCoercionReply) && (state.ifCurrentScreen.value == true)) {
|
||||
_replyAddICCardBegin(reply);
|
||||
}
|
||||
|
||||
@ -36,9 +36,9 @@ class AddICCardLogic extends BaseGetXController{
|
||||
}
|
||||
|
||||
// 添加胁迫卡
|
||||
if(reply is SenderAddStressICCardReply) {
|
||||
_replyAddICStressCard(reply);
|
||||
}
|
||||
// if(reply is SenderAddStressICCardReply) {
|
||||
// _replyAddICStressCard(reply);
|
||||
// }
|
||||
});
|
||||
}
|
||||
|
||||
@ -63,17 +63,30 @@ class AddICCardLogic extends BaseGetXController{
|
||||
// var publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||
// List<int> publicKeyDataList = changeStringListToIntList(publicKey!);
|
||||
|
||||
var weekStr = "00000000";
|
||||
for (var day in state.weekDay.value) {
|
||||
int index = day % 7; // 将周日的索引转换为 0
|
||||
weekStr = '${weekStr.substring(0, index)}1${weekStr.substring(index + 1)}';
|
||||
}
|
||||
// print("weekStrweekStrweekStr:$weekStr");
|
||||
int weekRound = int.parse(weekStr, radix: 2);
|
||||
|
||||
var token = reply.data.sublist(5, 9);
|
||||
var saveStrList = changeIntListToStringList(token);
|
||||
Storage.setStringList(saveBlueToken, saveStrList);
|
||||
|
||||
IoSenderManage.senderAddICCardCommand(
|
||||
IoSenderManage.senderAddCardWithTimeCycleCoercionCommand(
|
||||
keyID:"1",
|
||||
userID:await Storage.getUid(),
|
||||
cardNo:state.isAdministrator.value == "2" ? 254 : 1,
|
||||
useCountLimit:0xff,
|
||||
startTime:int.parse(state.startDate.value)~/1000,
|
||||
endTime:int.parse(state.endDate.value)~/1000,
|
||||
isForce:state.isCoerced.value == "1" ? 0 : 1, // 是否是胁迫
|
||||
isRound:state.selectType.value == "2" ? 1: 0, // 是否是循环
|
||||
weekRound:weekRound, // 周循环
|
||||
startDate: int.parse(state.startDate.value)~/1000,
|
||||
endDate: int.parse(state.endDate.value)~/1000,
|
||||
startTime:int.parse(state.effectiveDateTime.value)~/1000,
|
||||
endTime:int.parse(state.failureDateTime.value)~/1000,
|
||||
needAuthor:1,
|
||||
signKey:signKeyDataList,
|
||||
privateKey:getPrivateKeyList,
|
||||
@ -107,7 +120,7 @@ class AddICCardLogic extends BaseGetXController{
|
||||
}else{
|
||||
state.cardNumber.value = (reply.data[6]).toString();
|
||||
}
|
||||
if(state.isCoerced.value == "1"){
|
||||
// if(state.isCoerced.value == "1"){
|
||||
// 非胁迫
|
||||
int addResultStatus = reply.data[5];
|
||||
if(addResultStatus == 0){
|
||||
@ -117,10 +130,10 @@ class AddICCardLogic extends BaseGetXController{
|
||||
// 255 自动退出
|
||||
Get.close(2);
|
||||
}
|
||||
}else{
|
||||
// 如果是胁迫指纹在 添加完之后以后再调用添加胁迫指纹的
|
||||
senderAddStressICCard();
|
||||
}
|
||||
// }else{
|
||||
// // 如果是胁迫指纹在 添加完之后以后再调用添加胁迫指纹的
|
||||
// addICCardData();
|
||||
// }
|
||||
break;
|
||||
case 0x06:
|
||||
//无权限
|
||||
@ -143,62 +156,62 @@ class AddICCardLogic extends BaseGetXController{
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _replyAddICStressCard(Reply reply) async {
|
||||
int status = reply.data[2];
|
||||
|
||||
switch(status){
|
||||
case 0x00:
|
||||
//成功
|
||||
Get.log("${reply.commandType!.typeValue} 数据解析成功");
|
||||
addICCardData();
|
||||
break;
|
||||
case 0x06:
|
||||
//无权限
|
||||
var publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||
List<int> publicKeyDataList = changeStringListToIntList(publicKey!);
|
||||
|
||||
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
|
||||
var signKey = await Storage.getStringList(saveBlueSignKey);
|
||||
List<int> getSignKeyList = changeStringListToIntList(signKey!);
|
||||
|
||||
var token = reply.data.sublist(5, 9);
|
||||
var saveStrList = changeIntListToStringList(token);
|
||||
Storage.setStringList(saveBlueToken, saveStrList);
|
||||
|
||||
Get.log("state.isAdministrator.value:${state.isAdministrator.value}");
|
||||
IoSenderManage.senderAddStressICCardCommand(
|
||||
keyID:"1",
|
||||
userID:await Storage.getUid(),
|
||||
icCardNo:state.isAdministrator.value == "2" ? 254 : 1,
|
||||
cardType:1,
|
||||
useCountLimit:1,
|
||||
startTime:int.parse(state.startDate.value)~/1000,
|
||||
endTime:int.parse(state.endDate.value)~/1000,
|
||||
needAuthor:1,
|
||||
publicKey:publicKeyDataList,
|
||||
privateKey:getPrivateKeyList,
|
||||
token: token,
|
||||
signKey: getSignKeyList,
|
||||
);
|
||||
break;
|
||||
case 0x07:
|
||||
//无权限
|
||||
Get.log("${reply.commandType!.typeValue} 用户无权限");
|
||||
|
||||
break;
|
||||
case 0x09:
|
||||
// 权限校验错误
|
||||
Get.log("${reply.commandType!.typeValue} 权限校验错误");
|
||||
|
||||
break;
|
||||
default:
|
||||
//失败
|
||||
Get.log("${reply.commandType!.typeValue} 失败");
|
||||
break;
|
||||
}
|
||||
}
|
||||
// Future<void> _replyAddICStressCard(Reply reply) async {
|
||||
// int status = reply.data[2];
|
||||
//
|
||||
// switch(status){
|
||||
// case 0x00:
|
||||
// //成功
|
||||
// Get.log("${reply.commandType!.typeValue} 数据解析成功");
|
||||
// addICCardData();
|
||||
// break;
|
||||
// case 0x06:
|
||||
// //无权限
|
||||
// var publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||
// List<int> publicKeyDataList = changeStringListToIntList(publicKey!);
|
||||
//
|
||||
// var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
// List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
//
|
||||
// var signKey = await Storage.getStringList(saveBlueSignKey);
|
||||
// List<int> getSignKeyList = changeStringListToIntList(signKey!);
|
||||
//
|
||||
// var token = reply.data.sublist(5, 9);
|
||||
// var saveStrList = changeIntListToStringList(token);
|
||||
// Storage.setStringList(saveBlueToken, saveStrList);
|
||||
//
|
||||
// Get.log("state.isAdministrator.value:${state.isAdministrator.value}");
|
||||
// IoSenderManage.senderAddStressICCardCommand(
|
||||
// keyID:"1",
|
||||
// userID:await Storage.getUid(),
|
||||
// icCardNo:state.isAdministrator.value == "2" ? 254 : 1,
|
||||
// cardType:1,
|
||||
// useCountLimit:1,
|
||||
// startTime:int.parse(state.startDate.value)~/1000,
|
||||
// endTime:int.parse(state.endDate.value)~/1000,
|
||||
// needAuthor:1,
|
||||
// publicKey:publicKeyDataList,
|
||||
// privateKey:getPrivateKeyList,
|
||||
// token: token,
|
||||
// signKey: getSignKeyList,
|
||||
// );
|
||||
// break;
|
||||
// case 0x07:
|
||||
// //无权限
|
||||
// Get.log("${reply.commandType!.typeValue} 用户无权限");
|
||||
//
|
||||
// break;
|
||||
// case 0x09:
|
||||
// // 权限校验错误
|
||||
// Get.log("${reply.commandType!.typeValue} 权限校验错误");
|
||||
//
|
||||
// break;
|
||||
// default:
|
||||
// //失败
|
||||
// Get.log("${reply.commandType!.typeValue} 失败");
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
|
||||
// 添加卡片
|
||||
Future<void> senderAddICCard() async {
|
||||
@ -229,10 +242,10 @@ class AddICCardLogic extends BaseGetXController{
|
||||
List<int> getTokenList = changeStringListToIntList(token!);
|
||||
|
||||
Get.log("state.isAdministrator.value:${state.isAdministrator.value}");
|
||||
IoSenderManage.senderAddFingerprintWithTimeCycleCoercionCommand(
|
||||
IoSenderManage.senderAddCardWithTimeCycleCoercionCommand(
|
||||
keyID:"1",
|
||||
userID:await Storage.getUid(),
|
||||
fingerNo:state.isAdministrator.value == "2" ? 254 : 1,
|
||||
cardNo:state.isAdministrator.value == "2" ? 254 : 1,
|
||||
useCountLimit:0xff,
|
||||
isForce:state.isCoerced.value == "1" ? 0 : 1, // 是否是胁迫
|
||||
isRound:state.selectType.value == "2" ? 1: 0, // 是否是循环
|
||||
@ -270,38 +283,38 @@ class AddICCardLogic extends BaseGetXController{
|
||||
}
|
||||
|
||||
// 添加胁迫卡片
|
||||
Future<void> senderAddStressICCard() async {
|
||||
BlueManage().bludSendData(BlueManage().connectDeviceName, (BluetoothConnectionState deviceConnectionState) async {
|
||||
if (deviceConnectionState == BluetoothConnectionState.connected){
|
||||
var publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||
List<int> publicKeyDataList = changeStringListToIntList(publicKey!);
|
||||
|
||||
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
|
||||
var signKey = await Storage.getStringList(saveBlueSignKey);
|
||||
List<int> getSignKeyList = changeStringListToIntList(signKey!);
|
||||
|
||||
var token = await Storage.getStringList(saveBlueToken);
|
||||
List<int> getTokenList = changeStringListToIntList(token!);
|
||||
|
||||
IoSenderManage.senderAddStressICCardCommand(
|
||||
keyID:"1",
|
||||
userID:await Storage.getUid(),
|
||||
icCardNo:state.isAdministrator.value == "2" ? 254 : 1,
|
||||
cardType:1,
|
||||
useCountLimit:1,
|
||||
startTime:int.parse(state.startDate.value)~/1000,
|
||||
endTime:int.parse(state.endDate.value)~/1000,
|
||||
needAuthor:1,
|
||||
publicKey:publicKeyDataList,
|
||||
privateKey:getPrivateKeyList,
|
||||
token: getTokenList,
|
||||
signKey: getSignKeyList,
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
// Future<void> senderAddStressICCard() async {
|
||||
// BlueManage().bludSendData(BlueManage().connectDeviceName, (BluetoothConnectionState deviceConnectionState) async {
|
||||
// if (deviceConnectionState == BluetoothConnectionState.connected){
|
||||
// var publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||
// List<int> publicKeyDataList = changeStringListToIntList(publicKey!);
|
||||
//
|
||||
// var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
// List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
//
|
||||
// var signKey = await Storage.getStringList(saveBlueSignKey);
|
||||
// List<int> getSignKeyList = changeStringListToIntList(signKey!);
|
||||
//
|
||||
// var token = await Storage.getStringList(saveBlueToken);
|
||||
// List<int> getTokenList = changeStringListToIntList(token!);
|
||||
//
|
||||
// IoSenderManage.senderAddStressICCardCommand(
|
||||
// keyID:"1",
|
||||
// userID:await Storage.getUid(),
|
||||
// icCardNo:state.isAdministrator.value == "2" ? 254 : 1,
|
||||
// cardType:1,
|
||||
// useCountLimit:1,
|
||||
// startTime:int.parse(state.startDate.value)~/1000,
|
||||
// endTime:int.parse(state.endDate.value)~/1000,
|
||||
// needAuthor:1,
|
||||
// publicKey:publicKeyDataList,
|
||||
// privateKey:getPrivateKeyList,
|
||||
// token: getTokenList,
|
||||
// signKey: getSignKeyList,
|
||||
// );
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
void addICCardData() async {
|
||||
var entity = await ApiRepository.to.addICCardData(
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
|
||||
import 'dart:async';
|
||||
|
||||
// import 'package:flutter_reactive_ble/flutter_reactive_ble.dart';
|
||||
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/blue/io_type.dart';
|
||||
@ -9,7 +8,7 @@ import 'package:star_lock/tools/baseGetXController.dart';
|
||||
import 'package:star_lock/tools/eventBusEventManage.dart';
|
||||
|
||||
import '../../../../blue/blue_manage.dart';
|
||||
import '../../../../blue/io_protocol/io_addICCard.dart';
|
||||
import '../../../../blue/io_protocol/io_addICCardWithTimeCycleCoercion.dart';
|
||||
import '../../../../blue/io_reply.dart';
|
||||
import '../../../../blue/io_tool/io_tool.dart';
|
||||
import '../../../../blue/io_tool/manager_event_bus.dart';
|
||||
@ -27,7 +26,7 @@ class CardDetailLogic extends BaseGetXController{
|
||||
void _initReplySubscription() {
|
||||
_replySubscription = EventBusManager().eventBus!.on<Reply>().listen((reply) async {
|
||||
// 添加卡片开始(重置锁里面所有卡)
|
||||
if((reply is SenderAddICCardReply)) {
|
||||
if((reply is SenderAddICCardWithTimeCycleCoercionReply) && (state.ifCurrentScreen.value == true)) {
|
||||
_replyAddICCardBegin(reply);
|
||||
}
|
||||
});
|
||||
@ -60,14 +59,18 @@ class CardDetailLogic extends BaseGetXController{
|
||||
var token = await Storage.getStringList(saveBlueToken);
|
||||
List<int> getTokenList = changeStringListToIntList(token!);
|
||||
|
||||
String? userID = await Storage.getUid();
|
||||
IoSenderManage.senderAddICCardCommand(
|
||||
keyID:state.keyId.value.toString(),
|
||||
userID:userID,
|
||||
IoSenderManage.senderAddCardWithTimeCycleCoercionCommand(
|
||||
keyID:"1",
|
||||
userID:await Storage.getUid(),
|
||||
cardNo:int.parse(state.typeNumber.value),
|
||||
useCountLimit:0,
|
||||
startTime:int.parse(state.starDate.value),
|
||||
endTime:int.parse(state.endDate.value),
|
||||
useCountLimit:0xff,
|
||||
isForce:0, // 是否是胁迫
|
||||
isRound:0, // 是否是循环
|
||||
weekRound:0, // 周循环
|
||||
startDate: 0x11223344,
|
||||
endDate: 0x11223344,
|
||||
startTime:0x11223344,
|
||||
endTime:0x11223344,
|
||||
needAuthor:1,
|
||||
signKey:signKeyDataList,
|
||||
privateKey:getPrivateKeyList,
|
||||
@ -115,19 +118,36 @@ class CardDetailLogic extends BaseGetXController{
|
||||
var token = await Storage.getStringList(saveBlueToken);
|
||||
List<int> getTokenList = changeStringListToIntList(token!);
|
||||
|
||||
String? userID = await Storage.getUid();
|
||||
IoSenderManage.senderAddICCardCommand(
|
||||
IoSenderManage.senderAddCardWithTimeCycleCoercionCommand(
|
||||
keyID:state.keyId.value.toString(),
|
||||
userID:userID,
|
||||
userID:await Storage.getUid(),
|
||||
cardNo:int.parse(state.typeNumber.value),
|
||||
useCountLimit:0,
|
||||
startTime:int.parse(state.starDate.value),
|
||||
endTime:int.parse(state.endDate.value),
|
||||
isForce:0, // 是否是胁迫
|
||||
isRound:0, // 是否是循环
|
||||
weekRound:0, // 周循环
|
||||
startDate: 0x11223344,
|
||||
endDate: 0x11223344,
|
||||
startTime:0x11223344,
|
||||
endTime:0x11223344,
|
||||
needAuthor:1,
|
||||
signKey:signKeyDataList,
|
||||
privateKey:getPrivateKeyList,
|
||||
token: getTokenList,
|
||||
);
|
||||
|
||||
// IoSenderManage.senderAddCardWithTimeCycleCoercionCommand(
|
||||
// keyID:state.keyId.value.toString(),
|
||||
// userID:userID,
|
||||
// cardNo:int.parse(state.typeNumber.value),
|
||||
// useCountLimit:0,
|
||||
// startTime:int.parse(state.starDate.value),
|
||||
// endTime:int.parse(state.endDate.value),
|
||||
// needAuthor:1,
|
||||
// signKey:signKeyDataList,
|
||||
// privateKey:getPrivateKeyList,
|
||||
// token: getTokenList,
|
||||
// );
|
||||
} else if (deviceConnectionState == BluetoothConnectionState.disconnected) {
|
||||
dismissEasyLoading();
|
||||
cancelBlueConnetctToastTimer();
|
||||
|
||||
@ -7,7 +7,7 @@ import 'package:star_lock/blue/io_type.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
import 'package:star_lock/tools/dateTool.dart';
|
||||
import '../../../../blue/blue_manage.dart';
|
||||
import '../../../../blue/io_protocol/io_addICCard.dart';
|
||||
import '../../../../blue/io_protocol/io_addICCardWithTimeCycleCoercion.dart';
|
||||
import '../../../../blue/io_protocol/io_checkingCardStatus.dart';
|
||||
import '../../../../blue/io_protocol/io_checkingUserInfoCount.dart';
|
||||
import '../../../../blue/io_reply.dart';
|
||||
@ -29,7 +29,7 @@ class CardListLogic extends BaseGetXController {
|
||||
_replySubscription = EventBusManager().eventBus!.on<Reply>().listen((reply) {
|
||||
|
||||
// 添加卡片开始(重置锁里面所有卡)
|
||||
if((reply is SenderAddICCardReply) && (state.isDeletCardData == true)) {
|
||||
if((reply is SenderAddICCardWithTimeCycleCoercionReply) && (state.isDeletCardData == true)) {
|
||||
_replyAddICCardBegin(reply);
|
||||
}
|
||||
|
||||
@ -68,20 +68,26 @@ class CardListLogic extends BaseGetXController {
|
||||
// var publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||
// List<int> publicKeyDataList = changeStringListToIntList(publicKey!);
|
||||
|
||||
var token = await Storage.getStringList(saveBlueToken);
|
||||
List<int> getTokenList = changeStringListToIntList(token!);
|
||||
var token = reply.data.sublist(5, 9);
|
||||
var saveStrList = changeIntListToStringList(token);
|
||||
Storage.setStringList(saveBlueToken, saveStrList);
|
||||
|
||||
IoSenderManage.senderAddICCardCommand(
|
||||
IoSenderManage.senderAddCardWithTimeCycleCoercionCommand(
|
||||
keyID:state.deletKeyID,
|
||||
userID:state.deletUserID,
|
||||
cardNo:state.deletCardNo,
|
||||
useCountLimit:0,
|
||||
isForce:0, // 是否是胁迫
|
||||
isRound:0, // 是否是循环
|
||||
weekRound:0, // 周循环
|
||||
startDate: 0x11223344,
|
||||
endDate: 0x11223344,
|
||||
startTime:0x11223344,
|
||||
endTime:0x11223344,
|
||||
needAuthor:1,
|
||||
signKey:signKeyDataList,
|
||||
privateKey:getPrivateKeyList,
|
||||
token: getTokenList,
|
||||
token: token,
|
||||
);
|
||||
break;
|
||||
case 0x07:
|
||||
@ -273,11 +279,16 @@ class CardListLogic extends BaseGetXController {
|
||||
var token = await Storage.getStringList(saveBlueToken);
|
||||
List<int> getTokenList = changeStringListToIntList(token!);
|
||||
|
||||
IoSenderManage.senderAddICCardCommand(
|
||||
IoSenderManage.senderAddCardWithTimeCycleCoercionCommand(
|
||||
keyID:state.deletKeyID,
|
||||
userID:state.deletUserID,
|
||||
cardNo:state.deletCardNo,
|
||||
useCountLimit:0,
|
||||
isForce:0, // 是否是胁迫
|
||||
isRound:0, // 是否是循环
|
||||
weekRound:0, // 周循环
|
||||
startDate: 0x11223344,
|
||||
endDate: 0x11223344,
|
||||
startTime:0x11223344,
|
||||
endTime:0x11223344,
|
||||
needAuthor:1,
|
||||
@ -285,6 +296,19 @@ 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();
|
||||
|
||||
@ -49,6 +49,8 @@ class _CardListPageState extends State<CardListPage> with RouteAware {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Get.log("DateTime.now().timeZoneName:${DateTime.now().timeZoneName} timeZoneOffset:${DateTime.now().timeZoneOffset}");
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor: AppColors.mainBackgroundColor,
|
||||
appBar: TitleAppBar(
|
||||
@ -142,6 +144,7 @@ class _CardListPageState extends State<CardListPage> with RouteAware {
|
||||
state.deletUserID = (await Storage.getUid())!;
|
||||
state.deletKeyID = fingerprintItemData.cardId.toString();
|
||||
state.deletCardNo = int.parse(fingerprintItemData.cardNumber!);
|
||||
state.fingerprintDeletItem = fingerprintItemData;
|
||||
logic.senderAddICCard();
|
||||
});
|
||||
},
|
||||
|
||||
@ -14,6 +14,7 @@ class CardListState {
|
||||
var deletCardNo = 0;
|
||||
|
||||
final fingerprintItemListData = <FingerprintItemData>[].obs;
|
||||
var fingerprintDeletItem = FingerprintItemData();
|
||||
final TextEditingController searchController = TextEditingController();
|
||||
|
||||
var ifCurrentScreen = true.obs; // 是否是当前界面,用于判断是否需要针对当前界面进行展示
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/appRouters.dart';
|
||||
import 'package:star_lock/app_settings/app_colors.dart';
|
||||
@ -10,6 +11,8 @@ import 'package:star_lock/tools/dateTool.dart';
|
||||
import 'package:star_lock/tools/eventBusEventManage.dart';
|
||||
import 'package:star_lock/translations/trans_lib.dart';
|
||||
|
||||
import '../../../../../tools/showTipView.dart';
|
||||
|
||||
class SendElectronicKeyLogic extends BaseGetXController {
|
||||
final SendElectronicKeyState state = SendElectronicKeyState();
|
||||
|
||||
@ -115,11 +118,14 @@ class SendElectronicKeyLogic extends BaseGetXController {
|
||||
if (entity.errorCode == 425) {
|
||||
//用户未注册
|
||||
state.isCreateUser.value = true;
|
||||
if (isPhoneNumber(state.emailOrPhoneController.text) == true) {
|
||||
_showEmailDialog();
|
||||
} else {
|
||||
_showEmailDialog();
|
||||
}
|
||||
ShowTipView().showIosTipWithContentDialog('${"是否发送电子钥匙给未注册账号".tr}\n${state.emailOrPhoneController.text}', (){
|
||||
sendElectronicKeyRequest();
|
||||
});
|
||||
// if (isPhoneNumber(state.emailOrPhoneController.text) == true) {
|
||||
// _showEmailDialog();
|
||||
// } else {
|
||||
// _showEmailDialog();
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -179,38 +185,38 @@ class SendElectronicKeyLogic extends BaseGetXController {
|
||||
// }
|
||||
|
||||
//用户未注册确认弹窗---邮箱
|
||||
void _showEmailDialog() {
|
||||
showCupertinoDialog(
|
||||
context: Get.context!,
|
||||
builder: (context) {
|
||||
return CupertinoAlertDialog(
|
||||
title: Text('${"是否发送电子钥匙给未注册账号".tr}\n${state.emailOrPhoneController.text}'),
|
||||
actions: [
|
||||
CupertinoDialogAction(
|
||||
child: Text(
|
||||
TranslationLoader.lanKeys!.cancel!.tr,
|
||||
style: TextStyle(color: AppColors.mainColor),
|
||||
),
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
},
|
||||
),
|
||||
CupertinoDialogAction(
|
||||
child: Text(
|
||||
TranslationLoader.lanKeys!.sure!.tr,
|
||||
style: TextStyle(color: AppColors.mainColor),
|
||||
),
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
|
||||
sendElectronicKeyRequest();
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
// void _showEmailDialog() {
|
||||
// showCupertinoDialog(
|
||||
// context: Get.context!,
|
||||
// builder: (context) {
|
||||
// return CupertinoAlertDialog(
|
||||
// title: Text('${"是否发送电子钥匙给未注册账号".tr}\n${state.emailOrPhoneController.text}'),
|
||||
// actions: [
|
||||
// CupertinoDialogAction(
|
||||
// child: Text(
|
||||
// TranslationLoader.lanKeys!.cancel!.tr,
|
||||
// style: TextStyle(color: AppColors.mainColor),
|
||||
// ),
|
||||
// onPressed: () {
|
||||
// Get.back();
|
||||
// },
|
||||
// ),
|
||||
// CupertinoDialogAction(
|
||||
// child: Text(
|
||||
// TranslationLoader.lanKeys!.sure!.tr,
|
||||
// style: TextStyle(color: AppColors.mainColor),
|
||||
// ),
|
||||
// onPressed: () {
|
||||
// Get.back();
|
||||
//
|
||||
// sendElectronicKeyRequest();
|
||||
// },
|
||||
// ),
|
||||
// ],
|
||||
// );
|
||||
// },
|
||||
// );
|
||||
// }
|
||||
|
||||
void resetData() {
|
||||
state.emailOrPhoneController.text = "";
|
||||
|
||||
@ -258,6 +258,15 @@ class _AddFingerprintTypePageState extends State<AddFingerprintTypePage> {
|
||||
isHaveRightWidget: true,
|
||||
rightWidget: SizedBox(
|
||||
width: 60.w, height: 50.h, child: _isStressFingerprint()))),
|
||||
Container(
|
||||
color: Colors.white,
|
||||
padding: EdgeInsets.only(left:20.w, right: 20.w, bottom: 20.h),
|
||||
child: Text(
|
||||
"${"当被胁迫要求强行开锁时,使用胁迫指纹会触发报警,报警信息回推送给管理员,该功能需要锁联网。".tr}\n${"请不要将胁迫指纹用于日常开锁".tr}",
|
||||
style: TextStyle(
|
||||
fontSize: 22.sp, color: AppColors.darkGrayTextColor),
|
||||
)
|
||||
),
|
||||
SizedBox(height: 30.h),
|
||||
SubmitBtn(
|
||||
btnName: TranslationLoader.lanKeys!.next!.tr,
|
||||
@ -382,6 +391,10 @@ class _AddFingerprintTypePageState extends State<AddFingerprintTypePage> {
|
||||
enabledBorder: const OutlineInputBorder(borderSide: BorderSide(width: 0, color: Colors.transparent)),
|
||||
border: const OutlineInputBorder(borderSide: BorderSide(width: 0, color: Colors.transparent)),
|
||||
contentPadding: const EdgeInsets.symmetric(vertical: 0),
|
||||
// suffixIcon: IconButton(
|
||||
// icon: const Icon(Icons.clear),
|
||||
// onPressed: state.nameController.clear,
|
||||
// ),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@ -6,7 +6,7 @@ import 'package:get/get.dart';
|
||||
import 'package:star_lock/blue/io_type.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
import '../../../../blue/blue_manage.dart';
|
||||
import '../../../../blue/io_protocol/io_addFingerprint.dart';
|
||||
import '../../../../blue/io_protocol/io_addFingerprintWithTimeCycleCoercion.dart';
|
||||
import '../../../../blue/io_reply.dart';
|
||||
import '../../../../blue/io_tool/io_tool.dart';
|
||||
import '../../../../blue/io_tool/manager_event_bus.dart';
|
||||
@ -25,7 +25,7 @@ class FingerprintDetailLogic extends BaseGetXController{
|
||||
void _initReplySubscription() {
|
||||
_replySubscription = EventBusManager().eventBus!.on<Reply>().listen((reply) {
|
||||
// 添加指纹开始(此处用作删除指纹)
|
||||
if((reply is SenderAddFingerprintReply)) {
|
||||
if((reply is SenderAddFingerprintWithTimeCycleCoercionReply) && (state.ifCurrentScreen.value == true)) {
|
||||
_replyAddFingerprintBegin(reply);
|
||||
}
|
||||
});
|
||||
@ -61,14 +61,18 @@ class FingerprintDetailLogic extends BaseGetXController{
|
||||
var token = await Storage.getStringList(saveBlueToken);
|
||||
List<int> getTokenList = changeStringListToIntList(token!);
|
||||
|
||||
String? userID = await Storage.getUid();
|
||||
IoSenderManage.senderAddFingerprintCommand(
|
||||
IoSenderManage.senderAddFingerprintWithTimeCycleCoercionCommand(
|
||||
keyID:state.keyId.value.toString(),
|
||||
userID:userID,
|
||||
userID:await Storage.getUid(),
|
||||
fingerNo:int.parse(state.typeNumber.value),
|
||||
useCountLimit:0,
|
||||
startTime:int.parse(state.starDate.value),
|
||||
endTime:int.parse(state.endDate.value),
|
||||
useCountLimit:0xff,
|
||||
isForce:0, // 是否是胁迫
|
||||
isRound:0, // 是否是循环
|
||||
weekRound:0, // 周循环
|
||||
startDate: 0x11223344,
|
||||
endDate: 0x11223344,
|
||||
startTime:0x11223344,
|
||||
endTime:0x11223344,
|
||||
needAuthor:1,
|
||||
signKey:signKeyDataList,
|
||||
privateKey:getPrivateKeyList,
|
||||
@ -116,20 +120,36 @@ class FingerprintDetailLogic extends BaseGetXController{
|
||||
var token = await Storage.getStringList(saveBlueToken);
|
||||
List<int> getTokenList = changeStringListToIntList(token!);
|
||||
|
||||
String? userID = await Storage.getUid();
|
||||
|
||||
IoSenderManage.senderAddFingerprintCommand(
|
||||
IoSenderManage.senderAddFingerprintWithTimeCycleCoercionCommand(
|
||||
keyID:state.keyId.value.toString(),
|
||||
userID:userID,
|
||||
userID:await Storage.getUid(),
|
||||
fingerNo:int.parse(state.typeNumber.value),
|
||||
useCountLimit:0,
|
||||
startTime:int.parse(state.starDate.value),
|
||||
endTime:int.parse(state.endDate.value),
|
||||
useCountLimit:0xff,
|
||||
isForce:0, // 是否是胁迫
|
||||
isRound:0, // 是否是循环
|
||||
weekRound:0, // 周循环
|
||||
startDate: 0x11223344,
|
||||
endDate: 0x11223344,
|
||||
startTime:0x11223344,
|
||||
endTime:0x11223344,
|
||||
needAuthor:1,
|
||||
signKey:signKeyDataList,
|
||||
privateKey:getPrivateKeyList,
|
||||
token: getTokenList,
|
||||
);
|
||||
|
||||
// IoSenderManage.senderAddFingerprintCommand(
|
||||
// keyID:state.keyId.value.toString(),
|
||||
// userID:userID,
|
||||
// fingerNo:int.parse(state.typeNumber.value),
|
||||
// useCountLimit:0,
|
||||
// startTime:int.parse(state.starDate.value),
|
||||
// endTime:int.parse(state.endDate.value),
|
||||
// needAuthor:1,
|
||||
// signKey:signKeyDataList,
|
||||
// privateKey:getPrivateKeyList,
|
||||
// token: getTokenList,
|
||||
// );
|
||||
} else if (deviceConnectionState == BluetoothConnectionState.disconnected) {
|
||||
dismissEasyLoading();
|
||||
cancelBlueConnetctToastTimer();
|
||||
|
||||
@ -1,13 +1,12 @@
|
||||
|
||||
import 'dart:async';
|
||||
|
||||
// import 'package:flutter_reactive_ble/flutter_reactive_ble.dart';
|
||||
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/blue/io_type.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
import '../../../../blue/blue_manage.dart';
|
||||
import '../../../../blue/io_protocol/io_addFingerprint.dart';
|
||||
import '../../../../blue/io_protocol/io_addFingerprintWithTimeCycleCoercion.dart';
|
||||
import '../../../../blue/io_protocol/io_checkingUserInfoCount.dart';
|
||||
import '../../../../blue/io_protocol/io_queryingFingerprintStatus.dart';
|
||||
import '../../../../blue/io_reply.dart';
|
||||
@ -29,7 +28,7 @@ class FingerprintListLogic extends BaseGetXController{
|
||||
void _initReplySubscription() {
|
||||
_replySubscription = EventBusManager().eventBus!.on<Reply>().listen((reply) {
|
||||
// 添加指纹开始(此处用作删除指纹)
|
||||
if((reply is SenderAddFingerprintReply) && (state.isDeletFingerprintData == true)) {
|
||||
if((reply is SenderAddFingerprintWithTimeCycleCoercionReply) && (state.isDeletFingerprintData == true)) {
|
||||
_replyAddFingerprintBegin(reply);
|
||||
}
|
||||
|
||||
@ -73,11 +72,29 @@ class FingerprintListLogic extends BaseGetXController{
|
||||
var token = await Storage.getStringList(saveBlueToken);
|
||||
List<int> getTokenList = changeStringListToIntList(token!);
|
||||
|
||||
IoSenderManage.senderAddFingerprintCommand(
|
||||
// IoSenderManage.senderAddFingerprintCommand(
|
||||
// keyID:state.deletKeyID,
|
||||
// userID:state.deletUserID,
|
||||
// fingerNo:state.deletFingerNo,
|
||||
// useCountLimit:0,
|
||||
// startTime:0x11223344,
|
||||
// endTime:0x11223344,
|
||||
// needAuthor:1,
|
||||
// signKey:signKeyDataList,
|
||||
// privateKey:getPrivateKeyList,
|
||||
// token: getTokenList,
|
||||
// );
|
||||
|
||||
IoSenderManage.senderAddFingerprintWithTimeCycleCoercionCommand(
|
||||
keyID:state.deletKeyID,
|
||||
userID:state.deletUserID,
|
||||
fingerNo:state.deletFingerNo,
|
||||
useCountLimit:0,
|
||||
isForce:0, // 是否是胁迫
|
||||
isRound:0, // 是否是循环
|
||||
weekRound:0, // 周循环
|
||||
startDate: 0x11223344,
|
||||
endDate: 0x11223344,
|
||||
startTime:0x11223344,
|
||||
endTime:0x11223344,
|
||||
needAuthor:1,
|
||||
@ -314,11 +331,16 @@ class FingerprintListLogic extends BaseGetXController{
|
||||
var token = await Storage.getStringList(saveBlueToken);
|
||||
List<int> getTokenList = changeStringListToIntList(token!);
|
||||
|
||||
IoSenderManage.senderAddFingerprintCommand(
|
||||
IoSenderManage.senderAddFingerprintWithTimeCycleCoercionCommand(
|
||||
keyID:state.deletKeyID,
|
||||
userID:state.deletUserID,
|
||||
fingerNo:state.deletFingerNo,
|
||||
useCountLimit:0,
|
||||
isForce:0, // 是否是胁迫
|
||||
isRound:0, // 是否是循环
|
||||
weekRound:0, // 周循环
|
||||
startDate: 0x11223344,
|
||||
endDate: 0x11223344,
|
||||
startTime:0x11223344,
|
||||
endTime:0x11223344,
|
||||
needAuthor:1,
|
||||
@ -326,6 +348,19 @@ class FingerprintListLogic extends BaseGetXController{
|
||||
privateKey:getPrivateKeyList,
|
||||
token: getTokenList,
|
||||
);
|
||||
|
||||
// IoSenderManage.senderAddFingerprintCommand(
|
||||
// keyID:state.deletKeyID,
|
||||
// userID:state.deletUserID,
|
||||
// fingerNo:state.deletFingerNo,
|
||||
// useCountLimit:0,
|
||||
// startTime:0x11223344,
|
||||
// endTime:0x11223344,
|
||||
// needAuthor:1,
|
||||
// signKey:signKeyDataList,
|
||||
// privateKey:getPrivateKeyList,
|
||||
// token: getTokenList,
|
||||
// );
|
||||
} else if (deviceConnectionState == BluetoothConnectionState.disconnected) {
|
||||
dismissEasyLoading();
|
||||
cancelBlueConnetctToastTimer();
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
import 'dart:async';
|
||||
|
||||
// import 'package:flutter_reactive_ble/flutter_reactive_ble.dart';
|
||||
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/blue/io_type.dart';
|
||||
@ -9,7 +8,7 @@ import 'package:star_lock/tools/baseGetXController.dart';
|
||||
import 'package:star_lock/tools/eventBusEventManage.dart';
|
||||
|
||||
import '../../../../blue/blue_manage.dart';
|
||||
import '../../../../blue/io_protocol/io_addICCard.dart';
|
||||
// import '../../../../blue/io_protocol/io_addICCard.dart';
|
||||
import '../../../../blue/io_reply.dart';
|
||||
import '../../../../blue/io_tool/io_tool.dart';
|
||||
import '../../../../blue/io_tool/manager_event_bus.dart';
|
||||
@ -27,9 +26,9 @@ class IrisDetailLogic extends BaseGetXController {
|
||||
_replySubscription =
|
||||
EventBusManager().eventBus!.on<Reply>().listen((reply) async {
|
||||
// 添加卡片开始(重置锁里面所有卡)
|
||||
if ((reply is SenderAddICCardReply)) {
|
||||
_replyAddICCardBegin(reply);
|
||||
}
|
||||
// if ((reply is SenderAddICCardReply)) {
|
||||
// _replyAddICCardBegin(reply);
|
||||
// }
|
||||
});
|
||||
}
|
||||
|
||||
@ -62,18 +61,18 @@ class IrisDetailLogic extends BaseGetXController {
|
||||
List<int> getTokenList = changeStringListToIntList(token!);
|
||||
|
||||
String? userID = await Storage.getUid();
|
||||
IoSenderManage.senderAddICCardCommand(
|
||||
keyID: state.keyId.value.toString(),
|
||||
userID: userID,
|
||||
cardNo: int.parse(state.typeNumber.value),
|
||||
useCountLimit: 0,
|
||||
startTime: int.parse(state.starDate.value),
|
||||
endTime: int.parse(state.endDate.value),
|
||||
needAuthor: 1,
|
||||
signKey: signKeyDataList,
|
||||
privateKey: getPrivateKeyList,
|
||||
token: getTokenList,
|
||||
);
|
||||
// IoSenderManage.senderAddICCardCommand(
|
||||
// keyID: state.keyId.value.toString(),
|
||||
// userID: userID,
|
||||
// cardNo: int.parse(state.typeNumber.value),
|
||||
// useCountLimit: 0,
|
||||
// startTime: int.parse(state.starDate.value),
|
||||
// endTime: int.parse(state.endDate.value),
|
||||
// needAuthor: 1,
|
||||
// signKey: signKeyDataList,
|
||||
// privateKey: getPrivateKeyList,
|
||||
// token: getTokenList,
|
||||
// );
|
||||
break;
|
||||
case 0x07:
|
||||
//无权限
|
||||
@ -122,18 +121,18 @@ class IrisDetailLogic extends BaseGetXController {
|
||||
print("openDoorTokenPubToken:$getTokenList");
|
||||
|
||||
String? userID = await Storage.getUid();
|
||||
IoSenderManage.senderAddICCardCommand(
|
||||
keyID: state.keyId.value.toString(),
|
||||
userID: userID,
|
||||
cardNo: int.parse(state.typeNumber.value),
|
||||
useCountLimit: 0,
|
||||
startTime: int.parse(state.starDate.value),
|
||||
endTime: int.parse(state.endDate.value),
|
||||
needAuthor: 1,
|
||||
signKey: signKeyDataList,
|
||||
privateKey: getPrivateKeyList,
|
||||
token: getTokenList,
|
||||
);
|
||||
// IoSenderManage.senderAddICCardCommand(
|
||||
// keyID: state.keyId.value.toString(),
|
||||
// userID: userID,
|
||||
// cardNo: int.parse(state.typeNumber.value),
|
||||
// useCountLimit: 0,
|
||||
// startTime: int.parse(state.starDate.value),
|
||||
// endTime: int.parse(state.endDate.value),
|
||||
// needAuthor: 1,
|
||||
// signKey: signKeyDataList,
|
||||
// privateKey: getPrivateKeyList,
|
||||
// token: getTokenList,
|
||||
// );
|
||||
} else if (deviceConnectionState ==
|
||||
BluetoothConnectionState.disconnected) {
|
||||
dismissEasyLoading();
|
||||
|
||||
@ -19,6 +19,7 @@ import '../../../blue/io_tool/io_tool.dart';
|
||||
import '../../../blue/io_tool/manager_event_bus.dart';
|
||||
import '../../../blue/sender_manage.dart';
|
||||
import '../../../network/api_repository.dart';
|
||||
import '../../../permission/permission_dialog.dart';
|
||||
import '../../../tools/baseGetXController.dart';
|
||||
import '../../../tools/eventBusEventManage.dart';
|
||||
import '../../../tools/storage.dart';
|
||||
@ -900,7 +901,7 @@ class LockDetailLogic extends BaseGetXController {
|
||||
}
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
Future<void> onReady() async {
|
||||
// TODO: implement onReady
|
||||
super.onReady();
|
||||
|
||||
@ -910,9 +911,9 @@ class LockDetailLogic extends BaseGetXController {
|
||||
|
||||
// openBlueSet();
|
||||
|
||||
positionPermissionAlert();
|
||||
await PermissionDialog.request(Permission.location);
|
||||
|
||||
// _scanListDiscoveredDeviceSubscriptionAction();
|
||||
// positionPermissionAlert();
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@ -105,31 +105,27 @@ class AutomaticBlockingLogic extends BaseGetXController{
|
||||
switch(status){
|
||||
case 0x00:
|
||||
//成功
|
||||
print("${reply.commandType}数据解析成功");
|
||||
Get.log("${reply.commandType}数据解析成功");
|
||||
state.sureBtnState.value = 0;
|
||||
cancelBlueConnetctToastTimer();
|
||||
dismissEasyLoading();
|
||||
setAutoUnLock();
|
||||
break;
|
||||
case 0x06:
|
||||
//无权限
|
||||
print("${reply.commandType}需要鉴权");
|
||||
|
||||
//无权限
|
||||
Get.log("${reply.commandType}需要鉴权");
|
||||
break;
|
||||
case 0x07:
|
||||
//无权限
|
||||
print("${reply.commandType}用户无权限");
|
||||
|
||||
//无权限
|
||||
Get.log("${reply.commandType}用户无权限");
|
||||
break;
|
||||
case 0x09:
|
||||
// 权限校验错误
|
||||
print("${reply.commandType}权限校验错误");
|
||||
|
||||
// 权限校验错误
|
||||
Get.log("${reply.commandType}权限校验错误");
|
||||
break;
|
||||
default:
|
||||
//失败
|
||||
print("${reply.commandType}失败");
|
||||
|
||||
//失败
|
||||
Get.log("${reply.commandType}失败");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -198,33 +198,6 @@ class _AutomaticBlockingPageState extends State<AutomaticBlockingPage> with Rout
|
||||
);
|
||||
}
|
||||
|
||||
// void showDeletAlertTipDialog(BuildContext context) {
|
||||
// showCupertinoDialog(
|
||||
// context: context,
|
||||
// builder: (context) {
|
||||
// return CupertinoAlertDialog(
|
||||
// // title: const Text("提示"),
|
||||
// content: Text('关闭后,智能锁将设置为全天常开模式,直到手动关闭'.tr),
|
||||
// actions: [
|
||||
// CupertinoDialogAction(
|
||||
// child: Text(TranslationLoader.lanKeys!.cancel!.tr),
|
||||
// onPressed: () {
|
||||
// Get.back();
|
||||
// },
|
||||
// ),
|
||||
// CupertinoDialogAction(
|
||||
// child: Text(TranslationLoader.lanKeys!.sure!.tr),
|
||||
// onPressed: () {
|
||||
// Get.back();
|
||||
// logic.sendAutoLock();
|
||||
// },
|
||||
// ),
|
||||
// ],
|
||||
// );
|
||||
// },
|
||||
// );
|
||||
// }
|
||||
|
||||
@override
|
||||
void didChangeDependencies() {
|
||||
// TODO: implement didChangeDependencies
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
|
||||
@ -3,11 +3,11 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupListEntity.dart';
|
||||
import 'package:star_lock/tools/showTFView.dart';
|
||||
|
||||
import '../../../../../app_settings/app_colors.dart';
|
||||
import '../../../../../tools/commonItem.dart';
|
||||
import '../../../../../tools/noData.dart';
|
||||
import '../../../../../tools/showTipView.dart';
|
||||
import '../../../../../tools/submitBtn.dart';
|
||||
import '../../../../../tools/titleAppBar.dart';
|
||||
import '../../../../../translations/trans_lib.dart';
|
||||
@ -43,8 +43,11 @@ class _LockSelectGroupingPageState extends State<LockSelectGroupingPage> {
|
||||
left: 30.w, right: 30.w, top: 30.w, bottom: 30.w),
|
||||
padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
|
||||
onClick: () {
|
||||
showCupertinoAlertDialog(context);
|
||||
// Navigator.pop(context);
|
||||
// showCupertinoAlertDialog(context);
|
||||
ShowTipView().showTFViewAlertDialog(state.changeNameController, TranslationLoader.lanKeys!.createNewGroup!.tr, "请输入分组名称".tr, (){
|
||||
logic.addLockGroupRequest();
|
||||
Get.back();
|
||||
});
|
||||
}),
|
||||
SizedBox(
|
||||
height: 40.h,
|
||||
@ -80,28 +83,4 @@ class _LockSelectGroupingPageState extends State<LockSelectGroupingPage> {
|
||||
}) : NoData());
|
||||
}
|
||||
|
||||
void showCupertinoAlertDialog(BuildContext context) {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return ShowTFView(
|
||||
title: TranslationLoader.lanKeys!.createNewGroup!.tr,
|
||||
tipTitle: TranslationLoader.lanKeys!.pleaseEnter!.tr,
|
||||
controller: state.changeNameController,
|
||||
sureClick: () {
|
||||
//发送编辑钥匙名称请求
|
||||
if (state.changeNameController.text.isNotEmpty) {
|
||||
logic.addLockGroupRequest();
|
||||
Get.back();
|
||||
} else {
|
||||
logic.showToast("请输入分组名称".tr);
|
||||
}
|
||||
},
|
||||
cancelClick: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -31,7 +31,7 @@ class BurglarAlarmLogic extends BaseGetXController{
|
||||
|
||||
state.burglarAlarmEnable.value = state.burglarAlarmEnable.value == 1 ? 0 : 1;
|
||||
state.lockSetInfoData.value.lockSettingInfo!.antiPrySwitch = state.burglarAlarmEnable.value;
|
||||
showToast("操作成功", something: (){
|
||||
showToast("操作成功".tr, something: (){
|
||||
eventBus.fire(PassCurrentLockInformationEvent(state.lockSetInfoData.value));
|
||||
});
|
||||
}
|
||||
@ -85,32 +85,28 @@ class BurglarAlarmLogic extends BaseGetXController{
|
||||
int status = reply.data[2];
|
||||
switch(status){
|
||||
case 0x00:
|
||||
//成功
|
||||
print("${reply.commandType}数据解析成功");
|
||||
//成功
|
||||
Get.log("${reply.commandType}数据解析成功");
|
||||
state.sureBtnState.value = 0;
|
||||
dismissEasyLoading();
|
||||
cancelBlueConnetctToastTimer();
|
||||
_setLockSetGeneralSetting();
|
||||
break;
|
||||
case 0x06:
|
||||
//无权限
|
||||
print("${reply.commandType}需要鉴权");
|
||||
|
||||
//无权限
|
||||
Get.log("${reply.commandType}需要鉴权");
|
||||
break;
|
||||
case 0x07:
|
||||
//无权限
|
||||
print("${reply.commandType}用户无权限");
|
||||
|
||||
//无权限
|
||||
Get.log("${reply.commandType}用户无权限");
|
||||
break;
|
||||
case 0x09:
|
||||
// 权限校验错误
|
||||
print("${reply.commandType}权限校验错误");
|
||||
|
||||
// 权限校验错误
|
||||
Get.log("${reply.commandType}权限校验错误");
|
||||
break;
|
||||
default:
|
||||
//失败
|
||||
print("${reply.commandType}失败");
|
||||
|
||||
//失败
|
||||
Get.log("${reply.commandType}失败");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -188,7 +184,6 @@ class BurglarAlarmLogic extends BaseGetXController{
|
||||
void onReady() {
|
||||
// TODO: implement onReady
|
||||
super.onReady();
|
||||
print("onReady()");
|
||||
|
||||
_initReplySubscription();
|
||||
}
|
||||
@ -197,7 +192,6 @@ class BurglarAlarmLogic extends BaseGetXController{
|
||||
void onInit() {
|
||||
// TODO: implement onInit
|
||||
super.onInit();
|
||||
print("onInit()");
|
||||
|
||||
// _readSupportFunctionsNoParameters();
|
||||
}
|
||||
@ -206,6 +200,7 @@ class BurglarAlarmLogic extends BaseGetXController{
|
||||
void onClose() {
|
||||
// TODO: implement onClose
|
||||
super.onClose();
|
||||
|
||||
_replySubscription.cancel();
|
||||
}
|
||||
|
||||
|
||||
@ -97,7 +97,7 @@ class _BurglarAlarmPageState extends State<BurglarAlarmPage> with RouteAware{
|
||||
@override
|
||||
void didPush() {
|
||||
super.didPush();
|
||||
print("lockSet===didPush");
|
||||
|
||||
state.ifCurrentScreen.value = true;
|
||||
}
|
||||
|
||||
@ -105,7 +105,7 @@ class _BurglarAlarmPageState extends State<BurglarAlarmPage> with RouteAware{
|
||||
@override
|
||||
void didPop() {
|
||||
super.didPop();
|
||||
print("lockSet===didPop");
|
||||
|
||||
logic.cancelBlueConnetctToastTimer();
|
||||
if (EasyLoading.isShow) EasyLoading.dismiss(animation: true);
|
||||
BlueManage().stopScan();
|
||||
@ -117,7 +117,7 @@ class _BurglarAlarmPageState extends State<BurglarAlarmPage> with RouteAware{
|
||||
@override
|
||||
void didPopNext() {
|
||||
super.didPopNext();
|
||||
print("lockSet===didPopNext");
|
||||
|
||||
state.ifCurrentScreen.value = true;
|
||||
}
|
||||
|
||||
@ -125,7 +125,7 @@ class _BurglarAlarmPageState extends State<BurglarAlarmPage> with RouteAware{
|
||||
@override
|
||||
void didPushNext() {
|
||||
super.didPushNext();
|
||||
print("lockSet===didPushNext");
|
||||
|
||||
logic.cancelBlueConnetctToastTimer();
|
||||
if (EasyLoading.isShow) EasyLoading.dismiss(animation: true);
|
||||
BlueManage().stopScan();
|
||||
|
||||
@ -12,12 +12,12 @@ class CheckInCreatCompanyLogic extends BaseGetXController{
|
||||
// 设置考勤创建公司
|
||||
void setCheckInCreateCompany() async{
|
||||
if(state.companyNameController.text.length > 50){
|
||||
showToast("公司名称不能超过30个字符");
|
||||
showToast("公司名称不能超过30个字符".tr);
|
||||
return;
|
||||
}
|
||||
|
||||
if(state.companyNameController.text.length < 6){
|
||||
showToast("公司名称不能小于6个字符");
|
||||
showToast("公司名称不能小于6个字符".tr);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -30,7 +30,7 @@ class CheckInCreatCompanyLogic extends BaseGetXController{
|
||||
workStartTime: state.beginTimeTimestamp.value,
|
||||
);
|
||||
if(entity.errorCode!.codeIsSuccessful){
|
||||
showToast("创建成功", something: (){
|
||||
showToast("创建成功".tr, something: (){
|
||||
setLockSetGeneralSetting();
|
||||
});
|
||||
}
|
||||
@ -46,11 +46,10 @@ class CheckInCreatCompanyLogic extends BaseGetXController{
|
||||
eventBus.fire(RefreshLockListInfoDataEvent());
|
||||
|
||||
state.lockSetInfoData.value.lockSettingInfo!.attendance = 1;
|
||||
print("333state.lockSetInfoData.value.lockSettingInfo!.attendance:${state.lockSetInfoData.value.lockSettingInfo!.attendance}");
|
||||
eventBus.fire(PassCurrentLockInformationEvent(state.lockSetInfoData.value));
|
||||
eventBus.fire(LockSetChangeSetRefreshLockDetailWithType(0, "1"));
|
||||
Get.back();
|
||||
showToast("设置成功");
|
||||
showToast("设置成功".tr);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -60,12 +60,11 @@ class ConfiguringWifiLogic extends BaseGetXController{
|
||||
// WIFI配网结果
|
||||
Future<void> _replySenderConfiguringWifi(Reply reply) async {
|
||||
int status = reply.data[5];
|
||||
print("status:$status");
|
||||
|
||||
switch(status){
|
||||
case 0x00:
|
||||
//成功
|
||||
print("${reply.commandType}数据解析成功");
|
||||
//成功
|
||||
Get.log("${reply.commandType}数据解析成功");
|
||||
state.sureBtnState.value = 0;
|
||||
cancelBlueConnetctToastTimer();
|
||||
dismissEasyLoading();
|
||||
@ -74,8 +73,8 @@ class ConfiguringWifiLogic extends BaseGetXController{
|
||||
});
|
||||
break;
|
||||
case 0x06:
|
||||
//无权限
|
||||
print("${reply.commandType}需要鉴权");
|
||||
//无权限
|
||||
Get.log("${reply.commandType}需要鉴权");
|
||||
|
||||
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
@ -85,16 +84,15 @@ class ConfiguringWifiLogic extends BaseGetXController{
|
||||
|
||||
var tokenData = reply.data.sublist(7, 10);
|
||||
var saveStrList = changeIntListToStringList(tokenData);
|
||||
print("openDoorToken:$tokenData");
|
||||
Storage.setStringList(saveBlueToken, saveStrList);
|
||||
|
||||
var serversList = <int>[];
|
||||
for(int i = 0; i<state.configuringWifiEntity.value.data!.serviceList!.length; i++){
|
||||
var item = state.configuringWifiEntity.value.data!.serviceList![i];
|
||||
var itemList = item.serviceIp!.split(".");
|
||||
itemList.forEach((element) {
|
||||
for (var element in itemList) {
|
||||
serversList.add(int.parse(element));
|
||||
});
|
||||
}
|
||||
|
||||
double typeDouble = int.parse(item.port!) / 256;
|
||||
int type1 = typeDouble.toInt();
|
||||
@ -121,23 +119,20 @@ class ConfiguringWifiLogic extends BaseGetXController{
|
||||
|
||||
break;
|
||||
case 0x07:
|
||||
//无权限
|
||||
print("${reply.commandType}用户无权限");
|
||||
|
||||
//无权限
|
||||
Get.log("${reply.commandType}用户无权限");
|
||||
break;
|
||||
case 0x09:
|
||||
// 权限校验错误
|
||||
print("${reply.commandType}校验错误");
|
||||
|
||||
// 权限校验错误
|
||||
Get.log("${reply.commandType}校验错误");
|
||||
break;
|
||||
case 0xff:
|
||||
//成功
|
||||
showToast("配网失败");
|
||||
break;
|
||||
default:
|
||||
//失败
|
||||
print("${reply.commandType}失败");
|
||||
|
||||
//失败
|
||||
Get.log("${reply.commandType}失败");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -164,7 +159,6 @@ class ConfiguringWifiLogic extends BaseGetXController{
|
||||
|
||||
var token = await Storage.getStringList(saveBlueToken);
|
||||
List<int> getTokenList = changeStringListToIntList(token!);
|
||||
print("openDoorTokenPubToken:$getTokenList");
|
||||
|
||||
// print("millisecondsSinceEpoch/1000:${DateTime.now().millisecondsSinceEpoch~/1000}");
|
||||
var serversList = <int>[];
|
||||
@ -181,7 +175,7 @@ class ConfiguringWifiLogic extends BaseGetXController{
|
||||
for (var element in itemList) {
|
||||
serversList.add(int.parse(element));
|
||||
}
|
||||
print('Resolved google.com to address: ${addresses.first.address} serversList:$serversList');
|
||||
Get.log('Resolved google.com to address: ${addresses.first.address} serversList:$serversList');
|
||||
}
|
||||
|
||||
double typeDouble = int.parse(item.port!) / 256;
|
||||
@ -262,7 +256,6 @@ class ConfiguringWifiLogic extends BaseGetXController{
|
||||
void onInit() {
|
||||
// TODO: implement onInit
|
||||
super.onInit();
|
||||
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@ -37,8 +37,8 @@ class WifiListLogic extends BaseGetXController {
|
||||
int status = reply.data[2];
|
||||
switch(status){
|
||||
case 0x00:
|
||||
//成功
|
||||
print("${reply.commandType}数据解析成功");
|
||||
//成功
|
||||
Get.log("${reply.commandType}数据解析成功");
|
||||
showEasyLoading();
|
||||
cancelBlueConnetctToastTimer();
|
||||
Future.delayed(5.seconds, (){
|
||||
@ -46,24 +46,20 @@ class WifiListLogic extends BaseGetXController {
|
||||
});
|
||||
break;
|
||||
case 0x06:
|
||||
//无权限
|
||||
print("${reply.commandType}需要鉴权");
|
||||
|
||||
//无权限
|
||||
Get.log("${reply.commandType}需要鉴权");
|
||||
break;
|
||||
case 0x07:
|
||||
//无权限
|
||||
print("${reply.commandType}用户无权限");
|
||||
|
||||
//无权限
|
||||
Get.log("${reply.commandType}用户无权限");
|
||||
break;
|
||||
case 0x09:
|
||||
// 权限校验错误
|
||||
print("${reply.commandType}权限校验错误");
|
||||
|
||||
// 权限校验错误
|
||||
Get.log("${reply.commandType}权限校验错误");
|
||||
break;
|
||||
default:
|
||||
//失败
|
||||
print("${reply.commandType}失败");
|
||||
|
||||
//失败
|
||||
Get.log("${reply.commandType}失败");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -73,8 +69,8 @@ class WifiListLogic extends BaseGetXController {
|
||||
int status = reply.data[2];
|
||||
switch(status){
|
||||
case 0x00:
|
||||
//成功
|
||||
print("${reply.commandType}数据解析成功");
|
||||
//成功
|
||||
Get.log("${reply.commandType}数据解析成功");
|
||||
// showEasyLoading();
|
||||
dismissEasyLoading();
|
||||
state.sureBtnState.value = 0;
|
||||
@ -101,24 +97,20 @@ class WifiListLogic extends BaseGetXController {
|
||||
|
||||
break;
|
||||
case 0x06:
|
||||
//无权限
|
||||
print("${reply.commandType}需要鉴权");
|
||||
|
||||
//无权限
|
||||
Get.log("${reply.commandType}需要鉴权");
|
||||
break;
|
||||
case 0x07:
|
||||
//无权限
|
||||
print("${reply.commandType}用户无权限");
|
||||
|
||||
//无权限
|
||||
Get.log("${reply.commandType}用户无权限");
|
||||
break;
|
||||
case 0x09:
|
||||
// 权限校验错误
|
||||
print("${reply.commandType}权限校验错误");
|
||||
|
||||
// 权限校验错误
|
||||
Get.log("${reply.commandType}权限校验错误");
|
||||
break;
|
||||
default:
|
||||
//失败
|
||||
print("${reply.commandType}失败");
|
||||
|
||||
//失败
|
||||
Get.log("${reply.commandType}失败");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -139,7 +131,6 @@ class WifiListLogic extends BaseGetXController {
|
||||
if (connectionState == BluetoothConnectionState.connected){
|
||||
var token = await Storage.getStringList(saveBlueToken);
|
||||
List<int> getTokenList = changeStringListToIntList(token!);
|
||||
print("openDoorTokenPubToken:$getTokenList");
|
||||
|
||||
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
@ -170,17 +161,14 @@ class WifiListLogic extends BaseGetXController {
|
||||
void onReady() {
|
||||
// TODO: implement onReady
|
||||
super.onReady();
|
||||
print("onReady()");
|
||||
|
||||
_initReplySubscription();
|
||||
|
||||
}
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
// TODO: implement onInit
|
||||
super.onInit();
|
||||
print("onInit()");
|
||||
|
||||
senderGetWifiListWifiAction();
|
||||
}
|
||||
|
||||
@ -26,12 +26,12 @@ class _WifiListPageState extends State<WifiListPage> {
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.white,
|
||||
appBar: TitleAppBar(
|
||||
barTitle: "WIFI列表",
|
||||
barTitle: "WIFI列表".tr,
|
||||
haveBack: true,
|
||||
actionsList: [
|
||||
TextButton(
|
||||
child: Text(
|
||||
"刷新", style: TextStyle(color: Colors.white, fontSize: 24.sp),
|
||||
"刷新".tr, style: TextStyle(color: Colors.white, fontSize: 24.sp),
|
||||
),
|
||||
onPressed: () {
|
||||
logic.senderGetWifiListWifiAction();
|
||||
@ -55,7 +55,7 @@ class _WifiListPageState extends State<WifiListPage> {
|
||||
}) : NoData(noDataHeight: 1.sh - ScreenUtil().statusBarHeight - ScreenUtil().bottomBarHeight - 64.h)),
|
||||
),
|
||||
SubmitBtn(
|
||||
btnName: "手动配网",
|
||||
btnName: "手动配网".tr,
|
||||
fontSize: 28.sp,
|
||||
borderRadius: 20.w,
|
||||
padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/main/lockDetail/lockSet/faceUnlock/faceUnlock_state.dart';
|
||||
import 'package:star_lock/main/lockDetail/lockSet/lockSet/lockSetInfo_entity.dart';
|
||||
import 'package:star_lock/network/api_repository.dart';
|
||||
@ -19,8 +20,8 @@ class FaceUnlockLogic extends BaseGetXController {
|
||||
entity.data!.lockSettingInfo!.faceAutoLightScreen == 0 ? false : true;
|
||||
state.senseDistance.value =
|
||||
entity.data!.lockSettingInfo!.faceInductionDistance! == 0
|
||||
? '远距离'
|
||||
: '近距离';
|
||||
? '远距离'.tr
|
||||
: '近距离'.tr;
|
||||
state.antiMisoperation.value =
|
||||
entity.data!.lockSettingInfo!.faceAntiMistakeOpen!;
|
||||
}
|
||||
@ -34,7 +35,7 @@ class FaceUnlockLogic extends BaseGetXController {
|
||||
faceSwitch: state.faceOn.value == false ? 0 : 1,
|
||||
);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
showToast('设置成功');
|
||||
showToast('设置成功'.tr);
|
||||
}
|
||||
}
|
||||
|
||||
@ -45,7 +46,7 @@ class FaceUnlockLogic extends BaseGetXController {
|
||||
faceAutoLightScreen: state.autoBright.value == false ? 0 : 1,
|
||||
);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
showToast('设置成功');
|
||||
showToast('设置成功'.tr);
|
||||
}
|
||||
}
|
||||
|
||||
@ -53,10 +54,10 @@ class FaceUnlockLogic extends BaseGetXController {
|
||||
void updateFaceSenseDistance() async {
|
||||
var entity = await ApiRepository.to.updateFaceSenseDistance(
|
||||
lockId: state.lockSetInfoData.value.lockId ?? 0,
|
||||
faceInductionDistance: state.senseDistance.value == '远距离' ? 0 : 1,
|
||||
faceInductionDistance: state.senseDistance.value == '远距离'.tr ? 0 : 1,
|
||||
);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
showToast('设置成功');
|
||||
showToast('设置成功'.tr);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -506,7 +506,7 @@ class LockSetLogic extends BaseGetXController {
|
||||
}
|
||||
|
||||
void showDeletAlertTipDialog({String? showContent = ""}) {
|
||||
var content = showContent!.isEmpty ? "删除设备失败,请确保在设备附近,设备未被连接,设备已打开${BlueManage().connectDeviceName!.contains("T9A") == true ? "。如果是全自动锁,请使屏幕变亮" : ""}" : showContent;
|
||||
var content = showContent!.isEmpty ? "${"删除设备失败,请确保在设备附近,设备未被连接,设备已打开".tr}${BlueManage().connectDeviceName!.contains("T9A") == true ? "。如果是全自动锁,请使屏幕变亮".tr : ""}" : showContent;
|
||||
ShowTipView().showSureAlertDialog(content);
|
||||
}
|
||||
|
||||
|
||||
@ -767,7 +767,7 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
|
||||
@override
|
||||
void didPush() {
|
||||
super.didPush();
|
||||
print("lockSet===didPush");
|
||||
|
||||
state.ifCurrentScreen.value = true;
|
||||
}
|
||||
|
||||
@ -775,7 +775,7 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
|
||||
@override
|
||||
void didPop() {
|
||||
super.didPop();
|
||||
print("lockSet===didPop");
|
||||
|
||||
logic.cancelBlueConnetctToastTimer();
|
||||
if (EasyLoading.isShow) EasyLoading.dismiss(animation: true);
|
||||
// if (state.deletWaitScanTimer != null) {
|
||||
@ -793,7 +793,7 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
|
||||
@override
|
||||
void didPopNext() {
|
||||
super.didPopNext();
|
||||
print("lockSet===didPopNext");
|
||||
|
||||
state.ifCurrentScreen.value = true;
|
||||
}
|
||||
|
||||
@ -801,18 +801,9 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
|
||||
@override
|
||||
void didPushNext() {
|
||||
super.didPushNext();
|
||||
print("lockSet===didPushNext");
|
||||
logic.cancelBlueConnetctToastTimer();
|
||||
|
||||
logic.cancelBlueConnetctToastTimer();
|
||||
if (EasyLoading.isShow) EasyLoading.dismiss(animation: true);
|
||||
// if (state.deletWaitScanTimer != null) {
|
||||
// state.deletWaitScanTimer!.cancel();
|
||||
// }
|
||||
// if (state.deletWaitScanCompleter != null &&
|
||||
// !state.deletWaitScanCompleter!.isCompleted) {
|
||||
// state.deletWaitScanCompleter!.complete();
|
||||
// }
|
||||
// BlueManage().stopScan();
|
||||
state.ifCurrentScreen.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,11 +13,9 @@ class LockSetState {
|
||||
final lockBasicInfo = LockBasicInfo().obs;
|
||||
|
||||
final lockId = 0.obs;
|
||||
// var lockCount = 1;
|
||||
|
||||
var isOnlyOneData = false.obs;
|
||||
var isAttendance = 0.obs;// 是否开启考勤
|
||||
// var currentDeviceUUid = "".obs;// 当前设备的uuid
|
||||
var isOpenLockNeedOnline = 0.obs;// APP开锁时是否需联网
|
||||
|
||||
var isLockPickingReminder = 0.obs;// 是否开启开锁提醒
|
||||
@ -31,15 +29,9 @@ class LockSetState {
|
||||
var ifCurrentScreen = true.obs; // 是否是当前界面,用于判断是否需要针对当前界面进行展示
|
||||
var deleteAdministratorIsHaveAllData = false.obs; // 删除管理员是否有所有数据
|
||||
|
||||
// Completer? deletWaitScanCompleter;
|
||||
// Timer? deletWaitScanTimer;
|
||||
|
||||
LockSetState() {
|
||||
Map map = Get.arguments;
|
||||
lockId.value = map["lockId"];
|
||||
isOnlyOneData.value = map["isOnlyOneData"];
|
||||
// getKeyInfosData.value = Get.arguments as KeyInfos;
|
||||
// isAttendance.value = getKeyInfosData.value.isAttendance!;
|
||||
// isLockPickingReminder.value = getKeyInfosData.value.monitorFlag!;
|
||||
}
|
||||
}
|
||||
@ -1,6 +1,5 @@
|
||||
import 'dart:async';
|
||||
|
||||
// import 'package:flutter_reactive_ble/flutter_reactive_ble.dart';
|
||||
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
@ -32,7 +31,7 @@ class LockSoundSetLogic extends BaseGetXController {
|
||||
state.lockSetInfoData.value.lockSettingInfo!.lockSound = state.isOpenLockSound.value == true ? 1 :0;
|
||||
state.lockSetInfoData.value.lockSettingInfo!.lockSoundVolume = state.lockSoundLevel.value;
|
||||
ifCanNext();
|
||||
showToast("操作成功", something: (){
|
||||
showToast("操作成功".tr, something: (){
|
||||
eventBus.fire(PassCurrentLockInformationEvent(state.lockSetInfoData.value));
|
||||
Get.back();
|
||||
});
|
||||
@ -93,32 +92,28 @@ class LockSoundSetLogic extends BaseGetXController {
|
||||
int status = reply.data[2];
|
||||
switch(status){
|
||||
case 0x00:
|
||||
//成功
|
||||
print("${reply.commandType}数据解析成功");
|
||||
//成功
|
||||
Get.log("${reply.commandType}数据解析成功");
|
||||
state.sureBtnState.value = 0;
|
||||
cancelBlueConnetctToastTimer();
|
||||
dismissEasyLoading();
|
||||
_setLockSetGeneralSetting();
|
||||
break;
|
||||
case 0x06:
|
||||
//无权限
|
||||
print("${reply.commandType}需要鉴权");
|
||||
|
||||
//无权限
|
||||
Get.log("${reply.commandType}需要鉴权");
|
||||
break;
|
||||
case 0x07:
|
||||
//无权限
|
||||
print("${reply.commandType}用户无权限");
|
||||
|
||||
//无权限
|
||||
Get.log("${reply.commandType}用户无权限");
|
||||
break;
|
||||
case 0x09:
|
||||
// 权限校验错误
|
||||
print("${reply.commandType}权限校验错误");
|
||||
|
||||
// 权限校验错误
|
||||
Get.log("${reply.commandType}权限校验错误");
|
||||
break;
|
||||
default:
|
||||
//失败
|
||||
print("${reply.commandType}失败");
|
||||
|
||||
//失败
|
||||
Get.log("${reply.commandType}失败");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -187,7 +182,6 @@ class LockSoundSetLogic extends BaseGetXController {
|
||||
void onReady() {
|
||||
// TODO: implement onReady
|
||||
super.onReady();
|
||||
print("onReady()");
|
||||
|
||||
_initReplySubscription();
|
||||
}
|
||||
@ -196,9 +190,7 @@ class LockSoundSetLogic extends BaseGetXController {
|
||||
void onInit() {
|
||||
// TODO: implement onInit
|
||||
super.onInit();
|
||||
print("onInit()");
|
||||
|
||||
// _readSupportFunctionsWithParameters();
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@ -235,7 +235,6 @@ class _LockSoundSetPageState extends State<LockSoundSetPage> with RouteAware {
|
||||
@override
|
||||
void didPush() {
|
||||
super.didPush();
|
||||
print("lockSet===didPush");
|
||||
state.ifCurrentScreen.value = true;
|
||||
}
|
||||
|
||||
@ -243,7 +242,6 @@ class _LockSoundSetPageState extends State<LockSoundSetPage> with RouteAware {
|
||||
@override
|
||||
void didPop() {
|
||||
super.didPop();
|
||||
print("lockSet===didPop");
|
||||
logic.cancelBlueConnetctToastTimer();
|
||||
if (EasyLoading.isShow) EasyLoading.dismiss(animation: true);
|
||||
BlueManage().stopScan();
|
||||
@ -255,7 +253,6 @@ class _LockSoundSetPageState extends State<LockSoundSetPage> with RouteAware {
|
||||
@override
|
||||
void didPopNext() {
|
||||
super.didPopNext();
|
||||
print("lockSet===didPopNext");
|
||||
state.ifCurrentScreen.value = true;
|
||||
}
|
||||
|
||||
@ -263,7 +260,6 @@ class _LockSoundSetPageState extends State<LockSoundSetPage> with RouteAware {
|
||||
@override
|
||||
void didPushNext() {
|
||||
super.didPushNext();
|
||||
print("lockSet===didPushNext");
|
||||
logic.cancelBlueConnetctToastTimer();
|
||||
if (EasyLoading.isShow) EasyLoading.dismiss(animation: true);
|
||||
BlueManage().stopScan();
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../../../../blue/blue_manage.dart';
|
||||
import '../../../../blue/io_protocol/io_getStarLockStatusInfo.dart';
|
||||
@ -39,8 +40,8 @@ class LockTimeLogic extends BaseGetXController{
|
||||
int status = reply.data[2];
|
||||
switch (status) {
|
||||
case 0x00:
|
||||
//成功
|
||||
print("${reply.commandType}数据解析成功");
|
||||
//成功
|
||||
Get.log("${reply.commandType}数据解析成功");
|
||||
|
||||
cancelBlueConnetctToastTimer();
|
||||
dismissEasyLoading();
|
||||
@ -53,28 +54,24 @@ class LockTimeLogic extends BaseGetXController{
|
||||
(0xFF & indate[3]));
|
||||
state.dateTime.value = DateTool().dateToYMDHNString("$indateValue");
|
||||
// state.dateTime = indateValue * 1000;
|
||||
print("indate:$indate indateValue:$indateValue");
|
||||
Get.log("indate:$indate indateValue:$indateValue");
|
||||
|
||||
break;
|
||||
case 0x06:
|
||||
//无权限
|
||||
print("${reply.commandType}需要鉴权");
|
||||
|
||||
//无权限
|
||||
Get.log("${reply.commandType}需要鉴权");
|
||||
break;
|
||||
case 0x07:
|
||||
//无权限
|
||||
print("${reply.commandType}用户无权限");
|
||||
|
||||
//无权限
|
||||
Get.log("${reply.commandType}用户无权限");
|
||||
break;
|
||||
case 0x09:
|
||||
// 权限校验错误
|
||||
print("${reply.commandType}权限校验错误");
|
||||
|
||||
// 权限校验错误
|
||||
Get.log("${reply.commandType}权限校验错误");
|
||||
break;
|
||||
default:
|
||||
//失败
|
||||
print("${reply.commandType}失败");
|
||||
|
||||
//失败
|
||||
Get.log("${reply.commandType}失败");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -84,18 +81,8 @@ class LockTimeLogic extends BaseGetXController{
|
||||
int status = reply.data[2];
|
||||
switch(status){
|
||||
case 0x00:
|
||||
//成功
|
||||
print("${reply.commandType}数据解析成功");
|
||||
|
||||
// var lockTime = reply.data.sublist(4, 8);
|
||||
// int value = (
|
||||
// (0xff & lockTime[(0)]) << 24 |
|
||||
// (0xff & lockTime[1]) << 16 |
|
||||
// (0xff & lockTime[2]) << 8 |
|
||||
// (0xFF & lockTime[3]));
|
||||
|
||||
// String dataEime = DateTool().dateToYMDHNSString("$value");
|
||||
// state.dateTime.value = dataEime;
|
||||
//成功
|
||||
Get.log("${reply.commandType}数据解析成功");
|
||||
|
||||
String dataEime = DateTool().dateToYMDHNString("${state.dateTimestamp.value}");
|
||||
state.dateTime.value = dataEime;
|
||||
@ -103,27 +90,23 @@ class LockTimeLogic extends BaseGetXController{
|
||||
state.sureBtnState.value = 0;
|
||||
cancelBlueConnetctToastTimer();
|
||||
dismissEasyLoading();
|
||||
showToast("锁时间更新成功");
|
||||
showToast("锁时间更新成功".tr);
|
||||
break;
|
||||
case 0x06:
|
||||
//无权限
|
||||
print("${reply.commandType}需要鉴权");
|
||||
|
||||
//无权限
|
||||
Get.log("${reply.commandType}需要鉴权");
|
||||
break;
|
||||
case 0x07:
|
||||
//无权限
|
||||
print("${reply.commandType}用户无权限");
|
||||
|
||||
//无权限
|
||||
Get.log("${reply.commandType}用户无权限");
|
||||
break;
|
||||
case 0x09:
|
||||
// 权限校验错误
|
||||
print("${reply.commandType}权限校验错误");
|
||||
|
||||
// 权限校验错误
|
||||
Get.log("${reply.commandType}权限校验错误");
|
||||
break;
|
||||
default:
|
||||
//失败
|
||||
print("${reply.commandType}失败");
|
||||
|
||||
//失败
|
||||
Get.log("${reply.commandType}失败");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -215,7 +198,7 @@ class LockTimeLogic extends BaseGetXController{
|
||||
lockId: state.lockSetInfoData.value.lockId.toString(),
|
||||
);
|
||||
if(entity.errorCode!.codeIsSuccessful){
|
||||
state.dateTimestamp.value = entity.data!.date!;
|
||||
state.dateTimestamp.value = entity.data!.date!.toString().length > 10 ? entity.data!.date!~/ 1000 : entity.data!.date!;
|
||||
if(isSendBlue){
|
||||
sendTiming();
|
||||
}
|
||||
@ -226,7 +209,7 @@ class LockTimeLogic extends BaseGetXController{
|
||||
void onReady() {
|
||||
// TODO: implement onReady
|
||||
super.onReady();
|
||||
print("onReady()");
|
||||
Get.log("onReady()");
|
||||
|
||||
_initReplySubscription();
|
||||
|
||||
@ -239,7 +222,7 @@ class LockTimeLogic extends BaseGetXController{
|
||||
void onInit() {
|
||||
// TODO: implement onInit
|
||||
super.onInit();
|
||||
print("onInit()");
|
||||
Get.log("onInit()");
|
||||
|
||||
// _getLockStatus();
|
||||
}
|
||||
|
||||
@ -23,7 +23,7 @@ class _LockUserPageState extends State<LockUserPage> {
|
||||
return Scaffold(
|
||||
backgroundColor: AppColors.mainBackgroundColor,
|
||||
appBar: TitleAppBar(
|
||||
barTitle: '锁用户',
|
||||
barTitle: '锁用户'.tr,
|
||||
haveBack: true,
|
||||
backgroundColor: AppColors.mainColor,
|
||||
),
|
||||
@ -35,7 +35,7 @@ class _LockUserPageState extends State<LockUserPage> {
|
||||
),
|
||||
Expanded(child: _buildMainUI()),
|
||||
SubmitBtn(
|
||||
btnName: '确定',
|
||||
btnName: '确定'.tr,
|
||||
onClick: () {},
|
||||
),
|
||||
SizedBox(
|
||||
|
||||
@ -8,7 +8,7 @@ import 'package:star_lock/tools/baseGetXController.dart';
|
||||
import 'package:star_lock/tools/eventBusEventManage.dart';
|
||||
|
||||
import '../../../../blue/blue_manage.dart';
|
||||
import '../../../../blue/io_protocol/io_addICCard.dart';
|
||||
// import '../../../../blue/io_protocol/io_addICCard.dart';
|
||||
import '../../../../blue/io_reply.dart';
|
||||
import '../../../../blue/io_tool/io_tool.dart';
|
||||
import '../../../../blue/io_tool/manager_event_bus.dart';
|
||||
@ -26,9 +26,9 @@ class PalmDetailLogic extends BaseGetXController {
|
||||
_replySubscription =
|
||||
EventBusManager().eventBus!.on<Reply>().listen((reply) async {
|
||||
// 添加卡片开始(重置锁里面所有卡)
|
||||
if ((reply is SenderAddICCardReply)) {
|
||||
_replyAddICCardBegin(reply);
|
||||
}
|
||||
// if ((reply is SenderAddICCardReply)) {
|
||||
// _replyAddICCardBegin(reply);
|
||||
// }
|
||||
});
|
||||
}
|
||||
|
||||
@ -61,18 +61,18 @@ class PalmDetailLogic extends BaseGetXController {
|
||||
List<int> getTokenList = changeStringListToIntList(token!);
|
||||
|
||||
String? userID = await Storage.getUid();
|
||||
IoSenderManage.senderAddICCardCommand(
|
||||
keyID: state.keyId.value.toString(),
|
||||
userID: userID,
|
||||
cardNo: int.parse(state.typeNumber.value),
|
||||
useCountLimit: 0,
|
||||
startTime: int.parse(state.starDate.value),
|
||||
endTime: int.parse(state.endDate.value),
|
||||
needAuthor: 1,
|
||||
signKey: signKeyDataList,
|
||||
privateKey: getPrivateKeyList,
|
||||
token: getTokenList,
|
||||
);
|
||||
// IoSenderManage.senderAddICCardCommand(
|
||||
// keyID: state.keyId.value.toString(),
|
||||
// userID: userID,
|
||||
// cardNo: int.parse(state.typeNumber.value),
|
||||
// useCountLimit: 0,
|
||||
// startTime: int.parse(state.starDate.value),
|
||||
// endTime: int.parse(state.endDate.value),
|
||||
// needAuthor: 1,
|
||||
// signKey: signKeyDataList,
|
||||
// privateKey: getPrivateKeyList,
|
||||
// token: getTokenList,
|
||||
// );
|
||||
break;
|
||||
case 0x07:
|
||||
//无权限
|
||||
@ -121,18 +121,18 @@ class PalmDetailLogic extends BaseGetXController {
|
||||
print("openDoorTokenPubToken:$getTokenList");
|
||||
|
||||
String? userID = await Storage.getUid();
|
||||
IoSenderManage.senderAddICCardCommand(
|
||||
keyID: state.keyId.value.toString(),
|
||||
userID: userID,
|
||||
cardNo: int.parse(state.typeNumber.value),
|
||||
useCountLimit: 0,
|
||||
startTime: int.parse(state.starDate.value),
|
||||
endTime: int.parse(state.endDate.value),
|
||||
needAuthor: 1,
|
||||
signKey: signKeyDataList,
|
||||
privateKey: getPrivateKeyList,
|
||||
token: getTokenList,
|
||||
);
|
||||
// IoSenderManage.senderAddICCardCommand(
|
||||
// keyID: state.keyId.value.toString(),
|
||||
// userID: userID,
|
||||
// cardNo: int.parse(state.typeNumber.value),
|
||||
// useCountLimit: 0,
|
||||
// startTime: int.parse(state.starDate.value),
|
||||
// endTime: int.parse(state.endDate.value),
|
||||
// needAuthor: 1,
|
||||
// signKey: signKeyDataList,
|
||||
// privateKey: getPrivateKeyList,
|
||||
// token: getTokenList,
|
||||
// );
|
||||
} else if (deviceConnectionState ==
|
||||
BluetoothConnectionState.disconnected) {
|
||||
dismissEasyLoading();
|
||||
|
||||
@ -58,7 +58,6 @@ class LockAddressGaoDeLogic extends BaseGetXController{
|
||||
void onReady() {
|
||||
// TODO: implement onReady
|
||||
super.onReady();
|
||||
print("onReady()");
|
||||
|
||||
}
|
||||
|
||||
@ -66,7 +65,6 @@ class LockAddressGaoDeLogic extends BaseGetXController{
|
||||
void onInit() {
|
||||
// TODO: implement onInit
|
||||
super.onInit();
|
||||
print("onInit()");
|
||||
|
||||
// AMapFlutterLocation.updatePrivacyAgree(true);
|
||||
// AMapFlutterLocation.updatePrivacyShow(true, true);
|
||||
@ -79,7 +77,6 @@ class LockAddressGaoDeLogic extends BaseGetXController{
|
||||
void onClose() {
|
||||
// TODO: implement onClose
|
||||
super.onClose();
|
||||
print("地图界面onClose()");
|
||||
}
|
||||
|
||||
}
|
||||
@ -24,7 +24,7 @@ class _MessageDetailPageState extends State<MessageDetailPage> {
|
||||
return Scaffold(
|
||||
backgroundColor: AppColors.mainBackgroundColor,
|
||||
appBar: TitleAppBar(
|
||||
barTitle: "消息详情",
|
||||
barTitle: "消息详情".tr,
|
||||
haveBack: true,
|
||||
backgroundColor: AppColors.mainColor),
|
||||
body: Container(
|
||||
@ -33,7 +33,7 @@ class _MessageDetailPageState extends State<MessageDetailPage> {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"创建时间:${DateTool().dateToYMDHNString(state.itemData.value.createdAt!.toString())}",
|
||||
"${"创建时间".tr}:${DateTool().dateToYMDHNString(state.itemData.value.createdAt!.toString())}",
|
||||
style: TextStyle(fontSize: 22.sp, color: AppColors.placeholderTextColor),
|
||||
),
|
||||
SizedBox(height: 20.h),
|
||||
|
||||
@ -23,7 +23,6 @@ class MessageListLogic extends BaseGetXController {
|
||||
} else {
|
||||
if (entity.data!.list!.isNotEmpty) {
|
||||
state.itemDataList.value.addAll(entity.data!.list!);
|
||||
print("state.itemDataList.value.length:${state.itemDataList.value.length}");
|
||||
pageNo++;
|
||||
}
|
||||
}
|
||||
@ -39,12 +38,21 @@ class MessageListLogic extends BaseGetXController {
|
||||
}
|
||||
}
|
||||
|
||||
/// 刷新消息列表
|
||||
// 清空消息
|
||||
void deletAllMessageDataRequest() async {
|
||||
MessageListEntity entity = await ApiRepository.to.deletAllMessageLoadData();
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
pageNo = 1;
|
||||
messageListDataRequest();
|
||||
}
|
||||
}
|
||||
|
||||
// 刷新消息列表
|
||||
StreamSubscription? _readMessageRefreshUIEvent;
|
||||
void _readMessageRefreshUIAction() {
|
||||
// 蓝牙协议通知传输跟蓝牙之外的数据传输类不一样 eventBus
|
||||
_readMessageRefreshUIEvent = eventBus.on<ReadMessageRefreshUI>().listen((event) {
|
||||
pageNo == 1;
|
||||
pageNo = 1;
|
||||
messageListDataRequest();
|
||||
});
|
||||
}
|
||||
|
||||
@ -7,6 +7,8 @@ import '../../../appRouters.dart';
|
||||
import '../../../app_settings/app_colors.dart';
|
||||
import '../../../tools/EasyRefreshTool.dart';
|
||||
import '../../../tools/dateTool.dart';
|
||||
import '../../../tools/showTipView.dart';
|
||||
import '../../../tools/storage.dart';
|
||||
import '../../../tools/titleAppBar.dart';
|
||||
import '../../../translations/trans_lib.dart';
|
||||
import 'messageList_entity.dart';
|
||||
@ -47,6 +49,24 @@ class _MessageListPageState extends State<MessageListPage>
|
||||
? TitleAppBar(
|
||||
barTitle: TranslationLoader.lanKeys!.message!.tr,
|
||||
haveBack: true,
|
||||
actionsList: [
|
||||
TextButton(
|
||||
child: Text(
|
||||
"清空".tr,
|
||||
style: TextStyle(color: Colors.white, fontSize: 24.sp),
|
||||
),
|
||||
onPressed: () async {
|
||||
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||
if (isDemoMode == false) {
|
||||
ShowTipView().showIosTipWithContentDialog("是否清空?".tr, () async {
|
||||
logic.deletAllMessageDataRequest();
|
||||
});
|
||||
} else {
|
||||
logic.showToast("演示模式".tr);
|
||||
}
|
||||
},
|
||||
),
|
||||
],
|
||||
backgroundColor: AppColors.mainColor)
|
||||
: null,
|
||||
body: EasyRefreshTool(onRefresh: () {
|
||||
@ -79,7 +99,7 @@ class _MessageListPageState extends State<MessageListPage>
|
||||
},
|
||||
backgroundColor: Colors.red,
|
||||
foregroundColor: Colors.white,
|
||||
label: '删除',
|
||||
label: '删除'.tr,
|
||||
padding: EdgeInsets.only(left: 5.w, right: 5.w),
|
||||
),
|
||||
],
|
||||
@ -116,6 +136,15 @@ class _MessageListPageState extends State<MessageListPage>
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
messageItemEntity.readAt! == 0 ? Container(
|
||||
width: 10.w,
|
||||
height: 10.w,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.red,
|
||||
borderRadius: BorderRadius.circular(5.w),
|
||||
),
|
||||
):Container(),
|
||||
messageItemEntity.readAt! == 0 ? SizedBox(width: 5.w) : Container(),
|
||||
Flexible(
|
||||
child: Text(
|
||||
messageItemEntity.data!,
|
||||
|
||||
@ -35,7 +35,7 @@ class StarLockMineLogic extends BaseGetXController {
|
||||
state.userEmail.value = (await Storage.getEmail())!;
|
||||
state.userHeadUrl.value = (await Storage.getHeadUrl())!;
|
||||
|
||||
Get.log("userNickName:${state.userNickName.value} userMobile:${state.userMobile.value} userEmail:${state.userEmail.value} userHeadUrl:${state.userHeadUrl.value}");
|
||||
// Get.log("userNickName:${state.userNickName.value} userMobile:${state.userMobile.value} userEmail:${state.userEmail.value} userHeadUrl:${state.userHeadUrl.value}");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
@ -103,7 +104,7 @@ class _MinePersonInfoResetPasswordPageState
|
||||
GestureDetector(
|
||||
child: SizedBox(
|
||||
// width: 150.w,
|
||||
height: 50.h,
|
||||
height: 60.h,
|
||||
// color: Colors.red,
|
||||
child: Center(
|
||||
child: Text(
|
||||
@ -113,8 +114,7 @@ class _MinePersonInfoResetPasswordPageState
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
Navigator.pushNamed(
|
||||
context, Routers.starLockForgetPasswordPage);
|
||||
Get.toNamed(Routers.starLockForgetPasswordPage);
|
||||
},
|
||||
)
|
||||
],
|
||||
|
||||
@ -21,7 +21,6 @@ class AdministratorDetailsLogic extends BaseGetXController{
|
||||
Future<void> administratorDetailRequest() async {
|
||||
AdministratorDetailEntity entity = await ApiRepository.to.authorizedAdminDetail(state.itemData.value.uid ?? 0);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
print("管理员详情请求成功啦啦啦啦啦");
|
||||
state.lockItemList.value = entity.data!.lockList!;
|
||||
}
|
||||
}
|
||||
@ -36,10 +35,9 @@ class AdministratorDetailsLogic extends BaseGetXController{
|
||||
'',
|
||||
isRemoteUnlock);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
print("修改管理员信息成功啦啦啦啦啦");
|
||||
showToast("修改成功", something: (){
|
||||
Get.back();
|
||||
});
|
||||
showToast("修改成功".tr);
|
||||
}else{
|
||||
state.isOnRemote.value = !state.isOnRemote.value;
|
||||
}
|
||||
}
|
||||
|
||||
@ -50,8 +48,7 @@ class AdministratorDetailsLogic extends BaseGetXController{
|
||||
includeUnderlings.toString()
|
||||
);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
print("删除授权管理员成功");
|
||||
showToast("删除成功", something: (){
|
||||
showToast("删除成功".tr, something: (){
|
||||
// eventBus.fire(AuthorizedAdministratorListPageRefreshUI());
|
||||
Get.back();
|
||||
});
|
||||
@ -65,10 +62,9 @@ class AdministratorDetailsLogic extends BaseGetXController{
|
||||
includeUnderlings: includeUnderlings
|
||||
);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
showToast("设置成功", something: () {
|
||||
showToast("设置成功".tr, something: () {
|
||||
eventBus.fire(ElectronicKeyListRefreshUI());
|
||||
eventBus.fire(AuthorizedAdminPageRefreshUI());
|
||||
Get.back();
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -80,10 +76,9 @@ class AdministratorDetailsLogic extends BaseGetXController{
|
||||
includeUnderlings: includeUnderlings
|
||||
);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
showToast("设置成功", something: () {
|
||||
showToast("设置成功".tr, something: () {
|
||||
eventBus.fire(ElectronicKeyListRefreshUI());
|
||||
eventBus.fire(AuthorizedAdminPageRefreshUI());
|
||||
Get.back();
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -94,7 +89,7 @@ class AdministratorDetailsLogic extends BaseGetXController{
|
||||
keyId:state.itemData.value.keyId.toString(),
|
||||
);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
showToast("设置成功", something: () {
|
||||
showToast("设置成功".tr, something: () {
|
||||
eventBus.fire(ElectronicKeyListRefreshUI());
|
||||
eventBus.fire(AuthorizedAdminPageRefreshUI());
|
||||
Get.back();
|
||||
@ -103,7 +98,7 @@ class AdministratorDetailsLogic extends BaseGetXController{
|
||||
}
|
||||
|
||||
Future openModalBottomSheet() async {
|
||||
var textList = [state.itemData.value.keyStatus == 110405 ? '取消冻结' : "冻结", '取消授权'];
|
||||
var textList = [state.itemData.value.keyStatus == 110405 ? '取消冻结'.tr : "冻结".tr, '取消授权'.tr];
|
||||
|
||||
showModalBottomSheet(
|
||||
context: Get.context!,
|
||||
@ -118,18 +113,18 @@ class AdministratorDetailsLogic extends BaseGetXController{
|
||||
if(index == 0){
|
||||
if(state.itemData.value.keyStatus == 110405){
|
||||
// 取消冻结
|
||||
ShowTipView().showDeleteAdministratorIsHaveAllDataDialog('同时解冻其发送的钥匙', (isAllData) {
|
||||
ShowTipView().showDeleteAdministratorIsHaveAllDataDialog('同时解冻其发送的钥匙'.tr, (isAllData) {
|
||||
cancelFreeze(isAllData ? 1 : 0);
|
||||
});
|
||||
}else{
|
||||
ShowTipView().showDeleteAdministratorIsHaveAllDataDialog('同时解冻其发送的钥匙', (isAllData) {
|
||||
ShowTipView().showDeleteAdministratorIsHaveAllDataDialog('同时冻结其发送的钥匙'.tr, (isAllData) {
|
||||
freezeKey(isAllData ? 1 : 0);
|
||||
});
|
||||
}
|
||||
}else{
|
||||
// 取消/授权管理员
|
||||
// 管理员
|
||||
ShowTipView().showIosTipWithContentDialog("取消授权会在用户APP连网后生效", (){
|
||||
ShowTipView().showIosTipWithContentDialog("取消授权会在用户APP连网后生效".tr, (){
|
||||
cancelAdministrator();
|
||||
});
|
||||
}
|
||||
@ -152,14 +147,14 @@ class AdministratorDetailsLogic extends BaseGetXController{
|
||||
} else if (indexEntity.keyType == XSConstantMacro.keyTypeLong) {
|
||||
//永久
|
||||
DateTime dateStr = DateTime.fromMillisecondsSinceEpoch(indexEntity.date!);
|
||||
useDateStr = '${dateStr.toLocal().toString().substring(0, 16)}\n永久';
|
||||
useDateStr = '${dateStr.toLocal().toString().substring(0, 16)}\n${"永久".tr}';
|
||||
} else if (indexEntity.keyType == XSConstantMacro.keyTypeOnce) {
|
||||
//单次
|
||||
DateTime dateStr = DateTime.fromMillisecondsSinceEpoch(indexEntity.date!);
|
||||
useDateStr = '${dateStr.toLocal().toString().substring(0, 16)} \n单次';
|
||||
useDateStr = '${dateStr.toLocal().toString().substring(0, 16)} \n${"单次".tr}';
|
||||
} else if (indexEntity.keyType == XSConstantMacro.keyTypeLoop) {
|
||||
//循环
|
||||
useDateStr = '循环';
|
||||
useDateStr = '循环'.tr;
|
||||
}
|
||||
return useDateStr;
|
||||
}
|
||||
|
||||
@ -38,7 +38,7 @@ class _AdministratorDetailsPageState extends State<AdministratorDetailsPage> {
|
||||
resizeToAvoidBottomInset: false,
|
||||
backgroundColor: AppColors.mainBackgroundColor,
|
||||
appBar: TitleAppBar(
|
||||
barTitle: '管理员详情',
|
||||
barTitle: '管理员详情'.tr,
|
||||
haveBack: true,
|
||||
actionsList: [
|
||||
IconButton(
|
||||
@ -100,7 +100,7 @@ class _AdministratorDetailsPageState extends State<AdministratorDetailsPage> {
|
||||
left: 30.w, right: 30.w, top: 30.w, bottom: 30.w),
|
||||
padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
|
||||
onClick: () {
|
||||
ShowTipView().showDeleteAdministratorIsHaveAllDataDialog('同时删除其发送的所有钥匙,钥匙删除后不能恢复', (isAllData) {
|
||||
ShowTipView().showDeleteAdministratorIsHaveAllDataDialog('同时删除其发送的所有钥匙,钥匙删除后不能恢复'.tr, (isAllData) {
|
||||
logic.deleteAdministratorRequest(isAllData ? 1 : 0);
|
||||
});
|
||||
}),
|
||||
@ -194,7 +194,7 @@ class _AdministratorDetailsPageState extends State<AdministratorDetailsPage> {
|
||||
return ShowTFView(
|
||||
title:
|
||||
"${TranslationLoader.lanKeys!.amend!.tr} ${TranslationLoader.lanKeys!.name!.tr}",
|
||||
tipTitle: "请输入",
|
||||
tipTitle: "请输入".tr,
|
||||
controller: state.changeNameController,
|
||||
sureClick: () {
|
||||
//发送编辑钥匙名称请求
|
||||
|
||||
@ -2,7 +2,6 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/blue/blue_manage.dart';
|
||||
import 'package:star_lock/blue/io_reply.dart';
|
||||
import 'package:star_lock/blue/io_tool/io_tool.dart';
|
||||
@ -11,7 +10,7 @@ import 'package:star_lock/blue/io_type.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
import 'package:star_lock/tools/dateTool.dart';
|
||||
|
||||
import '../../../../../blue/io_protocol/io_addICCard.dart';
|
||||
import '../../../../../blue/io_protocol/io_addICCardWithTimeCycleCoercion.dart';
|
||||
import '../../../../../blue/sender_manage.dart';
|
||||
import '../../../../../network/api_repository.dart';
|
||||
import '../../../../../tools/eventBusEventManage.dart';
|
||||
@ -27,7 +26,7 @@ class ExpireCardLogic extends BaseGetXController {
|
||||
void _initReplySubscription() {
|
||||
_replySubscription = EventBusManager().eventBus!.on<Reply>().listen((reply) async {
|
||||
// 添加卡片开始(重置锁里面所有卡)
|
||||
if((reply is SenderAddICCardReply)) {
|
||||
if((reply is SenderAddICCardWithTimeCycleCoercionReply) && (state.ifCurrentScreen.value == true)) {
|
||||
_replyAddICCardBegin(reply);
|
||||
}
|
||||
});
|
||||
@ -61,14 +60,18 @@ class ExpireCardLogic extends BaseGetXController {
|
||||
var token = await Storage.getStringList(saveBlueToken);
|
||||
List<int> getTokenList = changeStringListToIntList(token!);
|
||||
|
||||
String? userID = await Storage.getUid();
|
||||
IoSenderManage.senderAddICCardCommand(
|
||||
keyID:state.deletExpireCardItemEntity.cardId.toString(),
|
||||
userID:userID,
|
||||
IoSenderManage.senderAddCardWithTimeCycleCoercionCommand(
|
||||
keyID:"1",
|
||||
userID:await Storage.getUid(),
|
||||
cardNo:state.deletExpireCardItemEntity.cardUserNo!,
|
||||
useCountLimit:0,
|
||||
startTime:state.deletExpireCardItemEntity.startDate!~/1000,
|
||||
endTime:state.deletExpireCardItemEntity.endDate!~/1000,
|
||||
useCountLimit:0xff,
|
||||
isForce:0, // 是否是胁迫
|
||||
isRound:0, // 是否是循环
|
||||
weekRound:0, // 周循环
|
||||
startDate: 0x11223344,
|
||||
endDate: 0x11223344,
|
||||
startTime:0x11223344,
|
||||
endTime:0x11223344,
|
||||
needAuthor:1,
|
||||
signKey:signKeyDataList,
|
||||
privateKey:getPrivateKeyList,
|
||||
@ -120,14 +123,18 @@ class ExpireCardLogic extends BaseGetXController {
|
||||
List<int> getTokenList = changeStringListToIntList(token!);
|
||||
print("openDoorTokenPubToken:$getTokenList");
|
||||
|
||||
String? userID = await Storage.getUid();
|
||||
IoSenderManage.senderAddICCardCommand(
|
||||
keyID:state.deletExpireCardItemEntity.cardId.toString(),
|
||||
userID:userID,
|
||||
IoSenderManage.senderAddCardWithTimeCycleCoercionCommand(
|
||||
keyID:"1",
|
||||
userID:await Storage.getUid(),
|
||||
cardNo:state.deletExpireCardItemEntity.cardUserNo!,
|
||||
useCountLimit:0,
|
||||
startTime:state.deletExpireCardItemEntity.startDate!~/1000,
|
||||
endTime:state.deletExpireCardItemEntity.endDate!~/1000,
|
||||
useCountLimit:0xff,
|
||||
isForce:0, // 是否是胁迫
|
||||
isRound:0, // 是否是循环
|
||||
weekRound:0, // 周循环
|
||||
startDate: 0x11223344,
|
||||
endDate: 0x11223344,
|
||||
startTime:0x11223344,
|
||||
endTime:0x11223344,
|
||||
needAuthor:1,
|
||||
signKey:signKeyDataList,
|
||||
privateKey:getPrivateKeyList,
|
||||
|
||||
@ -2,13 +2,13 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
||||
import 'package:star_lock/blue/io_protocol/io_addFingerprint.dart';
|
||||
import 'package:star_lock/blue/io_tool/io_tool.dart';
|
||||
import 'package:star_lock/blue/io_type.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
import 'package:star_lock/tools/dateTool.dart';
|
||||
|
||||
import '../../../../../blue/blue_manage.dart';
|
||||
import '../../../../../blue/io_protocol/io_addFingerprintWithTimeCycleCoercion.dart';
|
||||
import '../../../../../blue/io_reply.dart';
|
||||
import '../../../../../blue/io_tool/manager_event_bus.dart';
|
||||
import '../../../../../blue/sender_manage.dart';
|
||||
@ -26,7 +26,7 @@ class ExpireFingerprintLogic extends BaseGetXController {
|
||||
void _initReplySubscription() {
|
||||
_replySubscription = EventBusManager().eventBus!.on<Reply>().listen((reply) {
|
||||
// 添加指纹开始(此处用作删除指纹)
|
||||
if((reply is SenderAddFingerprintReply)) {
|
||||
if((reply is SenderAddFingerprintWithTimeCycleCoercionReply) && (state.ifCurrentScreen.value == true)) {
|
||||
_replyAddFingerprintBegin(reply);
|
||||
}
|
||||
});
|
||||
@ -62,14 +62,18 @@ class ExpireFingerprintLogic extends BaseGetXController {
|
||||
var token = await Storage.getStringList(saveBlueToken);
|
||||
List<int> getTokenList = changeStringListToIntList(token!);
|
||||
|
||||
String? userID = await Storage.getUid();
|
||||
IoSenderManage.senderAddFingerprintCommand(
|
||||
IoSenderManage.senderAddFingerprintWithTimeCycleCoercionCommand(
|
||||
keyID:state.deletExpireFingerprintItemEntity.fingerprintId.toString(),
|
||||
userID:userID,
|
||||
userID:await Storage.getUid(),
|
||||
fingerNo:int.parse(state.deletExpireFingerprintItemEntity.fingerprintNumber!),
|
||||
useCountLimit:0,
|
||||
startTime:state.deletExpireFingerprintItemEntity.startDate!~/1000,
|
||||
endTime:state.deletExpireFingerprintItemEntity.endDate!~/1000,
|
||||
useCountLimit:0xff,
|
||||
isForce:0, // 是否是胁迫
|
||||
isRound:0, // 是否是循环
|
||||
weekRound:0, // 周循环
|
||||
startDate: 0x11223344,
|
||||
endDate: 0x11223344,
|
||||
startTime:0x11223344,
|
||||
endTime:0x11223344,
|
||||
needAuthor:1,
|
||||
signKey:signKeyDataList,
|
||||
privateKey:getPrivateKeyList,
|
||||
@ -122,18 +126,36 @@ class ExpireFingerprintLogic extends BaseGetXController {
|
||||
|
||||
String? userID = await Storage.getUid();
|
||||
|
||||
IoSenderManage.senderAddFingerprintCommand(
|
||||
IoSenderManage.senderAddFingerprintWithTimeCycleCoercionCommand(
|
||||
keyID:state.deletExpireFingerprintItemEntity.fingerprintId.toString(),
|
||||
userID:userID,
|
||||
userID:await Storage.getUid(),
|
||||
fingerNo:int.parse(state.deletExpireFingerprintItemEntity.fingerprintNumber!),
|
||||
useCountLimit:0,
|
||||
startTime:state.deletExpireFingerprintItemEntity.startDate!~/1000,
|
||||
endTime:state.deletExpireFingerprintItemEntity.endDate!~/1000,
|
||||
useCountLimit:0xff,
|
||||
isForce:0, // 是否是胁迫
|
||||
isRound:0, // 是否是循环
|
||||
weekRound:0, // 周循环
|
||||
startDate: 0x11223344,
|
||||
endDate: 0x11223344,
|
||||
startTime:0x11223344,
|
||||
endTime:0x11223344,
|
||||
needAuthor:1,
|
||||
signKey:signKeyDataList,
|
||||
privateKey:getPrivateKeyList,
|
||||
token: getTokenList,
|
||||
);
|
||||
|
||||
// IoSenderManage.senderAddFingerprintCommand(
|
||||
// keyID:state.deletExpireFingerprintItemEntity.fingerprintId.toString(),
|
||||
// userID:userID,
|
||||
// fingerNo:int.parse(state.deletExpireFingerprintItemEntity.fingerprintNumber!),
|
||||
// useCountLimit:0,
|
||||
// startTime:state.deletExpireFingerprintItemEntity.startDate!~/1000,
|
||||
// endTime:state.deletExpireFingerprintItemEntity.endDate!~/1000,
|
||||
// needAuthor:1,
|
||||
// signKey:signKeyDataList,
|
||||
// privateKey:getPrivateKeyList,
|
||||
// token: getTokenList,
|
||||
// );
|
||||
} else if (deviceConnectionState == BluetoothConnectionState.disconnected) {
|
||||
dismissEasyLoading();
|
||||
cancelBlueConnetctToastTimer();
|
||||
|
||||
@ -183,6 +183,7 @@ abstract class Api {
|
||||
final String messageListURL = '/notifications/list'; //消息列表
|
||||
final String readMessageURL = '/notifications/markAsRead'; //读取消息
|
||||
final String deletMessageURL = '/notifications/delete'; //删除消息
|
||||
final String deletAllMessageURL = '/notifications/deleteAll'; //删除所有消息
|
||||
|
||||
final String getVersionURL = '/app/getVersion'; //版本更新
|
||||
|
||||
|
||||
@ -1680,6 +1680,11 @@ class ApiProvider extends BaseProvider {
|
||||
'id': messageId,
|
||||
}));
|
||||
|
||||
// 删除所有消息
|
||||
Future<Response> deletAllMessageLoadData() => post(
|
||||
deletAllMessageURL.toUrl,
|
||||
jsonEncode({}));
|
||||
|
||||
// 获取最新版本号
|
||||
Future<Response> getVersionData(String brandName, String currentVersion) =>
|
||||
post(
|
||||
|
||||
@ -1731,6 +1731,12 @@ class ApiRepository {
|
||||
return MessageListEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
// 删除消息
|
||||
Future<MessageListEntity> deletAllMessageLoadData() async {
|
||||
final res = await apiProvider.deletAllMessageLoadData();
|
||||
return MessageListEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
// 获取版本号
|
||||
Future<VersionUndateEntity> getVersionData(
|
||||
{required String brandName, required String currentVersion}) async {
|
||||
|
||||
@ -127,6 +127,9 @@ class DateTool {
|
||||
String dateToYMDHNString(String timestamp){
|
||||
// Get.log('dateToYMDHNString timestamp: $timestamp');
|
||||
int time = int.parse(timestamp);
|
||||
if(timestamp.length == 10){
|
||||
time = time * 1000;
|
||||
}
|
||||
DateTime nowDate = DateTime.fromMillisecondsSinceEpoch(time);
|
||||
String appointmentDate = formatDate(nowDate, [yyyy,'-',mm,'-',dd,' ',HH,':',nn]);
|
||||
return appointmentDate;
|
||||
|
||||
@ -59,7 +59,7 @@ class ShowTFView extends StatelessWidget {
|
||||
decoration: InputDecoration(
|
||||
contentPadding:
|
||||
const EdgeInsets.only(left: 5, top: -8, bottom: 6),
|
||||
hintText: TranslationLoader.lanKeys!.pleaseEnter!.tr,
|
||||
hintText: tipTitle??TranslationLoader.lanKeys!.pleaseEnter!.tr,
|
||||
hintStyle: TextStyle(fontSize: 22.sp, height: 1.0),
|
||||
//不需要输入框下划线
|
||||
border: InputBorder.none,
|
||||
|
||||
@ -103,7 +103,7 @@ class ShowTipView {
|
||||
builder: (BuildContext context) {
|
||||
return ShowTFView(
|
||||
title: title,
|
||||
tipTitle: "",
|
||||
tipTitle: tipTitle??"",
|
||||
controller: controller,
|
||||
sureClick: () {
|
||||
//发送删除锁请求
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user