修复添加指纹bug,删除多余引入,人脸模块添加是否是管理员功能,number改为2字节
This commit is contained in:
parent
24fac59ac4
commit
c559a37197
@ -1,6 +1,7 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/tools/dateTool.dart';
|
||||
|
||||
import '../../app_settings/app_settings.dart';
|
||||
import '../io_tool/io_tool.dart';
|
||||
@ -21,6 +22,8 @@ class SenderAddFaceCommand extends SenderProtocol {
|
||||
int? faceNo;
|
||||
int? useCountLimit;
|
||||
int? isForce;
|
||||
int? operate;
|
||||
int? isAdmin;
|
||||
List<int>? token;
|
||||
int? isRound;
|
||||
int? weekRound;
|
||||
@ -37,6 +40,8 @@ class SenderAddFaceCommand extends SenderProtocol {
|
||||
this.userID,
|
||||
this.faceNo,
|
||||
this.useCountLimit,
|
||||
this.operate,
|
||||
this.isAdmin,
|
||||
this.isForce,
|
||||
this.token,
|
||||
this.isRound,
|
||||
@ -85,6 +90,14 @@ class SenderAddFaceCommand extends SenderProtocol {
|
||||
// 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!);
|
||||
|
||||
@ -108,6 +121,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];
|
||||
|
||||
@ -496,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,
|
||||
@ -514,6 +516,8 @@ class IoSenderManage {
|
||||
faceNo: faceNo,
|
||||
useCountLimit: useCountLimit,
|
||||
isForce: isForce,
|
||||
operate: operate,
|
||||
isAdmin: isAdmin,
|
||||
token: token,
|
||||
isRound: isRound,
|
||||
weekRound: weekRound,
|
||||
|
||||
@ -139,7 +139,6 @@ class _CardListPageState extends State<CardListPage> with RouteAware {
|
||||
state.isDeletAll = false;
|
||||
state.deletKeyID = fingerprintItemData.cardId.toString();
|
||||
state.deletCardNo = int.parse(fingerprintItemData.cardNumber!);
|
||||
state.fingerprintDeletItem = fingerprintItemData;
|
||||
logic.senderAddICCard();
|
||||
});
|
||||
},
|
||||
|
||||
@ -12,7 +12,7 @@ class CardListState {
|
||||
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!), // 周循环
|
||||
@ -419,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), // 周循环
|
||||
@ -174,7 +178,7 @@ class OtherTypeKeyChangeValidityDateLogic extends BaseGetXController{
|
||||
cardNo:int.parse(state.fingerprintItemData.value.cardNumber!),
|
||||
useCountLimit:0xffff,
|
||||
operate: 1, // 0:注册 1:修改 2:删除 3:删除全部
|
||||
isAdmin:state.fingerprintItemData.value.isCoerced!,
|
||||
isAdmin:state.fingerprintItemData.value.cardRight!,
|
||||
isForce:state.fingerprintItemData.value.isCoerced, // 是否是胁迫
|
||||
isRound:1, // 是否是循环
|
||||
weekRound:DateTool().accordingTheCycleIntoTheCorrespondingNumber(state.weekDay.value), // 周循环
|
||||
@ -329,7 +333,7 @@ class OtherTypeKeyChangeValidityDateLogic extends BaseGetXController{
|
||||
cardNo:int.parse(state.fingerprintItemData.value.cardNumber!),
|
||||
useCountLimit:0xffff,
|
||||
operate: 1, // 0:注册 1:修改 2:删除 3:删除全部
|
||||
isAdmin:state.fingerprintItemData.value.isCoerced!,
|
||||
isAdmin:state.fingerprintItemData.value.cardRight!,
|
||||
isForce:state.fingerprintItemData.value.isCoerced, // 是否是胁迫
|
||||
isRound:1, // 是否是循环
|
||||
weekRound:DateTool().accordingTheCycleIntoTheCorrespondingNumber(state.weekDay.value), // 周循环
|
||||
@ -397,7 +401,7 @@ class OtherTypeKeyChangeValidityDateLogic extends BaseGetXController{
|
||||
startTime: state.starTimeTimestamp.value,
|
||||
endTime: state.endTimeTimestamp.value,
|
||||
cardType: state.fingerprintItemData.value.cardType!,
|
||||
cardRight: state.fingerprintItemData.value.cardRight!
|
||||
cardRight: state.fingerprintItemData.value.cardRight!,
|
||||
);
|
||||
if(entity.errorCode!.codeIsSuccessful){
|
||||
showToast("修改成功".tr, something: (){
|
||||
@ -427,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: () {
|
||||
|
||||
@ -67,9 +67,11 @@ 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:DateTool().accordingTheCycleIntoTheCorrespondingNumber(state.weekDay.value), // 周循环
|
||||
startDate: int.parse(state.startDate.value)~/1000,
|
||||
@ -164,9 +166,11 @@ 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:DateTool().accordingTheCycleIntoTheCorrespondingNumber(state.weekDay.value), // 周循环
|
||||
startDate: int.parse(state.startDate.value)~/1000,
|
||||
|
||||
@ -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';
|
||||
|
||||
@ -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();
|
||||
@ -332,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,10 +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.deletFingerNo = 255;
|
||||
state.deletFingerNo = 0;
|
||||
logic.senderAddFingerprint();
|
||||
});
|
||||
} else {
|
||||
@ -141,9 +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.deletFingerNo = int.parse(fingerprintItemData.faceNumber!);
|
||||
logic.senderAddFingerprint();
|
||||
});
|
||||
},
|
||||
|
||||
@ -8,7 +8,6 @@ class FingerprintListState{
|
||||
final lockId = 0.obs;
|
||||
|
||||
// 因为删除跟添加指纹用的同一个协议 所以这里用做判断
|
||||
var isDeletFingerprintData = false;
|
||||
var isDeletAll = false;
|
||||
var deletKeyID = "0";
|
||||
var deletFingerNo = 0;
|
||||
|
||||
@ -586,15 +586,6 @@ class LockDetailLogic extends BaseGetXController {
|
||||
|
||||
await PermissionDialog.request(Permission.location);
|
||||
await PermissionDialog.requestBluetooth();
|
||||
|
||||
var vendorStr = utf8String([84, 77, 72, 95, 100, 99, 56, 102, 57, 50,
|
||||
56, 51, 54, 57, 101, 100, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ]);
|
||||
AppLog.log("LockID :$vendorStr");
|
||||
|
||||
var userID = utf8String([51, 50, 57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
|
||||
AppLog.log("userID :$userID");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -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';
|
||||
|
||||
@ -103,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: (){
|
||||
|
||||
@ -97,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());
|
||||
|
||||
@ -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';
|
||||
|
||||
|
||||
@ -489,7 +489,8 @@ class ApiProvider extends BaseProvider {
|
||||
String isCoerced,
|
||||
int hoursStart,
|
||||
int hoursEnd,
|
||||
int keyboardPwdType) =>
|
||||
int keyboardPwdType,
|
||||
int pwdRight) =>
|
||||
post(
|
||||
updatePasswordKeyURL.toUrl,
|
||||
jsonEncode({
|
||||
@ -503,7 +504,8 @@ class ApiProvider extends BaseProvider {
|
||||
'isCoerced': isCoerced,
|
||||
'hoursStart': hoursStart,
|
||||
'hoursEnd': hoursEnd,
|
||||
"keyboardPwdType": keyboardPwdType
|
||||
"keyboardPwdType": keyboardPwdType,
|
||||
"pwdRight": pwdRight
|
||||
}));
|
||||
|
||||
Future<Response> clearOperationRecord(String lockId) =>
|
||||
@ -1245,7 +1247,8 @@ class ApiProvider extends BaseProvider {
|
||||
List weekDay,
|
||||
String faceName,
|
||||
String addType,
|
||||
int isCoerced) =>
|
||||
int isCoerced,
|
||||
int faceRight) =>
|
||||
post(
|
||||
updateFaceUserInfoURL.toUrl,
|
||||
jsonEncode({
|
||||
@ -1260,6 +1263,7 @@ class ApiProvider extends BaseProvider {
|
||||
'faceName': faceName,
|
||||
'addType': addType,
|
||||
"isCoerced": isCoerced,
|
||||
"faceRight": faceRight
|
||||
}));
|
||||
|
||||
// 删除人脸
|
||||
|
||||
@ -503,7 +503,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,
|
||||
@ -515,7 +516,8 @@ class ApiRepository {
|
||||
isCoerced,
|
||||
hoursStart,
|
||||
hoursEnd,
|
||||
keyboardPwdType);
|
||||
keyboardPwdType,
|
||||
pwdRight);
|
||||
return PasswordKeyEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
@ -1410,7 +1412,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,
|
||||
@ -1422,7 +1425,8 @@ class ApiRepository {
|
||||
weekDay,
|
||||
faceName,
|
||||
addType,
|
||||
isCoerced);
|
||||
isCoerced,
|
||||
faceRight);
|
||||
return LoginEntity.fromJson(res.body);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user