Merge branch 'master' of gitee.com:starlock-cn/app-starlock
This commit is contained in:
commit
3e30697605
@ -615,21 +615,34 @@
|
||||
"还未获取到位置信息哦,请耐心等待一下!": "The location information has not been obtained yet, please wait patiently!",
|
||||
"请填写信息": "Please fill in the information",
|
||||
|
||||
"有效期": "Validity period",
|
||||
"生效时间": "Effective time",
|
||||
"失效时间": "Expiration time",
|
||||
"上传成功": "Upload success",
|
||||
"未生效": "Not effective",
|
||||
"已生效": "Effective",
|
||||
"指纹详情": "Fingerprint details",
|
||||
"添加过程中,请根据提示,在指纹采集器上进行多次的抬起按压": "During the addition process, please follow the prompts and lift and press multiple times on the fingerprint collector",
|
||||
"开始添加": "Start adding",
|
||||
"请将您的手指按下": "Please press your finger",
|
||||
"根据提示,抬起手指后再进行下一次指纹采集": "According to the prompt, lift your finger and then collect the fingerprint again",
|
||||
"添加成功": "Add success",
|
||||
"搜索": "Search",
|
||||
|
||||
"permission_dialog_camera": "camera",
|
||||
"permission_dialog_photos": "photos",
|
||||
"permission_dialog_storage": "storage",
|
||||
"permission_dialog_location": "location",
|
||||
"permission_dialog_camera_text": "Access to the camera is required to take photos and upload files, such as uploading a profile picture",
|
||||
"permission_dialog_photos_text": "Access to camera is required to upload files and avatars using album images",
|
||||
"permission_dialog_storage_text": "Access to read and write permissions is required to upload avatars using local images",
|
||||
"permission_dialog_location_text": "Access to location information is required to use the add key function",
|
||||
"permission_dialog_application": "application",
|
||||
"permission_dialog_authority": "permission",
|
||||
"permission_dialog_not_allowed": "Not Allowed",
|
||||
"permission_dialog_allowed": "Allowed",
|
||||
"permission_dialog_permission_denied": "Permission denied",
|
||||
"permission_dialog_open_permissions": "Please manually enable it in the system settings",
|
||||
"permission_dialog_permission_continue_text": "Permission to continue using the application.",
|
||||
"permission_dialog_go_set_up": "Go set it up"
|
||||
"相机": "camera",
|
||||
"相册": "photos",
|
||||
"读写": "storage",
|
||||
"定位": "location",
|
||||
"需要访问相机权限才能拍照上传文件例如头像上传": "Access to the camera is required to take photos and upload files, such as uploading a profile picture",
|
||||
"需要访问相机权限才能使用相册图片上传文件上传头像": "Access to camera is required to upload files and avatars using album images",
|
||||
"需要访问读写权限才能使用本地图片上传头像": "Access to read and write permissions is required to upload avatars using local images",
|
||||
"需要访问定位权限才能使用添加钥匙功能的位置信息": "Access to location information is required to use the add key function",
|
||||
"申请": "application",
|
||||
"权限": "permission",
|
||||
"不允许": "Not Allowed",
|
||||
"允许": "Allowed",
|
||||
"权限被拒绝": "Permission denied",
|
||||
"请手动在系统设置中开启": "Please manually enable it in the system settings",
|
||||
"权限以继续使用应用": "Permission to continue using the application.",
|
||||
"去设置": "Go set it up"
|
||||
}
|
||||
|
||||
@ -615,21 +615,34 @@
|
||||
"跳过": "跳过",
|
||||
"还未获取到位置信息哦,请耐心等待一下!": "还未获取到位置信息哦,请耐心等待一下!",
|
||||
"请填写信息": "请填写信息",
|
||||
"有效期": "有效期",
|
||||
"生效时间": "生效时间",
|
||||
"失效时间": "失效时间",
|
||||
"上传成功": "上传成功",
|
||||
"未生效": "未生效",
|
||||
"已生效": "已生效",
|
||||
"指纹详情": "指纹详情",
|
||||
"添加过程中,请根据提示,在指纹采集器上进行多次的抬起按压": "添加过程中,请根据提示,在指纹采集器上进行多次的抬起按压",
|
||||
"开始添加": "开始添加",
|
||||
"请将您的手指按下": "请将您的手指按下",
|
||||
"根据提示,抬起手指后再进行下一次指纹采集": "根据提示,抬起手指后再进行下一次指纹采集",
|
||||
"添加成功": "添加成功",
|
||||
"搜索": "搜索",
|
||||
|
||||
"permission_dialog_camera": "相机",
|
||||
"permission_dialog_photos": "相册",
|
||||
"permission_dialog_storage": "读写",
|
||||
"permission_dialog_location": "定位",
|
||||
"permission_dialog_camera_text": "需要访问相机权限才能拍照上传文件例如头像上传",
|
||||
"permission_dialog_photos_text": "需要访问相机权限才能使用相册图片上传文件上传头像",
|
||||
"permission_dialog_storage_text": "需要访问读写权限才能使用本地图片上传头像",
|
||||
"permission_dialog_location_text": "需要访问定位权限才能使用添加钥匙功能的位置信息",
|
||||
"permission_dialog_application": "申请",
|
||||
"permission_dialog_authority": "权限",
|
||||
"permission_dialog_not_allowed": "不允许",
|
||||
"permission_dialog_allowed": "允许",
|
||||
"permission_dialog_permission_denied": "权限被拒绝",
|
||||
"permission_dialog_open_permissions": "请手动在系统设置中开启",
|
||||
"permission_dialog_permission_continue_text": "权限以继续使用应用。",
|
||||
"permission_dialog_go_set_up": "去设置"
|
||||
"相机": "相机",
|
||||
"相册": "相册",
|
||||
"读写": "读写",
|
||||
"定位": "定位",
|
||||
"需要访问相机权限才能拍照上传文件例如头像上传": "需要访问相机权限才能拍照上传文件例如头像上传",
|
||||
"需要访问相机权限才能使用相册图片上传文件上传头像": "需要访问相机权限才能使用相册图片上传文件上传头像",
|
||||
"需要访问读写权限才能使用本地图片上传头像": "需要访问读写权限才能使用本地图片上传头像",
|
||||
"需要访问定位权限才能使用添加钥匙功能的位置信息": "需要访问定位权限才能使用添加钥匙功能的位置信息",
|
||||
"申请": "申请",
|
||||
"权限": "权限",
|
||||
"不允许": "不允许",
|
||||
"允许": "允许",
|
||||
"权限被拒绝": "权限被拒绝",
|
||||
"请手动在系统设置中开启": "请手动在系统设置中开启",
|
||||
"权限以继续使用应用": "权限以继续使用应用。",
|
||||
"去设置": "去设置"
|
||||
}
|
||||
|
||||
@ -616,21 +616,34 @@
|
||||
"跳过": "跳过",
|
||||
"还未获取到位置信息哦,请耐心等待一下!": "还未获取到位置信息哦,请耐心等待一下!",
|
||||
"请填写信息": "请填写信息",
|
||||
"有效期": "有效期",
|
||||
"生效时间": "生效时间",
|
||||
"失效时间": "失效时间",
|
||||
"上传成功": "上传成功",
|
||||
"未生效": "未生效",
|
||||
"已生效": "已生效",
|
||||
"指纹详情": "指纹详情",
|
||||
"添加过程中,请根据提示,在指纹采集器上进行多次的抬起按压": "添加过程中,请根据提示,在指纹采集器上进行多次的抬起按压",
|
||||
"开始添加": "开始添加",
|
||||
"请将您的手指按下": "请将您的手指按下",
|
||||
"根据提示,抬起手指后再进行下一次指纹采集": "根据提示,抬起手指后再进行下一次指纹采集",
|
||||
"添加成功": "添加成功",
|
||||
"搜索": "搜索",
|
||||
|
||||
"permission_dialog_camera": "相机",
|
||||
"permission_dialog_photos": "相册",
|
||||
"permission_dialog_storage": "读写",
|
||||
"permission_dialog_location": "定位",
|
||||
"permission_dialog_camera_text": "需要访问相机权限才能拍照上传文件例如头像上传",
|
||||
"permission_dialog_photos_text": "需要访问相机权限才能使用相册图片上传文件上传头像",
|
||||
"permission_dialog_storage_text": "需要访问读写权限才能使用本地图片上传头像",
|
||||
"permission_dialog_location_text": "需要访问定位权限才能使用添加钥匙功能的位置信息",
|
||||
"permission_dialog_application": "申请",
|
||||
"permission_dialog_authority": "权限",
|
||||
"permission_dialog_not_allowed": "不允许",
|
||||
"permission_dialog_allowed": "允许",
|
||||
"permission_dialog_permission_denied": "权限被拒绝",
|
||||
"permission_dialog_open_permissions": "请手动在系统设置中开启",
|
||||
"permission_dialog_permission_continue_text": "权限以继续使用应用。",
|
||||
"permission_dialog_go_set_up": "去设置"
|
||||
"相机": "相机",
|
||||
"相册": "相册",
|
||||
"读写": "读写",
|
||||
"定位": "定位",
|
||||
"需要访问相机权限才能拍照上传文件例如头像上传": "需要访问相机权限才能拍照上传文件例如头像上传",
|
||||
"需要访问相机权限才能使用相册图片上传文件上传头像": "需要访问相机权限才能使用相册图片上传文件上传头像",
|
||||
"需要访问读写权限才能使用本地图片上传头像": "需要访问读写权限才能使用本地图片上传头像",
|
||||
"需要访问定位权限才能使用添加钥匙功能的位置信息": "需要访问定位权限才能使用添加钥匙功能的位置信息",
|
||||
"申请": "申请",
|
||||
"权限": "权限",
|
||||
"不允许": "不允许",
|
||||
"允许": "允许",
|
||||
"权限被拒绝": "权限被拒绝",
|
||||
"请手动在系统设置中开启": "请手动在系统设置中开启",
|
||||
"权限以继续使用应用": "权限以继续使用应用。",
|
||||
"去设置": "去设置"
|
||||
}
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
|
||||
import 'dart:async';
|
||||
|
||||
// import 'package:flutter_reactive_ble/flutter_reactive_ble.dart';
|
||||
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/blue/io_type.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
import 'package:star_lock/tools/dateTool.dart';
|
||||
@ -46,19 +46,19 @@ class CardListLogic extends BaseGetXController {
|
||||
// 添加卡片开始(此处用作删除卡片)
|
||||
Future<void> _replyAddICCardBegin(Reply reply) async {
|
||||
int status = reply.data[2];
|
||||
print("_replyAddFingerprintStatus:$status");
|
||||
Get.log("_replyAddFingerprintStatus:$status");
|
||||
|
||||
switch(status){
|
||||
case 0x00:
|
||||
//成功
|
||||
print("${reply.commandType!.typeValue} 数据解析成功");
|
||||
//成功
|
||||
Get.log("${reply.commandType!.typeValue} 数据解析成功");
|
||||
state.isDeletCardData = false;
|
||||
cancelBlueConnetctToastTimer();
|
||||
deletICCardData();
|
||||
break;
|
||||
case 0x06:
|
||||
//无权限
|
||||
print("${reply.commandType!.typeValue} 需要鉴权");
|
||||
//无权限
|
||||
Get.log("${reply.commandType!.typeValue} 需要鉴权");
|
||||
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
|
||||
@ -82,19 +82,16 @@ class CardListLogic extends BaseGetXController {
|
||||
);
|
||||
break;
|
||||
case 0x07:
|
||||
//无权限
|
||||
print("${reply.commandType!.typeValue} 用户无权限");
|
||||
|
||||
//无权限
|
||||
Get.log("${reply.commandType!.typeValue} 用户无权限");
|
||||
break;
|
||||
case 0x09:
|
||||
// 权限校验错误
|
||||
print("${reply.commandType!.typeValue} 权限校验错误");
|
||||
|
||||
// 权限校验错误
|
||||
Get.log("${reply.commandType!.typeValue} 权限校验错误");
|
||||
break;
|
||||
default:
|
||||
//失败
|
||||
print("${reply.commandType!.typeValue} 失败");
|
||||
|
||||
//失败
|
||||
Get.log("${reply.commandType!.typeValue} 失败");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -104,29 +101,25 @@ class CardListLogic extends BaseGetXController {
|
||||
int status = reply.data[2];
|
||||
switch(status){
|
||||
case 0x00:
|
||||
//成功
|
||||
print("${reply.commandType}数据解析成功");
|
||||
//成功
|
||||
Get.log("${reply.commandType}数据解析成功");
|
||||
// _getLockStatus();
|
||||
break;
|
||||
case 0x06:
|
||||
//无权限
|
||||
print("${reply.commandType}需要鉴权");
|
||||
|
||||
//无权限
|
||||
Get.log("${reply.commandType}需要鉴权");
|
||||
break;
|
||||
case 0x07:
|
||||
//无权限
|
||||
print("${reply.commandType}用户无权限");
|
||||
|
||||
//无权限
|
||||
Get.log("${reply.commandType}用户无权限");
|
||||
break;
|
||||
case 0x09:
|
||||
// 权限校验错误
|
||||
print("${reply.commandType}权限校验错误");
|
||||
|
||||
// 权限校验错误
|
||||
Get.log("${reply.commandType}权限校验错误");
|
||||
break;
|
||||
default:
|
||||
//失败
|
||||
print("${reply.commandType}失败");
|
||||
|
||||
//失败
|
||||
Get.log("${reply.commandType}失败");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -175,33 +168,29 @@ class CardListLogic extends BaseGetXController {
|
||||
|
||||
// 序列号
|
||||
var serialNo = reply.data.sublist(17, 21);
|
||||
print("serialNo:$serialNo");
|
||||
Get.log("serialNo:$serialNo");
|
||||
|
||||
switch(status){
|
||||
case 0x00:
|
||||
//成功
|
||||
print("${reply.commandType}数据解析成功");
|
||||
//成功
|
||||
Get.log("${reply.commandType}数据解析成功");
|
||||
// _getLockStatus();
|
||||
break;
|
||||
case 0x06:
|
||||
//无权限
|
||||
print("${reply.commandType}需要鉴权");
|
||||
|
||||
//无权限
|
||||
Get.log("${reply.commandType}需要鉴权");
|
||||
break;
|
||||
case 0x07:
|
||||
//无权限
|
||||
print("${reply.commandType}用户无权限");
|
||||
|
||||
//无权限
|
||||
Get.log("${reply.commandType}用户无权限");
|
||||
break;
|
||||
case 0x09:
|
||||
// 权限校验错误
|
||||
print("${reply.commandType}权限校验错误");
|
||||
|
||||
// 权限校验错误
|
||||
Get.log("${reply.commandType}权限校验错误");
|
||||
break;
|
||||
default:
|
||||
//失败
|
||||
print("${reply.commandType}失败");
|
||||
|
||||
//失败
|
||||
Get.log("${reply.commandType}失败");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -277,7 +266,6 @@ class CardListLogic extends BaseGetXController {
|
||||
|
||||
var token = await Storage.getStringList(saveBlueToken);
|
||||
List<int> getTokenList = changeStringListToIntList(token!);
|
||||
print("openDoorTokenPubToken:$getTokenList");
|
||||
|
||||
IoSenderManage.senderAddICCardCommand(
|
||||
keyID:state.deletKeyID,
|
||||
@ -316,7 +304,6 @@ class CardListLogic extends BaseGetXController {
|
||||
} else {
|
||||
if (entity.data!.list!.isNotEmpty) {
|
||||
state.fingerprintItemListData.value.addAll(entity.data!.list!);
|
||||
print("state.itemDataList.value.length:${state.fingerprintItemListData.value.length}");
|
||||
pageNo++;
|
||||
}
|
||||
}
|
||||
@ -332,7 +319,6 @@ class CardListLogic extends BaseGetXController {
|
||||
cardId = state.deletKeyID;
|
||||
type = "0";
|
||||
}
|
||||
print("delet fingerprintId $cardId");
|
||||
var entity = await ApiRepository.to.deletIcCardData(
|
||||
cardId: cardId,
|
||||
lockId: state.lockId.value.toString(),
|
||||
@ -368,7 +354,6 @@ class CardListLogic extends BaseGetXController {
|
||||
String getKeyType(FingerprintItemData fingerprintItemData){
|
||||
// fingerprintStatus 1:正常 2:失效
|
||||
var keyTypeStr = "";//
|
||||
// (fingerprintItemData.fingerprintType! != 1) ? (fingerprintItemData.endDate! < DateTime.now().millisecondsSinceEpoch ? "已失效" : "") : ""
|
||||
if(fingerprintItemData.cardStatus == 1){
|
||||
if(fingerprintItemData.startDate! > DateTime.now().millisecondsSinceEpoch){
|
||||
keyTypeStr = "未生效";
|
||||
@ -396,11 +381,10 @@ class CardListLogic extends BaseGetXController {
|
||||
Future<void> onReady() async {
|
||||
// TODO: implement onReady
|
||||
super.onReady();
|
||||
print("onReady()");
|
||||
Get.log("onReady()");
|
||||
|
||||
// 获取是否是演示模式 演示模式不获取接口
|
||||
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||
// print("aaaaaaa:$isDemoMode");
|
||||
if(isDemoMode == false){
|
||||
_initReplySubscription();
|
||||
|
||||
@ -412,14 +396,7 @@ class CardListLogic extends BaseGetXController {
|
||||
Future<void> onInit() async {
|
||||
// TODO: implement onInit
|
||||
super.onInit();
|
||||
print("onInit()");
|
||||
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||
if(isDemoMode == false) {
|
||||
// senderQueryingFingerprintStatus();
|
||||
// senderCheckingCardStatus();
|
||||
|
||||
// senderCheckingUserInfoCount();
|
||||
}
|
||||
Get.log("onInit()");
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
@ -12,9 +11,8 @@ import '../../../../blue/blue_manage.dart';
|
||||
import '../../../../tools/EasyRefreshTool.dart';
|
||||
import '../../../../tools/appRouteObserver.dart';
|
||||
import '../../../../tools/keySearchWidget.dart';
|
||||
import '../../../../tools/left_slide_actions.dart';
|
||||
import '../../../../tools/noData.dart';
|
||||
import '../../../../tools/showIosTipView.dart';
|
||||
import '../../../../tools/showTipView.dart';
|
||||
import '../../../../tools/storage.dart';
|
||||
import '../../../../tools/submitBtn.dart';
|
||||
import '../../../../tools/titleAppBar.dart';
|
||||
@ -66,9 +64,16 @@ class _CardListPageState extends State<CardListPage> with RouteAware {
|
||||
onPressed: () async {
|
||||
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||
if (isDemoMode == false) {
|
||||
showDeletAlertDialog(context);
|
||||
ShowTipView().showIosTipWithContentDialog("重置后,该锁的卡都将被删除哦,确认要重置吗?", () async {
|
||||
state.isDeletCardData = true;
|
||||
state.isDeletAll = true;
|
||||
state.deletKeyID = "1";
|
||||
state.deletUserID = "DeleteAll!@#";
|
||||
state.deletCardNo = 255;
|
||||
logic.senderAddICCard();
|
||||
});
|
||||
// showDeletAlertDialog(context);
|
||||
} else {
|
||||
// Get.toNamed(Routers.selectLockTypePage);
|
||||
logic.showToast("演示模式");
|
||||
}
|
||||
},
|
||||
@ -132,7 +137,14 @@ class _CardListPageState extends State<CardListPage> with RouteAware {
|
||||
children: [
|
||||
SlidableAction(
|
||||
onPressed: (BuildContext context){
|
||||
showIosTipViewDialog(fingerprintItemData);
|
||||
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!);
|
||||
logic.senderAddICCard();
|
||||
});
|
||||
},
|
||||
backgroundColor: Colors.red,
|
||||
foregroundColor: Colors.white,
|
||||
@ -167,30 +179,6 @@ class _CardListPageState extends State<CardListPage> with RouteAware {
|
||||
) : NoData(noDataHeight: 1.sh - ScreenUtil().statusBarHeight - ScreenUtil().bottomBarHeight - 190.h - 64.h));
|
||||
}
|
||||
|
||||
void showIosTipViewDialog(FingerprintItemData fingerprintItemData) {
|
||||
showDialog(
|
||||
context: Get.context!,
|
||||
builder: (BuildContext context) {
|
||||
return ShowIosTipView(
|
||||
title: "提示",
|
||||
tipTitle: "确定要删除吗?",
|
||||
sureClick: () async {
|
||||
Get.back();
|
||||
state.isDeletCardData = true;
|
||||
state.isDeletAll = false;
|
||||
state.deletUserID = (await Storage.getUid())!;
|
||||
state.deletKeyID = fingerprintItemData.cardId.toString();
|
||||
state.deletCardNo = int.parse(fingerprintItemData.cardNumber!);
|
||||
logic.senderAddICCard();
|
||||
},
|
||||
cancelClick: () {
|
||||
Get.back();
|
||||
},
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Widget _keyItem(String lockTypeIcon, String lockTypeTitle, String ifInvalidation, String showTime,
|
||||
Function() action) {
|
||||
return GestureDetector(
|
||||
@ -261,37 +249,61 @@ class _CardListPageState extends State<CardListPage> with RouteAware {
|
||||
);
|
||||
}
|
||||
|
||||
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.isDeletCardData = true;
|
||||
state.isDeletAll = true;
|
||||
state.deletKeyID = "1";
|
||||
state.deletUserID = "DeleteAll!@#";
|
||||
state.deletCardNo = 255;
|
||||
logic.senderAddICCard();
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
// void showIosTipViewDialog(FingerprintItemData fingerprintItemData) {
|
||||
// showDialog(
|
||||
// context: Get.context!,
|
||||
// builder: (BuildContext context) {
|
||||
// return ShowIosTipView(
|
||||
// title: "提示",
|
||||
// tipTitle: "确定要删除吗?",
|
||||
// sureClick: () async {
|
||||
// Get.back();
|
||||
// state.isDeletCardData = true;
|
||||
// state.isDeletAll = false;
|
||||
// state.deletUserID = (await Storage.getUid())!;
|
||||
// state.deletKeyID = fingerprintItemData.cardId.toString();
|
||||
// state.deletCardNo = int.parse(fingerprintItemData.cardNumber!);
|
||||
// logic.senderAddICCard();
|
||||
// },
|
||||
// cancelClick: () {
|
||||
// Get.back();
|
||||
// },
|
||||
// );
|
||||
// },
|
||||
// );
|
||||
// }
|
||||
|
||||
// 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.isDeletCardData = true;
|
||||
// state.isDeletAll = true;
|
||||
// state.deletKeyID = "1";
|
||||
// state.deletUserID = "DeleteAll!@#";
|
||||
// state.deletCardNo = 255;
|
||||
// logic.senderAddICCard();
|
||||
// },
|
||||
// ),
|
||||
// ],
|
||||
// );
|
||||
// },
|
||||
// );
|
||||
// }
|
||||
|
||||
@override
|
||||
void didChangeDependencies() {
|
||||
|
||||
@ -50,22 +50,22 @@ class AddFingerprintLogic extends BaseGetXController {
|
||||
|
||||
Future<void> _replyAddFingerprintBegin(Reply reply) async {
|
||||
int status = reply.data[2];
|
||||
print("status:$status");
|
||||
Get.log("status:$status");
|
||||
|
||||
switch(status){
|
||||
case 0x00:
|
||||
//成功
|
||||
print("${reply.commandType!.typeValue} 数据解析成功");
|
||||
//成功
|
||||
Get.log("${reply.commandType!.typeValue} 数据解析成功");
|
||||
state.ifConnectScuess.value = true;
|
||||
|
||||
// 最大图片数
|
||||
state.maxRegCount.value = reply.data[10];
|
||||
print("state.maxRegCount.value:${state.maxRegCount.value}");
|
||||
Get.log("state.maxRegCount.value:${state.maxRegCount.value}");
|
||||
// state.fingerprintNumber.value = reply.data.last.toString();
|
||||
break;
|
||||
case 0x06:
|
||||
//无权限
|
||||
print("${reply.commandType!.typeValue} 需要鉴权");
|
||||
//无权限
|
||||
Get.log("${reply.commandType!.typeValue} 需要鉴权");
|
||||
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
|
||||
@ -74,7 +74,6 @@ class AddFingerprintLogic extends BaseGetXController {
|
||||
|
||||
var token = reply.data.sublist(5, 9);
|
||||
var saveStrList = changeIntListToStringList(token);
|
||||
print("_replyAddFingerprintReplyToken:$token");
|
||||
Storage.setStringList(saveBlueToken, saveStrList);
|
||||
|
||||
IoSenderManage.senderAddFingerprintCommand(
|
||||
@ -82,8 +81,6 @@ class AddFingerprintLogic extends BaseGetXController {
|
||||
userID:await Storage.getUid(),
|
||||
fingerNo:state.isAdministrator.value == "2" ? 254 : 1,
|
||||
useCountLimit:0xff,
|
||||
// startTime:0x11223344,
|
||||
// endTime:0x11223344,
|
||||
startTime:int.parse(state.startDate.value)~/1000,
|
||||
endTime:int.parse(state.endDate.value)~/1000,
|
||||
needAuthor:1,
|
||||
@ -93,22 +90,22 @@ class AddFingerprintLogic extends BaseGetXController {
|
||||
);
|
||||
break;
|
||||
case 0x07:
|
||||
//无权限
|
||||
print("${reply.commandType!.typeValue} 用户无权限");
|
||||
//无权限
|
||||
Get.log("${reply.commandType!.typeValue} 用户无权限");
|
||||
showToast("添加指纹失败", something: (){
|
||||
Get.back();
|
||||
});
|
||||
break;
|
||||
case 0x09:
|
||||
// 权限校验错误
|
||||
print("${reply.commandType!.typeValue} 权限校验错误");
|
||||
// 权限校验错误
|
||||
Get.log("${reply.commandType!.typeValue} 权限校验错误");
|
||||
showToast("添加指纹失败", something: (){
|
||||
Get.back();
|
||||
});
|
||||
break;
|
||||
default:
|
||||
//失败
|
||||
print("${reply.commandType!.typeValue} 失败");
|
||||
//失败
|
||||
Get.log("${reply.commandType!.typeValue} 失败");
|
||||
showToast("添加指纹失败", something: (){
|
||||
Get.back();
|
||||
});
|
||||
@ -118,15 +115,14 @@ class AddFingerprintLogic extends BaseGetXController {
|
||||
|
||||
Future<void> _replyAddFingerprintProcess(Reply reply) async {
|
||||
int status = reply.data[2];
|
||||
print("33 status:$status");
|
||||
Get.log("33 status:$status");
|
||||
|
||||
switch(status){
|
||||
case 0x00:
|
||||
//成功
|
||||
print("${reply.commandType!.typeValue} 数据解析成功");
|
||||
Get.log("${reply.commandType!.typeValue} 数据解析成功");
|
||||
if(reply.data[5] == 255){
|
||||
// 注册指纹失败
|
||||
// print("${reply.commandType!.typeValue} 注册指纹失败");
|
||||
showToast("添加失败");
|
||||
Get.close(2);
|
||||
}else{
|
||||
@ -134,40 +130,35 @@ class AddFingerprintLogic extends BaseGetXController {
|
||||
|
||||
// 当前注册数
|
||||
state.regIndex.value = reply.data[6];
|
||||
print("state.regIndex.value:${state.regIndex.value}");
|
||||
Get.log("state.regIndex.value:${state.regIndex.value}");
|
||||
}
|
||||
break;
|
||||
case 0x06:
|
||||
//需要权限
|
||||
|
||||
break;
|
||||
case 0x07:
|
||||
//无权限
|
||||
print("${reply.commandType!.typeValue} 用户无权限");
|
||||
|
||||
Get.log("${reply.commandType!.typeValue} 用户无权限");
|
||||
break;
|
||||
case 0x09:
|
||||
// 权限校验错误
|
||||
print("${reply.commandType!.typeValue} 权限校验错误");
|
||||
|
||||
Get.log("${reply.commandType!.typeValue} 权限校验错误");
|
||||
break;
|
||||
default:
|
||||
//失败
|
||||
print("${reply.commandType!.typeValue} 失败");
|
||||
|
||||
Get.log("${reply.commandType!.typeValue} 失败");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _replyAddFingerprintConfirmation(Reply reply) async {
|
||||
int status = reply.data[2];
|
||||
print("status:$status");
|
||||
Get.log("status:$status");
|
||||
|
||||
switch(status){
|
||||
case 0x00:
|
||||
//成功
|
||||
print("${reply.commandType!.typeValue} 数据解析成功");
|
||||
// print("添加指纹确认成功,调用添加指纹接口");
|
||||
Get.log("${reply.commandType!.typeValue} 数据解析成功");
|
||||
if(state.fingerprintNumber.value == (reply.data[6]).toString()){
|
||||
return;
|
||||
}else{
|
||||
@ -183,40 +174,35 @@ class AddFingerprintLogic extends BaseGetXController {
|
||||
break;
|
||||
case 0x06:
|
||||
//需要权限
|
||||
|
||||
break;
|
||||
case 0x07:
|
||||
//无权限
|
||||
print("${reply.commandType!.typeValue} 用户无权限");
|
||||
|
||||
Get.log("${reply.commandType!.typeValue} 用户无权限");
|
||||
break;
|
||||
case 0x09:
|
||||
// 权限校验错误
|
||||
print("${reply.commandType!.typeValue} 权限校验错误");
|
||||
|
||||
Get.log("${reply.commandType!.typeValue} 权限校验错误");
|
||||
break;
|
||||
default:
|
||||
//失败
|
||||
print("${reply.commandType!.typeValue} 失败");
|
||||
|
||||
Get.log("${reply.commandType!.typeValue} 失败");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _replyAddStressFingerprint(Reply reply) async {
|
||||
int status = reply.data[2];
|
||||
print("status:$status");
|
||||
Get.log("status:$status");
|
||||
|
||||
switch(status){
|
||||
case 0x00:
|
||||
//成功
|
||||
print("${reply.commandType!.typeValue} 数据解析成功");
|
||||
Get.log("${reply.commandType!.typeValue} 数据解析成功");
|
||||
// print("添加指纹确认成功,调用添加指纹接口");
|
||||
addFingerprintsData();
|
||||
break;
|
||||
case 0x06:
|
||||
//需要权限
|
||||
|
||||
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
|
||||
@ -228,7 +214,6 @@ class AddFingerprintLogic extends BaseGetXController {
|
||||
|
||||
var token = reply.data.sublist(5, 9);
|
||||
var saveStrList = changeIntListToStringList(token);
|
||||
print("_replyAddFingerprintReplyToken:$token");
|
||||
Storage.setStringList(saveBlueToken, saveStrList);
|
||||
|
||||
IoSenderManage.senderAddStressFingerprintCommand(
|
||||
@ -237,8 +222,6 @@ class AddFingerprintLogic extends BaseGetXController {
|
||||
fingerNo:state.isAdministrator.value == "2" ? 254 : 1,
|
||||
fingerType:1,
|
||||
useCountLimit:1,
|
||||
// startTime:0x11223344,
|
||||
// endTime:0x11223344,
|
||||
startTime:int.parse(state.startDate.value)~/1000,
|
||||
endTime:int.parse(state.endDate.value)~/1000,
|
||||
needAuthor:1,
|
||||
@ -249,19 +232,16 @@ class AddFingerprintLogic extends BaseGetXController {
|
||||
);
|
||||
break;
|
||||
case 0x07:
|
||||
//无权限
|
||||
print("${reply.commandType!.typeValue} 用户无权限");
|
||||
|
||||
//无权限
|
||||
Get.log("${reply.commandType!.typeValue} 用户无权限");
|
||||
break;
|
||||
case 0x09:
|
||||
// 权限校验错误
|
||||
print("${reply.commandType!.typeValue} 权限校验错误");
|
||||
|
||||
// 权限校验错误
|
||||
Get.log("${reply.commandType!.typeValue} 权限校验错误");
|
||||
break;
|
||||
default:
|
||||
//失败
|
||||
print("${reply.commandType!.typeValue} 失败");
|
||||
|
||||
//失败
|
||||
Get.log("${reply.commandType!.typeValue} 失败");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -323,7 +303,6 @@ class AddFingerprintLogic extends BaseGetXController {
|
||||
|
||||
var token = await Storage.getStringList(saveBlueToken);
|
||||
List<int> getTokenList = changeStringListToIntList(token!);
|
||||
print("StressFingerprintToken:$getTokenList");
|
||||
|
||||
IoSenderManage.senderAddStressFingerprintCommand(
|
||||
keyID:"1",
|
||||
@ -331,8 +310,6 @@ class AddFingerprintLogic extends BaseGetXController {
|
||||
fingerNo:state.isAdministrator.value == "2" ? 254 : 1,
|
||||
fingerType:1,
|
||||
useCountLimit:1,
|
||||
// startTime:0x11223344,
|
||||
// endTime:0x11223344,
|
||||
startTime:int.parse(state.startDate.value)~/1000,
|
||||
endTime:int.parse(state.endDate.value)~/1000,
|
||||
needAuthor:1,
|
||||
@ -364,7 +341,6 @@ class AddFingerprintLogic extends BaseGetXController {
|
||||
endTime: int.parse(state.failureDateTime.value),
|
||||
);
|
||||
if(entity.errorCode!.codeIsSuccessful){
|
||||
// Toast.show(msg: "添加成功");
|
||||
updateFingerprintUserNoLoadData(entity.data!.fingerprintId.toString());
|
||||
}
|
||||
}
|
||||
@ -377,14 +353,15 @@ class AddFingerprintLogic extends BaseGetXController {
|
||||
fingerprintUserNo: state.fingerprintNumber.value,
|
||||
);
|
||||
if(entity.errorCode!.codeIsSuccessful){
|
||||
showToast("添加成功");
|
||||
if(state.fromType.value == 2){
|
||||
// 回调指纹号
|
||||
eventBus.fire(ChickInAddStaffCardAndFingerprintBlockNumberEvent(state.fingerprintNumber.value));
|
||||
}else if(state.fromType.value == 1){
|
||||
eventBus.fire(OtherTypeRefreshListEvent());
|
||||
}
|
||||
Get.close(2);
|
||||
showToast("添加成功".tr, something: (){
|
||||
if(state.fromType.value == 2){
|
||||
// 回调指纹号
|
||||
eventBus.fire(ChickInAddStaffCardAndFingerprintBlockNumberEvent(state.fingerprintNumber.value));
|
||||
}else if(state.fromType.value == 1){
|
||||
eventBus.fire(OtherTypeRefreshListEvent());
|
||||
}
|
||||
Get.close(2);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -30,8 +30,6 @@ class _AddFingerprintPageState extends State<AddFingerprintPage> with RouteAware
|
||||
haveBack: true,
|
||||
backgroundColor: AppColors.mainColor),
|
||||
body: ListView(
|
||||
// mainAxisAlignment: MainAxisAlignment.center,
|
||||
// crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 50.h,
|
||||
@ -47,7 +45,7 @@ class _AddFingerprintPageState extends State<AddFingerprintPage> with RouteAware
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
"请将您的手指按下",
|
||||
"请将您的手指按下".tr,
|
||||
// TranslationLoader.lanKeys!.lightTouchScreenTip!.tr,
|
||||
textAlign: TextAlign.center,
|
||||
maxLines:null,
|
||||
@ -75,7 +73,7 @@ class _AddFingerprintPageState extends State<AddFingerprintPage> with RouteAware
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
"尝试连接设备......",
|
||||
"尝试连接设备...".tr,
|
||||
// TranslationLoader.lanKeys!.lightTouchScreenTip!.tr,
|
||||
textAlign: TextAlign.center,
|
||||
maxLines:null,
|
||||
@ -103,7 +101,7 @@ class _AddFingerprintPageState extends State<AddFingerprintPage> with RouteAware
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
"根据提示,抬起手指后再进行下一次指纹采集",
|
||||
"根据提示,抬起手指后再进行下一次指纹采集".tr,
|
||||
// TranslationLoader.lanKeys!.lightTouchScreenTip!.tr,
|
||||
textAlign: TextAlign.center,
|
||||
maxLines:null,
|
||||
|
||||
@ -14,7 +14,6 @@ class AddFingerprintState{
|
||||
final endDate = "".obs;
|
||||
final addType = "".obs;
|
||||
final fingerprintName = "".obs;
|
||||
// final fingerprintNumber = "".obs;
|
||||
final fingerprintType = "".obs;
|
||||
final isCoerced = "".obs;
|
||||
final isAdministrator = "".obs;
|
||||
@ -30,12 +29,11 @@ class AddFingerprintState{
|
||||
endDate.value = map["endDate"];
|
||||
addType.value = map["addType"];
|
||||
fingerprintName.value = map["fingerprintName"];
|
||||
// fingerprintNumber.value = map["fingerprintNumber"];
|
||||
fingerprintType.value = map["fingerprintType"];
|
||||
isCoerced.value = map["isCoerced"];
|
||||
print("isCoerced.valueisCoerced.value:${isCoerced.value}");
|
||||
Get.log("isCoerced.valueisCoerced.value:${isCoerced.value}");
|
||||
isAdministrator.value = map["isAdministrator"];
|
||||
print("isAdministrator.value isAdministrator.value:${isAdministrator.value}");
|
||||
Get.log("isAdministrator.value isAdministrator.value:${isAdministrator.value}");
|
||||
startDate.value = map["startDate"];
|
||||
lockId.value = map["lockId"];
|
||||
weekDay.value = map["weekDay"];
|
||||
|
||||
@ -30,11 +30,11 @@ class AddFingerprintTypeLogic extends BaseGetXController{
|
||||
endTime = "0";
|
||||
|
||||
if (startDate.isEmpty) {
|
||||
showToast("请选择开始时间");
|
||||
showToast("请选择开始时间".tr);
|
||||
return;
|
||||
}
|
||||
if (endDate.isEmpty) {
|
||||
showToast("请选择结束时间");
|
||||
showToast("请选择结束时间".tr);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -44,7 +44,7 @@ class AddFingerprintTypeLogic extends BaseGetXController{
|
||||
// }
|
||||
|
||||
if (int.parse(startDate) >= int.parse(endDate)) {
|
||||
showToast("失效时间要大于生效时间");
|
||||
showToast("失效时间要大于生效时间".tr);
|
||||
return;
|
||||
}
|
||||
} else if (state.selectType.value == "2") {
|
||||
@ -60,7 +60,7 @@ class AddFingerprintTypeLogic extends BaseGetXController{
|
||||
}
|
||||
|
||||
var isCoerced = state.isStressFingerprint.value == false ? "1" : "2"; // 1:非胁迫指纹 2:胁迫指纹
|
||||
print("addOtherType startDate:$startDate endDate:$endDate isCoerced:$isCoerced");
|
||||
Get.log("addOtherType startDate:$startDate endDate:$endDate isCoerced:$isCoerced");
|
||||
|
||||
// 指纹
|
||||
Get.toNamed(Routers.addFingerprintPage, arguments: {
|
||||
|
||||
@ -189,7 +189,7 @@ class _AddFingerprintTypePageState extends State<AddFingerprintTypePage> {
|
||||
Obx(() => Visibility(
|
||||
visible: state.weekdaysList.isNotEmpty ? true : false,
|
||||
child: CommonItem(
|
||||
leftTitel: "有效日",
|
||||
leftTitel: "有效日".tr,
|
||||
rightTitle: state.weekdaysList.value.join(",").toString(),
|
||||
isHaveDirection: true,
|
||||
isHaveLine: true,
|
||||
@ -214,7 +214,7 @@ class _AddFingerprintTypePageState extends State<AddFingerprintTypePage> {
|
||||
Obx(() => Visibility(
|
||||
visible: state.effectiveDateTime.value.isNotEmpty,
|
||||
child: CommonItem(
|
||||
leftTitel: "有效时间",
|
||||
leftTitel: "有效时间".tr,
|
||||
rightTitle: "${state.effectiveDateTime.value}-${state.failureDateTime.value}",
|
||||
isHaveDirection: true,
|
||||
action: () async {
|
||||
@ -244,7 +244,7 @@ class _AddFingerprintTypePageState extends State<AddFingerprintTypePage> {
|
||||
return Column(
|
||||
children: [
|
||||
Obx(() => CommonItem(
|
||||
leftTitel: "是否是管理员",
|
||||
leftTitel: "是否是管理员".tr,
|
||||
rightTitle: "",
|
||||
isTipsImg: false,
|
||||
isHaveRightWidget: true,
|
||||
@ -266,13 +266,13 @@ class _AddFingerprintTypePageState extends State<AddFingerprintTypePage> {
|
||||
if (isDemoMode == false) {
|
||||
// print("state.selectType:${state.selectType.value}");
|
||||
if (state.nameController.text.isEmpty) {
|
||||
logic.showToast("请输入姓名");
|
||||
logic.showToast("请输入姓名".tr);
|
||||
return;
|
||||
}
|
||||
logic.checkFingerprintNameDuplicated(state.nameController.text);
|
||||
} else {
|
||||
// Get.toNamed(Routers.selectLockTypePage);
|
||||
logic.showToast("演示模式");
|
||||
logic.showToast("演示模式".tr);
|
||||
}
|
||||
}),
|
||||
],
|
||||
@ -280,74 +280,74 @@ class _AddFingerprintTypePageState extends State<AddFingerprintTypePage> {
|
||||
}
|
||||
|
||||
// 发送电子钥匙成功
|
||||
Widget sendElectronicKeySucceed() {
|
||||
return Column(
|
||||
children: [
|
||||
Container(
|
||||
height: 300.h,
|
||||
width: 1.sw,
|
||||
color: Colors.white,
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 30.h,
|
||||
),
|
||||
Image.asset(
|
||||
'images/main/icon_main_addLock.png',
|
||||
width: 150.w,
|
||||
height: 150.w,
|
||||
color: AppColors.mainColor,
|
||||
),
|
||||
SizedBox(
|
||||
height: 20.h,
|
||||
),
|
||||
Text(
|
||||
"操作成功,密码为",
|
||||
style: TextStyle(
|
||||
fontSize: 32.sp,
|
||||
color: Colors.black,
|
||||
fontWeight: FontWeight.w500),
|
||||
),
|
||||
SizedBox(
|
||||
height: 10.h,
|
||||
),
|
||||
Text(
|
||||
"62689876",
|
||||
style: TextStyle(
|
||||
fontSize: 60.sp,
|
||||
color: Colors.black,
|
||||
fontWeight: FontWeight.w500),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 20.h,
|
||||
),
|
||||
SubmitBtn(
|
||||
btnName: '完成'.tr,
|
||||
fontSize: 28.sp,
|
||||
borderRadius: 20.w,
|
||||
margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w),
|
||||
padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
|
||||
onClick: () {}),
|
||||
SubmitBtn(
|
||||
btnName: '分享',
|
||||
fontSize: 28.sp,
|
||||
borderRadius: 20.w,
|
||||
margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w),
|
||||
padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
|
||||
onClick: () {}),
|
||||
SubmitBtn(
|
||||
btnName: '标记为:已入住',
|
||||
fontSize: 28.sp,
|
||||
borderRadius: 20.w,
|
||||
margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w),
|
||||
padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
|
||||
onClick: () {}),
|
||||
],
|
||||
);
|
||||
}
|
||||
// Widget sendElectronicKeySucceed() {
|
||||
// return Column(
|
||||
// children: [
|
||||
// Container(
|
||||
// height: 300.h,
|
||||
// width: 1.sw,
|
||||
// color: Colors.white,
|
||||
// child: Column(
|
||||
// children: [
|
||||
// SizedBox(
|
||||
// height: 30.h,
|
||||
// ),
|
||||
// Image.asset(
|
||||
// 'images/main/icon_main_addLock.png',
|
||||
// width: 150.w,
|
||||
// height: 150.w,
|
||||
// color: AppColors.mainColor,
|
||||
// ),
|
||||
// SizedBox(
|
||||
// height: 20.h,
|
||||
// ),
|
||||
// Text(
|
||||
// "操作成功,密码为",
|
||||
// style: TextStyle(
|
||||
// fontSize: 32.sp,
|
||||
// color: Colors.black,
|
||||
// fontWeight: FontWeight.w500),
|
||||
// ),
|
||||
// SizedBox(
|
||||
// height: 10.h,
|
||||
// ),
|
||||
// Text(
|
||||
// "62689876",
|
||||
// style: TextStyle(
|
||||
// fontSize: 60.sp,
|
||||
// color: Colors.black,
|
||||
// fontWeight: FontWeight.w500),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// SizedBox(
|
||||
// height: 20.h,
|
||||
// ),
|
||||
// SubmitBtn(
|
||||
// btnName: '完成'.tr,
|
||||
// fontSize: 28.sp,
|
||||
// borderRadius: 20.w,
|
||||
// margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w),
|
||||
// padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
|
||||
// onClick: () {}),
|
||||
// SubmitBtn(
|
||||
// btnName: '分享',
|
||||
// fontSize: 28.sp,
|
||||
// borderRadius: 20.w,
|
||||
// margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w),
|
||||
// padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
|
||||
// onClick: () {}),
|
||||
// SubmitBtn(
|
||||
// btnName: '标记为:已入住',
|
||||
// fontSize: 28.sp,
|
||||
// borderRadius: 20.w,
|
||||
// margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w),
|
||||
// padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
|
||||
// onClick: () {}),
|
||||
// ],
|
||||
// );
|
||||
// }
|
||||
|
||||
// 接受者信息输入框
|
||||
Widget getTFWidget(String tfStr) {
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
|
||||
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
|
||||
import 'addFingerprintTip_state.dart';
|
||||
|
||||
@ -43,7 +43,7 @@ class _AddFingerprintTipPageState extends State<AddFingerprintTipPage> {
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
"添加过程中,请根据提示,在指纹采集器上进行多次的抬起按压",
|
||||
"添加过程中,请根据提示,在指纹采集器上进行多次的抬起按压".tr,
|
||||
// TranslationLoader.lanKeys!.lightTouchScreenTip!.tr,
|
||||
textAlign: TextAlign.center,
|
||||
maxLines:null,
|
||||
@ -67,7 +67,7 @@ class _AddFingerprintTipPageState extends State<AddFingerprintTipPage> {
|
||||
Container(
|
||||
padding: EdgeInsets.only(left: 20.w, right: 20.w),
|
||||
child: SubmitBtn(
|
||||
btnName: "开始添加",//TranslationLoader.lanKeys!.next!.tr,
|
||||
btnName: "开始添加".tr,//TranslationLoader.lanKeys!.next!.tr,
|
||||
borderRadius: 20.w,
|
||||
onClick: () {
|
||||
Get.toNamed(Routers.addFingerprintPage, arguments: {
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
|
||||
import 'dart:async';
|
||||
|
||||
// import 'package:flutter_reactive_ble/flutter_reactive_ble.dart';
|
||||
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/blue/io_type.dart';
|
||||
@ -36,20 +35,20 @@ class FingerprintDetailLogic extends BaseGetXController{
|
||||
Future<void> _replyAddFingerprintBegin(Reply reply) async {
|
||||
|
||||
int status = reply.data[2];
|
||||
print("status:$status");
|
||||
Get.log("status:$status");
|
||||
|
||||
switch(status){
|
||||
case 0x00:
|
||||
//成功
|
||||
print("${reply.commandType!.typeValue} 数据解析成功");
|
||||
//成功
|
||||
Get.log("${reply.commandType!.typeValue} 数据解析成功");
|
||||
state.sureBtnState.value = 0;
|
||||
cancelBlueConnetctToastTimer();
|
||||
dismissEasyLoading();
|
||||
deletFingerprintsData();
|
||||
break;
|
||||
case 0x06:
|
||||
//无权限
|
||||
print("${reply.commandType!.typeValue} 需要鉴权");
|
||||
//无权限
|
||||
Get.log("${reply.commandType!.typeValue} 需要鉴权");
|
||||
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
|
||||
@ -74,19 +73,16 @@ class FingerprintDetailLogic extends BaseGetXController{
|
||||
);
|
||||
break;
|
||||
case 0x07:
|
||||
//无权限
|
||||
print("${reply.commandType!.typeValue} 用户无权限");
|
||||
|
||||
//无权限
|
||||
Get.log("${reply.commandType!.typeValue} 用户无权限");
|
||||
break;
|
||||
case 0x09:
|
||||
// 权限校验错误
|
||||
print("${reply.commandType!.typeValue} 权限校验错误");
|
||||
|
||||
// 权限校验错误
|
||||
Get.log("${reply.commandType!.typeValue} 权限校验错误");
|
||||
break;
|
||||
default:
|
||||
//失败
|
||||
print("${reply.commandType!.typeValue} 失败");
|
||||
|
||||
//失败
|
||||
Get.log("${reply.commandType!.typeValue} 失败");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -148,7 +144,7 @@ class FingerprintDetailLogic extends BaseGetXController{
|
||||
deleteType:"1"
|
||||
);
|
||||
if(entity.errorCode!.codeIsSuccessful){
|
||||
showToast("删除成功",something: (){
|
||||
showToast("删除成功".tr, something: (){
|
||||
Get.back(result: "addScuess");
|
||||
});
|
||||
}
|
||||
@ -170,7 +166,7 @@ class FingerprintDetailLogic extends BaseGetXController{
|
||||
fingerprintType: state.fingerprintItemData.value.fingerprintType!,
|
||||
);
|
||||
if(entity.errorCode!.codeIsSuccessful){
|
||||
showToast("修改成功",something: (){
|
||||
showToast("修改成功".tr, something: (){
|
||||
eventBus.fire(OtherTypeRefreshListEvent());
|
||||
});
|
||||
}
|
||||
@ -179,7 +175,7 @@ class FingerprintDetailLogic extends BaseGetXController{
|
||||
String getKeyTypeShowDateTime(){
|
||||
String useDateStr = '';
|
||||
if(state.keyType.value == 1){
|
||||
useDateStr = "永久";
|
||||
useDateStr = "永久".tr;
|
||||
}else if(state.keyType.value == 2){
|
||||
useDateStr = "${DateTool().dateToYMDHNString(state.starDate.value)}\n${DateTool().dateToYMDHNString(state.endDate.value)}";
|
||||
} else if(state.keyType.value == 4){
|
||||
|
||||
@ -13,6 +13,7 @@ import '../../../../tools/commonItem.dart';
|
||||
import '../../../../tools/dateTool.dart';
|
||||
import '../../../../tools/showIosTipView.dart';
|
||||
import '../../../../tools/showTFView.dart';
|
||||
import '../../../../tools/showTipView.dart';
|
||||
import '../../../../tools/submitBtn.dart';
|
||||
import '../../../../tools/titleAppBar.dart';
|
||||
import '../../../../translations/trans_lib.dart';
|
||||
@ -34,7 +35,7 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage> with Rout
|
||||
return Scaffold(
|
||||
backgroundColor: AppColors.mainBackgroundColor,
|
||||
appBar: TitleAppBar(
|
||||
barTitle: "指纹详情",
|
||||
barTitle: "指纹详情".tr,
|
||||
haveBack: true,
|
||||
backgroundColor: AppColors.mainColor,
|
||||
),
|
||||
@ -125,7 +126,7 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage> with Rout
|
||||
Obx(() => Visibility(
|
||||
visible: state.keyType.value == 4 ? true : false,
|
||||
child: Obx(() => CommonItem(
|
||||
leftTitel: "有效时间",
|
||||
leftTitel: "有效时间".tr,
|
||||
rightTitle: "${DateTool().dateToHNString(state.starTime.value)}-${DateTool().dateToHNString(state.endTime.value)}",
|
||||
isHaveDirection: true,
|
||||
action: () async {
|
||||
@ -153,9 +154,7 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage> with Rout
|
||||
Obx(() => CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.addTime!.tr,
|
||||
rightTitle: DateTool().dateToYMDHNString(state.addTime.value.toString()),
|
||||
action: () {
|
||||
|
||||
})),
|
||||
)),
|
||||
SizedBox(height: 10.h),
|
||||
Obx(() => CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.stressFingerprint!.tr,
|
||||
@ -186,7 +185,9 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage> with Rout
|
||||
margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w, bottom: 30.w),
|
||||
padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
|
||||
onClick: () {
|
||||
showIosTipViewDialog(context);
|
||||
ShowTipView().showIosTipWithContentDialog("确定要删除吗?".tr, () async {
|
||||
logic.senderAddFingerprint();
|
||||
});
|
||||
}),
|
||||
],
|
||||
),
|
||||
@ -219,7 +220,7 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage> with Rout
|
||||
controller: state.changeNameController,
|
||||
sureClick: () {
|
||||
if(state.changeNameController.text.isEmpty){
|
||||
logic.showToast("请输入姓名");
|
||||
logic.showToast("请输入姓名".tr);
|
||||
return;
|
||||
}
|
||||
Get.back();
|
||||
@ -233,25 +234,25 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage> with Rout
|
||||
});
|
||||
}
|
||||
|
||||
void showIosTipViewDialog(BuildContext context) {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return ShowIosTipView(
|
||||
title: "提示",
|
||||
tipTitle: "确定要删除吗?",
|
||||
sureClick: () {
|
||||
Get.back();
|
||||
// 指纹
|
||||
logic.senderAddFingerprint();
|
||||
},
|
||||
cancelClick: () {
|
||||
Get.back();
|
||||
},
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
// void showIosTipViewDialog(BuildContext context) {
|
||||
// showDialog(
|
||||
// context: context,
|
||||
// builder: (BuildContext context) {
|
||||
// return ShowIosTipView(
|
||||
// title: "提示",
|
||||
// tipTitle: "确定要删除吗?",
|
||||
// sureClick: () {
|
||||
// Get.back();
|
||||
// // 指纹
|
||||
// logic.senderAddFingerprint();
|
||||
// },
|
||||
// cancelClick: () {
|
||||
// Get.back();
|
||||
// },
|
||||
// );
|
||||
// }
|
||||
// );
|
||||
// }
|
||||
|
||||
@override
|
||||
void didChangeDependencies() {
|
||||
|
||||
@ -3,6 +3,7 @@ import 'dart:async';
|
||||
|
||||
// import 'package:flutter_reactive_ble/flutter_reactive_ble.dart';
|
||||
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/blue/io_type.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
import '../../../../blue/blue_manage.dart';
|
||||
@ -46,20 +47,20 @@ class FingerprintListLogic extends BaseGetXController{
|
||||
// 添加指纹开始---这里用作删除指纹
|
||||
Future<void> _replyAddFingerprintBegin(Reply reply) async {
|
||||
int status = reply.data[2];
|
||||
print("status:$status");
|
||||
Get.log("status:$status");
|
||||
|
||||
switch(status){
|
||||
case 0x00:
|
||||
//成功
|
||||
print("${reply.commandType!.typeValue} 数据解析成功");
|
||||
//成功
|
||||
Get.log("${reply.commandType!.typeValue} 数据解析成功");
|
||||
state.isDeletFingerprintData = false;
|
||||
cancelBlueConnetctToastTimer();
|
||||
dismissEasyLoading();
|
||||
deletAllFingerprintsData();
|
||||
break;
|
||||
case 0x06:
|
||||
//无权限
|
||||
print("${reply.commandType!.typeValue} 需要鉴权");
|
||||
//无权限
|
||||
Get.log("${reply.commandType!.typeValue} 需要鉴权");
|
||||
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
|
||||
@ -83,18 +84,18 @@ class FingerprintListLogic extends BaseGetXController{
|
||||
);
|
||||
break;
|
||||
case 0x07:
|
||||
//无权限
|
||||
print("${reply.commandType!.typeValue} 用户无权限");
|
||||
//无权限
|
||||
Get.log("${reply.commandType!.typeValue} 用户无权限");
|
||||
|
||||
break;
|
||||
case 0x09:
|
||||
// 权限校验错误
|
||||
print("${reply.commandType!.typeValue} 权限校验错误");
|
||||
// 权限校验错误
|
||||
Get.log("${reply.commandType!.typeValue} 权限校验错误");
|
||||
|
||||
break;
|
||||
default:
|
||||
//失败
|
||||
print("${reply.commandType!.typeValue} 失败");
|
||||
//失败
|
||||
Get.log("${reply.commandType!.typeValue} 失败");
|
||||
|
||||
break;
|
||||
}
|
||||
@ -107,22 +108,22 @@ class FingerprintListLogic extends BaseGetXController{
|
||||
switch(status){
|
||||
case 0x00:
|
||||
//成功
|
||||
print("${reply.commandType}数据解析成功");
|
||||
Get.log("${reply.commandType}数据解析成功");
|
||||
// _getLockStatus();
|
||||
break;
|
||||
case 0x06:
|
||||
//无权限
|
||||
print("${reply.commandType}需要鉴权");
|
||||
Get.log("${reply.commandType}需要鉴权");
|
||||
|
||||
break;
|
||||
case 0x07:
|
||||
//无权限
|
||||
print("${reply.commandType}用户无权限");
|
||||
Get.log("${reply.commandType}用户无权限");
|
||||
|
||||
break;
|
||||
case 0x09:
|
||||
// 权限校验错误
|
||||
print("${reply.commandType}权限校验错误");
|
||||
Get.log("${reply.commandType}权限校验错误");
|
||||
|
||||
break;
|
||||
default:
|
||||
@ -138,28 +139,28 @@ class FingerprintListLogic extends BaseGetXController{
|
||||
int status = reply.data[2];
|
||||
switch(status){
|
||||
case 0x00:
|
||||
//成功
|
||||
print("${reply.commandType}数据解析成功");
|
||||
//成功
|
||||
Get.log("${reply.commandType}数据解析成功");
|
||||
// _getLockStatus();
|
||||
break;
|
||||
case 0x06:
|
||||
//无权限
|
||||
print("${reply.commandType}需要鉴权");
|
||||
//无权限
|
||||
Get.log("${reply.commandType}需要鉴权");
|
||||
|
||||
break;
|
||||
case 0x07:
|
||||
//无权限
|
||||
print("${reply.commandType}用户无权限");
|
||||
//无权限
|
||||
Get.log("${reply.commandType}用户无权限");
|
||||
|
||||
break;
|
||||
case 0x09:
|
||||
// 权限校验错误
|
||||
print("${reply.commandType}权限校验错误");
|
||||
// 权限校验错误
|
||||
Get.log("${reply.commandType}权限校验错误");
|
||||
|
||||
break;
|
||||
default:
|
||||
//失败
|
||||
print("${reply.commandType}失败");
|
||||
//失败
|
||||
Get.log("${reply.commandType}失败");
|
||||
|
||||
break;
|
||||
}
|
||||
@ -209,33 +210,29 @@ class FingerprintListLogic extends BaseGetXController{
|
||||
|
||||
// 序列号
|
||||
var serialNo = reply.data.sublist(17, 21);
|
||||
print("serialNo:$serialNo");
|
||||
Get.log("serialNo:$serialNo");
|
||||
|
||||
switch(status){
|
||||
case 0x00:
|
||||
//成功
|
||||
print("${reply.commandType}数据解析成功");
|
||||
//成功
|
||||
Get.log("${reply.commandType}数据解析成功");
|
||||
// _getLockStatus();
|
||||
break;
|
||||
case 0x06:
|
||||
//无权限
|
||||
print("${reply.commandType}需要鉴权");
|
||||
|
||||
//无权限
|
||||
Get.log("${reply.commandType}需要鉴权");
|
||||
break;
|
||||
case 0x07:
|
||||
//无权限
|
||||
print("${reply.commandType}用户无权限");
|
||||
|
||||
//无权限
|
||||
Get.log("${reply.commandType}用户无权限");
|
||||
break;
|
||||
case 0x09:
|
||||
// 权限校验错误
|
||||
print("${reply.commandType}权限校验错误");
|
||||
|
||||
// 权限校验错误
|
||||
Get.log("${reply.commandType}权限校验错误");
|
||||
break;
|
||||
default:
|
||||
//失败
|
||||
print("${reply.commandType}失败");
|
||||
|
||||
//失败
|
||||
Get.log("${reply.commandType}失败");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -349,7 +346,6 @@ class FingerprintListLogic extends BaseGetXController{
|
||||
} else {
|
||||
if (entity.data!.list!.isNotEmpty) {
|
||||
state.fingerprintItemListData.value.addAll(entity.data!.list!);
|
||||
print("state.itemDataList.value.length:${state.fingerprintItemListData.value.length}");
|
||||
pageNo++;
|
||||
}
|
||||
}
|
||||
@ -365,7 +361,7 @@ class FingerprintListLogic extends BaseGetXController{
|
||||
fingerprintId = state.deletKeyID;
|
||||
type = "0";
|
||||
}
|
||||
print("delet fingerprintId $fingerprintId");
|
||||
Get.log("delet fingerprintId $fingerprintId");
|
||||
var entity = await ApiRepository.to.deletFingerprintsData(
|
||||
fingerprintId: fingerprintId,
|
||||
lockId: state.lockId.value.toString(),
|
||||
@ -374,13 +370,13 @@ class FingerprintListLogic extends BaseGetXController{
|
||||
);
|
||||
if(entity.errorCode!.codeIsSuccessful){
|
||||
if(state.isDeletAll == false){
|
||||
showToast("删除成功", something:(){
|
||||
showToast("删除成功".tr, something:(){
|
||||
state.isDeletFingerprintData = false;
|
||||
pageNo = 1;
|
||||
getFingerprintsListData();
|
||||
});
|
||||
}else{
|
||||
showToast("重置成功", something:(){
|
||||
showToast("重置成功".tr, something:(){
|
||||
state.isDeletFingerprintData = false;
|
||||
pageNo = 1;
|
||||
getFingerprintsListData();
|
||||
@ -404,11 +400,11 @@ class FingerprintListLogic extends BaseGetXController{
|
||||
// (fingerprintItemData.fingerprintType! != 1) ? (fingerprintItemData.endDate! < DateTime.now().millisecondsSinceEpoch ? "已失效" : "") : ""
|
||||
if(fingerprintItemData.fingerprintStatus == 1){
|
||||
if(fingerprintItemData.startDate! > DateTime.now().millisecondsSinceEpoch){
|
||||
keyTypeStr = "未生效";
|
||||
keyTypeStr = "未生效".tr;
|
||||
}
|
||||
|
||||
}else if(fingerprintItemData.fingerprintStatus == 2){
|
||||
keyTypeStr = "已失效";
|
||||
keyTypeStr = "已失效".tr;
|
||||
}
|
||||
return keyTypeStr;
|
||||
}
|
||||
@ -416,7 +412,7 @@ class FingerprintListLogic extends BaseGetXController{
|
||||
String getKeyDateType(FingerprintItemData fingerprintItemData){
|
||||
var keyDateTypeStr = "";// 永久:1;限时2,单次3,循环:4
|
||||
if(fingerprintItemData.fingerprintType! == 1){
|
||||
keyDateTypeStr = "${DateTool().dateToYMDHNString(fingerprintItemData.createDate.toString())} 永久";
|
||||
keyDateTypeStr = "${DateTool().dateToYMDHNString(fingerprintItemData.createDate.toString())} ${"永久".tr}";
|
||||
}else if(fingerprintItemData.fingerprintType! == 2){
|
||||
keyDateTypeStr = "${DateTool().dateToYMDHNString(fingerprintItemData.startDate.toString())} - ${DateTool().dateToYMDHNString(fingerprintItemData.endDate.toString())} 限时";
|
||||
}else if(fingerprintItemData.fingerprintType! == 4){
|
||||
@ -433,7 +429,6 @@ class FingerprintListLogic extends BaseGetXController{
|
||||
|
||||
// 获取是否是演示模式 演示模式不获取接口
|
||||
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||
// print("aaaaaaa:$isDemoMode");
|
||||
if(isDemoMode == false){
|
||||
_initReplySubscription();
|
||||
|
||||
@ -445,14 +440,7 @@ class FingerprintListLogic extends BaseGetXController{
|
||||
Future<void> onInit() async {
|
||||
// TODO: implement onInit
|
||||
super.onInit();
|
||||
print("onInit()");
|
||||
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||
if(isDemoMode == false) {
|
||||
// senderQueryingFingerprintStatus();
|
||||
// senderCheckingCardStatus();
|
||||
|
||||
// senderCheckingUserInfoCount();
|
||||
}
|
||||
Get.log("onInit()");
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@ -14,6 +14,7 @@ import '../../../../tools/appRouteObserver.dart';
|
||||
import '../../../../tools/keySearchWidget.dart';
|
||||
import '../../../../tools/noData.dart';
|
||||
import '../../../../tools/showIosTipView.dart';
|
||||
import '../../../../tools/showTipView.dart';
|
||||
import '../../../../tools/storage.dart';
|
||||
import '../../../../tools/submitBtn.dart';
|
||||
import '../../../../tools/titleAppBar.dart';
|
||||
@ -67,10 +68,16 @@ class _FingerprintListPageState extends State<FingerprintListPage> with RouteAwa
|
||||
onPressed: () async {
|
||||
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||
if (isDemoMode == false) {
|
||||
showDeletAlertDialog();
|
||||
ShowTipView().showIosTipWithContentDialog("重置后,该锁的指纹都将被删除哦,确认要重置吗?".tr, () async {
|
||||
state.isDeletFingerprintData = true;
|
||||
state.isDeletAll = true;
|
||||
state.deletKeyID = "1";
|
||||
state.deletUserID = "DeleteAll!@#";
|
||||
state.deletFingerNo = 255;
|
||||
logic.senderAddFingerprint();
|
||||
});
|
||||
} else {
|
||||
// Get.toNamed(Routers.selectLockTypePage);
|
||||
logic.showToast("演示模式");
|
||||
logic.showToast("演示模式".tr);
|
||||
}
|
||||
},
|
||||
),
|
||||
@ -134,11 +141,17 @@ class _FingerprintListPageState extends State<FingerprintListPage> with RouteAwa
|
||||
children: [
|
||||
SlidableAction(
|
||||
onPressed: (BuildContext context){
|
||||
showIosTipViewDialog(fingerprintItemData.fingerprintId);
|
||||
ShowTipView().showIosTipWithContentDialog("确定要删除吗?".tr, () async {
|
||||
state.isDeletFingerprintData = true;
|
||||
state.isDeletAll = false;
|
||||
state.deletKeyID = fingerprintItemData.fingerprintId.toString();
|
||||
state.deletUserID = (await Storage.getUid())!;
|
||||
logic.senderAddFingerprint();
|
||||
});
|
||||
},
|
||||
backgroundColor: Colors.red,
|
||||
// foregroundColor: Colors.white,
|
||||
label: '删除',
|
||||
label: '删除'.tr,
|
||||
padding: EdgeInsets.only(left: 5.w, right: 5.w),
|
||||
),
|
||||
],
|
||||
@ -170,29 +183,6 @@ class _FingerprintListPageState extends State<FingerprintListPage> with RouteAwa
|
||||
) : NoData(noDataHeight: 1.sh - ScreenUtil().statusBarHeight - ScreenUtil().bottomBarHeight - 190.h - 64.h));
|
||||
}
|
||||
|
||||
void showIosTipViewDialog(int? fingerprintId) {
|
||||
showDialog(
|
||||
context: Get.context!,
|
||||
builder: (BuildContext context) {
|
||||
return ShowIosTipView(
|
||||
title: "提示",
|
||||
tipTitle: "确定要删除吗?",
|
||||
sureClick: () async {
|
||||
Get.back();
|
||||
state.isDeletFingerprintData = true;
|
||||
state.isDeletAll = false;
|
||||
state.deletKeyID = fingerprintId.toString();
|
||||
state.deletUserID = (await Storage.getUid())!;
|
||||
logic.senderAddFingerprint();
|
||||
},
|
||||
cancelClick: () {
|
||||
Get.back();
|
||||
},
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Widget _keyItem(String lockTypeIcon, String lockTypeTitle, String ifInvalidation, String showTime, Function() action) {
|
||||
return GestureDetector(
|
||||
onTap: action,
|
||||
@ -263,37 +253,60 @@ class _FingerprintListPageState extends State<FingerprintListPage> with RouteAwa
|
||||
);
|
||||
}
|
||||
|
||||
void showDeletAlertDialog() {
|
||||
showCupertinoDialog(
|
||||
context: Get.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.isDeletFingerprintData = true;
|
||||
state.isDeletAll = true;
|
||||
state.deletKeyID = "1";
|
||||
state.deletUserID = "DeleteAll!@#";
|
||||
state.deletFingerNo = 255;
|
||||
logic.senderAddFingerprint();
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
// void showIosTipViewDialog(int? fingerprintId) {
|
||||
// showDialog(
|
||||
// context: Get.context!,
|
||||
// builder: (BuildContext context) {
|
||||
// return ShowIosTipView(
|
||||
// title: "提示",
|
||||
// tipTitle: "确定要删除吗?",
|
||||
// sureClick: () async {
|
||||
// Get.back();
|
||||
// state.isDeletFingerprintData = true;
|
||||
// state.isDeletAll = false;
|
||||
// state.deletKeyID = fingerprintId.toString();
|
||||
// state.deletUserID = (await Storage.getUid())!;
|
||||
// logic.senderAddFingerprint();
|
||||
// },
|
||||
// cancelClick: () {
|
||||
// Get.back();
|
||||
// },
|
||||
// );
|
||||
// },
|
||||
// );
|
||||
// }
|
||||
|
||||
// void showDeletAlertDialog() {
|
||||
// showCupertinoDialog(
|
||||
// context: Get.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.isDeletFingerprintData = true;
|
||||
// state.isDeletAll = true;
|
||||
// state.deletKeyID = "1";
|
||||
// state.deletUserID = "DeleteAll!@#";
|
||||
// state.deletFingerNo = 255;
|
||||
// logic.senderAddFingerprint();
|
||||
// },
|
||||
// ),
|
||||
// ],
|
||||
// );
|
||||
// },
|
||||
// );
|
||||
// }
|
||||
|
||||
@override
|
||||
void didChangeDependencies() {
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
import 'dart:async';
|
||||
import 'dart:io';
|
||||
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:image_picker/image_picker.dart';
|
||||
import 'package:permission_handler/permission_handler.dart';
|
||||
@ -14,7 +13,7 @@ import '../../../tools/eventBusEventManage.dart';
|
||||
import '../../../tools/storage.dart';
|
||||
import 'minePersonGetUploadFileInfo_entity.dart';
|
||||
|
||||
class MinePersonInfoLogic extends GetConnect {
|
||||
class MinePersonInfoLogic extends BaseGetXController {
|
||||
MinePersonInfoState state = MinePersonInfoState();
|
||||
|
||||
//用户信息
|
||||
@ -68,7 +67,7 @@ class MinePersonInfoLogic extends GetConnect {
|
||||
loginData!.headUrl = headUrl;
|
||||
await Storage.saveLoginData(loginData);
|
||||
eventBus.fire(MineInfoChangeRefreshUI());
|
||||
EasyLoading.showToast("操作成功", duration: 2000.milliseconds);
|
||||
showToast("上传成功".tr);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,17 +1,12 @@
|
||||
import 'dart:ffi';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:image_picker/image_picker.dart';
|
||||
import 'package:permission_handler/permission_handler.dart';
|
||||
import 'package:star_lock/app_settings/app_colors.dart';
|
||||
import 'package:star_lock/app_settings/app_settings.dart';
|
||||
import 'package:star_lock/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_logic.dart';
|
||||
import 'package:star_lock/tools/appFirstEnterHandle.dart';
|
||||
import 'package:star_lock/tools/custom_bottom_sheet.dart';
|
||||
import 'package:star_lock/tools/storage.dart';
|
||||
|
||||
import '../../../appRouters.dart';
|
||||
import '../../../tools/commonItem.dart';
|
||||
import '../../../tools/customNetworkImage.dart';
|
||||
@ -29,11 +24,6 @@ class _MinePersonInfoPageState extends State<MinePersonInfoPage> {
|
||||
final logic = Get.put(MinePersonInfoLogic());
|
||||
final state = Get.find<MinePersonInfoLogic>().state;
|
||||
|
||||
@override
|
||||
initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
@ -176,12 +166,8 @@ class _MinePersonInfoPageState extends State<MinePersonInfoPage> {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
// WidgetsBinding.instance.removeObserver(this); // 移除观察者
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
@ -22,22 +22,24 @@ class BaseProvider extends GetConnect with Api {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<Response<T>> post<T>(String? url, body,
|
||||
{String? contentType = "application/json",
|
||||
Map<String, String>? headers,
|
||||
Map<String, dynamic>? query,
|
||||
Decoder<T>? decoder,
|
||||
bool? isUnUploadFile = true,
|
||||
Progress? uploadProgress,
|
||||
bool? isUnShowLoading = false,// 是否显示loading
|
||||
bool? isUserBaseUrl = true,// 文件上传不使用baseUrl
|
||||
}) async {
|
||||
Future<Response<T>> post<T>(
|
||||
String? url,
|
||||
body, {
|
||||
String? contentType = "application/json",
|
||||
Map<String, String>? headers,
|
||||
Map<String, dynamic>? query,
|
||||
Decoder<T>? decoder,
|
||||
bool? isUnUploadFile = true,
|
||||
Progress? uploadProgress,
|
||||
bool? isUnShowLoading = false, // 是否显示loading
|
||||
bool? isUserBaseUrl = true, // 文件上传不使用baseUrl
|
||||
}) async {
|
||||
// print("post: url:${url} body:${body} contentType:${contentType} headers:${headers} query:${query}");
|
||||
if (isUnShowLoading == false) EasyLoading.show();
|
||||
// print('请求url======>$url');
|
||||
if (isUserBaseUrl == false){
|
||||
if (isUserBaseUrl == false) {
|
||||
httpClient.baseUrl = '';
|
||||
}else{
|
||||
} else {
|
||||
httpClient.baseUrl = '${F.apiPrefix}/api';
|
||||
}
|
||||
print('请求body体======>$body');
|
||||
@ -51,6 +53,9 @@ class BaseProvider extends GetConnect with Api {
|
||||
if (res.body == null) {
|
||||
if (EasyLoading.isShow) EasyLoading.dismiss(animation: true);
|
||||
// EasyLoading.showToast("Network Error!", duration: 2000.milliseconds);
|
||||
if (res.statusCode == null) {
|
||||
EasyLoading.showToast("Network Error!", duration: 2000.milliseconds);
|
||||
}
|
||||
var rs = {
|
||||
"errorMsg": "Network Error!",
|
||||
"errorCode": -1,
|
||||
|
||||
@ -8,21 +8,17 @@ import 'package:star_lock/translations/trans_lib.dart';
|
||||
|
||||
class PermissionDialog {
|
||||
static Map<Permission, String> titles = {
|
||||
Permission.camera: TranslationLoader.lanKeys!.permissionDialogCamera!.tr,
|
||||
Permission.photos: TranslationLoader.lanKeys!.permissionDialogPhotos!.tr,
|
||||
Permission.storage: TranslationLoader.lanKeys!.permissionDialogStorage!.tr,
|
||||
Permission.location:
|
||||
TranslationLoader.lanKeys!.permissionDialogLocation!.tr,
|
||||
Permission.camera: '相机'.tr,
|
||||
Permission.photos: '相册'.tr,
|
||||
Permission.storage: '读写'.tr,
|
||||
Permission.location: '定位'.tr,
|
||||
};
|
||||
|
||||
static Map<Permission, String> contents = {
|
||||
Permission.camera:
|
||||
TranslationLoader.lanKeys!.permissionDialogCameraText!.tr,
|
||||
Permission.photos: TranslationLoader.lanKeys!.permissionDialogPhotos!.tr,
|
||||
Permission.storage:
|
||||
TranslationLoader.lanKeys!.permissionDialogStorageText!.tr,
|
||||
Permission.location:
|
||||
TranslationLoader.lanKeys!.permissionDialogLocationText!.tr,
|
||||
Permission.camera: '需要访问相机权限才能拍照上传文件例如头像上传'.tr,
|
||||
Permission.photos: '需要访问相机权限才能使用相册图片上传文件上传头像'.tr,
|
||||
Permission.storage: '需要访问读写权限才能使用本地图片上传头像'.tr,
|
||||
Permission.location: '需要访问定位权限才能使用添加钥匙功能的位置信息'.tr,
|
||||
};
|
||||
|
||||
//显示权限判断申请框
|
||||
@ -40,20 +36,17 @@ class PermissionDialog {
|
||||
return PopScope(
|
||||
canPop: false,
|
||||
child: CupertinoAlertDialog(
|
||||
title: Text(
|
||||
'${TranslationLoader.lanKeys!.permissionDialogApplication!.tr}${titles[permission] ?? ''}${TranslationLoader.lanKeys!.permissionDialogAuthority!.tr}'),
|
||||
title: Text('${'申请'.tr}${titles[permission] ?? ''}${'权限'.tr}'),
|
||||
content: Text(contents[permission] ?? ''),
|
||||
actions: [
|
||||
CupertinoDialogAction(
|
||||
child: Text(TranslationLoader
|
||||
.lanKeys!.permissionDialogNotAllowed!.tr),
|
||||
child: Text('不允许'.tr),
|
||||
onPressed: () {
|
||||
Get.back(result: false);
|
||||
},
|
||||
),
|
||||
CupertinoDialogAction(
|
||||
child: Text(
|
||||
TranslationLoader.lanKeys!.permissionDialogAllowed!.tr),
|
||||
child: Text('允许'.tr),
|
||||
onPressed: () {
|
||||
Get.back(result: true);
|
||||
},
|
||||
@ -62,7 +55,7 @@ class PermissionDialog {
|
||||
));
|
||||
},
|
||||
);
|
||||
if(application){
|
||||
if (application) {
|
||||
await Storage.setString(titles[permission], titles[permission]);
|
||||
}
|
||||
} else if (cache is String) {
|
||||
@ -89,14 +82,12 @@ class PermissionDialog {
|
||||
return PopScope(
|
||||
canPop: false,
|
||||
child: CupertinoAlertDialog(
|
||||
title: Text(
|
||||
'${titles[permission] ?? ''}${TranslationLoader.lanKeys!.permissionDialogPermissionDenied!.tr}'),
|
||||
title: Text('${titles[permission] ?? ''}${'权限被拒绝'.tr}'),
|
||||
content: Text(
|
||||
'${contents[permission] ?? ''},${TranslationLoader.lanKeys!.permissionDialogOpenPermissions!.tr}${titles[permission]}${TranslationLoader.lanKeys!.permissionDialogCameraText!.tr}'),
|
||||
'${contents[permission] ?? ''},${'请手动在系统设置中开启'.tr}${titles[permission]}${'权限以继续使用应用'.tr}'),
|
||||
actions: [
|
||||
CupertinoDialogAction(
|
||||
child: Text(
|
||||
TranslationLoader.lanKeys!.permissionDialogGoSetUp!.tr),
|
||||
child: Text('去设置'.tr),
|
||||
onPressed: () {
|
||||
Get.back(); // 关闭对话框
|
||||
openAppSettings(); // 打开系统设置页面
|
||||
|
||||
@ -1,12 +1,10 @@
|
||||
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../app_settings/app_colors.dart';
|
||||
import '../translations/trans_lib.dart';
|
||||
|
||||
class KeySearchWidget extends StatelessWidget {
|
||||
TextEditingController editingController;
|
||||
@ -33,8 +31,7 @@ class KeySearchWidget extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.only(
|
||||
top: 15.h, bottom: 15.h, right: 5.w, left: 10.w),
|
||||
padding: EdgeInsets.only(top: 15.h, bottom: 15.h, right: 5.w, left: 10.w),
|
||||
child: Image.asset(
|
||||
'images/main/icon_main_search.png',
|
||||
width: 40.w,
|
||||
@ -42,7 +39,7 @@ class KeySearchWidget extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Container(
|
||||
child: SizedBox(
|
||||
height: 60.h,
|
||||
// width: 1.sw,
|
||||
// color: Colors.red,
|
||||
@ -58,22 +55,18 @@ class KeySearchWidget extends StatelessWidget {
|
||||
autofocus: false,
|
||||
textAlign: TextAlign.start,
|
||||
onChanged: (value) {
|
||||
print("onChanged:$value");
|
||||
Get.log("onChanged:$value");
|
||||
},
|
||||
onEditingComplete: () {
|
||||
print("onEditingComplete:");
|
||||
Get.log("onEditingComplete:");
|
||||
},
|
||||
onSubmitted: (value) {
|
||||
onSubmittedAction!();
|
||||
},
|
||||
decoration: InputDecoration(
|
||||
//输入里面输入文字内边距设置
|
||||
// contentPadding: const EdgeInsets.only(
|
||||
// top: 12.0, left: -19.0, right: -15.0, bottom: 8.0),
|
||||
// hintText: TranslationLoader.lanKeys!.pleaseEnter!.tr,
|
||||
hintText:"搜索",
|
||||
hintText:"搜索".tr,
|
||||
hintStyle: TextStyle(fontSize: 22.sp),
|
||||
// border: InputBorder.none,
|
||||
focusedBorder: const OutlineInputBorder(borderSide: BorderSide(width: 0, color: Colors.transparent)),
|
||||
disabledBorder: const OutlineInputBorder(borderSide: BorderSide(width: 0, color: Colors.transparent)),
|
||||
enabledBorder: const OutlineInputBorder(borderSide: BorderSide(width: 0, color: Colors.transparent)),
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
@ -21,15 +22,10 @@ class NoData extends StatelessWidget {
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Image.asset(
|
||||
'images/icon_noData.png',
|
||||
width: 160.w,
|
||||
height: 180.h,
|
||||
),
|
||||
Image.asset('images/icon_noData.png', width: 160.w, height: 180.h,),
|
||||
Text(
|
||||
TranslationLoader.lanKeys!.noData!.tr,
|
||||
style:
|
||||
TextStyle(color: AppColors.darkGrayTextColor, fontSize: 22.sp),
|
||||
style: TextStyle(color: AppColors.darkGrayTextColor, fontSize: 22.sp),
|
||||
)
|
||||
],
|
||||
)),
|
||||
|
||||
@ -14,12 +14,12 @@ class SeletKeyCyclicDateLogic extends BaseGetXController {
|
||||
var endTimeTimestamp = DateTool().dateToTimestamp(state.endTime.value, 0).toString();
|
||||
|
||||
if (int.parse(starDateTimestamp) >= int.parse(endDateTimestamp)) {
|
||||
showToast("失效日期要大于生效日期");
|
||||
showToast("失效日期要大于生效日期".tr);
|
||||
return;
|
||||
}
|
||||
|
||||
if (int.parse(starTimeTimestamp) >= int.parse(endTimeTimestamp)) {
|
||||
showToast("失效时间要大于生效时间");
|
||||
showToast("失效时间要大于生效时间".tr);
|
||||
return;
|
||||
}
|
||||
Map<String, dynamic> resultMap = {};
|
||||
|
||||
@ -32,7 +32,7 @@ class _SeletKeyCyclicDatePageState extends State<SeletKeyCyclicDatePage> {
|
||||
return Scaffold(
|
||||
backgroundColor: AppColors.mainBackgroundColor,
|
||||
appBar: TitleAppBar(
|
||||
barTitle: "有效期",
|
||||
barTitle: "有效期".tr,
|
||||
haveBack: true,
|
||||
backgroundColor: AppColors.mainColor),
|
||||
body: ListView(
|
||||
@ -68,7 +68,7 @@ class _SeletKeyCyclicDatePageState extends State<SeletKeyCyclicDatePage> {
|
||||
child: Column(
|
||||
children: [
|
||||
Obx(() => CommonItem(
|
||||
leftTitel: "生效日期",
|
||||
leftTitel: "生效日期".tr,
|
||||
rightTitle: state.starDate.value,
|
||||
isHaveDirection: true,
|
||||
isHaveLine: true,
|
||||
@ -79,7 +79,7 @@ class _SeletKeyCyclicDatePageState extends State<SeletKeyCyclicDatePage> {
|
||||
});
|
||||
})),
|
||||
Obx(() => CommonItem(
|
||||
leftTitel: "失效日期",
|
||||
leftTitel: "失效日期".tr,
|
||||
rightTitle: state.endDate.value,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
@ -198,7 +198,7 @@ class _SeletKeyCyclicDatePageState extends State<SeletKeyCyclicDatePage> {
|
||||
child: Column(
|
||||
children: [
|
||||
Obx(() => CommonItem(
|
||||
leftTitel: "生效时间",
|
||||
leftTitel: "生效时间".tr,
|
||||
rightTitle: state.starTime.value,
|
||||
isHaveDirection: true,
|
||||
isHaveLine: true,
|
||||
@ -208,7 +208,7 @@ class _SeletKeyCyclicDatePageState extends State<SeletKeyCyclicDatePage> {
|
||||
});
|
||||
})),
|
||||
Obx(() => CommonItem(
|
||||
leftTitel:"失效时间",
|
||||
leftTitel:"失效时间".tr,
|
||||
rightTitle: state.endTime.value,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
|
||||
@ -1,8 +1,6 @@
|
||||
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../translations/trans_lib.dart';
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user