添加卡、指纹模块国际化

This commit is contained in:
魏少阳 2024-04-10 15:59:44 +08:00
parent 40818eaf99
commit f493ce4fc4
22 changed files with 447 additions and 500 deletions

View File

@ -613,5 +613,18 @@
"地图加载中,请稍候。。": "The map is loading, please wait...",
"跳过": "Skip",
"还未获取到位置信息哦,请耐心等待一下!": "The location information has not been obtained yet, please wait patiently!",
"请填写信息": "Please fill in the information"
"请填写信息": "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"
}

View File

@ -614,5 +614,18 @@
"地图加载中,请稍候。。": "地图加载中,请稍候。。",
"跳过": "跳过",
"还未获取到位置信息哦,请耐心等待一下!": "还未获取到位置信息哦,请耐心等待一下!",
"请填写信息": "请填写信息"
"请填写信息": "请填写信息",
"有效期": "有效期",
"生效时间": "生效时间",
"失效时间": "失效时间",
"上传成功": "上传成功",
"未生效": "未生效",
"已生效": "已生效",
"指纹详情": "指纹详情",
"添加过程中,请根据提示,在指纹采集器上进行多次的抬起按压": "添加过程中,请根据提示,在指纹采集器上进行多次的抬起按压",
"开始添加": "开始添加",
"请将您的手指按下": "请将您的手指按下",
"根据提示,抬起手指后再进行下一次指纹采集": "根据提示,抬起手指后再进行下一次指纹采集",
"添加成功": "添加成功",
"搜索": "搜索"
}

View File

@ -615,5 +615,18 @@
"地图加载中,请稍候。。": "地图加载中,请稍候。。",
"跳过": "跳过",
"还未获取到位置信息哦,请耐心等待一下!": "还未获取到位置信息哦,请耐心等待一下!",
"请填写信息": "请填写信息"
"请填写信息": "请填写信息",
"有效期": "有效期",
"生效时间": "生效时间",
"失效时间": "失效时间",
"上传成功": "上传成功",
"未生效": "未生效",
"已生效": "已生效",
"指纹详情": "指纹详情",
"添加过程中,请根据提示,在指纹采集器上进行多次的抬起按压": "添加过程中,请根据提示,在指纹采集器上进行多次的抬起按压",
"开始添加": "开始添加",
"请将您的手指按下": "请将您的手指按下",
"根据提示,抬起手指后再进行下一次指纹采集": "根据提示,抬起手指后再进行下一次指纹采集",
"添加成功": "添加成功",
"搜索": "搜索"
}

View File

@ -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

View File

@ -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() {

View File

@ -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);
});
}
}

View File

@ -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,

View File

@ -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"];

View File

@ -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: {

View File

@ -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) {

View File

@ -1,5 +1,4 @@
import 'package:star_lock/tools/baseGetXController.dart';
import 'addFingerprintTip_state.dart';

View File

@ -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: {

View File

@ -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){

View File

@ -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() {

View File

@ -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;23: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

View File

@ -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() {

View File

@ -1,6 +1,5 @@
import 'dart:async';
import 'dart:io';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:get/get.dart';
import 'package:star_lock/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_entity.dart';
import 'package:star_lock/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_state.dart';
@ -10,7 +9,7 @@ import '../../../tools/eventBusEventManage.dart';
import '../../../tools/storage.dart';
import 'minePersonGetUploadFileInfo_entity.dart';
class MinePersonInfoLogic extends GetConnect {
class MinePersonInfoLogic extends BaseGetXController {
MinePersonInfoState state = MinePersonInfoState();
//
@ -30,7 +29,6 @@ class MinePersonInfoLogic extends GetConnect {
size: size);
if (entity.errorCode!.codeIsSuccessful) {
uploadFile(entity);
// print("aaaaa:$loginEntity");
}
}
@ -62,7 +60,7 @@ class MinePersonInfoLogic extends GetConnect {
loginData!.headUrl = headUrl;
await Storage.saveLoginData(loginData);
eventBus.fire(MineInfoChangeRefreshUI());
EasyLoading.showToast("操作成功", duration: 2000.milliseconds);
showToast("上传成功".tr);
}
}

View File

@ -1,4 +1,4 @@
import 'dart:ffi';
import 'dart:io';
import 'package:flutter/material.dart';
@ -25,31 +25,10 @@ class MinePersonInfoPage extends StatefulWidget {
State<MinePersonInfoPage> createState() => _MinePersonInfoPageState();
}
class _MinePersonInfoPageState extends State<MinePersonInfoPage>
// with WidgetsBindingObserver
{
class _MinePersonInfoPageState extends State<MinePersonInfoPage> {
final logic = Get.put(MinePersonInfoLogic());
final state = Get.find<MinePersonInfoLogic>().state;
@override
initState() {
super.initState();
// WidgetsBinding.instance.addObserver(this); //
// logic.getUserInfoRequest();
// _checkCameraPermission();
// _checkPhotoPermission();
}
// //
// @override
// void didChangeAppLifecycleState(AppLifecycleState state) {
// super.didChangeAppLifecycleState(state);
// if (state == AppLifecycleState.resumed) {
// //
// checkCameraPermission();
// }
// }
@override
Widget build(BuildContext context) {
return Scaffold(
@ -71,21 +50,6 @@ class _MinePersonInfoPageState extends State<MinePersonInfoPage>
borderRadius: BorderRadius.circular(36.w),
child: CustomNetworkImage(url:state.headUrl.value, defaultUrl: 'images/controls_user.png', width:72.w, height:72.w),
),
// ClipOval(
// child: state.image != null
// ? Image.file(
// File(state.image!.path),
// width: 72.w,
// height: 72.w,
// fit: BoxFit.fill,
// )
// : Image.asset(
// 'images/controls_user.png',
// width: 72.w,
// height: 72.w,
// fit: BoxFit.fill,
// ),
// ),
action: () async {
//
if (Platform.isAndroid) {
@ -327,16 +291,12 @@ class _MinePersonInfoPageState extends State<MinePersonInfoPage>
if (status.isGranted) {
selectImage();
} else {
// setState(() {
// state.hasPhotoPermission.value = false; //
// });
_requestPhotoPermission();
}
}
@override
void dispose() {
// WidgetsBinding.instance.removeObserver(this); //
super.dispose();
}
}

View File

@ -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)),

View File

@ -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 = {};

View File

@ -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: () {

View File

@ -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';