Merge branch 'master' of gitee.com:starlock-cn/app-starlock
This commit is contained in:
commit
8788e68466
@ -795,4 +795,5 @@
|
||||
"当前剩余数量":"Current surplus quantity",
|
||||
"购买":"Buy",
|
||||
"实名认证为付费功能,请购买后再使用":"Real-name authentication is a paid function, please use it after purchase"
|
||||
"密码不一致哦":"The passwords are inconsistent",
|
||||
}
|
||||
|
||||
@ -707,6 +707,7 @@
|
||||
"型号": "型号",
|
||||
"密码生成后,请在当日23:59前使用一次进行激活,否则过0点后未激活则失效。密码激活后,有效期内不限次数使用。": "密码生成后,请在当日23:59前使用一次进行激活,否则过0点后未激活则失效。密码激活后,有效期内不限次数使用。",
|
||||
"密码生成后,请在当日23:59前使用,否则过0点后失效。清空码用于清空今天0点之前生成的所有密码。":"密码生成后,请在当日23:59前使用,否则过0点后失效。清空码用于清空今天0点之前生成的所有密码。",
|
||||
"密码不一致哦":"密码不一致哦",
|
||||
|
||||
"相机": "相机",
|
||||
"相册": "相册",
|
||||
|
||||
@ -709,6 +709,7 @@
|
||||
"型号": "型号",
|
||||
"密码生成后,请在当日23:59前使用一次进行激活,否则过0点后未激活则失效。密码激活后,有效期内不限次数使用。": "密码生成后,请在当日23:59前使用一次进行激活,否则过0点后未激活则失效。密码激活后,有效期内不限次数使用。",
|
||||
"密码生成后,请在当日23:59前使用,否则过0点后失效。清空码用于清空今天0点之前生成的所有密码。":"密码生成后,请在当日23:59前使用,否则过0点后失效。清空码用于清空今天0点之前生成的所有密码。",
|
||||
"密码不一致哦":"密码不一致哦",
|
||||
|
||||
"相机": "相机",
|
||||
"相册": "相册",
|
||||
|
||||
@ -23,6 +23,8 @@ class SenderAddFaceCommand extends SenderProtocol {
|
||||
int? faceNo;
|
||||
int? useCountLimit;
|
||||
int? isForce;
|
||||
int? operate;
|
||||
int? isAdmin;
|
||||
List<int>? token;
|
||||
int? isRound;
|
||||
int? weekRound;
|
||||
@ -39,6 +41,8 @@ class SenderAddFaceCommand extends SenderProtocol {
|
||||
this.userID,
|
||||
this.faceNo,
|
||||
this.useCountLimit,
|
||||
this.operate,
|
||||
this.isAdmin,
|
||||
this.isForce,
|
||||
this.token,
|
||||
this.isRound,
|
||||
@ -73,12 +77,13 @@ class SenderAddFaceCommand extends SenderProtocol {
|
||||
List<int> ebcData = [];
|
||||
|
||||
// 指令类型
|
||||
int type = commandType!.typeValue;
|
||||
double typeDouble = type / 256;
|
||||
int type1 = typeDouble.toInt();
|
||||
int type2 = type % 256;
|
||||
data.add(type1);
|
||||
data.add(type2);
|
||||
// int type = commandType!.typeValue;
|
||||
// double typeDouble = type / 256;
|
||||
// int type1 = typeDouble.toInt();
|
||||
// int type2 = type % 256;
|
||||
// data.add(type1);
|
||||
// data.add(type2);
|
||||
data.addAll(intChangList(commandType!.typeValue));
|
||||
|
||||
// 子命令类型
|
||||
data.add(81);
|
||||
@ -93,11 +98,20 @@ class SenderAddFaceCommand extends SenderProtocol {
|
||||
subData.addAll(utf8.encode(userID!));
|
||||
subData = getFixedLengthList(subData, 20 - userIDLength);
|
||||
|
||||
// fingerNo
|
||||
subData.add(faceNo!);
|
||||
// faceNo
|
||||
subData.addAll(intChangList(faceNo!));
|
||||
AppLog.log("faceNo:$faceNo intChangList(faceNo!):${intChangList(faceNo!)}");
|
||||
|
||||
// UseCountLimit
|
||||
subData.add(useCountLimit!);
|
||||
subData.addAll(intChangList(useCountLimit!));
|
||||
|
||||
// Operate 0:注册 1:修改 2:删除 3:删除全部
|
||||
subData.add(operate!);
|
||||
AppLog.log("addFingerprint operate:$operate");
|
||||
|
||||
// isAdmin
|
||||
subData.add(isAdmin!);
|
||||
AppLog.log("addFingerprint isAdmin:$isAdmin");
|
||||
|
||||
// isForce
|
||||
subData.add(isForce!);
|
||||
@ -122,6 +136,7 @@ class SenderAddFaceCommand extends SenderProtocol {
|
||||
subData.add((endDate! & 0xff0000) >> 16);
|
||||
subData.add((endDate! & 0xff00) >> 8);
|
||||
subData.add((endDate! & 0xff));
|
||||
AppLog.log("addFingerprint startDate:${DateTool().dateToYMDHNString(startDate.toString())} endDate:${DateTool().dateToYMDHNString(endDate.toString())}");
|
||||
|
||||
// startTime 4
|
||||
List<int> startTimeList = [0,0,0,0];
|
||||
|
||||
@ -23,6 +23,8 @@ class SenderAddFingerprintWithTimeCycleCoercionCommand extends SenderProtocol {
|
||||
int? fingerNo;
|
||||
int? useCountLimit;
|
||||
int? isForce;
|
||||
int? operate;
|
||||
int? isAdmin;
|
||||
List<int>? token;
|
||||
int? isRound;
|
||||
int? weekRound;
|
||||
@ -40,6 +42,8 @@ class SenderAddFingerprintWithTimeCycleCoercionCommand extends SenderProtocol {
|
||||
this.fingerNo,
|
||||
this.useCountLimit,
|
||||
this.isForce,
|
||||
this.operate,
|
||||
this.isAdmin,
|
||||
this.token,
|
||||
this.isRound,
|
||||
this.weekRound,
|
||||
@ -73,12 +77,13 @@ class SenderAddFingerprintWithTimeCycleCoercionCommand extends SenderProtocol {
|
||||
List<int> ebcData = [];
|
||||
|
||||
// 指令类型
|
||||
int type = commandType!.typeValue;
|
||||
double typeDouble = type / 256;
|
||||
int type1 = typeDouble.toInt();
|
||||
int type2 = type % 256;
|
||||
data.add(type1);
|
||||
data.add(type2);
|
||||
// int type = commandType!.typeValue;
|
||||
// double typeDouble = type / 256;
|
||||
// int type1 = typeDouble.toInt();
|
||||
// int type2 = type % 256;
|
||||
// data.add(type1);
|
||||
// data.add(type2);
|
||||
data.addAll(intChangList(commandType!.typeValue));
|
||||
|
||||
// 子命令类型
|
||||
data.add(36);
|
||||
@ -94,10 +99,19 @@ class SenderAddFingerprintWithTimeCycleCoercionCommand extends SenderProtocol {
|
||||
subData = getFixedLengthList(subData, 20 - userIDLength);
|
||||
|
||||
// fingerNo
|
||||
subData.add(fingerNo!);
|
||||
subData.addAll(intChangList(fingerNo!));
|
||||
AppLog.log("fingerNo:$fingerNo intChangList(fingerNo!):${intChangList(fingerNo!)}");
|
||||
|
||||
// UseCountLimit
|
||||
subData.add(useCountLimit!);
|
||||
subData.addAll(intChangList(useCountLimit!));
|
||||
|
||||
// Operate 0:注册 1:修改 2:删除 3:删除全部
|
||||
subData.add(operate!);
|
||||
AppLog.log("addFingerprint operate:$operate");
|
||||
|
||||
// isAdmin
|
||||
subData.add(isAdmin!);
|
||||
AppLog.log("addFingerprint isAdmin:$isAdmin");
|
||||
|
||||
// isForce
|
||||
subData.add(isForce!);
|
||||
|
||||
@ -23,6 +23,8 @@ class SenderAddICCardWithTimeCycleCoercionCommand extends SenderProtocol {
|
||||
int? cardNo;
|
||||
int? useCountLimit;
|
||||
int? isForce;
|
||||
int? operate;
|
||||
int? isAdmin;
|
||||
List<int>? token;
|
||||
int? isRound;
|
||||
int? weekRound;
|
||||
@ -40,6 +42,8 @@ class SenderAddICCardWithTimeCycleCoercionCommand extends SenderProtocol {
|
||||
this.cardNo,
|
||||
this.useCountLimit,
|
||||
this.isForce,
|
||||
this.operate,
|
||||
this.isAdmin,
|
||||
this.token,
|
||||
this.isRound,
|
||||
this.weekRound,
|
||||
@ -73,12 +77,13 @@ class SenderAddICCardWithTimeCycleCoercionCommand extends SenderProtocol {
|
||||
List<int> ebcData = [];
|
||||
|
||||
// 指令类型
|
||||
int type = commandType!.typeValue;
|
||||
double typeDouble = type / 256;
|
||||
int type1 = typeDouble.toInt();
|
||||
int type2 = type % 256;
|
||||
data.add(type1);
|
||||
data.add(type2);
|
||||
// int type = commandType!.typeValue;
|
||||
// double typeDouble = type / 256;
|
||||
// int type1 = typeDouble.toInt();
|
||||
// int type2 = type % 256;
|
||||
// data.add(type1);
|
||||
// data.add(type2);
|
||||
data.addAll(intChangList(commandType!.typeValue));
|
||||
|
||||
// 子命令类型
|
||||
data.add(24);
|
||||
@ -93,14 +98,23 @@ class SenderAddICCardWithTimeCycleCoercionCommand extends SenderProtocol {
|
||||
subData.addAll(utf8.encode(userID!));
|
||||
subData = getFixedLengthList(subData, 20 - userIDLength);
|
||||
|
||||
// fingerNo
|
||||
subData.add(cardNo!);
|
||||
// cardNo
|
||||
subData.addAll(intChangList(cardNo!));
|
||||
|
||||
// UseCountLimit
|
||||
subData.add(useCountLimit!);
|
||||
subData.addAll(intChangList(useCountLimit!));
|
||||
|
||||
// Operate 0:注册 1:修改 2:删除 3:删除全部
|
||||
subData.add(operate!);
|
||||
AppLog.log("addCard operate:$operate");
|
||||
|
||||
// isAdmin
|
||||
subData.add(isAdmin!);
|
||||
AppLog.log("addCard isAdmin:$isAdmin");
|
||||
|
||||
// isForce
|
||||
subData.add(isForce!);
|
||||
AppLog.log("addCard isForce:$isForce");
|
||||
|
||||
// token
|
||||
subData.addAll(token!);
|
||||
|
||||
@ -58,12 +58,13 @@ class ChangeAdministratorPasswordCommand extends SenderProtocol {
|
||||
List<int> ebcData = [];
|
||||
|
||||
// 指令类型
|
||||
int type = commandType!.typeValue;
|
||||
double typeDouble = type / 256;
|
||||
int type1 = typeDouble.toInt();
|
||||
int type2 = type % 256;
|
||||
data.add(type1);
|
||||
data.add(type2);
|
||||
// int type = commandType!.typeValue;
|
||||
// double typeDouble = type / 256;
|
||||
// int type1 = typeDouble.toInt();
|
||||
// int type2 = type % 256;
|
||||
// data.add(type1);
|
||||
// data.add(type2);
|
||||
data.addAll(intChangList(commandType!.typeValue));
|
||||
|
||||
// 子命令类型
|
||||
data.add(2);
|
||||
@ -79,7 +80,8 @@ class ChangeAdministratorPasswordCommand extends SenderProtocol {
|
||||
subData = getFixedLengthList(subData, 20 - userIDLength);
|
||||
|
||||
// PwdNo
|
||||
subData.add(1);
|
||||
subData.addAll(intChangList(pwdNo!));
|
||||
AppLog.log("pwdNo:$pwdNo");
|
||||
|
||||
// pwd 20
|
||||
int pwdLength = utf8.encode(pwd!).length;
|
||||
@ -87,7 +89,7 @@ class ChangeAdministratorPasswordCommand extends SenderProtocol {
|
||||
subData = getFixedLengthList(subData, 20 - pwdLength);
|
||||
|
||||
// UseCountLimit
|
||||
subData.add(0xff);
|
||||
subData.addAll(intChangList(useCountLimit!));
|
||||
|
||||
// token
|
||||
subData.addAll(token!);
|
||||
|
||||
@ -19,6 +19,8 @@ class SenderCustomPasswordsCommand extends SenderProtocol {
|
||||
String? keyID;
|
||||
String? userID;
|
||||
int? pwdNo;
|
||||
int? operate;
|
||||
int? isAdmin;
|
||||
String? pwd;
|
||||
int? useCountLimit;
|
||||
List<int>? token;
|
||||
@ -32,6 +34,8 @@ class SenderCustomPasswordsCommand extends SenderProtocol {
|
||||
this.keyID,
|
||||
this.userID,
|
||||
this.pwdNo,
|
||||
this.operate,
|
||||
this.isAdmin,
|
||||
this.pwd,
|
||||
this.useCountLimit,
|
||||
this.token,
|
||||
@ -59,12 +63,13 @@ class SenderCustomPasswordsCommand extends SenderProtocol {
|
||||
List<int> ebcData = [];
|
||||
|
||||
// 指令类型
|
||||
int type = commandType!.typeValue;
|
||||
double typeDouble = type / 256;
|
||||
int type1 = typeDouble.toInt();
|
||||
int type2 = type % 256;
|
||||
data.add(type1);
|
||||
data.add(type2);
|
||||
// int type = commandType!.typeValue;
|
||||
// double typeDouble = type / 256;
|
||||
// int type1 = typeDouble.toInt();
|
||||
// int type2 = type % 256;
|
||||
// data.add(type1);
|
||||
// data.add(type2);
|
||||
data.addAll(intChangList(commandType!.typeValue));
|
||||
|
||||
// 子命令类型
|
||||
data.add(3);
|
||||
@ -80,9 +85,15 @@ class SenderCustomPasswordsCommand extends SenderProtocol {
|
||||
subData = getFixedLengthList(subData, 20 - userIDLength);
|
||||
|
||||
// PwdNo
|
||||
subData.add(pwdNo!);
|
||||
subData.addAll(intChangList(pwdNo!));
|
||||
AppLog.log("pwdNo:$pwdNo");
|
||||
|
||||
// Operate 0:注册 1:修改 2:删除 3:删除全部
|
||||
subData.add(operate!);
|
||||
|
||||
// isAdmin
|
||||
subData.add(isAdmin!);
|
||||
|
||||
// pwd 20
|
||||
int pwdLength = utf8.encode(pwd!).length;
|
||||
subData.addAll(utf8.encode(pwd!));
|
||||
@ -90,7 +101,7 @@ class SenderCustomPasswordsCommand extends SenderProtocol {
|
||||
AppLog.log("pwd:$pwd");
|
||||
|
||||
// UseCountLimit
|
||||
subData.add(useCountLimit!);
|
||||
subData.addAll(intChangList(useCountLimit!));
|
||||
|
||||
// token
|
||||
subData.addAll(token!);
|
||||
|
||||
@ -4,6 +4,21 @@ import 'dart:typed_data';
|
||||
import 'package:crypto/crypto.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
int listChangInt(List<int> list){
|
||||
int dataLen = (list[0] << 8) + list[1];
|
||||
return dataLen;
|
||||
}
|
||||
|
||||
List<int> intChangList(int count){
|
||||
List<int> intList = [];
|
||||
double typeDouble = count / 256;
|
||||
int type1 = typeDouble.toInt();
|
||||
int type2 = count % 256;
|
||||
intList.add(type1);
|
||||
intList.add(type2);
|
||||
return intList;
|
||||
}
|
||||
|
||||
List<String> changeIntListToStringList(List<int> list){
|
||||
List<String> strList = [];
|
||||
for(int i = 0; i<list.length; i++)
|
||||
|
||||
@ -280,13 +280,15 @@ class IoSenderManage {
|
||||
{required String? keyID,
|
||||
required String? userID,
|
||||
required int? pwdNo,
|
||||
required int? operate,
|
||||
required int? isAdmin,
|
||||
required String? pwd,
|
||||
required int? useCountLimit,
|
||||
required List<int>? token,
|
||||
required int? startTime,
|
||||
required int? endTime,
|
||||
required int? needAuthor,
|
||||
required bool? isBeforeAddUser,
|
||||
required bool? isBeforeAddUser,
|
||||
required List<int>? signKey,
|
||||
required List<int>? privateKey,
|
||||
CommandSendCallBack? callBack}) {
|
||||
@ -295,6 +297,8 @@ class IoSenderManage {
|
||||
keyID: keyID,
|
||||
userID: userID,
|
||||
pwdNo: pwdNo,
|
||||
operate: operate,
|
||||
isAdmin: isAdmin,
|
||||
pwd: pwd,
|
||||
useCountLimit: useCountLimit,
|
||||
token: token,
|
||||
@ -377,6 +381,8 @@ class IoSenderManage {
|
||||
required int? fingerNo,
|
||||
required int? useCountLimit,
|
||||
required int? isForce,
|
||||
required int? isAdmin,
|
||||
required int? operate,
|
||||
required List<int>? token,
|
||||
required int? isRound,
|
||||
required int? weekRound,
|
||||
@ -395,6 +401,8 @@ class IoSenderManage {
|
||||
fingerNo: fingerNo,
|
||||
useCountLimit: useCountLimit,
|
||||
isForce: isForce,
|
||||
operate: operate,
|
||||
isAdmin: isAdmin,
|
||||
token: token,
|
||||
isRound: isRound,
|
||||
weekRound: weekRound,
|
||||
@ -444,6 +452,8 @@ class IoSenderManage {
|
||||
required String? userID,
|
||||
required int? cardNo,
|
||||
required int? useCountLimit,
|
||||
required int? operate,
|
||||
required int? isAdmin,
|
||||
required int? isForce,
|
||||
required List<int>? token,
|
||||
required int? isRound,
|
||||
@ -462,6 +472,8 @@ class IoSenderManage {
|
||||
userID: userID,
|
||||
cardNo: cardNo,
|
||||
useCountLimit: useCountLimit,
|
||||
operate: operate,
|
||||
isAdmin: isAdmin,
|
||||
isForce: isForce,
|
||||
token: token,
|
||||
isRound: isRound,
|
||||
@ -484,6 +496,8 @@ class IoSenderManage {
|
||||
required int? faceNo,
|
||||
required int? useCountLimit,
|
||||
required int? isForce,
|
||||
required int? operate,
|
||||
required int? isAdmin,
|
||||
required List<int>? token,
|
||||
required int? isRound,
|
||||
required int? weekRound,
|
||||
@ -502,6 +516,8 @@ class IoSenderManage {
|
||||
faceNo: faceNo,
|
||||
useCountLimit: useCountLimit,
|
||||
isForce: isForce,
|
||||
operate: operate,
|
||||
isAdmin: isAdmin,
|
||||
token: token,
|
||||
isRound: isRound,
|
||||
weekRound: weekRound,
|
||||
|
||||
@ -113,6 +113,7 @@ class _StarLockForgetPasswordPageState
|
||||
logic.checkNext(state.pwdController);
|
||||
},
|
||||
isPwd: true,
|
||||
// isSuffixIcon: 2,
|
||||
leftWidget: Padding(
|
||||
padding: EdgeInsets.only(
|
||||
top: 30.w, bottom: 20.w, right: 5.w, left: 5.w),
|
||||
@ -140,6 +141,7 @@ class _StarLockForgetPasswordPageState
|
||||
logic.checkNext(state.sureController);
|
||||
},
|
||||
isPwd: true,
|
||||
// isSuffixIcon: 2,
|
||||
leftWidget: Padding(
|
||||
padding: EdgeInsets.only(
|
||||
top: 30.w, bottom: 20.w, right: 5.w, left: 5.w),
|
||||
|
||||
@ -96,6 +96,7 @@ class _StarLockForgetPasswordPageState
|
||||
logic.checkNext(state.pwdController);
|
||||
},
|
||||
isPwd: true,
|
||||
// isSuffixIcon: 2,
|
||||
leftWidget: Padding(
|
||||
padding: EdgeInsets.only(top: 30.w, bottom: 20.w, left: 5.w),
|
||||
),
|
||||
@ -115,6 +116,7 @@ class _StarLockForgetPasswordPageState
|
||||
logic.checkNext(state.sureController);
|
||||
},
|
||||
isPwd: true,
|
||||
// isSuffixIcon: 2,
|
||||
leftWidget: Padding(
|
||||
padding: EdgeInsets.only(top: 30.w, bottom: 20.w, left: 5.w),
|
||||
),
|
||||
|
||||
@ -116,6 +116,7 @@ class _StarLockLoginPageState extends State<StarLockLoginPage> {
|
||||
logic.checkNext(state.pwdController);
|
||||
},
|
||||
isPwd: true,
|
||||
// isSuffixIcon: 2,
|
||||
leftWidget: Padding(
|
||||
padding: EdgeInsets.only(
|
||||
top: 30.w, bottom: 20.w, right: 5.w, left: 5.w),
|
||||
|
||||
@ -105,6 +105,7 @@ class _StarLockLoginPageState extends State<StarLockLoginXHJPage> {
|
||||
logic.checkNext(state.pwdController);
|
||||
},
|
||||
isPwd: true,
|
||||
// isSuffixIcon: 2,
|
||||
leftWidget: Padding(
|
||||
padding: EdgeInsets.only(
|
||||
top: 30.w,
|
||||
|
||||
@ -2,6 +2,7 @@ import 'dart:async';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/app_settings/app_settings.dart';
|
||||
|
||||
import '../../network/api_repository.dart';
|
||||
import '../../tools/baseGetXController.dart';
|
||||
@ -29,6 +30,11 @@ class StarLockRegisterLogic extends BaseGetXController {
|
||||
}
|
||||
|
||||
void register() async {
|
||||
AppLog.log("state.pwd.value:${state.pwd.value} state.surePwd.value:${state.surePwd.value}");
|
||||
if(state.pwd.value != state.surePwd.value){
|
||||
showToast("密码不一致哦".tr);
|
||||
return;
|
||||
}
|
||||
var entity = await ApiRepository.to.register(
|
||||
receiverType: state.isIphoneType.value == true ? 1 : 2,
|
||||
countryCode: int.parse(state.countryCode.value),
|
||||
|
||||
@ -226,6 +226,7 @@ class _StarLockRegisterPageState extends State<StarLockRegisterPage> {
|
||||
logic.checkNext(state.pwdController);
|
||||
},
|
||||
isPwd: true,
|
||||
// isSuffixIcon: 2,
|
||||
leftWidget: Padding(
|
||||
padding: EdgeInsets.only(right: 5.w, left: 5.w),
|
||||
child: Image.asset(
|
||||
@ -252,6 +253,7 @@ class _StarLockRegisterPageState extends State<StarLockRegisterPage> {
|
||||
logic.checkNext(state.sureController);
|
||||
},
|
||||
isPwd: true,
|
||||
// isSuffixIcon: 2,
|
||||
leftWidget: Padding(
|
||||
padding: EdgeInsets.only(right: 10.w, left: 5.w),
|
||||
child: Image.asset(
|
||||
|
||||
@ -25,7 +25,7 @@ class StarLockRegisterState {
|
||||
|
||||
bool get isEmail => RegexUtil.isEmail(phoneOrEmailStr.value);
|
||||
bool get isIphone => RegexUtil.isMobileSimple(phoneOrEmailStr.value);
|
||||
bool get pwdIsOK => pwd.value.isNotEmpty && (pwd.value == surePwd.value);
|
||||
bool get pwdIsOK => pwd.value.isNotEmpty && surePwd.value.isNotEmpty;
|
||||
bool get codeIsOK => verificationCode.value.isNotEmpty;
|
||||
|
||||
var canResend = false.obs;
|
||||
|
||||
@ -193,17 +193,18 @@ class _StarLockRegisterPageState extends State<StarLockRegisterXHJPage> {
|
||||
),
|
||||
Obx(() => GestureDetector(
|
||||
onTap:
|
||||
state.phoneOrEmailStrIsOK.value && state.canResend.value
|
||||
? () async {
|
||||
state.phoneOrEmailStrIsOK.value && state.canResend.value ? () async {
|
||||
// Navigator.pushNamed(context, Routers.safetyVerificationPage, arguments: {"countryCode":"+86", "account":state.phoneOrEmailStr.value});
|
||||
var result = await Navigator.pushNamed(
|
||||
context, Routers.safetyVerificationPage,
|
||||
if(state.pwd.value != state.surePwd.value){
|
||||
logic.showToast("密码不一致哦".tr);
|
||||
return;
|
||||
}
|
||||
var result = await Get.toNamed(Routers.safetyVerificationPage,
|
||||
arguments: {
|
||||
"countryCode": state.countryCode,
|
||||
"account": state.phoneOrEmailStr.value
|
||||
});
|
||||
state.xWidth.value =
|
||||
(result as Map<String, dynamic>)['xWidth'];
|
||||
state.xWidth.value = (result as Map<String, dynamic>)['xWidth'];
|
||||
logic.sendValidationCode();
|
||||
}
|
||||
: null,
|
||||
|
||||
@ -50,7 +50,10 @@ class AddICCardLogic extends BaseGetXController{
|
||||
switch(status){
|
||||
case 0x00:
|
||||
//成功
|
||||
state.cardNumber.value = reply.data.last.toString();
|
||||
var cardNumberList = reply.data.sublist(reply.data.length - 2);
|
||||
var cardNumber = listChangInt(cardNumberList).toString();
|
||||
// AppLog.log("添加卡号:$cardNumberList cardNumber:$cardNumber");
|
||||
state.cardNumber.value = cardNumber.toString();
|
||||
cancelBlueConnetctToastTimer();
|
||||
state.ifConnectScuess.value = true;
|
||||
break;
|
||||
@ -68,13 +71,16 @@ class AddICCardLogic extends BaseGetXController{
|
||||
var token = reply.data.sublist(5, 9);
|
||||
var saveStrList = changeIntListToStringList(token);
|
||||
Storage.setStringList(saveBlueToken, saveStrList);
|
||||
AppLog.log("添加卡token:$token");
|
||||
|
||||
IoSenderManage.senderAddCardWithTimeCycleCoercionCommand(
|
||||
keyID:"1",
|
||||
userID:await Storage.getUid(),
|
||||
cardNo:state.isAdministrator.value == "2" ? 254 : 0,
|
||||
useCountLimit:0xff,
|
||||
isForce:state.isCoerced.value == "1" ? 0 : 1, // 是否是胁迫
|
||||
cardNo:0,
|
||||
useCountLimit:0xffff,
|
||||
operate:0, // 0:注册 1:修改 2:删除 3:删除全部
|
||||
isAdmin:state.isAdministrator.value == "2" ? 1 : 0,
|
||||
isForce:state.isCoerced.value == "2" ? 1 : 0, // 是否是胁迫
|
||||
isRound:state.selectType.value == "2" ? 1: 0, // 是否是循环
|
||||
weekRound:DateTool().accordingTheCycleIntoTheCorrespondingNumber(state.weekDay.value), // 周循环
|
||||
startDate: int.parse(state.startDate.value)~/1000,
|
||||
@ -205,8 +211,10 @@ class AddICCardLogic extends BaseGetXController{
|
||||
IoSenderManage.senderAddCardWithTimeCycleCoercionCommand(
|
||||
keyID:"1",
|
||||
userID:await Storage.getUid(),
|
||||
cardNo:state.isAdministrator.value == "2" ? 254 : 0,
|
||||
useCountLimit:0xff,
|
||||
cardNo:0,
|
||||
useCountLimit:0xffff,
|
||||
operate:0, // 0:注册 1:修改 2:删除 3:删除全部
|
||||
isAdmin:state.isAdministrator.value == "2" ? 1 : 0,
|
||||
isForce:state.isCoerced.value == "2" ? 1 : 0, // 是否是胁迫
|
||||
isRound:state.selectType.value == "2" ? 1: 0, // 是否是循环
|
||||
weekRound:DateTool().accordingTheCycleIntoTheCorrespondingNumber(state.weekDay.value), // 周循环
|
||||
|
||||
@ -66,7 +66,9 @@ class CardDetailLogic extends BaseGetXController{
|
||||
keyID:state.keyId.value.toString(),
|
||||
userID:await Storage.getUid(),
|
||||
cardNo:int.parse(state.typeNumber.value),
|
||||
useCountLimit:state.isDeletCard.value == true ? 0 : 0xff,
|
||||
useCountLimit:0xffff,
|
||||
operate:state.isDeletCard.value ? 2 : 1, // 0:注册 1:修改 2:删除 3:删除全部
|
||||
isAdmin:state.isAdministrator.value == true ? 1 : 0,
|
||||
isForce:state.isStressCard.value == true ? 1 : 0, // 是否是胁迫
|
||||
isRound:state.keyType.value == 4 ? 1: 0, // 是否是循环
|
||||
weekRound:DateTool().accordingTheCycleIntoTheCorrespondingNumber(state.weekDay.value), // 周循环
|
||||
@ -113,7 +115,9 @@ class CardDetailLogic extends BaseGetXController{
|
||||
keyID:state.keyId.value.toString(),
|
||||
userID:await Storage.getUid(),
|
||||
cardNo:int.parse(state.typeNumber.value),
|
||||
useCountLimit:state.isDeletCard.value == true ? 0 : 0xff,
|
||||
useCountLimit:0xffff,
|
||||
operate:state.isDeletCard.value ? 2 : 1, // 0:注册 1:修改 2:删除 3:删除全部
|
||||
isAdmin:state.isAdministrator.value == true ? 1 : 0,
|
||||
isForce:state.isStressCard.value == true ? 1 : 0, // 是否是胁迫
|
||||
isRound:state.keyType.value == 4 ? 1: 0, // 是否是循环
|
||||
weekRound:DateTool().accordingTheCycleIntoTheCorrespondingNumber(state.weekDay.value), // 周循环
|
||||
@ -151,6 +155,7 @@ class CardDetailLogic extends BaseGetXController{
|
||||
startTime: int.parse(state.starTime.value),
|
||||
endTime: int.parse(state.endTime.value),
|
||||
cardType:state.keyType.value,
|
||||
cardRight: state.isAdministrator.value ? 1 : 0,
|
||||
);
|
||||
if(entity.errorCode!.codeIsSuccessful){
|
||||
showToast("修改成功".tr, something: (){
|
||||
|
||||
@ -160,8 +160,15 @@ class _CardDetailPageState extends State<CardDetailPage> with RouteAware {
|
||||
leftTitel: TranslationLoader.lanKeys!.stressCard!.tr,
|
||||
rightTitle: "",
|
||||
isTipsImg: false,
|
||||
isHaveLine: true,
|
||||
isHaveRightWidget: true,
|
||||
rightWidget: SizedBox(width: 60.w, height: 50.h, child: _isStressFingerprint()))),
|
||||
Obx(() => CommonItem(
|
||||
leftTitel: "是否是管理员".tr,
|
||||
rightTitle: "",
|
||||
isTipsImg: false,
|
||||
isHaveRightWidget: true,
|
||||
rightWidget: SizedBox(width: 60.w, height: 50.h, child: _isAdmin()))),
|
||||
Container(height: 10.h),
|
||||
CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.operatingRecord!.tr,
|
||||
@ -210,6 +217,21 @@ class _CardDetailPageState extends State<CardDetailPage> with RouteAware {
|
||||
);
|
||||
}
|
||||
|
||||
// 是否是管理员
|
||||
CupertinoSwitch _isAdmin() {
|
||||
return CupertinoSwitch(
|
||||
activeColor: CupertinoColors.activeBlue,
|
||||
trackColor: CupertinoColors.systemGrey5,
|
||||
thumbColor: CupertinoColors.white,
|
||||
value: state.isAdministrator.value,
|
||||
onChanged: (value) {
|
||||
state.isAdministrator.value = value;
|
||||
state.isDeletCard.value = false;
|
||||
logic.senderAddICCard();
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void didChangeDependencies() {
|
||||
// TODO: implement didChangeDependencies
|
||||
|
||||
@ -14,6 +14,7 @@ class CardDetailState{
|
||||
var sureBtnState = 0.obs;// 0普通状态(可用) 1连接中(不可用)
|
||||
var isDeletCard = true.obs;// 是否删除卡
|
||||
var isStressCard = false.obs;// 是否胁迫
|
||||
var isAdministrator = false.obs;// 是否是管理员
|
||||
|
||||
final typeNumber = "".obs;// 指纹号
|
||||
final typeName = "".obs;// 指纹名字
|
||||
@ -44,6 +45,7 @@ class CardDetailState{
|
||||
addTime.value = fingerprintItemData.value.createDate!;
|
||||
isStressCard.value = fingerprintItemData.value.isCoerced! == 2 ? true : false;
|
||||
weekDay.value = fingerprintItemData.value.weekDay!;
|
||||
isAdministrator.value = fingerprintItemData.value.cardRight! == 1 ? true : false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -29,7 +29,7 @@ class CardListLogic extends BaseGetXController {
|
||||
_replySubscription = EventBusManager().eventBus!.on<Reply>().listen((reply) {
|
||||
|
||||
// 添加卡片开始(重置锁里面所有卡)
|
||||
if((reply is SenderAddICCardWithTimeCycleCoercionReply) && (state.isDeletCardData == true)) {
|
||||
if((reply is SenderAddICCardWithTimeCycleCoercionReply) && (state.ifCurrentScreen.value == true)) {
|
||||
_replyAddICCardBegin(reply);
|
||||
}
|
||||
|
||||
@ -50,7 +50,6 @@ class CardListLogic extends BaseGetXController {
|
||||
switch(status){
|
||||
case 0x00:
|
||||
//成功
|
||||
state.isDeletCardData = false;
|
||||
cancelBlueConnetctToastTimer();
|
||||
deletICCardData();
|
||||
break;
|
||||
@ -71,9 +70,11 @@ class CardListLogic extends BaseGetXController {
|
||||
|
||||
IoSenderManage.senderAddCardWithTimeCycleCoercionCommand(
|
||||
keyID:state.deletKeyID,
|
||||
userID:state.deletUserID,
|
||||
userID:(await Storage.getUid())!,
|
||||
cardNo:state.deletCardNo,
|
||||
useCountLimit:0,
|
||||
useCountLimit:0xffff,
|
||||
operate: state.isDeletAll == true ? 3 : 2, // 0:注册 1:修改 2:删除 3:删除全部
|
||||
isAdmin:0,
|
||||
isForce:0, // 是否是胁迫
|
||||
isRound:0, // 是否是循环
|
||||
weekRound:0, // 周循环
|
||||
@ -244,9 +245,11 @@ class CardListLogic extends BaseGetXController {
|
||||
|
||||
IoSenderManage.senderAddCardWithTimeCycleCoercionCommand(
|
||||
keyID:state.deletKeyID,
|
||||
userID:state.deletUserID,
|
||||
userID:(await Storage.getUid())!,
|
||||
cardNo:state.deletCardNo,
|
||||
useCountLimit:0,
|
||||
useCountLimit:0xffff,
|
||||
operate: state.isDeletAll == true ? 3 : 2, // 0:注册 1:修改 2:删除 3:删除全部
|
||||
isAdmin:0,
|
||||
isForce:0, // 是否是胁迫
|
||||
isRound:0, // 是否是循环
|
||||
weekRound:0, // 周循环
|
||||
@ -321,13 +324,11 @@ class CardListLogic extends BaseGetXController {
|
||||
if(entity.errorCode!.codeIsSuccessful){
|
||||
if(state.isDeletAll == false){
|
||||
showToast("删除成功".tr, something: (){
|
||||
state.isDeletCardData = false;
|
||||
pageNo = 1;
|
||||
getICCardListData();
|
||||
});
|
||||
}else{
|
||||
showToast("重置成功".tr, something: (){
|
||||
state.isDeletCardData = false;
|
||||
pageNo = 1;
|
||||
getICCardListData();
|
||||
});
|
||||
|
||||
@ -66,11 +66,9 @@ class _CardListPageState extends State<CardListPage> with RouteAware {
|
||||
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||
if (isDemoMode == false) {
|
||||
ShowTipView().showIosTipWithContentDialog("重置后,该锁的卡都将被删除哦,确认要重置吗?".tr, () async {
|
||||
state.isDeletCardData = true;
|
||||
state.isDeletAll = true;
|
||||
state.deletKeyID = "1";
|
||||
state.deletUserID = "DeleteAll!@#";
|
||||
state.deletCardNo = 255;
|
||||
state.deletKeyID = "0";
|
||||
state.deletCardNo = 0;
|
||||
logic.senderAddICCard();
|
||||
});
|
||||
// showDeletAlertDialog(context);
|
||||
@ -138,12 +136,9 @@ class _CardListPageState extends State<CardListPage> with RouteAware {
|
||||
SlidableAction(
|
||||
onPressed: (BuildContext context){
|
||||
ShowTipView().showIosTipWithContentDialog("确定要删除吗?".tr, () async {
|
||||
state.isDeletCardData = true;
|
||||
state.isDeletAll = false;
|
||||
state.deletUserID = (await Storage.getUid())!;
|
||||
state.deletKeyID = fingerprintItemData.cardId.toString();
|
||||
state.deletCardNo = int.parse(fingerprintItemData.cardNumber!);
|
||||
state.fingerprintDeletItem = fingerprintItemData;
|
||||
logic.senderAddICCard();
|
||||
});
|
||||
},
|
||||
|
||||
@ -7,14 +7,12 @@ class CardListState {
|
||||
final lockId = 0.obs;
|
||||
|
||||
// 因为删除跟添加指纹用的同一个协议 所以这里用做判断
|
||||
var isDeletCardData = false;
|
||||
var isDeletAll = false;
|
||||
var deletKeyID = "";
|
||||
var deletUserID = "DeleteAll!@#";
|
||||
var deletKeyID = "0";
|
||||
var deletCardNo = 0;
|
||||
|
||||
final fingerprintItemListData = <FingerprintItemData>[].obs;
|
||||
var fingerprintDeletItem = FingerprintItemData();
|
||||
// var fingerprintDeletItem = FingerprintItemData();
|
||||
final TextEditingController searchController = TextEditingController();
|
||||
|
||||
var ifCurrentScreen = true.obs; // 是否是当前界面,用于判断是否需要针对当前界面进行展示
|
||||
|
||||
@ -71,7 +71,9 @@ class OtherTypeKeyChangeDateLogic extends BaseGetXController{
|
||||
keyID:state.fingerprintItemData.value.cardId!.toString(),
|
||||
userID:await Storage.getUid(),
|
||||
faceNo:int.parse(state.fingerprintItemData.value.faceNumber!),
|
||||
useCountLimit:0xff,
|
||||
useCountLimit:0xffff,
|
||||
operate: 1, // 0:注册 1:修改 2:删除 3:删除全部
|
||||
isAdmin:state.fingerprintItemData.value.faceRight!,
|
||||
isForce:state.fingerprintItemData.value.isCoerced, // 是否是胁迫
|
||||
isRound:0, // 是否是循环
|
||||
weekRound:DateTool().accordingTheCycleIntoTheCorrespondingNumber(state.fingerprintItemData.value.weekDay!), // 周循环
|
||||
@ -118,7 +120,9 @@ class OtherTypeKeyChangeDateLogic extends BaseGetXController{
|
||||
keyID:state.fingerprintItemData.value.cardId!.toString(),
|
||||
userID:await Storage.getUid(),
|
||||
faceNo:int.parse(state.fingerprintItemData.value.faceNumber!),
|
||||
useCountLimit:0xff,
|
||||
useCountLimit:0xffff,
|
||||
operate: 1, // 0:注册 1:修改 2:删除 3:删除全部
|
||||
isAdmin:state.fingerprintItemData.value.faceRight!,
|
||||
isForce:state.fingerprintItemData.value.isCoerced, // 是否是胁迫
|
||||
isRound:0, // 是否是循环
|
||||
weekRound:DateTool().accordingTheCycleIntoTheCorrespondingNumber(state.fingerprintItemData.value.weekDay!), // 周循环
|
||||
@ -170,7 +174,9 @@ class OtherTypeKeyChangeDateLogic extends BaseGetXController{
|
||||
keyID:state.fingerprintItemData.value.cardId!.toString(),
|
||||
userID:await Storage.getUid(),
|
||||
cardNo:int.parse(state.fingerprintItemData.value.cardNumber!),
|
||||
useCountLimit:0xff ,
|
||||
useCountLimit:0xffff,
|
||||
operate: 1, // 0:注册 1:修改 2:删除 3:删除全部
|
||||
isAdmin:state.fingerprintItemData.value.cardRight!,
|
||||
isForce:state.fingerprintItemData.value.isCoerced, // 是否是胁迫
|
||||
isRound:0, // 是否是循环
|
||||
weekRound:DateTool().accordingTheCycleIntoTheCorrespondingNumber(state.fingerprintItemData.value.weekDay!), // 周循环
|
||||
@ -217,7 +223,9 @@ class OtherTypeKeyChangeDateLogic extends BaseGetXController{
|
||||
keyID:state.fingerprintItemData.value.fingerprintId.toString(),
|
||||
userID:await Storage.getUid(),
|
||||
fingerNo:int.parse(state.fingerprintItemData.value.fingerprintNumber!),
|
||||
useCountLimit:0xff,
|
||||
useCountLimit:0xffff,
|
||||
operate:1, // 0:注册 1:修改 2:删除 3:删除全部
|
||||
isAdmin:state.fingerprintItemData.value.fingerRight,
|
||||
isForce:state.fingerprintItemData.value.isCoerced, // 是否是胁迫
|
||||
isRound:0, // 是否是循环
|
||||
weekRound:DateTool().accordingTheCycleIntoTheCorrespondingNumber(state.fingerprintItemData.value.weekDay!), // 周循环
|
||||
@ -267,7 +275,9 @@ class OtherTypeKeyChangeDateLogic extends BaseGetXController{
|
||||
keyID:state.fingerprintItemData.value.fingerprintId.toString(),
|
||||
userID:await Storage.getUid(),
|
||||
fingerNo:int.parse(state.fingerprintItemData.value.fingerprintNumber!),
|
||||
useCountLimit:0xff,
|
||||
useCountLimit:0xffff,
|
||||
operate:1, // 0:注册 1:修改 2:删除 3:删除全部
|
||||
isAdmin:state.fingerprintItemData.value.fingerRight,
|
||||
isForce:state.fingerprintItemData.value.isCoerced, // 是否是胁迫
|
||||
isRound:0, // 是否是循环
|
||||
weekRound:DateTool().accordingTheCycleIntoTheCorrespondingNumber(state.fingerprintItemData.value.weekDay!), // 周循环
|
||||
@ -319,7 +329,9 @@ class OtherTypeKeyChangeDateLogic extends BaseGetXController{
|
||||
keyID:state.fingerprintItemData.value.cardId!.toString(),
|
||||
userID:await Storage.getUid(),
|
||||
cardNo:int.parse(state.fingerprintItemData.value.cardNumber!),
|
||||
useCountLimit:0xff ,
|
||||
useCountLimit:0xffff,
|
||||
operate: 1, // 0:注册 1:修改 2:删除 3:删除全部
|
||||
isAdmin:state.fingerprintItemData.value.cardRight!,
|
||||
isForce:state.fingerprintItemData.value.isCoerced, // 是否是胁迫
|
||||
isRound:0, // 是否是循环
|
||||
weekRound:DateTool().accordingTheCycleIntoTheCorrespondingNumber(state.fingerprintItemData.value.weekDay!), // 周循环
|
||||
@ -357,6 +369,7 @@ class OtherTypeKeyChangeDateLogic extends BaseGetXController{
|
||||
startTime: 0,
|
||||
endTime: 0,
|
||||
fingerprintType: state.fingerprintItemData.value.fingerprintType! == 4 ? 4 : 2,
|
||||
fingerRight: state.fingerprintItemData.value.fingerRight!,
|
||||
);
|
||||
if(entity.errorCode!.codeIsSuccessful){
|
||||
showToast("修改成功".tr, something: (){
|
||||
@ -383,6 +396,7 @@ class OtherTypeKeyChangeDateLogic extends BaseGetXController{
|
||||
startTime: 0,
|
||||
endTime: 0,
|
||||
cardType: 2,// 2:限时 无论之前是永久还是限时,修改之后都是限时
|
||||
cardRight: state.fingerprintItemData.value.cardRight!,
|
||||
);
|
||||
if(entity.errorCode!.codeIsSuccessful){
|
||||
showToast("修改成功".tr, something: (){
|
||||
@ -409,6 +423,7 @@ class OtherTypeKeyChangeDateLogic extends BaseGetXController{
|
||||
faceName: state.fingerprintItemData.value.faceName!,
|
||||
addType: "1",
|
||||
isCoerced: state.fingerprintItemData.value.isCoerced!,
|
||||
faceRight: state.fingerprintItemData.value.faceRight!,
|
||||
);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
showToast("修改成功", something: () {
|
||||
|
||||
@ -73,7 +73,9 @@ class OtherTypeKeyChangeValidityDateLogic extends BaseGetXController{
|
||||
keyID:state.fingerprintItemData.value.cardId!.toString(),
|
||||
userID:await Storage.getUid(),
|
||||
faceNo:int.parse(state.fingerprintItemData.value.faceNumber!),
|
||||
useCountLimit:0xff,
|
||||
useCountLimit:0xffff,
|
||||
operate: 1, // 0:注册 1:修改 2:删除 3:删除全部
|
||||
isAdmin:state.fingerprintItemData.value.faceRight!,
|
||||
isForce:state.fingerprintItemData.value.isCoerced, // 是否是胁迫
|
||||
isRound:1, // 是否是循环
|
||||
weekRound:DateTool().accordingTheCycleIntoTheCorrespondingNumber(state.weekDay.value), // 周循环
|
||||
@ -120,7 +122,9 @@ class OtherTypeKeyChangeValidityDateLogic extends BaseGetXController{
|
||||
keyID:state.fingerprintItemData.value.cardId!.toString(),
|
||||
userID:await Storage.getUid(),
|
||||
faceNo:int.parse(state.fingerprintItemData.value.faceNumber!),
|
||||
useCountLimit:0xff,
|
||||
useCountLimit:0xffff,
|
||||
operate: 1, // 0:注册 1:修改 2:删除 3:删除全部
|
||||
isAdmin:state.fingerprintItemData.value.faceRight!,
|
||||
isForce:state.fingerprintItemData.value.isCoerced, // 是否是胁迫
|
||||
isRound:1, // 是否是循环
|
||||
weekRound:DateTool().accordingTheCycleIntoTheCorrespondingNumber(state.weekDay.value), // 周循环
|
||||
@ -172,7 +176,9 @@ class OtherTypeKeyChangeValidityDateLogic extends BaseGetXController{
|
||||
keyID:state.fingerprintItemData.value.cardId!.toString(),
|
||||
userID:await Storage.getUid(),
|
||||
cardNo:int.parse(state.fingerprintItemData.value.cardNumber!),
|
||||
useCountLimit:0xff ,
|
||||
useCountLimit:0xffff,
|
||||
operate: 1, // 0:注册 1:修改 2:删除 3:删除全部
|
||||
isAdmin:state.fingerprintItemData.value.cardRight!,
|
||||
isForce:state.fingerprintItemData.value.isCoerced, // 是否是胁迫
|
||||
isRound:1, // 是否是循环
|
||||
weekRound:DateTool().accordingTheCycleIntoTheCorrespondingNumber(state.weekDay.value), // 周循环
|
||||
@ -219,7 +225,9 @@ class OtherTypeKeyChangeValidityDateLogic extends BaseGetXController{
|
||||
keyID:state.fingerprintItemData.value.fingerprintId.toString(),
|
||||
userID:await Storage.getUid(),
|
||||
fingerNo:int.parse(state.fingerprintItemData.value.fingerprintNumber!),
|
||||
useCountLimit:0xff,
|
||||
useCountLimit:0xffff,
|
||||
operate:1, // 0:注册 1:修改 2:删除 3:删除全部
|
||||
isAdmin:state.fingerprintItemData.value.fingerRight,
|
||||
isForce:state.fingerprintItemData.value.isCoerced, // 是否是胁迫
|
||||
isRound:1, // 是否是循环
|
||||
weekRound:DateTool().accordingTheCycleIntoTheCorrespondingNumber(state.weekDay.value), // 周循环
|
||||
@ -269,7 +277,9 @@ class OtherTypeKeyChangeValidityDateLogic extends BaseGetXController{
|
||||
keyID:state.fingerprintItemData.value.fingerprintId.toString(),
|
||||
userID:await Storage.getUid(),
|
||||
fingerNo:int.parse(state.fingerprintItemData.value.fingerprintNumber!),
|
||||
useCountLimit:0xff,
|
||||
useCountLimit:0xffff,
|
||||
operate:1, // 0:注册 1:修改 2:删除 3:删除全部
|
||||
isAdmin:state.fingerprintItemData.value.fingerRight,
|
||||
isForce:state.fingerprintItemData.value.isCoerced, // 是否是胁迫
|
||||
isRound:1, // 是否是循环
|
||||
weekRound:DateTool().accordingTheCycleIntoTheCorrespondingNumber(state.weekDay.value), // 周循环
|
||||
@ -321,7 +331,9 @@ class OtherTypeKeyChangeValidityDateLogic extends BaseGetXController{
|
||||
keyID:state.fingerprintItemData.value.cardId!.toString(),
|
||||
userID:await Storage.getUid(),
|
||||
cardNo:int.parse(state.fingerprintItemData.value.cardNumber!),
|
||||
useCountLimit:0xff ,
|
||||
useCountLimit:0xffff,
|
||||
operate: 1, // 0:注册 1:修改 2:删除 3:删除全部
|
||||
isAdmin:state.fingerprintItemData.value.cardRight!,
|
||||
isForce:state.fingerprintItemData.value.isCoerced, // 是否是胁迫
|
||||
isRound:1, // 是否是循环
|
||||
weekRound:DateTool().accordingTheCycleIntoTheCorrespondingNumber(state.weekDay.value), // 周循环
|
||||
@ -359,6 +371,7 @@ class OtherTypeKeyChangeValidityDateLogic extends BaseGetXController{
|
||||
startTime: state.starTimeTimestamp.value,
|
||||
endTime: state.endTimeTimestamp.value,
|
||||
fingerprintType: state.fingerprintItemData.value.fingerprintType!,
|
||||
fingerRight: state.fingerprintItemData.value.fingerRight!
|
||||
);
|
||||
if(entity.errorCode!.codeIsSuccessful){
|
||||
showToast("修改成功".tr, something: (){
|
||||
@ -388,6 +401,7 @@ class OtherTypeKeyChangeValidityDateLogic extends BaseGetXController{
|
||||
startTime: state.starTimeTimestamp.value,
|
||||
endTime: state.endTimeTimestamp.value,
|
||||
cardType: state.fingerprintItemData.value.cardType!,
|
||||
cardRight: state.fingerprintItemData.value.cardRight!,
|
||||
);
|
||||
if(entity.errorCode!.codeIsSuccessful){
|
||||
showToast("修改成功".tr, something: (){
|
||||
@ -417,6 +431,7 @@ class OtherTypeKeyChangeValidityDateLogic extends BaseGetXController{
|
||||
faceName: state.fingerprintItemData.value.faceName!,
|
||||
addType: "1",
|
||||
isCoerced: state.fingerprintItemData.value.isCoerced!,
|
||||
faceRight: state.fingerprintItemData.value.faceRight!,
|
||||
);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
showToast("修改成功", something: () {
|
||||
|
||||
@ -161,20 +161,20 @@ class _DoorLockLogPageState extends State<DoorLockLogPage> with RouteAware {
|
||||
},
|
||||
child: Stack(
|
||||
children: [
|
||||
timelineData.imagesUrl != null
|
||||
timelineData.imagesUrl!.isNotEmpty
|
||||
?
|
||||
// Image.network(
|
||||
// timelineData.imagesUrl!,
|
||||
// width: 260.w,
|
||||
// height: 260.h,
|
||||
// )
|
||||
Image(
|
||||
image: const AssetImage(
|
||||
'images/main/icon_lockDetail_monitoringvoiceFrist.png'),
|
||||
width: 240.w,
|
||||
height: 180.h,
|
||||
fit: BoxFit.contain,
|
||||
)
|
||||
Image.network(
|
||||
timelineData.imagesUrl!,
|
||||
width: 260.w,
|
||||
height: 260.h,
|
||||
)
|
||||
// Image(
|
||||
// image: const AssetImage(
|
||||
// 'images/main/icon_lockDetail_monitoringvoiceFrist.png'),
|
||||
// width: 240.w,
|
||||
// height: 180.h,
|
||||
// fit: BoxFit.contain,
|
||||
// )
|
||||
: Container(),
|
||||
Positioned(
|
||||
top: 150.h,
|
||||
|
||||
@ -26,7 +26,7 @@ class AddFaceLogic extends BaseGetXController {
|
||||
_replySubscription =
|
||||
EventBusManager().eventBus!.on<Reply>().listen((reply) async {
|
||||
// 添加人脸开始
|
||||
if (reply is SenderAddFaceReply) {
|
||||
if (reply is SenderAddFaceReply && state.ifCurrentScreen.value == true) {
|
||||
_replyAddFaceBegin(reply);
|
||||
}
|
||||
|
||||
@ -44,27 +44,16 @@ class AddFaceLogic extends BaseGetXController {
|
||||
|
||||
Future<void> _replyAddFaceBegin(Reply reply) async {
|
||||
int status = reply.data[2];
|
||||
|
||||
switch (status) {
|
||||
case 0x00:
|
||||
//成功
|
||||
state.ifConnectScuess.value = true;
|
||||
|
||||
// 最大图片数
|
||||
state.maxRegCount.value = reply.data[10];
|
||||
state.maxRegCount.value = reply.data[11];
|
||||
// AppLog.log("人脸开始state.maxRegCount.value:${state.maxRegCount.value}");
|
||||
break;
|
||||
case 0x06:
|
||||
//无权限
|
||||
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)}';
|
||||
}
|
||||
// 倒序 weekStr
|
||||
weekStr = weekStr.split('').reversed.join('');
|
||||
int weekRound = int.parse(weekStr, radix: 2);
|
||||
|
||||
var signKey = await Storage.getStringList(saveBlueSignKey);
|
||||
List<int> signKeyDataList = changeStringListToIntList(signKey!);
|
||||
|
||||
@ -78,11 +67,13 @@ class AddFaceLogic extends BaseGetXController {
|
||||
IoSenderManage.senderAddFaceCommand(
|
||||
keyID:"1",
|
||||
userID:await Storage.getUid(),
|
||||
faceNo:state.isAdministrator.value == "2" ? 254 : 0,
|
||||
useCountLimit:0xff,
|
||||
faceNo:0,
|
||||
useCountLimit:0xffff,
|
||||
isForce:state.isCoerced.value == "2" ? 1 : 0, // 是否是胁迫
|
||||
isAdmin: state.isAdministrator.value == "2" ? 1 : 0,
|
||||
operate: 0,
|
||||
isRound:state.selectType.value == "2" ? 1: 0, // 是否是循环
|
||||
weekRound:weekRound, // 周循环
|
||||
weekRound:DateTool().accordingTheCycleIntoTheCorrespondingNumber(state.weekDay.value), // 周循环
|
||||
startDate: int.parse(state.startDate.value)~/1000,
|
||||
endDate: int.parse(state.endDate.value)~/1000,
|
||||
startTime:DateTool().dateToHNString(state.effectiveDateTime.value),
|
||||
@ -132,10 +123,14 @@ class AddFaceLogic extends BaseGetXController {
|
||||
switch (status) {
|
||||
case 0x00:
|
||||
//成功
|
||||
if (state.faceNumber.value == (reply.data[6]).toString()) {
|
||||
var faceList = reply.data.sublist(reply.data.length - 2);
|
||||
var faceNumber = listChangInt(faceList).toString();
|
||||
// var faceNumber = listChangInt(reply.data.sublist(6, 7)).toString();
|
||||
// if (state.faceNumber.value == (reply.data[6]).toString()) {
|
||||
if (state.faceNumber.value == faceNumber) {
|
||||
return;
|
||||
} else {
|
||||
state.faceNumber.value = (reply.data[6]).toString();
|
||||
state.faceNumber.value = faceNumber;
|
||||
}
|
||||
addFaceData();
|
||||
break;
|
||||
@ -158,14 +153,6 @@ class AddFaceLogic extends BaseGetXController {
|
||||
(BluetoothConnectionState deviceConnectionState) async {
|
||||
if (deviceConnectionState == BluetoothConnectionState.connected) {
|
||||
cancelBlueConnetctToastTimer();
|
||||
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)}';
|
||||
}
|
||||
// 倒序 weekStr
|
||||
weekStr = weekStr.split('').reversed.join('');
|
||||
int weekRound = int.parse(weekStr, radix: 2);
|
||||
|
||||
var signKey = await Storage.getStringList(saveBlueSignKey);
|
||||
List<int> signKeyDataList = changeStringListToIntList(signKey!);
|
||||
@ -179,11 +166,13 @@ class AddFaceLogic extends BaseGetXController {
|
||||
IoSenderManage.senderAddFaceCommand(
|
||||
keyID:"1",
|
||||
userID:await Storage.getUid(),
|
||||
faceNo:state.isAdministrator.value == "2" ? 254 : 0,
|
||||
useCountLimit:0xff,
|
||||
faceNo:0,
|
||||
useCountLimit:0xffff,
|
||||
isForce:state.isCoerced.value == "2" ? 1 : 0, // 是否是胁迫
|
||||
isAdmin: state.isAdministrator.value == "2" ? 1 : 0,
|
||||
operate: 0,
|
||||
isRound:state.selectType.value == "2" ? 1: 0, // 是否是循环
|
||||
weekRound:weekRound, // 周循环
|
||||
weekRound:DateTool().accordingTheCycleIntoTheCorrespondingNumber(state.weekDay.value), // 周循环
|
||||
startDate: int.parse(state.startDate.value)~/1000,
|
||||
endDate: int.parse(state.endDate.value)~/1000,
|
||||
startTime:DateTool().dateToHNString(state.effectiveDateTime.value),
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
@ -7,6 +8,7 @@ import '../../../../../app_settings/app_colors.dart';
|
||||
import '../../../../../tools/submitBtn.dart';
|
||||
import '../../../../../tools/titleAppBar.dart';
|
||||
import '../../../../../translations/trans_lib.dart';
|
||||
import '../../../../tools/appRouteObserver.dart';
|
||||
|
||||
class AddFacePage extends StatefulWidget {
|
||||
const AddFacePage({Key? key}) : super(key: key);
|
||||
@ -15,7 +17,7 @@ class AddFacePage extends StatefulWidget {
|
||||
State<AddFacePage> createState() => _AddFacePageState();
|
||||
}
|
||||
|
||||
class _AddFacePageState extends State<AddFacePage> {
|
||||
class _AddFacePageState extends State<AddFacePage> with RouteAware {
|
||||
final logic = Get.put(AddFaceLogic());
|
||||
final state = Get.find<AddFaceLogic>().state;
|
||||
|
||||
@ -93,4 +95,52 @@ class _AddFacePageState extends State<AddFacePage> {
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void didChangeDependencies() {
|
||||
// TODO: implement didChangeDependencies
|
||||
super.didChangeDependencies();
|
||||
|
||||
/// 路由订阅
|
||||
AppRouteObserver().routeObserver.subscribe(this, ModalRoute.of(context)!);
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
// TODO: implement dispose
|
||||
/// 取消路由订阅
|
||||
AppRouteObserver().routeObserver.unsubscribe(this);
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
/// 从上级界面进入 当前界面即将出现
|
||||
@override
|
||||
void didPush() {
|
||||
super.didPush();
|
||||
state.ifCurrentScreen.value = true;
|
||||
}
|
||||
|
||||
/// 返回上一个界面 当前界面即将消失
|
||||
@override
|
||||
void didPop() {
|
||||
super.didPop();
|
||||
logic.cancelBlueConnetctToastTimer();
|
||||
state.ifCurrentScreen.value = false;
|
||||
}
|
||||
|
||||
/// 从下级返回 当前界面即将出现
|
||||
@override
|
||||
void didPopNext() {
|
||||
super.didPopNext();
|
||||
state.ifCurrentScreen.value = true;
|
||||
}
|
||||
|
||||
/// 进入下级界面 当前界面即将消失
|
||||
@override
|
||||
void didPushNext() {
|
||||
super.didPushNext();
|
||||
logic.cancelBlueConnetctToastTimer();
|
||||
|
||||
state.ifCurrentScreen.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -40,6 +40,11 @@ class FaceDetailLogic extends BaseGetXController {
|
||||
state.sureBtnState.value = 0;
|
||||
cancelBlueConnetctToastTimer();
|
||||
dismissEasyLoading();
|
||||
if(state.isDeletFace.value == true){
|
||||
deletFaceData();
|
||||
}else{
|
||||
editFaceData();
|
||||
}
|
||||
deletFaceData();
|
||||
break;
|
||||
case 0x06:
|
||||
@ -58,7 +63,9 @@ class FaceDetailLogic extends BaseGetXController {
|
||||
keyID:state.keyId.value.toString(),
|
||||
userID:await Storage.getUid(),
|
||||
faceNo:int.parse(state.typeNumber.value),
|
||||
useCountLimit:state.isDeletFace.value == true ? 0 : 0xff,
|
||||
useCountLimit:0xffff,
|
||||
operate:state.isDeletFace.value ? 2 : 1, // 0:注册 1:修改 2:删除 3:删除全部
|
||||
isAdmin:state.isAdministrator.value == true ? 1 : 0,
|
||||
isForce:state.isStressFace.value == true ? 1 : 0, // 是否是胁迫
|
||||
isRound:state.keyType.value == 4 ? 1: 0, // 是否是循环
|
||||
weekRound:DateTool().accordingTheCycleIntoTheCorrespondingNumber(state.weekDay.value), // 周循环
|
||||
@ -106,7 +113,9 @@ class FaceDetailLogic extends BaseGetXController {
|
||||
keyID:state.keyId.value.toString(),
|
||||
userID:await Storage.getUid(),
|
||||
faceNo:int.parse(state.typeNumber.value),
|
||||
useCountLimit:state.isDeletFace.value == true ? 0 : 0xff,
|
||||
useCountLimit:0xffff,
|
||||
operate:state.isDeletFace.value ? 2 : 1, // 0:注册 1:修改 2:删除 3:删除全部
|
||||
isAdmin:state.isAdministrator.value == true ? 1 : 0,
|
||||
isForce:state.isStressFace.value == true ? 1 : 0, // 是否是胁迫
|
||||
isRound:state.keyType.value == 4 ? 1: 0, // 是否是循环
|
||||
weekRound:DateTool().accordingTheCycleIntoTheCorrespondingNumber(state.weekDay.value), // 周循环
|
||||
@ -173,6 +182,7 @@ class FaceDetailLogic extends BaseGetXController {
|
||||
faceName: state.changeNameController.text,
|
||||
addType: "1",
|
||||
isCoerced: state.isStressFace.value ? 2 : 1,
|
||||
faceRight: state.isAdministrator.value ? 1 : 0,
|
||||
);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
showToast("修改成功", something: () {
|
||||
|
||||
@ -174,7 +174,15 @@ class _FaceDetailPageState extends State<FaceDetailPage> with RouteAware {
|
||||
rightTitle: "",
|
||||
isTipsImg: false,
|
||||
isHaveRightWidget: true,
|
||||
isHaveLine: true,
|
||||
rightWidget: SizedBox(width: 60.w, height: 50.h, child: _isStressFace()))),
|
||||
Obx(() => CommonItem(
|
||||
leftTitel: "是否是管理员".tr,
|
||||
rightTitle: "",
|
||||
isTipsImg: false,
|
||||
isHaveRightWidget: true,
|
||||
rightWidget: SizedBox(
|
||||
width: 60.w, height: 50.h, child: _isAdmin()))),
|
||||
Container(height: 10.h),
|
||||
CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.operatingRecord!.tr,
|
||||
@ -223,6 +231,21 @@ class _FaceDetailPageState extends State<FaceDetailPage> with RouteAware {
|
||||
);
|
||||
}
|
||||
|
||||
// 是否是管理员
|
||||
CupertinoSwitch _isAdmin() {
|
||||
return CupertinoSwitch(
|
||||
activeColor: CupertinoColors.activeBlue,
|
||||
trackColor: CupertinoColors.systemGrey5,
|
||||
thumbColor: CupertinoColors.white,
|
||||
value: state.isAdministrator.value,
|
||||
onChanged: (value) {
|
||||
state.isAdministrator.value = value;
|
||||
state.isDeletFace.value = false;
|
||||
logic.senderAddFace();
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void didChangeDependencies() {
|
||||
// TODO: implement didChangeDependencies
|
||||
|
||||
@ -23,6 +23,7 @@ class FaceDetailState {
|
||||
var sureBtnState = 0.obs; // 0普通状态(可用) 1连接中(不可用)
|
||||
var isDeletFace = true.obs;// 是否删除卡
|
||||
var isStressFace = false.obs;// 是否胁迫
|
||||
var isAdministrator = false.obs;// 是否是管理员
|
||||
|
||||
FaceDetailState() {
|
||||
Map map = Get.arguments;
|
||||
@ -40,5 +41,6 @@ class FaceDetailState {
|
||||
addTime.value = faceItemData.value.createDate!;
|
||||
weekDay.value = faceItemData.value.cyclicConfig!;
|
||||
isStressFace.value = faceItemData.value.isCoerced! == 2 ? true : false;
|
||||
isAdministrator.value = faceItemData.value.faceRight! == 1 ? true : false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,11 +1,9 @@
|
||||
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_protocol/io_addFace.dart';
|
||||
import 'package:star_lock/blue/io_protocol/io_queryingFaceStatus.dart';
|
||||
import 'package:star_lock/blue/io_type.dart';
|
||||
import 'package:star_lock/main/lockDetail/face/faceList/faceList_state.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
import '../../../../blue/blue_manage.dart';
|
||||
@ -29,7 +27,7 @@ class FaceListLogic extends BaseGetXController {
|
||||
_replySubscription =
|
||||
EventBusManager().eventBus!.on<Reply>().listen((reply) {
|
||||
// 添加人脸开始(此处用作删除人脸)
|
||||
if ((reply is SenderAddFaceReply) && (state.isDeletFaceData == true)) {
|
||||
if ((reply is SenderAddFaceReply) && (state.ifCurrentScreen == true)) {
|
||||
_replyAddFaceBegin(reply);
|
||||
}
|
||||
|
||||
@ -51,7 +49,6 @@ class FaceListLogic extends BaseGetXController {
|
||||
switch (status) {
|
||||
case 0x00:
|
||||
//成功
|
||||
state.isDeletFaceData = false;
|
||||
cancelBlueConnetctToastTimer();
|
||||
dismissEasyLoading();
|
||||
if (state.isDeletAll == false) {
|
||||
@ -74,9 +71,11 @@ class FaceListLogic extends BaseGetXController {
|
||||
|
||||
IoSenderManage.senderAddFaceCommand(
|
||||
keyID:state.deletKeyID,
|
||||
userID:state.deletUserID,
|
||||
userID:(await Storage.getUid())!,
|
||||
faceNo:state.deletFaceNo,
|
||||
useCountLimit:0,
|
||||
useCountLimit:0xffff,
|
||||
operate: state.isDeletAll == true ? 3 : 2, // 0:注册 1:修改 2:删除 3:删除全部
|
||||
isAdmin:0,
|
||||
isForce:0, // 是否是胁迫
|
||||
isRound:0, // 是否是循环
|
||||
weekRound:0, // 周循环
|
||||
@ -283,9 +282,11 @@ class FaceListLogic extends BaseGetXController {
|
||||
|
||||
IoSenderManage.senderAddFaceCommand(
|
||||
keyID:state.deletKeyID,
|
||||
userID:state.deletUserID,
|
||||
userID:(await Storage.getUid())!,
|
||||
faceNo:state.deletFaceNo,
|
||||
useCountLimit:0,
|
||||
useCountLimit:0xffff,
|
||||
operate: state.isDeletAll == true ? 3 : 2, // 0:注册 1:修改 2:删除 3:删除全部
|
||||
isAdmin:0,
|
||||
isForce:0, // 是否是胁迫
|
||||
isRound:0, // 是否是循环
|
||||
weekRound:0, // 周循环
|
||||
@ -298,19 +299,6 @@ class FaceListLogic extends BaseGetXController {
|
||||
privateKey:getPrivateKeyList,
|
||||
token: getTokenList,
|
||||
);
|
||||
|
||||
// IoSenderManage.senderAddFaceCommand(
|
||||
// keyID: state.deletKeyID,
|
||||
// userID: state.deletUserID,
|
||||
// faceNo: state.deletFaceNo,
|
||||
// useCountLimit: 0,
|
||||
// startTime: 0x11223344,
|
||||
// endTime: 0x11223344,
|
||||
// needAuthor: 1,
|
||||
// publicKey: publicKeyDataList,
|
||||
// privateKey: getPrivateKeyList,
|
||||
// token: getTokenList,
|
||||
// );
|
||||
} else if (deviceConnectionState == BluetoothConnectionState.disconnected) {
|
||||
dismissEasyLoading();
|
||||
cancelBlueConnetctToastTimer();
|
||||
@ -348,7 +336,6 @@ class FaceListLogic extends BaseGetXController {
|
||||
);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
showToast("删除成功");
|
||||
state.isDeletFaceData = false;
|
||||
getFaceListData();
|
||||
}
|
||||
}
|
||||
@ -366,7 +353,6 @@ class FaceListLogic extends BaseGetXController {
|
||||
);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
showToast("重置成功");
|
||||
state.isDeletFaceData = false;
|
||||
getFaceListData();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/main/lockDetail/fingerprint/fingerprintList/fingerprintListData_entity.dart';
|
||||
@ -9,8 +10,8 @@ import 'package:star_lock/tools/showTipView.dart';
|
||||
|
||||
import '../../../../appRouters.dart';
|
||||
import '../../../../app_settings/app_colors.dart';
|
||||
import '../../../../tools/appRouteObserver.dart';
|
||||
import '../../../../tools/noData.dart';
|
||||
import '../../../../tools/showIosTipView.dart';
|
||||
import '../../../../tools/storage.dart';
|
||||
import '../../../../tools/submitBtn.dart';
|
||||
import '../../../../tools/titleAppBar.dart';
|
||||
@ -24,7 +25,7 @@ class FaceListPage extends StatefulWidget {
|
||||
State<FaceListPage> createState() => _FaceListPageState();
|
||||
}
|
||||
|
||||
class _FaceListPageState extends State<FaceListPage> {
|
||||
class _FaceListPageState extends State<FaceListPage> with RouteAware {
|
||||
final logic = Get.put(FaceListLogic());
|
||||
final state = Get.find<FaceListLogic>().state;
|
||||
|
||||
@ -47,11 +48,10 @@ class _FaceListPageState extends State<FaceListPage> {
|
||||
if (isDemoMode == false) {
|
||||
// showDeletAlertDialog(context);
|
||||
ShowTipView().showIosTipWithContentDialog("重置后,该锁的人脸都将被删除哦,确认要重置吗?", () async {
|
||||
state.isDeletFaceData = true;
|
||||
state.isDeletAll = true;
|
||||
state.deletKeyID = "1";
|
||||
state.deletUserID = "DeleteAll!@#";
|
||||
state.deletFaceNo = 255;
|
||||
state.deletFaceNo = 0;
|
||||
|
||||
logic.senderAddFace();
|
||||
});
|
||||
} else {
|
||||
@ -144,12 +144,11 @@ class _FaceListPageState extends State<FaceListPage> {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
// 省略: 弹出是否删除的确认对话框。
|
||||
state.deletKeyID = faceItemData.faceId.toString();
|
||||
state.deletFaceNo = int.parse(faceItemData.faceNumber!);
|
||||
ShowTipView().showIosTipWithContentDialog("确定要删除吗?".tr, () async {
|
||||
state.isDeletFaceData = true;
|
||||
state.isDeletAll = false;
|
||||
state.deletUserID = (await Storage.getUid())!;
|
||||
state.deletKeyID = faceItemData.faceId.toString();
|
||||
state.deletFaceNo = int.parse(faceItemData.faceNumber!);
|
||||
|
||||
logic.senderAddFace();
|
||||
});
|
||||
// showIosTipViewDialog(context);
|
||||
@ -263,36 +262,52 @@ class _FaceListPageState extends State<FaceListPage> {
|
||||
);
|
||||
}
|
||||
|
||||
// void showDeletAlertDialog(BuildContext context) {
|
||||
// showCupertinoDialog(
|
||||
// context: context,
|
||||
// builder: (context) {
|
||||
// return CupertinoAlertDialog(
|
||||
// title: const Text("提示"),
|
||||
// content: const Text('重置后,该锁的人脸都将被删除哦,确认要重置吗?'),
|
||||
// actions: [
|
||||
// CupertinoDialogAction(
|
||||
// child: Text(TranslationLoader.lanKeys!.cancel!.tr),
|
||||
// onPressed: () {
|
||||
// Navigator.pop(context);
|
||||
// },
|
||||
// ),
|
||||
// CupertinoDialogAction(
|
||||
// child: Text(TranslationLoader.lanKeys!.sure!.tr),
|
||||
// onPressed: () {
|
||||
// Navigator.pop(context);
|
||||
// state.isDeletFaceData = true;
|
||||
// state.isDeletAll = true;
|
||||
// state.deletKeyID = "1";
|
||||
// state.deletUserID = "DeleteAll!@#";
|
||||
// state.deletFaceNo = 255;
|
||||
// logic.senderAddFace();
|
||||
// },
|
||||
// ),
|
||||
// ],
|
||||
// );
|
||||
// },
|
||||
// );
|
||||
// }
|
||||
@override
|
||||
void didChangeDependencies() {
|
||||
// TODO: implement didChangeDependencies
|
||||
super.didChangeDependencies();
|
||||
|
||||
/// 路由订阅
|
||||
AppRouteObserver().routeObserver.subscribe(this, ModalRoute.of(context)!);
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
// TODO: implement dispose
|
||||
/// 取消路由订阅
|
||||
AppRouteObserver().routeObserver.unsubscribe(this);
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
/// 从上级界面进入 当前界面即将出现
|
||||
@override
|
||||
void didPush() {
|
||||
super.didPush();
|
||||
state.ifCurrentScreen.value = true;
|
||||
}
|
||||
|
||||
/// 返回上一个界面 当前界面即将消失
|
||||
@override
|
||||
void didPop() {
|
||||
super.didPop();
|
||||
logic.cancelBlueConnetctToastTimer();
|
||||
if (EasyLoading.isShow) EasyLoading.dismiss(animation: true);
|
||||
state.ifCurrentScreen.value = false;
|
||||
}
|
||||
|
||||
/// 从下级返回 当前界面即将出现
|
||||
@override
|
||||
void didPopNext() {
|
||||
super.didPopNext();
|
||||
state.ifCurrentScreen.value = true;
|
||||
}
|
||||
|
||||
/// 进入下级界面 当前界面即将消失
|
||||
@override
|
||||
void didPushNext() {
|
||||
super.didPushNext();
|
||||
logic.cancelBlueConnetctToastTimer();
|
||||
if (EasyLoading.isShow) EasyLoading.dismiss(animation: true);
|
||||
state.ifCurrentScreen.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -7,10 +7,8 @@ class FaceListState {
|
||||
final lockId = 0.obs;
|
||||
|
||||
// 因为删除跟添加人脸用的同一个协议 所以这里用做判断
|
||||
var isDeletFaceData = false;
|
||||
var isDeletAll = false;
|
||||
var deletKeyID = "";
|
||||
var deletUserID = "DeleteAll!@#";
|
||||
var deletFaceNo = 0;
|
||||
|
||||
final faceItemListData = <FingerprintItemData>[].obs;
|
||||
|
||||
@ -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/app_settings/app_settings.dart';
|
||||
@ -27,7 +26,7 @@ class AddFingerprintLogic extends BaseGetXController {
|
||||
void _initReplySubscription() {
|
||||
_replySubscription = EventBusManager().eventBus!.on<Reply>().listen((reply) async {
|
||||
// 添加指纹开始
|
||||
if(reply is SenderAddFingerprintWithTimeCycleCoercionReply) {
|
||||
if((reply is SenderAddFingerprintWithTimeCycleCoercionReply) && (state.ifCurrentScreen.value == true)) {
|
||||
_replyAddFingerprintBegin(reply);
|
||||
}
|
||||
|
||||
@ -57,7 +56,7 @@ class AddFingerprintLogic extends BaseGetXController {
|
||||
state.ifConnectScuess.value = true;
|
||||
|
||||
// 最大图片数
|
||||
state.maxRegCount.value = reply.data[10];
|
||||
state.maxRegCount.value = reply.data[11];
|
||||
// AppLog.log("state.maxRegCount.value:${state.maxRegCount.value}");
|
||||
// state.fingerprintNumber.value = reply.data.last.toString();
|
||||
break;
|
||||
@ -66,9 +65,6 @@ class AddFingerprintLogic extends BaseGetXController {
|
||||
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
|
||||
// var publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||
// List<int> publicKeyDataList = changeStringListToIntList(publicKey!);
|
||||
|
||||
var signKey = await Storage.getStringList(saveBlueSignKey);
|
||||
List<int> signKeyDataList = changeStringListToIntList(signKey!);
|
||||
|
||||
@ -76,21 +72,14 @@ class AddFingerprintLogic extends BaseGetXController {
|
||||
var saveStrList = changeIntListToStringList(token);
|
||||
Storage.setStringList(saveBlueToken, saveStrList);
|
||||
|
||||
// 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)}';
|
||||
// }
|
||||
// // 倒序 weekStr
|
||||
// weekStr = weekStr.split('').reversed.join('');
|
||||
// int weekRound = int.parse(weekStr, radix: 2);
|
||||
|
||||
IoSenderManage.senderAddFingerprintWithTimeCycleCoercionCommand(
|
||||
keyID:"1",
|
||||
userID:await Storage.getUid(),
|
||||
fingerNo:state.isAdministrator.value == "2" ? 254 : 0,
|
||||
useCountLimit:0xff,
|
||||
isForce:state.isCoerced.value == "1" ? 1 : 0, // 是否是胁迫
|
||||
fingerNo:0,
|
||||
useCountLimit:0xffff,
|
||||
isForce:state.isCoerced.value == "2" ? 1 : 0, // 是否是胁迫
|
||||
isAdmin: state.isAdministrator.value == "2" ? 1 : 0,
|
||||
operate: 0,
|
||||
isRound:state.selectType.value == "2" ? 1: 0, // 是否是循环
|
||||
weekRound:DateTool().accordingTheCycleIntoTheCorrespondingNumber(state.weekDay.value), // 周循环
|
||||
startDate: int.parse(state.startDate.value)~/1000,
|
||||
@ -153,17 +142,20 @@ class AddFingerprintLogic extends BaseGetXController {
|
||||
|
||||
Future<void> _replyAddFingerprintConfirmation(Reply reply) async {
|
||||
int status = reply.data[2];
|
||||
|
||||
switch(status){
|
||||
case 0x00:
|
||||
//成功
|
||||
if(state.fingerprintNumber.value == (reply.data[6]).toString()){
|
||||
// var fingerprintNum = listChangInt(reply.data.sublist(9, 11)).toString();
|
||||
var fingerprintList = reply.data.sublist(reply.data.length - 2);
|
||||
var fingerprintNum = listChangInt(fingerprintList).toString();
|
||||
|
||||
if(state.fingerprintNumber.value == fingerprintNum){
|
||||
return;
|
||||
}else{
|
||||
state.fingerprintNumber.value = (reply.data[6]).toString();
|
||||
state.fingerprintNumber.value = fingerprintNum;
|
||||
}
|
||||
// if(state.isCoerced.value == "1"){
|
||||
// 非胁迫指纹
|
||||
// 调用添加指纹接口
|
||||
addFingerprintsData();
|
||||
// }else{
|
||||
// // 如果是胁迫指纹在 添加完之后以后再调用添加胁迫指纹的
|
||||
@ -250,9 +242,11 @@ class AddFingerprintLogic extends BaseGetXController {
|
||||
IoSenderManage.senderAddFingerprintWithTimeCycleCoercionCommand(
|
||||
keyID:"1",
|
||||
userID:await Storage.getUid(),
|
||||
fingerNo:state.isAdministrator.value == "2" ? 254 : 0,
|
||||
useCountLimit:0xff,
|
||||
fingerNo:0,
|
||||
useCountLimit:0xffff,
|
||||
isForce:state.isCoerced.value == "2" ? 1 : 0, // 是否是胁迫
|
||||
isAdmin: state.isAdministrator.value == "2" ? 1 : 0,
|
||||
operate: 0,
|
||||
isRound:state.selectType.value == "2" ? 1: 0, // 是否是循环
|
||||
weekRound:DateTool().accordingTheCycleIntoTheCorrespondingNumber(state.weekDay.value), // 周循环
|
||||
startDate: int.parse(state.startDate.value)~/1000,
|
||||
|
||||
@ -96,7 +96,6 @@ class _AddFingerprintTypePageState extends State<AddFingerprintTypePage> with Si
|
||||
TranslationLoader.lanKeys!.pleaseEnter!.tr,
|
||||
state.nameController),
|
||||
keyTimeLimitWidget(),
|
||||
SizedBox(height: 10.h),
|
||||
keyBottomWidget()
|
||||
],
|
||||
),
|
||||
|
||||
@ -3,7 +3,6 @@ import 'dart:async';
|
||||
|
||||
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_addFingerprintWithTimeCycleCoercion.dart';
|
||||
@ -66,7 +65,9 @@ class FingerprintDetailLogic extends BaseGetXController{
|
||||
keyID:state.keyId.value.toString(),
|
||||
userID:await Storage.getUid(),
|
||||
fingerNo:int.parse(state.typeNumber.value),
|
||||
useCountLimit:state.isDeletFingerprint.value == true ? 0 : 0xff,
|
||||
useCountLimit:0xffff,
|
||||
operate:state.isDeletFingerprint.value ? 2 : 1, // 0:注册 1:修改 2:删除 3:删除全部
|
||||
isAdmin:state.isAdministrator.value == true ? 1 : 0,
|
||||
isForce:state.isStressFingerprint.value == true ? 1 : 0, // 是否是胁迫
|
||||
isRound:state.keyType.value == 4 ? 1: 0, // 是否是循环
|
||||
weekRound:DateTool().accordingTheCycleIntoTheCorrespondingNumber(state.weekDay.value), // 周循环
|
||||
@ -116,7 +117,9 @@ class FingerprintDetailLogic extends BaseGetXController{
|
||||
keyID:state.keyId.value.toString(),
|
||||
userID:await Storage.getUid(),
|
||||
fingerNo:int.parse(state.typeNumber.value),
|
||||
useCountLimit:state.isDeletFingerprint.value == true ? 0 : 0xff,
|
||||
useCountLimit:0xffff,
|
||||
operate:state.isDeletFingerprint.value ? 2 : 1, // 0:注册 1:修改 2:删除 3:删除全部
|
||||
isAdmin:state.isAdministrator.value == true ? 1 : 0,
|
||||
isForce:state.isStressFingerprint.value == true ? 1 : 0, // 是否是胁迫
|
||||
isRound:state.keyType.value == 4 ? 1: 0, // 是否是循环
|
||||
weekRound:DateTool().accordingTheCycleIntoTheCorrespondingNumber(state.weekDay.value), // 周循环
|
||||
@ -169,6 +172,7 @@ class FingerprintDetailLogic extends BaseGetXController{
|
||||
startTime: int.parse(state.startDate.value),
|
||||
endTime: int.parse(state.endTime.value),
|
||||
fingerprintType: state.fingerprintItemData.value.fingerprintType!,
|
||||
fingerRight: state.isAdministrator.value ? 1 : 0,
|
||||
);
|
||||
if(entity.errorCode!.codeIsSuccessful){
|
||||
showToast("修改成功".tr, something: (){
|
||||
|
||||
@ -167,8 +167,15 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage> with Rout
|
||||
rightTitle: "",
|
||||
isTipsImg: false,
|
||||
isHaveRightWidget: true,
|
||||
isHaveLine: true,
|
||||
rightWidget: SizedBox(
|
||||
width: 60.w, height: 50.h, child: _isStressFingerprint()))),
|
||||
Obx(() => CommonItem(
|
||||
leftTitel: "是否是管理员".tr,
|
||||
rightTitle: "",
|
||||
isTipsImg: false,
|
||||
isHaveRightWidget: true,
|
||||
rightWidget: SizedBox(width: 60.w, height: 50.h, child: _isAdmin()))),
|
||||
Container(height: 10.h),
|
||||
CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.operatingRecord!.tr,
|
||||
@ -192,6 +199,7 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage> with Rout
|
||||
padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
|
||||
onClick: () {
|
||||
ShowTipView().showIosTipWithContentDialog("确定要删除吗?".tr, () async {
|
||||
state.isDeletFingerprint.value = true;
|
||||
logic.senderAddFingerprint();
|
||||
});
|
||||
}),
|
||||
@ -210,12 +218,28 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage> with Rout
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
state.isStressFingerprint.value = value;
|
||||
logic.editFingerprintsData();
|
||||
state.isDeletFingerprint.value = false;
|
||||
logic.senderAddFingerprint();
|
||||
});
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
// 是否是管理员
|
||||
CupertinoSwitch _isAdmin() {
|
||||
return CupertinoSwitch(
|
||||
activeColor: CupertinoColors.activeBlue,
|
||||
trackColor: CupertinoColors.systemGrey5,
|
||||
thumbColor: CupertinoColors.white,
|
||||
value: state.isAdministrator.value,
|
||||
onChanged: (value) {
|
||||
state.isAdministrator.value = value;
|
||||
state.isDeletFingerprint.value = false;
|
||||
logic.senderAddFingerprint();
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void didChangeDependencies() {
|
||||
// TODO: implement didChangeDependencies
|
||||
|
||||
@ -25,6 +25,7 @@ class FingerprintDetailState{
|
||||
var sureBtnState = 0.obs;// 0普通状态(可用) 1连接中(不可用)
|
||||
var isDeletFingerprint = true.obs;// 是否删除卡
|
||||
final isStressFingerprint = false.obs;
|
||||
var isAdministrator = false.obs;// 是否是管理员
|
||||
|
||||
FingerprintDetailState() {
|
||||
Map map = Get.arguments;
|
||||
@ -43,6 +44,7 @@ class FingerprintDetailState{
|
||||
addTime.value = fingerprintItemData.value.createDate!;
|
||||
isStressFingerprint.value = fingerprintItemData.value.isCoerced! == 2 ? true : false;
|
||||
weekDay.value = fingerprintItemData.value.weekDay!;
|
||||
isAdministrator.value = fingerprintItemData.value.fingerRight! == 1 ? true : false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -77,12 +77,14 @@ class FingerprintItemData {
|
||||
String? senderUsername;
|
||||
List? weekDay;
|
||||
String? validTimeStr;
|
||||
int? fingerRight;
|
||||
|
||||
String? cardName;
|
||||
String? cardNumber;
|
||||
int? cardType;
|
||||
int? cardId;
|
||||
int? cardStatus;
|
||||
int? cardRight;
|
||||
|
||||
int? faceId;
|
||||
String? faceName;
|
||||
@ -123,7 +125,9 @@ class FingerprintItemData {
|
||||
this.cyclicConfig,
|
||||
this.featureData,
|
||||
this.faceRight,
|
||||
this.cardStatus});
|
||||
this.cardStatus,
|
||||
this.cardRight,
|
||||
this.fingerRight});
|
||||
|
||||
FingerprintItemData.fromJson(Map<String, dynamic> json) {
|
||||
fingerprintStatus = json['fingerprintStatus'];
|
||||
@ -155,6 +159,8 @@ class FingerprintItemData {
|
||||
featureData = json['featureData'];
|
||||
faceRight = json['faceRight'];
|
||||
cardStatus = json['cardStatus'];
|
||||
cardRight = json['cardRight'];
|
||||
fingerRight = json['fingerRight'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
@ -188,6 +194,8 @@ class FingerprintItemData {
|
||||
data['featureData'] = featureData;
|
||||
data['faceRight'] = faceRight;
|
||||
data['cardStatus'] = cardStatus;
|
||||
data['cardRight'] = cardRight;
|
||||
data['fingerRight'] = fingerRight;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
@ -28,7 +28,7 @@ class FingerprintListLogic extends BaseGetXController{
|
||||
void _initReplySubscription() {
|
||||
_replySubscription = EventBusManager().eventBus!.on<Reply>().listen((reply) {
|
||||
// 添加指纹开始(此处用作删除指纹)
|
||||
if((reply is SenderAddFingerprintWithTimeCycleCoercionReply) && (state.isDeletFingerprintData == true)) {
|
||||
if((reply is SenderAddFingerprintWithTimeCycleCoercionReply) && (state.ifCurrentScreen.value == true)) {
|
||||
_replyAddFingerprintBegin(reply);
|
||||
}
|
||||
|
||||
@ -50,7 +50,6 @@ class FingerprintListLogic extends BaseGetXController{
|
||||
switch(status){
|
||||
case 0x00:
|
||||
//成功
|
||||
state.isDeletFingerprintData = false;
|
||||
cancelBlueConnetctToastTimer();
|
||||
dismissEasyLoading();
|
||||
deletAllFingerprintsData();
|
||||
@ -63,30 +62,17 @@ class FingerprintListLogic extends BaseGetXController{
|
||||
var signKey = await Storage.getStringList(saveBlueSignKey);
|
||||
List<int> signKeyDataList = changeStringListToIntList(signKey!);
|
||||
|
||||
// var publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||
// List<int> publicKeyDataList = changeStringListToIntList(publicKey!);
|
||||
|
||||
var token = await Storage.getStringList(saveBlueToken);
|
||||
List<int> getTokenList = changeStringListToIntList(token!);
|
||||
|
||||
// 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,
|
||||
// );
|
||||
var token = reply.data.sublist(5, 9);
|
||||
var saveStrList = changeIntListToStringList(token);
|
||||
Storage.setStringList(saveBlueToken, saveStrList);
|
||||
|
||||
IoSenderManage.senderAddFingerprintWithTimeCycleCoercionCommand(
|
||||
keyID:state.deletKeyID,
|
||||
userID:state.deletUserID,
|
||||
userID:(await Storage.getUid())!,
|
||||
fingerNo:state.deletFingerNo,
|
||||
useCountLimit:0,
|
||||
useCountLimit:0xffff,
|
||||
operate: state.isDeletAll == true ? 3 : 2, // 0:注册 1:修改 2:删除 3:删除全部
|
||||
isAdmin:0,
|
||||
isForce:0, // 是否是胁迫
|
||||
isRound:0, // 是否是循环
|
||||
weekRound:0, // 周循环
|
||||
@ -97,7 +83,7 @@ class FingerprintListLogic extends BaseGetXController{
|
||||
needAuthor:1,
|
||||
signKey:signKeyDataList,
|
||||
privateKey:getPrivateKeyList,
|
||||
token: getTokenList,
|
||||
token: token,
|
||||
);
|
||||
break;
|
||||
default:
|
||||
@ -278,9 +264,11 @@ class FingerprintListLogic extends BaseGetXController{
|
||||
|
||||
IoSenderManage.senderAddFingerprintWithTimeCycleCoercionCommand(
|
||||
keyID:state.deletKeyID,
|
||||
userID:state.deletUserID,
|
||||
userID:(await Storage.getUid())!,
|
||||
fingerNo:state.deletFingerNo,
|
||||
useCountLimit:0,
|
||||
useCountLimit:0xffff,
|
||||
operate: state.isDeletAll == true ? 3 : 2, // 0:注册 1:修改 2:删除 3:删除全部
|
||||
isAdmin:0,
|
||||
isForce:0, // 是否是胁迫
|
||||
isRound:0, // 是否是循环
|
||||
weekRound:0, // 周循环
|
||||
@ -293,19 +281,6 @@ 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();
|
||||
@ -356,13 +331,11 @@ class FingerprintListLogic extends BaseGetXController{
|
||||
if(entity.errorCode!.codeIsSuccessful){
|
||||
if(state.isDeletAll == false){
|
||||
showToast("删除成功".tr, something:(){
|
||||
state.isDeletFingerprintData = false;
|
||||
pageNo = 1;
|
||||
getFingerprintsListData();
|
||||
});
|
||||
}else{
|
||||
showToast("重置成功".tr, something:(){
|
||||
state.isDeletFingerprintData = false;
|
||||
pageNo = 1;
|
||||
getFingerprintsListData();
|
||||
});
|
||||
|
||||
@ -69,11 +69,9 @@ class _FingerprintListPageState extends State<FingerprintListPage> with RouteAwa
|
||||
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||
if (isDemoMode == false) {
|
||||
ShowTipView().showIosTipWithContentDialog("重置后,该锁的指纹都将被删除哦,确认要重置吗?".tr, () async {
|
||||
state.isDeletFingerprintData = true;
|
||||
state.isDeletAll = true;
|
||||
state.deletKeyID = "1";
|
||||
state.deletUserID = "DeleteAll!@#";
|
||||
state.deletFingerNo = 255;
|
||||
state.deletFingerNo = 0;
|
||||
logic.senderAddFingerprint();
|
||||
});
|
||||
} else {
|
||||
@ -142,10 +140,9 @@ class _FingerprintListPageState extends State<FingerprintListPage> with RouteAwa
|
||||
SlidableAction(
|
||||
onPressed: (BuildContext context){
|
||||
ShowTipView().showIosTipWithContentDialog("确定要删除吗?".tr, () async {
|
||||
state.isDeletFingerprintData = true;
|
||||
state.isDeletAll = false;
|
||||
state.deletKeyID = fingerprintItemData.fingerprintId.toString();
|
||||
state.deletUserID = (await Storage.getUid())!;
|
||||
state.deletFingerNo = int.parse(fingerprintItemData.faceNumber!);
|
||||
logic.senderAddFingerprint();
|
||||
});
|
||||
},
|
||||
|
||||
@ -8,10 +8,8 @@ class FingerprintListState{
|
||||
final lockId = 0.obs;
|
||||
|
||||
// 因为删除跟添加指纹用的同一个协议 所以这里用做判断
|
||||
var isDeletFingerprintData = false;
|
||||
var isDeletAll = false;
|
||||
var deletKeyID = "";
|
||||
var deletUserID = "DeleteAll!@#";
|
||||
var deletKeyID = "0";
|
||||
var deletFingerNo = 0;
|
||||
|
||||
final fingerprintItemListData = <FingerprintItemData>[].obs;
|
||||
|
||||
@ -144,6 +144,7 @@ class IrisDetailLogic extends BaseGetXController {
|
||||
startTime: int.parse(state.starTime.value),
|
||||
endTime: int.parse(state.endTime.value),
|
||||
cardType: state.keyType.value,
|
||||
cardRight: 0,
|
||||
);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
showToast("修改成功", something: () {
|
||||
|
||||
@ -432,9 +432,12 @@ class LockDetailLogic extends BaseGetXController {
|
||||
AppLog.log("从服务器获取联网token:${state.lockNetToken}");
|
||||
openDoorAction();
|
||||
}else{
|
||||
showToast("", something: (){
|
||||
showToast("网络访问失败,请检查网络是否正常".tr, something: (){
|
||||
state.openLockBtnState.value = 0;
|
||||
state.animationController!.forward();
|
||||
cancelBlueConnetctToastTimer();
|
||||
state.lockNetToken = "0";
|
||||
openDoorAction();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,7 +13,7 @@ class LockDetailState {
|
||||
late StreamSubscription<Reply> replySubscription;
|
||||
StreamSubscription? lockSetOpenOrCloseCheckInRefreshLockDetailWithAttendanceEvent;
|
||||
|
||||
String lockNetToken = "";
|
||||
String lockNetToken = "0";
|
||||
int differentialTime = 0;
|
||||
int lockUserNo = 0;
|
||||
var senderUserId = 0;
|
||||
|
||||
@ -2,7 +2,6 @@ import 'dart:async';
|
||||
|
||||
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
||||
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||
// import 'package:flutter_reactive_ble/flutter_reactive_ble.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecord/keyOperationRecord_entity.dart';
|
||||
|
||||
import '../../../blue/blue_manage.dart';
|
||||
|
||||
@ -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_protocol/io_setSupportFunctionsWithParameters.dart';
|
||||
|
||||
@ -1,15 +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 '../../../../../blue/blue_manage.dart';
|
||||
import '../../../../../blue/io_protocol/io_changeAdministratorPassword.dart';
|
||||
import '../../../../../blue/io_protocol/io_readAdminPassword.dart';
|
||||
import '../../../../../blue/io_protocol/io_senderCustomPasswords.dart';
|
||||
import '../../../../../blue/io_reply.dart';
|
||||
import '../../../../../blue/io_tool/io_tool.dart';
|
||||
import '../../../../../blue/io_tool/manager_event_bus.dart';
|
||||
|
||||
@ -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/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecord/keyOperationRecord_entity.dart';
|
||||
|
||||
@ -3,7 +3,6 @@ import 'dart:async';
|
||||
|
||||
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
||||
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||
// import 'package:flutter_reactive_ble/flutter_reactive_ble.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/blue/io_protocol/io_setSupportFunctionsNoParameters.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
|
||||
@ -2,7 +2,6 @@
|
||||
import 'dart:async';
|
||||
import 'dart:io';
|
||||
|
||||
// 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:network_info_plus/network_info_plus.dart';
|
||||
|
||||
@ -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_protocol/io_getWifiList.dart';
|
||||
|
||||
@ -1,8 +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';
|
||||
|
||||
|
||||
@ -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/talk/udp/udp_manage.dart';
|
||||
|
||||
@ -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/main/lockDetail/lockSet/resetButton/resetButton_state.dart';
|
||||
|
||||
@ -143,6 +143,7 @@ class PalmDetailLogic extends BaseGetXController {
|
||||
startTime: int.parse(state.starTime.value),
|
||||
endTime: int.parse(state.endTime.value),
|
||||
cardType: state.keyType.value,
|
||||
cardRight: 0,
|
||||
);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
showToast("修改成功", something: () {
|
||||
|
||||
@ -25,7 +25,6 @@ class PasswordKeyDetailLogic extends BaseGetXController {
|
||||
void _initReplySubscription() {
|
||||
_replySubscription = EventBusManager().eventBus!.on<Reply>().listen((reply) async {
|
||||
// 设置自定义密码
|
||||
AppLog.log("ifCurrentScreen:${state.ifCurrentScreen.value}");
|
||||
if ((reply is SenderCustomPasswordsReply) && (state.ifCurrentScreen.value == true)) {
|
||||
int status = reply.data[2];
|
||||
switch (status) {
|
||||
@ -56,8 +55,10 @@ class PasswordKeyDetailLogic extends BaseGetXController {
|
||||
keyID:state.itemData.value.keyboardPwdId!.toString(),
|
||||
userID:await Storage.getUid(),
|
||||
pwdNo: state.itemData.value.pwdUserNo!,
|
||||
pwd: state.isDeletPasswordKey.value == true ? "000000" : state.inputPwdController.text,
|
||||
useCountLimit: state.isDeletPasswordKey.value == true ? 0 : 0xff,
|
||||
pwd: state.isDeletPasswordKey.value == true ? "0" : state.inputPwdController.text,
|
||||
useCountLimit: 0xffff,
|
||||
operate: state.isDeletPasswordKey.value == true ? 2 : 1,
|
||||
isAdmin: state.isAdministrator.value == true ? 1 : 0,
|
||||
startTime:state.itemData.value.startDate! ~/ 1000,
|
||||
endTime:state.itemData.value.endDate! ~/ 1000,
|
||||
needAuthor: 1,
|
||||
@ -102,7 +103,8 @@ class PasswordKeyDetailLogic extends BaseGetXController {
|
||||
hoursStart: state.itemData.value.hoursStart!,
|
||||
hoursEnd: state.itemData.value.hoursEnd!,
|
||||
isCoerced: state.itemData.value.isCoerced!.toString(),
|
||||
keyboardPwdType: state.itemData.value.keyboardPwdType!);
|
||||
keyboardPwdType: state.itemData.value.keyboardPwdType!,
|
||||
pwdRight: state.isAdministrator.value == true ? 1 : 0);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
Get.back();
|
||||
showToast("修改成功".tr, something: (){
|
||||
@ -150,12 +152,15 @@ class PasswordKeyDetailLogic extends BaseGetXController {
|
||||
// signKey: signKeyDataList,
|
||||
// privateKey: getPrivateKeyList,
|
||||
// token: getTokenList);
|
||||
|
||||
IoSenderManage.senderCustomPasswordsCommand(
|
||||
keyID:state.itemData.value.keyboardPwdId!.toString(),
|
||||
userID:await Storage.getUid(),
|
||||
pwdNo: state.itemData.value.pwdUserNo!,
|
||||
pwd: state.isDeletPasswordKey.value == true ? "000000" : state.inputPwdController.text,
|
||||
useCountLimit: state.isDeletPasswordKey.value == true ? 0 : 0xff,
|
||||
pwd: state.isDeletPasswordKey.value == true ? "0" : state.inputPwdController.text,
|
||||
useCountLimit: 0xffff,
|
||||
operate: state.isDeletPasswordKey.value == true ? 2 : 1,
|
||||
isAdmin: state.isAdministrator.value == true ? 1 : 0,
|
||||
startTime:state.itemData.value.startDate! ~/ 1000,
|
||||
endTime:state.itemData.value.endDate! ~/ 1000,
|
||||
needAuthor: 1,
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
@ -113,6 +114,20 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage> with Rout
|
||||
rightTitle: getSenderDate(state.itemData.value),
|
||||
action: () {}),
|
||||
Container(height: 10.h),
|
||||
Obx(() => Visibility(
|
||||
visible: state.itemData.value.isCustom! == 1,
|
||||
child: Column(
|
||||
children: [
|
||||
CommonItem(
|
||||
leftTitel: "管理员".tr,
|
||||
rightTitle: "",
|
||||
isTipsImg: false,
|
||||
isHaveRightWidget: true,
|
||||
rightWidget: SizedBox(width: 60.w, height: 50.h, child: _isAdmin())),
|
||||
Container(height: 10.h),
|
||||
],
|
||||
),
|
||||
)),
|
||||
CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.operatingRecord!.tr,
|
||||
rightTitle: "",
|
||||
@ -202,7 +217,6 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage> with Rout
|
||||
onClick: () {
|
||||
ShowTipView().showIosTipWithContentDialog("确定要删除吗?".tr, (){
|
||||
state.isDeletPasswordKey.value = true;
|
||||
state.ifCurrentScreen.value = true;
|
||||
if(state.itemData.value.isCustom! == 1){
|
||||
// 自定义密码
|
||||
logic.senderCustomPasswords();
|
||||
@ -217,6 +231,21 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage> with Rout
|
||||
));
|
||||
}
|
||||
|
||||
// 是否是管理员
|
||||
CupertinoSwitch _isAdmin() {
|
||||
return CupertinoSwitch(
|
||||
activeColor: CupertinoColors.activeBlue,
|
||||
trackColor: CupertinoColors.systemGrey5,
|
||||
thumbColor: CupertinoColors.white,
|
||||
value: state.isAdministrator.value,
|
||||
onChanged: (value) {
|
||||
state.isAdministrator.value = value;
|
||||
state.isDeletPasswordKey.value = false;
|
||||
logic.senderCustomPasswords();
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
//发送时间
|
||||
String getSenderDate(PasswordKeyListItem indexEntity) {
|
||||
String senderDate = '';
|
||||
@ -257,7 +286,6 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage> with Rout
|
||||
logic.updatePwdRequest(1);
|
||||
}else{
|
||||
// 修改密码
|
||||
state.ifCurrentScreen.value = true;
|
||||
logic.senderCustomPasswords();
|
||||
}
|
||||
},
|
||||
|
||||
@ -17,7 +17,8 @@ class PasswordKeyDetailState {
|
||||
var ifCurrentScreen = true.obs; // 是否是当前界面,用于判断是否需要针对当前界面进行展示
|
||||
var sureBtnState = 0.obs;// 0普通状态(可用) 1连接中(不可用)
|
||||
final passwordKeyNumber = "".obs;// 密码号
|
||||
var isDeletPasswordKey = true.obs;// 是否删除卡
|
||||
var isDeletPasswordKey = true.obs;// 是否删除密码
|
||||
var isAdministrator = false.obs;// 是否是管理员
|
||||
|
||||
PasswordKeyDetailState() {
|
||||
Map map = Get.arguments;
|
||||
@ -29,7 +30,7 @@ class PasswordKeyDetailState {
|
||||
inputPwdController.text = itemData.value.keyboardPwd!;
|
||||
keyId.value = itemData.value.keyboardPwdId!;
|
||||
keyboardUserNo.value = itemData.value.pwdUserNo!;
|
||||
|
||||
isAdministrator.value = itemData.value.pwdRight! == 1 ? true : false;
|
||||
// startDate.value = itemData.value.startDate!;
|
||||
// endDate.value = itemData.value.endDate!;
|
||||
// hoursStart.value = itemData.value.hoursStart!;
|
||||
|
||||
@ -51,7 +51,9 @@ class PasswordKeyDetailChangeDateLogic extends BaseGetXController {
|
||||
userID:await Storage.getUid(),
|
||||
pwdNo: state.itemData.value.pwdUserNo!,
|
||||
pwd: state.itemData.value.keyboardPwd!.toString(),
|
||||
useCountLimit: 0xff,
|
||||
operate: 1,
|
||||
isAdmin: 0,
|
||||
useCountLimit: 0xffff,
|
||||
startTime:state.itemData.value.startDate! ~/ 1000,
|
||||
endTime:state.itemData.value.endDate! ~/ 1000,
|
||||
needAuthor: 1,
|
||||
@ -95,7 +97,8 @@ class PasswordKeyDetailChangeDateLogic extends BaseGetXController {
|
||||
hoursStart: state.itemData.value.hoursStart!,
|
||||
hoursEnd: state.itemData.value.hoursEnd!,
|
||||
isCoerced: "1",
|
||||
keyboardPwdType: 3);
|
||||
keyboardPwdType: 3,
|
||||
pwdRight: state.itemData.value.pwdRight!);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
showToast("修改成功", something: (){
|
||||
eventBus.fire(GetPasswordListRefreshUI());
|
||||
@ -131,7 +134,9 @@ class PasswordKeyDetailChangeDateLogic extends BaseGetXController {
|
||||
userID:await Storage.getUid(),
|
||||
pwdNo: state.itemData.value.pwdUserNo!,
|
||||
pwd: state.itemData.value.keyboardPwd!.toString(),
|
||||
useCountLimit: 0xff,
|
||||
operate: 1,
|
||||
isAdmin: state.itemData.value.pwdUserNo!,
|
||||
useCountLimit: 0xffff,
|
||||
startTime:state.itemData.value.startDate! ~/ 1000,
|
||||
endTime:state.itemData.value.endDate! ~/ 1000,
|
||||
needAuthor: 1,
|
||||
|
||||
@ -83,6 +83,7 @@ class PasswordKeyListItem {
|
||||
int? hoursStart;
|
||||
int? hoursEnd;
|
||||
int? pwdUserNo;
|
||||
int? pwdRight;
|
||||
|
||||
PasswordKeyListItem(
|
||||
{this.apiUserId,
|
||||
@ -102,7 +103,8 @@ class PasswordKeyListItem {
|
||||
this.isCoerced,
|
||||
this.hoursStart,
|
||||
this.hoursEnd,
|
||||
this.pwdUserNo});
|
||||
this.pwdUserNo,
|
||||
this.pwdRight});
|
||||
|
||||
PasswordKeyListItem.fromJson(Map<String, dynamic> json) {
|
||||
apiUserId = json['apiUserId'];
|
||||
@ -123,6 +125,7 @@ class PasswordKeyListItem {
|
||||
hoursStart = json['hoursStart'];
|
||||
hoursEnd = json['hoursEnd'];
|
||||
pwdUserNo = json['pwdUserNo'];
|
||||
pwdRight = json['pwdRight'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
@ -145,6 +148,7 @@ class PasswordKeyListItem {
|
||||
data['hoursStart'] = hoursStart;
|
||||
data['hoursEnd'] = hoursEnd;
|
||||
data['pwdUserNo'] = pwdUserNo;
|
||||
data['pwdRight'] = pwdRight;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,8 +2,6 @@ import 'dart:async';
|
||||
|
||||
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/app_settings/app_settings.dart';
|
||||
import 'package:star_lock/blue/io_type.dart';
|
||||
import 'package:star_lock/main/lockDetail/passwordKey/passwordKeyList/passwordKeyListEntity.dart';
|
||||
import 'package:star_lock/main/lockDetail/passwordKey/passwordKeyList/passwordKeyList_state.dart';
|
||||
import 'package:star_lock/network/api_repository.dart';
|
||||
@ -41,7 +39,6 @@ class PasswordKeyListLogic extends BaseGetXController {
|
||||
switch(status){
|
||||
case 0x00:
|
||||
//成功
|
||||
state.isDeletPWDData = false;
|
||||
cancelBlueConnetctToastTimer();
|
||||
if(state.isDeletAll){
|
||||
resetPasswordKeyListRequest();
|
||||
@ -66,10 +63,12 @@ class PasswordKeyListLogic extends BaseGetXController {
|
||||
|
||||
IoSenderManage.senderCustomPasswordsCommand(
|
||||
keyID:state.deletKeyID,
|
||||
userID:state.deletUserID,
|
||||
userID:(await Storage.getUid())!,
|
||||
pwdNo:state.pwdNo,
|
||||
pwd:"000000",//state.deletPWD,
|
||||
useCountLimit: 0,
|
||||
pwd:"0",//state.deletPWD,
|
||||
operate: state.isDeletAll ? 3 : 2,
|
||||
isAdmin: 0,
|
||||
useCountLimit: 0xffff,
|
||||
startTime:0x11223344,
|
||||
endTime:0x11223344,
|
||||
needAuthor: 1,
|
||||
@ -155,10 +154,12 @@ class PasswordKeyListLogic extends BaseGetXController {
|
||||
|
||||
IoSenderManage.senderCustomPasswordsCommand(
|
||||
keyID:state.deletKeyID,
|
||||
userID:state.deletUserID,
|
||||
userID:(await Storage.getUid())!,
|
||||
pwdNo:state.pwdNo,
|
||||
pwd:"000000",//state.deletPWD,
|
||||
useCountLimit: 0,
|
||||
pwd:"0",//state.deletPWD,
|
||||
operate: state.isDeletAll ? 3 : 2,
|
||||
isAdmin: 0,
|
||||
useCountLimit: 0xffff,
|
||||
startTime:0x11223344,
|
||||
endTime:0x11223344,
|
||||
needAuthor: 1,
|
||||
|
||||
@ -62,12 +62,11 @@ class _PasswordKeyListPageState extends State<PasswordKeyListPage> with RouteAwa
|
||||
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||
if (isDemoMode == false) {
|
||||
ShowTipView().showIosTipWithContentDialog('该锁的密码都将被删除'.tr, () {
|
||||
state.isDeletPWDData = true;
|
||||
state.isDeletAll = true;
|
||||
state.deletKeyID = "0";
|
||||
state.deletUserID = "DeleteAll!@#";
|
||||
state.deletUserID = "0";
|
||||
// state.deletPWD = "";
|
||||
state.pwdNo = 255;
|
||||
state.pwdNo = 0;
|
||||
|
||||
logic.senderCustomPasswords();
|
||||
});
|
||||
|
||||
@ -14,7 +14,6 @@ class PasswordKeyListState {
|
||||
var sureBtnState = 0.obs;// 0普通状态(可用) 1连接中(不可用)
|
||||
|
||||
// 因为删除跟添加指纹用的同一个协议 所以这里用做判断
|
||||
var isDeletPWDData = false;
|
||||
var isDeletAll = false;
|
||||
var deletKeyID = "";
|
||||
var deletUserID = "DeleteAll!@#";
|
||||
|
||||
@ -4,6 +4,7 @@ import 'dart:async';
|
||||
|
||||
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/app_settings/app_settings.dart';
|
||||
import 'package:star_lock/main/lockDetail/passwordKey/passwordKey_perpetual/passwordKey_perpetual_state.dart';
|
||||
import 'package:star_lock/network/api_repository.dart';
|
||||
import 'package:star_lock/tools/eventBusEventManage.dart';
|
||||
@ -153,7 +154,8 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
|
||||
keyboardPwdType:getKeyType,
|
||||
startDate:getEffectiveDateTime,
|
||||
endDate:getFailureDateTime,
|
||||
addType:'1');
|
||||
addType:'1',
|
||||
pwdRight:state.isAdministrator.value == true ? 1 : 0,);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
state.isSendSuccess.value = true;
|
||||
state.sendSucceedType.value = state.widgetType.value;
|
||||
@ -205,23 +207,26 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
|
||||
void _initReplySubscription() {
|
||||
_replySubscription = EventBusManager().eventBus!.on<Reply>().listen((reply) async {
|
||||
// 设置自定义密码
|
||||
if (reply is SenderCustomPasswordsReply) {
|
||||
var token = reply.data.sublist(5, 9);
|
||||
var saveStrList = changeIntListToStringList(token);
|
||||
Storage.setStringList(saveBlueToken, saveStrList);
|
||||
|
||||
if ((reply is SenderCustomPasswordsReply) && (state.ifCurrentScreen.value == true)) {
|
||||
int status = reply.data[2];
|
||||
switch (status) {
|
||||
case 0x00:
|
||||
//成功
|
||||
state.sureBtnState.value = 0;
|
||||
state.pwdNumber.value = (reply.data[9]);
|
||||
state.pwdNumber.value = listChangInt(reply.data.sublist(9, 11));
|
||||
// AppLog.log("密码编号:${state.pwdNumber.value}");
|
||||
|
||||
dismissEasyLoading();
|
||||
cancelBlueConnetctToastTimer();
|
||||
addKeyboardPwdRequest();
|
||||
break;
|
||||
case 0x06:
|
||||
//无权限
|
||||
var token = reply.data.sublist(5, 9);
|
||||
// AppLog.log("token:$token");
|
||||
var saveStrList = changeIntListToStringList(token);
|
||||
Storage.setStringList(saveBlueToken, saveStrList);
|
||||
|
||||
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
|
||||
@ -231,9 +236,11 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
|
||||
IoSenderManage.senderCustomPasswordsCommand(
|
||||
keyID: "1",
|
||||
userID: await Storage.getUid(),
|
||||
pwdNo: state.isAdministrator.value == true ? 254 : 0,
|
||||
pwdNo: 0,
|
||||
pwd:state.pwdController.text,
|
||||
useCountLimit: 0xff,
|
||||
operate: 0,
|
||||
isAdmin: state.isAdministrator.value == true ? 1 : 0,
|
||||
useCountLimit: 0xffff,
|
||||
startTime: DateTool().dateToTimestamp(state.customBeginTime.value, 1)~/1000,
|
||||
endTime: DateTool().dateToTimestamp(state.customEndTime.value, 1)~/1000,
|
||||
needAuthor: 1,
|
||||
@ -312,11 +319,13 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
|
||||
IoSenderManage.senderCustomPasswordsCommand(
|
||||
keyID: "1",
|
||||
userID: await Storage.getUid(),
|
||||
pwdNo: state.isAdministrator.value == true ? 254 : 0,
|
||||
pwd: state.pwdController.text,
|
||||
useCountLimit: 0xff,
|
||||
startTime:state.isPermanent.value == false ? startDate ~/ 1000 : 0,
|
||||
endTime: state.isPermanent.value == false ? endDate ~/ 1000 : 0,
|
||||
pwdNo: 0,
|
||||
pwd:state.pwdController.text,
|
||||
operate: 0,
|
||||
isAdmin: state.isAdministrator.value == true ? 1 : 0,
|
||||
useCountLimit: 0xffff,
|
||||
startTime: DateTool().dateToTimestamp(state.customBeginTime.value, 1)~/1000,
|
||||
endTime: DateTool().dateToTimestamp(state.customEndTime.value, 1)~/1000,
|
||||
needAuthor: 1,
|
||||
isBeforeAddUser: false,
|
||||
signKey: signKeyDataList,
|
||||
|
||||
@ -5,6 +5,7 @@ import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/app_settings/app_colors.dart';
|
||||
import 'package:star_lock/app_settings/app_settings.dart';
|
||||
import 'package:star_lock/main/lockDetail/passwordKey/passwordKey_perpetual/passwordKey_perpetual_logic.dart';
|
||||
import 'package:star_lock/tools/commonDataManage.dart';
|
||||
import 'package:star_lock/tools/pickers/pickers.dart';
|
||||
@ -637,6 +638,7 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage>
|
||||
value: state.isAdministrator.value,
|
||||
onChanged: (value) {
|
||||
state.isAdministrator.value = value;
|
||||
AppLog.log("isAdministrator:${state.isAdministrator.value}");
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@ -1,7 +1,4 @@
|
||||
|
||||
import 'dart:typed_data';
|
||||
|
||||
// import 'package:flutter_reactive_ble/flutter_reactive_ble.dart';
|
||||
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
|
||||
@ -119,9 +119,11 @@ class SaveLockLogic extends BaseGetXController {
|
||||
IoSenderManage.senderCustomPasswordsCommand(
|
||||
keyID: "1",
|
||||
userID: await Storage.getUid(),
|
||||
pwdNo: 254,
|
||||
pwdNo: 0,
|
||||
pwd: state.adminPasswordTF.text,
|
||||
useCountLimit: 0xff,
|
||||
operate: 0,
|
||||
isAdmin: 1,
|
||||
useCountLimit: 0xffff,
|
||||
startTime: 0x11223344,
|
||||
endTime: 0x11223344,
|
||||
needAuthor: 1,
|
||||
@ -256,9 +258,11 @@ class SaveLockLogic extends BaseGetXController {
|
||||
IoSenderManage.senderCustomPasswordsCommand(
|
||||
keyID: "1",
|
||||
userID: await Storage.getUid(),
|
||||
pwdNo: 254,
|
||||
pwd:state.adminPasswordTF.text,
|
||||
useCountLimit: 0xff,
|
||||
pwdNo: 0,
|
||||
pwd: state.adminPasswordTF.text,
|
||||
operate: 0,
|
||||
isAdmin: 1,
|
||||
useCountLimit: 0xffff,
|
||||
startTime: 0x11223344,
|
||||
endTime: 0x11223344,
|
||||
needAuthor: 1,
|
||||
|
||||
@ -61,7 +61,9 @@ class ExpireCardLogic extends BaseGetXController {
|
||||
keyID:"1",
|
||||
userID:await Storage.getUid(),
|
||||
cardNo:state.deletExpireCardItemEntity.cardUserNo!,
|
||||
useCountLimit:0xff,
|
||||
useCountLimit:0xffff,
|
||||
operate: 2, // 0:注册 1:修改 2:删除 3:删除全部
|
||||
isAdmin:0,
|
||||
isForce:0, // 是否是胁迫
|
||||
isRound:0, // 是否是循环
|
||||
weekRound:0, // 周循环
|
||||
@ -110,7 +112,9 @@ class ExpireCardLogic extends BaseGetXController {
|
||||
keyID:"1",
|
||||
userID:await Storage.getUid(),
|
||||
cardNo:state.deletExpireCardItemEntity.cardUserNo!,
|
||||
useCountLimit:0xff,
|
||||
useCountLimit:0xffff,
|
||||
operate: 2, // 0:注册 1:修改 2:删除 3:删除全部
|
||||
isAdmin:0,
|
||||
isForce:0, // 是否是胁迫
|
||||
isRound:0, // 是否是循环
|
||||
weekRound:0, // 周循环
|
||||
|
||||
@ -74,6 +74,8 @@ class ExpireFingerprintLogic extends BaseGetXController {
|
||||
signKey:signKeyDataList,
|
||||
privateKey:getPrivateKeyList,
|
||||
token: getTokenList,
|
||||
isAdmin: 0,
|
||||
operate: 0,
|
||||
);
|
||||
break;
|
||||
default:
|
||||
@ -107,8 +109,6 @@ class ExpireFingerprintLogic extends BaseGetXController {
|
||||
var token = await Storage.getStringList(saveBlueToken);
|
||||
List<int> getTokenList = changeStringListToIntList(token!);
|
||||
|
||||
String? userID = await Storage.getUid();
|
||||
|
||||
IoSenderManage.senderAddFingerprintWithTimeCycleCoercionCommand(
|
||||
keyID:state.deletExpireFingerprintItemEntity.fingerprintId.toString(),
|
||||
userID:await Storage.getUid(),
|
||||
@ -125,6 +125,8 @@ class ExpireFingerprintLogic extends BaseGetXController {
|
||||
signKey:signKeyDataList,
|
||||
privateKey:getPrivateKeyList,
|
||||
token: getTokenList,
|
||||
isAdmin: 0,
|
||||
operate: 0,
|
||||
);
|
||||
|
||||
// IoSenderManage.senderAddFingerprintCommand(
|
||||
|
||||
@ -452,6 +452,7 @@ class ApiProvider extends BaseProvider {
|
||||
String startDate,
|
||||
String endDate,
|
||||
String addType,
|
||||
int? pwdRight,
|
||||
) =>
|
||||
post(
|
||||
passwordKeyAddURL.toUrl,
|
||||
@ -463,6 +464,7 @@ class ApiProvider extends BaseProvider {
|
||||
'startDate': startDate,
|
||||
'endDate': endDate,
|
||||
'addType': addType,
|
||||
'pwdRight': pwdRight
|
||||
}));
|
||||
|
||||
// 自定义密码校验名字密码是否重复
|
||||
@ -487,7 +489,8 @@ class ApiProvider extends BaseProvider {
|
||||
String isCoerced,
|
||||
int hoursStart,
|
||||
int hoursEnd,
|
||||
int keyboardPwdType) =>
|
||||
int keyboardPwdType,
|
||||
int pwdRight) =>
|
||||
post(
|
||||
updatePasswordKeyURL.toUrl,
|
||||
jsonEncode({
|
||||
@ -501,7 +504,8 @@ class ApiProvider extends BaseProvider {
|
||||
'isCoerced': isCoerced,
|
||||
'hoursStart': hoursStart,
|
||||
'hoursEnd': hoursEnd,
|
||||
"keyboardPwdType": keyboardPwdType
|
||||
"keyboardPwdType": keyboardPwdType,
|
||||
"pwdRight": pwdRight
|
||||
}));
|
||||
|
||||
Future<Response> clearOperationRecord(String lockId) =>
|
||||
@ -1122,7 +1126,8 @@ class ApiProvider extends BaseProvider {
|
||||
String changeType,
|
||||
int startTime,
|
||||
int endTime,
|
||||
int fingerprintType) =>
|
||||
int fingerprintType,
|
||||
int fingerRight) =>
|
||||
post(
|
||||
editFingerprintURL.toUrl,
|
||||
jsonEncode({
|
||||
@ -1137,6 +1142,7 @@ class ApiProvider extends BaseProvider {
|
||||
'startTime': startTime,
|
||||
'endTime': endTime,
|
||||
'fingerprintType': fingerprintType,
|
||||
'fingerRight': fingerRight
|
||||
}));
|
||||
|
||||
// 删除指纹
|
||||
@ -1241,7 +1247,8 @@ class ApiProvider extends BaseProvider {
|
||||
List weekDay,
|
||||
String faceName,
|
||||
String addType,
|
||||
int isCoerced) =>
|
||||
int isCoerced,
|
||||
int faceRight) =>
|
||||
post(
|
||||
updateFaceUserInfoURL.toUrl,
|
||||
jsonEncode({
|
||||
@ -1256,6 +1263,7 @@ class ApiProvider extends BaseProvider {
|
||||
'faceName': faceName,
|
||||
'addType': addType,
|
||||
"isCoerced": isCoerced,
|
||||
"faceRight": faceRight
|
||||
}));
|
||||
|
||||
// 删除人脸
|
||||
@ -1333,6 +1341,7 @@ class ApiProvider extends BaseProvider {
|
||||
int startTime,
|
||||
int endTime,
|
||||
int cardType,
|
||||
int cardRight,
|
||||
) =>
|
||||
post(
|
||||
editICCardURL.toUrl,
|
||||
@ -1347,7 +1356,8 @@ class ApiProvider extends BaseProvider {
|
||||
'changeType': changeType,
|
||||
'startTime': startTime,
|
||||
'endTime': endTime,
|
||||
'cardType': cardType
|
||||
'cardType': cardType,
|
||||
'cardRight': cardRight
|
||||
}));
|
||||
|
||||
// 删除卡
|
||||
|
||||
@ -471,9 +471,10 @@ class ApiRepository {
|
||||
required String startDate,
|
||||
required String endDate,
|
||||
required String addType,
|
||||
required int pwdRight,
|
||||
}) async {
|
||||
final res = await apiProvider.addKeyboardPwd(lockId, keyboardPwdName,
|
||||
keyboardPwd, keyboardPwdType, startDate, endDate, addType);
|
||||
keyboardPwd, keyboardPwdType, startDate, endDate, addType, pwdRight);
|
||||
return PasswordKeyEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
@ -499,7 +500,8 @@ class ApiRepository {
|
||||
required String isCoerced,
|
||||
required int hoursStart,
|
||||
required int hoursEnd,
|
||||
required int keyboardPwdType}) async {
|
||||
required int keyboardPwdType,
|
||||
required int pwdRight}) async {
|
||||
final res = await apiProvider.updateKeyboardPwd(
|
||||
lockId,
|
||||
keyboardPwdId,
|
||||
@ -511,7 +513,8 @@ class ApiRepository {
|
||||
isCoerced,
|
||||
hoursStart,
|
||||
hoursEnd,
|
||||
keyboardPwdType);
|
||||
keyboardPwdType,
|
||||
pwdRight);
|
||||
return PasswordKeyEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
@ -1293,7 +1296,8 @@ class ApiRepository {
|
||||
required String changeType,
|
||||
required int startTime,
|
||||
required int endTime,
|
||||
required int fingerprintType}) async {
|
||||
required int fingerprintType,
|
||||
required int fingerRight}) async {
|
||||
final res = await apiProvider.editFingerprintsData(
|
||||
fingerprintId,
|
||||
lockId,
|
||||
@ -1305,7 +1309,8 @@ class ApiRepository {
|
||||
changeType,
|
||||
startTime,
|
||||
endTime,
|
||||
fingerprintType);
|
||||
fingerprintType,
|
||||
fingerRight);
|
||||
return LoginEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
@ -1404,7 +1409,8 @@ class ApiRepository {
|
||||
required List weekDay,
|
||||
required String faceName,
|
||||
required String addType,
|
||||
required int isCoerced}) async {
|
||||
required int isCoerced,
|
||||
required int faceRight}) async {
|
||||
final res = await apiProvider.updateFaceValidity(
|
||||
faceId,
|
||||
lockId,
|
||||
@ -1416,7 +1422,8 @@ class ApiRepository {
|
||||
weekDay,
|
||||
faceName,
|
||||
addType,
|
||||
isCoerced);
|
||||
isCoerced,
|
||||
faceRight);
|
||||
return LoginEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
@ -1499,6 +1506,7 @@ class ApiRepository {
|
||||
required int startTime,
|
||||
required int endTime,
|
||||
required int cardType,
|
||||
required int cardRight,
|
||||
}) async {
|
||||
final res = await apiProvider.editICCardData(
|
||||
lockId,
|
||||
@ -1511,7 +1519,8 @@ class ApiRepository {
|
||||
changeType,
|
||||
startTime,
|
||||
endTime,
|
||||
cardType);
|
||||
cardType,
|
||||
cardRight);
|
||||
return LoginEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
|
||||
@ -1,5 +1,3 @@
|
||||
import 'package:extended_text_field/extended_text_field.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user