添加卡、指纹模块国际化

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...", "地图加载中,请稍候。。": "The map is loading, please wait...",
"跳过": "Skip", "跳过": "Skip",
"还未获取到位置信息哦,请耐心等待一下!": "The location information has not been obtained yet, please wait patiently!", "还未获取到位置信息哦,请耐心等待一下!": "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 'dart:async';
// import 'package:flutter_reactive_ble/flutter_reactive_ble.dart';
import 'package:flutter_blue_plus/flutter_blue_plus.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/blue/io_type.dart';
import 'package:star_lock/tools/baseGetXController.dart'; import 'package:star_lock/tools/baseGetXController.dart';
import 'package:star_lock/tools/dateTool.dart'; import 'package:star_lock/tools/dateTool.dart';
@ -46,19 +46,19 @@ class CardListLogic extends BaseGetXController {
// () // ()
Future<void> _replyAddICCardBegin(Reply reply) async { Future<void> _replyAddICCardBegin(Reply reply) async {
int status = reply.data[2]; int status = reply.data[2];
print("_replyAddFingerprintStatus:$status"); Get.log("_replyAddFingerprintStatus:$status");
switch(status){ switch(status){
case 0x00: case 0x00:
// //
print("${reply.commandType!.typeValue} 数据解析成功"); Get.log("${reply.commandType!.typeValue} 数据解析成功");
state.isDeletCardData = false; state.isDeletCardData = false;
cancelBlueConnetctToastTimer(); cancelBlueConnetctToastTimer();
deletICCardData(); deletICCardData();
break; break;
case 0x06: case 0x06:
// //
print("${reply.commandType!.typeValue} 需要鉴权"); Get.log("${reply.commandType!.typeValue} 需要鉴权");
var privateKey = await Storage.getStringList(saveBluePrivateKey); var privateKey = await Storage.getStringList(saveBluePrivateKey);
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!); List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
@ -82,19 +82,16 @@ class CardListLogic extends BaseGetXController {
); );
break; break;
case 0x07: case 0x07:
// //
print("${reply.commandType!.typeValue} 用户无权限"); Get.log("${reply.commandType!.typeValue} 用户无权限");
break; break;
case 0x09: case 0x09:
// //
print("${reply.commandType!.typeValue} 权限校验错误"); Get.log("${reply.commandType!.typeValue} 权限校验错误");
break; break;
default: default:
// //
print("${reply.commandType!.typeValue} 失败"); Get.log("${reply.commandType!.typeValue} 失败");
break; break;
} }
} }
@ -104,29 +101,25 @@ class CardListLogic extends BaseGetXController {
int status = reply.data[2]; int status = reply.data[2];
switch(status){ switch(status){
case 0x00: case 0x00:
// //
print("${reply.commandType}数据解析成功"); Get.log("${reply.commandType}数据解析成功");
// _getLockStatus(); // _getLockStatus();
break; break;
case 0x06: case 0x06:
// //
print("${reply.commandType}需要鉴权"); Get.log("${reply.commandType}需要鉴权");
break; break;
case 0x07: case 0x07:
// //
print("${reply.commandType}用户无权限"); Get.log("${reply.commandType}用户无权限");
break; break;
case 0x09: case 0x09:
// //
print("${reply.commandType}权限校验错误"); Get.log("${reply.commandType}权限校验错误");
break; break;
default: default:
// //
print("${reply.commandType}失败"); Get.log("${reply.commandType}失败");
break; break;
} }
} }
@ -175,33 +168,29 @@ class CardListLogic extends BaseGetXController {
// //
var serialNo = reply.data.sublist(17, 21); var serialNo = reply.data.sublist(17, 21);
print("serialNo:$serialNo"); Get.log("serialNo:$serialNo");
switch(status){ switch(status){
case 0x00: case 0x00:
// //
print("${reply.commandType}数据解析成功"); Get.log("${reply.commandType}数据解析成功");
// _getLockStatus(); // _getLockStatus();
break; break;
case 0x06: case 0x06:
// //
print("${reply.commandType}需要鉴权"); Get.log("${reply.commandType}需要鉴权");
break; break;
case 0x07: case 0x07:
// //
print("${reply.commandType}用户无权限"); Get.log("${reply.commandType}用户无权限");
break; break;
case 0x09: case 0x09:
// //
print("${reply.commandType}权限校验错误"); Get.log("${reply.commandType}权限校验错误");
break; break;
default: default:
// //
print("${reply.commandType}失败"); Get.log("${reply.commandType}失败");
break; break;
} }
} }
@ -277,7 +266,6 @@ class CardListLogic extends BaseGetXController {
var token = await Storage.getStringList(saveBlueToken); var token = await Storage.getStringList(saveBlueToken);
List<int> getTokenList = changeStringListToIntList(token!); List<int> getTokenList = changeStringListToIntList(token!);
print("openDoorTokenPubToken:$getTokenList");
IoSenderManage.senderAddICCardCommand( IoSenderManage.senderAddICCardCommand(
keyID:state.deletKeyID, keyID:state.deletKeyID,
@ -316,7 +304,6 @@ class CardListLogic extends BaseGetXController {
} else { } else {
if (entity.data!.list!.isNotEmpty) { if (entity.data!.list!.isNotEmpty) {
state.fingerprintItemListData.value.addAll(entity.data!.list!); state.fingerprintItemListData.value.addAll(entity.data!.list!);
print("state.itemDataList.value.length:${state.fingerprintItemListData.value.length}");
pageNo++; pageNo++;
} }
} }
@ -332,7 +319,6 @@ class CardListLogic extends BaseGetXController {
cardId = state.deletKeyID; cardId = state.deletKeyID;
type = "0"; type = "0";
} }
print("delet fingerprintId $cardId");
var entity = await ApiRepository.to.deletIcCardData( var entity = await ApiRepository.to.deletIcCardData(
cardId: cardId, cardId: cardId,
lockId: state.lockId.value.toString(), lockId: state.lockId.value.toString(),
@ -368,7 +354,6 @@ class CardListLogic extends BaseGetXController {
String getKeyType(FingerprintItemData fingerprintItemData){ String getKeyType(FingerprintItemData fingerprintItemData){
// fingerprintStatus 1: 2: // fingerprintStatus 1: 2:
var keyTypeStr = "";// var keyTypeStr = "";//
// (fingerprintItemData.fingerprintType! != 1) ? (fingerprintItemData.endDate! < DateTime.now().millisecondsSinceEpoch ? "已失效" : "") : ""
if(fingerprintItemData.cardStatus == 1){ if(fingerprintItemData.cardStatus == 1){
if(fingerprintItemData.startDate! > DateTime.now().millisecondsSinceEpoch){ if(fingerprintItemData.startDate! > DateTime.now().millisecondsSinceEpoch){
keyTypeStr = "未生效"; keyTypeStr = "未生效";
@ -396,11 +381,10 @@ class CardListLogic extends BaseGetXController {
Future<void> onReady() async { Future<void> onReady() async {
// TODO: implement onReady // TODO: implement onReady
super.onReady(); super.onReady();
print("onReady()"); Get.log("onReady()");
// //
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot); var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
// print("aaaaaaa:$isDemoMode");
if(isDemoMode == false){ if(isDemoMode == false){
_initReplySubscription(); _initReplySubscription();
@ -412,14 +396,7 @@ class CardListLogic extends BaseGetXController {
Future<void> onInit() async { Future<void> onInit() async {
// TODO: implement onInit // TODO: implement onInit
super.onInit(); super.onInit();
print("onInit()"); Get.log("onInit()");
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
if(isDemoMode == false) {
// senderQueryingFingerprintStatus();
// senderCheckingCardStatus();
// senderCheckingUserInfoCount();
}
} }
@override @override

View File

@ -1,5 +1,4 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
@ -12,9 +11,8 @@ import '../../../../blue/blue_manage.dart';
import '../../../../tools/EasyRefreshTool.dart'; import '../../../../tools/EasyRefreshTool.dart';
import '../../../../tools/appRouteObserver.dart'; import '../../../../tools/appRouteObserver.dart';
import '../../../../tools/keySearchWidget.dart'; import '../../../../tools/keySearchWidget.dart';
import '../../../../tools/left_slide_actions.dart';
import '../../../../tools/noData.dart'; import '../../../../tools/noData.dart';
import '../../../../tools/showIosTipView.dart'; import '../../../../tools/showTipView.dart';
import '../../../../tools/storage.dart'; import '../../../../tools/storage.dart';
import '../../../../tools/submitBtn.dart'; import '../../../../tools/submitBtn.dart';
import '../../../../tools/titleAppBar.dart'; import '../../../../tools/titleAppBar.dart';
@ -66,9 +64,16 @@ class _CardListPageState extends State<CardListPage> with RouteAware {
onPressed: () async { onPressed: () async {
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot); var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
if (isDemoMode == false) { 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 { } else {
// Get.toNamed(Routers.selectLockTypePage);
logic.showToast("演示模式"); logic.showToast("演示模式");
} }
}, },
@ -132,7 +137,14 @@ class _CardListPageState extends State<CardListPage> with RouteAware {
children: [ children: [
SlidableAction( SlidableAction(
onPressed: (BuildContext context){ 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, backgroundColor: Colors.red,
foregroundColor: Colors.white, 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)); ) : 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, Widget _keyItem(String lockTypeIcon, String lockTypeTitle, String ifInvalidation, String showTime,
Function() action) { Function() action) {
return GestureDetector( return GestureDetector(
@ -261,37 +249,61 @@ class _CardListPageState extends State<CardListPage> with RouteAware {
); );
} }
void showDeletAlertDialog(BuildContext context) { // void showIosTipViewDialog(FingerprintItemData fingerprintItemData) {
showCupertinoDialog( // showDialog(
context: context, // context: Get.context!,
builder: (context) { // builder: (BuildContext context) {
return CupertinoAlertDialog( // return ShowIosTipView(
title: const Text("提示"), // title: "提示",
content: const Text('重置后,该锁的卡都将被删除哦,确认要重置吗?'), // tipTitle: "确定要删除吗?",
actions: [ // sureClick: () async {
CupertinoDialogAction( // Get.back();
child: Text(TranslationLoader.lanKeys!.cancel!.tr), // state.isDeletCardData = true;
onPressed: () { // state.isDeletAll = false;
Navigator.pop(context); // state.deletUserID = (await Storage.getUid())!;
}, // state.deletKeyID = fingerprintItemData.cardId.toString();
), // state.deletCardNo = int.parse(fingerprintItemData.cardNumber!);
CupertinoDialogAction( // logic.senderAddICCard();
child: Text(TranslationLoader.lanKeys!.sure!.tr), // },
onPressed: () { // cancelClick: () {
Navigator.pop(context); // Get.back();
state.isDeletCardData = true; // },
state.isDeletAll = true; // );
state.deletKeyID = "1"; // },
state.deletUserID = "DeleteAll!@#"; // );
state.deletCardNo = 255; // }
logic.senderAddICCard();
}, // 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 @override
void didChangeDependencies() { void didChangeDependencies() {

View File

@ -50,22 +50,22 @@ class AddFingerprintLogic extends BaseGetXController {
Future<void> _replyAddFingerprintBegin(Reply reply) async { Future<void> _replyAddFingerprintBegin(Reply reply) async {
int status = reply.data[2]; int status = reply.data[2];
print("status:$status"); Get.log("status:$status");
switch(status){ switch(status){
case 0x00: case 0x00:
// //
print("${reply.commandType!.typeValue} 数据解析成功"); Get.log("${reply.commandType!.typeValue} 数据解析成功");
state.ifConnectScuess.value = true; state.ifConnectScuess.value = true;
// //
state.maxRegCount.value = reply.data[10]; 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(); // state.fingerprintNumber.value = reply.data.last.toString();
break; break;
case 0x06: case 0x06:
// //
print("${reply.commandType!.typeValue} 需要鉴权"); Get.log("${reply.commandType!.typeValue} 需要鉴权");
var privateKey = await Storage.getStringList(saveBluePrivateKey); var privateKey = await Storage.getStringList(saveBluePrivateKey);
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!); List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
@ -74,7 +74,6 @@ class AddFingerprintLogic extends BaseGetXController {
var token = reply.data.sublist(5, 9); var token = reply.data.sublist(5, 9);
var saveStrList = changeIntListToStringList(token); var saveStrList = changeIntListToStringList(token);
print("_replyAddFingerprintReplyToken:$token");
Storage.setStringList(saveBlueToken, saveStrList); Storage.setStringList(saveBlueToken, saveStrList);
IoSenderManage.senderAddFingerprintCommand( IoSenderManage.senderAddFingerprintCommand(
@ -82,8 +81,6 @@ class AddFingerprintLogic extends BaseGetXController {
userID:await Storage.getUid(), userID:await Storage.getUid(),
fingerNo:state.isAdministrator.value == "2" ? 254 : 1, fingerNo:state.isAdministrator.value == "2" ? 254 : 1,
useCountLimit:0xff, useCountLimit:0xff,
// startTime:0x11223344,
// endTime:0x11223344,
startTime:int.parse(state.startDate.value)~/1000, startTime:int.parse(state.startDate.value)~/1000,
endTime:int.parse(state.endDate.value)~/1000, endTime:int.parse(state.endDate.value)~/1000,
needAuthor:1, needAuthor:1,
@ -93,22 +90,22 @@ class AddFingerprintLogic extends BaseGetXController {
); );
break; break;
case 0x07: case 0x07:
// //
print("${reply.commandType!.typeValue} 用户无权限"); Get.log("${reply.commandType!.typeValue} 用户无权限");
showToast("添加指纹失败", something: (){ showToast("添加指纹失败", something: (){
Get.back(); Get.back();
}); });
break; break;
case 0x09: case 0x09:
// //
print("${reply.commandType!.typeValue} 权限校验错误"); Get.log("${reply.commandType!.typeValue} 权限校验错误");
showToast("添加指纹失败", something: (){ showToast("添加指纹失败", something: (){
Get.back(); Get.back();
}); });
break; break;
default: default:
// //
print("${reply.commandType!.typeValue} 失败"); Get.log("${reply.commandType!.typeValue} 失败");
showToast("添加指纹失败", something: (){ showToast("添加指纹失败", something: (){
Get.back(); Get.back();
}); });
@ -118,15 +115,14 @@ class AddFingerprintLogic extends BaseGetXController {
Future<void> _replyAddFingerprintProcess(Reply reply) async { Future<void> _replyAddFingerprintProcess(Reply reply) async {
int status = reply.data[2]; int status = reply.data[2];
print("33 status:$status"); Get.log("33 status:$status");
switch(status){ switch(status){
case 0x00: case 0x00:
// //
print("${reply.commandType!.typeValue} 数据解析成功"); Get.log("${reply.commandType!.typeValue} 数据解析成功");
if(reply.data[5] == 255){ if(reply.data[5] == 255){
// //
// print("${reply.commandType!.typeValue} 注册指纹失败");
showToast("添加失败"); showToast("添加失败");
Get.close(2); Get.close(2);
}else{ }else{
@ -134,40 +130,35 @@ class AddFingerprintLogic extends BaseGetXController {
// //
state.regIndex.value = reply.data[6]; state.regIndex.value = reply.data[6];
print("state.regIndex.value:${state.regIndex.value}"); Get.log("state.regIndex.value:${state.regIndex.value}");
} }
break; break;
case 0x06: case 0x06:
// //
break; break;
case 0x07: case 0x07:
// //
print("${reply.commandType!.typeValue} 用户无权限"); Get.log("${reply.commandType!.typeValue} 用户无权限");
break; break;
case 0x09: case 0x09:
// //
print("${reply.commandType!.typeValue} 权限校验错误"); Get.log("${reply.commandType!.typeValue} 权限校验错误");
break; break;
default: default:
// //
print("${reply.commandType!.typeValue} 失败"); Get.log("${reply.commandType!.typeValue} 失败");
break; break;
} }
} }
Future<void> _replyAddFingerprintConfirmation(Reply reply) async { Future<void> _replyAddFingerprintConfirmation(Reply reply) async {
int status = reply.data[2]; int status = reply.data[2];
print("status:$status"); Get.log("status:$status");
switch(status){ switch(status){
case 0x00: case 0x00:
// //
print("${reply.commandType!.typeValue} 数据解析成功"); Get.log("${reply.commandType!.typeValue} 数据解析成功");
// print("添加指纹确认成功,调用添加指纹接口");
if(state.fingerprintNumber.value == (reply.data[6]).toString()){ if(state.fingerprintNumber.value == (reply.data[6]).toString()){
return; return;
}else{ }else{
@ -183,40 +174,35 @@ class AddFingerprintLogic extends BaseGetXController {
break; break;
case 0x06: case 0x06:
// //
break; break;
case 0x07: case 0x07:
// //
print("${reply.commandType!.typeValue} 用户无权限"); Get.log("${reply.commandType!.typeValue} 用户无权限");
break; break;
case 0x09: case 0x09:
// //
print("${reply.commandType!.typeValue} 权限校验错误"); Get.log("${reply.commandType!.typeValue} 权限校验错误");
break; break;
default: default:
// //
print("${reply.commandType!.typeValue} 失败"); Get.log("${reply.commandType!.typeValue} 失败");
break; break;
} }
} }
Future<void> _replyAddStressFingerprint(Reply reply) async { Future<void> _replyAddStressFingerprint(Reply reply) async {
int status = reply.data[2]; int status = reply.data[2];
print("status:$status"); Get.log("status:$status");
switch(status){ switch(status){
case 0x00: case 0x00:
// //
print("${reply.commandType!.typeValue} 数据解析成功"); Get.log("${reply.commandType!.typeValue} 数据解析成功");
// print("添加指纹确认成功,调用添加指纹接口"); // print("添加指纹确认成功,调用添加指纹接口");
addFingerprintsData(); addFingerprintsData();
break; break;
case 0x06: case 0x06:
// //
var privateKey = await Storage.getStringList(saveBluePrivateKey); var privateKey = await Storage.getStringList(saveBluePrivateKey);
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!); List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
@ -228,7 +214,6 @@ class AddFingerprintLogic extends BaseGetXController {
var token = reply.data.sublist(5, 9); var token = reply.data.sublist(5, 9);
var saveStrList = changeIntListToStringList(token); var saveStrList = changeIntListToStringList(token);
print("_replyAddFingerprintReplyToken:$token");
Storage.setStringList(saveBlueToken, saveStrList); Storage.setStringList(saveBlueToken, saveStrList);
IoSenderManage.senderAddStressFingerprintCommand( IoSenderManage.senderAddStressFingerprintCommand(
@ -237,8 +222,6 @@ class AddFingerprintLogic extends BaseGetXController {
fingerNo:state.isAdministrator.value == "2" ? 254 : 1, fingerNo:state.isAdministrator.value == "2" ? 254 : 1,
fingerType:1, fingerType:1,
useCountLimit:1, useCountLimit:1,
// startTime:0x11223344,
// endTime:0x11223344,
startTime:int.parse(state.startDate.value)~/1000, startTime:int.parse(state.startDate.value)~/1000,
endTime:int.parse(state.endDate.value)~/1000, endTime:int.parse(state.endDate.value)~/1000,
needAuthor:1, needAuthor:1,
@ -249,19 +232,16 @@ class AddFingerprintLogic extends BaseGetXController {
); );
break; break;
case 0x07: case 0x07:
// //
print("${reply.commandType!.typeValue} 用户无权限"); Get.log("${reply.commandType!.typeValue} 用户无权限");
break; break;
case 0x09: case 0x09:
// //
print("${reply.commandType!.typeValue} 权限校验错误"); Get.log("${reply.commandType!.typeValue} 权限校验错误");
break; break;
default: default:
// //
print("${reply.commandType!.typeValue} 失败"); Get.log("${reply.commandType!.typeValue} 失败");
break; break;
} }
} }
@ -323,7 +303,6 @@ class AddFingerprintLogic extends BaseGetXController {
var token = await Storage.getStringList(saveBlueToken); var token = await Storage.getStringList(saveBlueToken);
List<int> getTokenList = changeStringListToIntList(token!); List<int> getTokenList = changeStringListToIntList(token!);
print("StressFingerprintToken:$getTokenList");
IoSenderManage.senderAddStressFingerprintCommand( IoSenderManage.senderAddStressFingerprintCommand(
keyID:"1", keyID:"1",
@ -331,8 +310,6 @@ class AddFingerprintLogic extends BaseGetXController {
fingerNo:state.isAdministrator.value == "2" ? 254 : 1, fingerNo:state.isAdministrator.value == "2" ? 254 : 1,
fingerType:1, fingerType:1,
useCountLimit:1, useCountLimit:1,
// startTime:0x11223344,
// endTime:0x11223344,
startTime:int.parse(state.startDate.value)~/1000, startTime:int.parse(state.startDate.value)~/1000,
endTime:int.parse(state.endDate.value)~/1000, endTime:int.parse(state.endDate.value)~/1000,
needAuthor:1, needAuthor:1,
@ -364,7 +341,6 @@ class AddFingerprintLogic extends BaseGetXController {
endTime: int.parse(state.failureDateTime.value), endTime: int.parse(state.failureDateTime.value),
); );
if(entity.errorCode!.codeIsSuccessful){ if(entity.errorCode!.codeIsSuccessful){
// Toast.show(msg: "添加成功");
updateFingerprintUserNoLoadData(entity.data!.fingerprintId.toString()); updateFingerprintUserNoLoadData(entity.data!.fingerprintId.toString());
} }
} }
@ -377,14 +353,15 @@ class AddFingerprintLogic extends BaseGetXController {
fingerprintUserNo: state.fingerprintNumber.value, fingerprintUserNo: state.fingerprintNumber.value,
); );
if(entity.errorCode!.codeIsSuccessful){ if(entity.errorCode!.codeIsSuccessful){
showToast("添加成功"); showToast("添加成功".tr, something: (){
if(state.fromType.value == 2){ if(state.fromType.value == 2){
// //
eventBus.fire(ChickInAddStaffCardAndFingerprintBlockNumberEvent(state.fingerprintNumber.value)); eventBus.fire(ChickInAddStaffCardAndFingerprintBlockNumberEvent(state.fingerprintNumber.value));
}else if(state.fromType.value == 1){ }else if(state.fromType.value == 1){
eventBus.fire(OtherTypeRefreshListEvent()); eventBus.fire(OtherTypeRefreshListEvent());
} }
Get.close(2); Get.close(2);
});
} }
} }

View File

@ -30,8 +30,6 @@ class _AddFingerprintPageState extends State<AddFingerprintPage> with RouteAware
haveBack: true, haveBack: true,
backgroundColor: AppColors.mainColor), backgroundColor: AppColors.mainColor),
body: ListView( body: ListView(
// mainAxisAlignment: MainAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
SizedBox( SizedBox(
height: 50.h, height: 50.h,
@ -47,7 +45,7 @@ class _AddFingerprintPageState extends State<AddFingerprintPage> with RouteAware
children: [ children: [
Expanded( Expanded(
child: Text( child: Text(
"请将您的手指按下", "请将您的手指按下".tr,
// TranslationLoader.lanKeys!.lightTouchScreenTip!.tr, // TranslationLoader.lanKeys!.lightTouchScreenTip!.tr,
textAlign: TextAlign.center, textAlign: TextAlign.center,
maxLines:null, maxLines:null,
@ -75,7 +73,7 @@ class _AddFingerprintPageState extends State<AddFingerprintPage> with RouteAware
children: [ children: [
Expanded( Expanded(
child: Text( child: Text(
"尝试连接设备......", "尝试连接设备...".tr,
// TranslationLoader.lanKeys!.lightTouchScreenTip!.tr, // TranslationLoader.lanKeys!.lightTouchScreenTip!.tr,
textAlign: TextAlign.center, textAlign: TextAlign.center,
maxLines:null, maxLines:null,
@ -103,7 +101,7 @@ class _AddFingerprintPageState extends State<AddFingerprintPage> with RouteAware
children: [ children: [
Expanded( Expanded(
child: Text( child: Text(
"根据提示,抬起手指后再进行下一次指纹采集", "根据提示,抬起手指后再进行下一次指纹采集".tr,
// TranslationLoader.lanKeys!.lightTouchScreenTip!.tr, // TranslationLoader.lanKeys!.lightTouchScreenTip!.tr,
textAlign: TextAlign.center, textAlign: TextAlign.center,
maxLines:null, maxLines:null,

View File

@ -14,7 +14,6 @@ class AddFingerprintState{
final endDate = "".obs; final endDate = "".obs;
final addType = "".obs; final addType = "".obs;
final fingerprintName = "".obs; final fingerprintName = "".obs;
// final fingerprintNumber = "".obs;
final fingerprintType = "".obs; final fingerprintType = "".obs;
final isCoerced = "".obs; final isCoerced = "".obs;
final isAdministrator = "".obs; final isAdministrator = "".obs;
@ -30,12 +29,11 @@ class AddFingerprintState{
endDate.value = map["endDate"]; endDate.value = map["endDate"];
addType.value = map["addType"]; addType.value = map["addType"];
fingerprintName.value = map["fingerprintName"]; fingerprintName.value = map["fingerprintName"];
// fingerprintNumber.value = map["fingerprintNumber"];
fingerprintType.value = map["fingerprintType"]; fingerprintType.value = map["fingerprintType"];
isCoerced.value = map["isCoerced"]; isCoerced.value = map["isCoerced"];
print("isCoerced.valueisCoerced.value:${isCoerced.value}"); Get.log("isCoerced.valueisCoerced.value:${isCoerced.value}");
isAdministrator.value = map["isAdministrator"]; isAdministrator.value = map["isAdministrator"];
print("isAdministrator.value isAdministrator.value:${isAdministrator.value}"); Get.log("isAdministrator.value isAdministrator.value:${isAdministrator.value}");
startDate.value = map["startDate"]; startDate.value = map["startDate"];
lockId.value = map["lockId"]; lockId.value = map["lockId"];
weekDay.value = map["weekDay"]; weekDay.value = map["weekDay"];

View File

@ -30,11 +30,11 @@ class AddFingerprintTypeLogic extends BaseGetXController{
endTime = "0"; endTime = "0";
if (startDate.isEmpty) { if (startDate.isEmpty) {
showToast("请选择开始时间"); showToast("请选择开始时间".tr);
return; return;
} }
if (endDate.isEmpty) { if (endDate.isEmpty) {
showToast("请选择结束时间"); showToast("请选择结束时间".tr);
return; return;
} }
@ -44,7 +44,7 @@ class AddFingerprintTypeLogic extends BaseGetXController{
// } // }
if (int.parse(startDate) >= int.parse(endDate)) { if (int.parse(startDate) >= int.parse(endDate)) {
showToast("失效时间要大于生效时间"); showToast("失效时间要大于生效时间".tr);
return; return;
} }
} else if (state.selectType.value == "2") { } else if (state.selectType.value == "2") {
@ -60,7 +60,7 @@ class AddFingerprintTypeLogic extends BaseGetXController{
} }
var isCoerced = state.isStressFingerprint.value == false ? "1" : "2"; // 1: 2: 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: { Get.toNamed(Routers.addFingerprintPage, arguments: {

View File

@ -189,7 +189,7 @@ class _AddFingerprintTypePageState extends State<AddFingerprintTypePage> {
Obx(() => Visibility( Obx(() => Visibility(
visible: state.weekdaysList.isNotEmpty ? true : false, visible: state.weekdaysList.isNotEmpty ? true : false,
child: CommonItem( child: CommonItem(
leftTitel: "有效日", leftTitel: "有效日".tr,
rightTitle: state.weekdaysList.value.join(",").toString(), rightTitle: state.weekdaysList.value.join(",").toString(),
isHaveDirection: true, isHaveDirection: true,
isHaveLine: true, isHaveLine: true,
@ -214,7 +214,7 @@ class _AddFingerprintTypePageState extends State<AddFingerprintTypePage> {
Obx(() => Visibility( Obx(() => Visibility(
visible: state.effectiveDateTime.value.isNotEmpty, visible: state.effectiveDateTime.value.isNotEmpty,
child: CommonItem( child: CommonItem(
leftTitel: "有效时间", leftTitel: "有效时间".tr,
rightTitle: "${state.effectiveDateTime.value}-${state.failureDateTime.value}", rightTitle: "${state.effectiveDateTime.value}-${state.failureDateTime.value}",
isHaveDirection: true, isHaveDirection: true,
action: () async { action: () async {
@ -244,7 +244,7 @@ class _AddFingerprintTypePageState extends State<AddFingerprintTypePage> {
return Column( return Column(
children: [ children: [
Obx(() => CommonItem( Obx(() => CommonItem(
leftTitel: "是否是管理员", leftTitel: "是否是管理员".tr,
rightTitle: "", rightTitle: "",
isTipsImg: false, isTipsImg: false,
isHaveRightWidget: true, isHaveRightWidget: true,
@ -266,13 +266,13 @@ class _AddFingerprintTypePageState extends State<AddFingerprintTypePage> {
if (isDemoMode == false) { if (isDemoMode == false) {
// print("state.selectType:${state.selectType.value}"); // print("state.selectType:${state.selectType.value}");
if (state.nameController.text.isEmpty) { if (state.nameController.text.isEmpty) {
logic.showToast("请输入姓名"); logic.showToast("请输入姓名".tr);
return; return;
} }
logic.checkFingerprintNameDuplicated(state.nameController.text); logic.checkFingerprintNameDuplicated(state.nameController.text);
} else { } else {
// Get.toNamed(Routers.selectLockTypePage); // Get.toNamed(Routers.selectLockTypePage);
logic.showToast("演示模式"); logic.showToast("演示模式".tr);
} }
}), }),
], ],
@ -280,74 +280,74 @@ class _AddFingerprintTypePageState extends State<AddFingerprintTypePage> {
} }
// //
Widget sendElectronicKeySucceed() { // Widget sendElectronicKeySucceed() {
return Column( // return Column(
children: [ // children: [
Container( // Container(
height: 300.h, // height: 300.h,
width: 1.sw, // width: 1.sw,
color: Colors.white, // color: Colors.white,
child: Column( // child: Column(
children: [ // children: [
SizedBox( // SizedBox(
height: 30.h, // height: 30.h,
), // ),
Image.asset( // Image.asset(
'images/main/icon_main_addLock.png', // 'images/main/icon_main_addLock.png',
width: 150.w, // width: 150.w,
height: 150.w, // height: 150.w,
color: AppColors.mainColor, // color: AppColors.mainColor,
), // ),
SizedBox( // SizedBox(
height: 20.h, // height: 20.h,
), // ),
Text( // Text(
"操作成功,密码为", // "操作成功,密码为",
style: TextStyle( // style: TextStyle(
fontSize: 32.sp, // fontSize: 32.sp,
color: Colors.black, // color: Colors.black,
fontWeight: FontWeight.w500), // fontWeight: FontWeight.w500),
), // ),
SizedBox( // SizedBox(
height: 10.h, // height: 10.h,
), // ),
Text( // Text(
"62689876", // "62689876",
style: TextStyle( // style: TextStyle(
fontSize: 60.sp, // fontSize: 60.sp,
color: Colors.black, // color: Colors.black,
fontWeight: FontWeight.w500), // fontWeight: FontWeight.w500),
), // ),
], // ],
), // ),
), // ),
SizedBox( // SizedBox(
height: 20.h, // height: 20.h,
), // ),
SubmitBtn( // SubmitBtn(
btnName: '完成'.tr, // btnName: '完成'.tr,
fontSize: 28.sp, // fontSize: 28.sp,
borderRadius: 20.w, // borderRadius: 20.w,
margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w), // margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w),
padding: EdgeInsets.only(top: 25.w, bottom: 25.w), // padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
onClick: () {}), // onClick: () {}),
SubmitBtn( // SubmitBtn(
btnName: '分享', // btnName: '分享',
fontSize: 28.sp, // fontSize: 28.sp,
borderRadius: 20.w, // borderRadius: 20.w,
margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w), // margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w),
padding: EdgeInsets.only(top: 25.w, bottom: 25.w), // padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
onClick: () {}), // onClick: () {}),
SubmitBtn( // SubmitBtn(
btnName: '标记为:已入住', // btnName: '标记为:已入住',
fontSize: 28.sp, // fontSize: 28.sp,
borderRadius: 20.w, // borderRadius: 20.w,
margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w), // margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w),
padding: EdgeInsets.only(top: 25.w, bottom: 25.w), // padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
onClick: () {}), // onClick: () {}),
], // ],
); // );
} // }
// //
Widget getTFWidget(String tfStr) { Widget getTFWidget(String tfStr) {

View File

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

View File

@ -43,7 +43,7 @@ class _AddFingerprintTipPageState extends State<AddFingerprintTipPage> {
children: [ children: [
Expanded( Expanded(
child: Text( child: Text(
"添加过程中,请根据提示,在指纹采集器上进行多次的抬起按压", "添加过程中,请根据提示,在指纹采集器上进行多次的抬起按压".tr,
// TranslationLoader.lanKeys!.lightTouchScreenTip!.tr, // TranslationLoader.lanKeys!.lightTouchScreenTip!.tr,
textAlign: TextAlign.center, textAlign: TextAlign.center,
maxLines:null, maxLines:null,
@ -67,7 +67,7 @@ class _AddFingerprintTipPageState extends State<AddFingerprintTipPage> {
Container( Container(
padding: EdgeInsets.only(left: 20.w, right: 20.w), padding: EdgeInsets.only(left: 20.w, right: 20.w),
child: SubmitBtn( child: SubmitBtn(
btnName: "开始添加",//TranslationLoader.lanKeys!.next!.tr, btnName: "开始添加".tr,//TranslationLoader.lanKeys!.next!.tr,
borderRadius: 20.w, borderRadius: 20.w,
onClick: () { onClick: () {
Get.toNamed(Routers.addFingerprintPage, arguments: { Get.toNamed(Routers.addFingerprintPage, arguments: {

View File

@ -1,7 +1,6 @@
import 'dart:async'; import 'dart:async';
// import 'package:flutter_reactive_ble/flutter_reactive_ble.dart';
import 'package:flutter_blue_plus/flutter_blue_plus.dart'; import 'package:flutter_blue_plus/flutter_blue_plus.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:star_lock/blue/io_type.dart'; import 'package:star_lock/blue/io_type.dart';
@ -36,20 +35,20 @@ class FingerprintDetailLogic extends BaseGetXController{
Future<void> _replyAddFingerprintBegin(Reply reply) async { Future<void> _replyAddFingerprintBegin(Reply reply) async {
int status = reply.data[2]; int status = reply.data[2];
print("status:$status"); Get.log("status:$status");
switch(status){ switch(status){
case 0x00: case 0x00:
// //
print("${reply.commandType!.typeValue} 数据解析成功"); Get.log("${reply.commandType!.typeValue} 数据解析成功");
state.sureBtnState.value = 0; state.sureBtnState.value = 0;
cancelBlueConnetctToastTimer(); cancelBlueConnetctToastTimer();
dismissEasyLoading(); dismissEasyLoading();
deletFingerprintsData(); deletFingerprintsData();
break; break;
case 0x06: case 0x06:
// //
print("${reply.commandType!.typeValue} 需要鉴权"); Get.log("${reply.commandType!.typeValue} 需要鉴权");
var privateKey = await Storage.getStringList(saveBluePrivateKey); var privateKey = await Storage.getStringList(saveBluePrivateKey);
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!); List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
@ -74,19 +73,16 @@ class FingerprintDetailLogic extends BaseGetXController{
); );
break; break;
case 0x07: case 0x07:
// //
print("${reply.commandType!.typeValue} 用户无权限"); Get.log("${reply.commandType!.typeValue} 用户无权限");
break; break;
case 0x09: case 0x09:
// //
print("${reply.commandType!.typeValue} 权限校验错误"); Get.log("${reply.commandType!.typeValue} 权限校验错误");
break; break;
default: default:
// //
print("${reply.commandType!.typeValue} 失败"); Get.log("${reply.commandType!.typeValue} 失败");
break; break;
} }
} }
@ -148,7 +144,7 @@ class FingerprintDetailLogic extends BaseGetXController{
deleteType:"1" deleteType:"1"
); );
if(entity.errorCode!.codeIsSuccessful){ if(entity.errorCode!.codeIsSuccessful){
showToast("删除成功",something: (){ showToast("删除成功".tr, something: (){
Get.back(result: "addScuess"); Get.back(result: "addScuess");
}); });
} }
@ -170,7 +166,7 @@ class FingerprintDetailLogic extends BaseGetXController{
fingerprintType: state.fingerprintItemData.value.fingerprintType!, fingerprintType: state.fingerprintItemData.value.fingerprintType!,
); );
if(entity.errorCode!.codeIsSuccessful){ if(entity.errorCode!.codeIsSuccessful){
showToast("修改成功",something: (){ showToast("修改成功".tr, something: (){
eventBus.fire(OtherTypeRefreshListEvent()); eventBus.fire(OtherTypeRefreshListEvent());
}); });
} }
@ -179,7 +175,7 @@ class FingerprintDetailLogic extends BaseGetXController{
String getKeyTypeShowDateTime(){ String getKeyTypeShowDateTime(){
String useDateStr = ''; String useDateStr = '';
if(state.keyType.value == 1){ if(state.keyType.value == 1){
useDateStr = "永久"; useDateStr = "永久".tr;
}else if(state.keyType.value == 2){ }else if(state.keyType.value == 2){
useDateStr = "${DateTool().dateToYMDHNString(state.starDate.value)}\n${DateTool().dateToYMDHNString(state.endDate.value)}"; useDateStr = "${DateTool().dateToYMDHNString(state.starDate.value)}\n${DateTool().dateToYMDHNString(state.endDate.value)}";
} else if(state.keyType.value == 4){ } else if(state.keyType.value == 4){

View File

@ -13,6 +13,7 @@ import '../../../../tools/commonItem.dart';
import '../../../../tools/dateTool.dart'; import '../../../../tools/dateTool.dart';
import '../../../../tools/showIosTipView.dart'; import '../../../../tools/showIosTipView.dart';
import '../../../../tools/showTFView.dart'; import '../../../../tools/showTFView.dart';
import '../../../../tools/showTipView.dart';
import '../../../../tools/submitBtn.dart'; import '../../../../tools/submitBtn.dart';
import '../../../../tools/titleAppBar.dart'; import '../../../../tools/titleAppBar.dart';
import '../../../../translations/trans_lib.dart'; import '../../../../translations/trans_lib.dart';
@ -34,7 +35,7 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage> with Rout
return Scaffold( return Scaffold(
backgroundColor: AppColors.mainBackgroundColor, backgroundColor: AppColors.mainBackgroundColor,
appBar: TitleAppBar( appBar: TitleAppBar(
barTitle: "指纹详情", barTitle: "指纹详情".tr,
haveBack: true, haveBack: true,
backgroundColor: AppColors.mainColor, backgroundColor: AppColors.mainColor,
), ),
@ -125,7 +126,7 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage> with Rout
Obx(() => Visibility( Obx(() => Visibility(
visible: state.keyType.value == 4 ? true : false, visible: state.keyType.value == 4 ? true : false,
child: Obx(() => CommonItem( child: Obx(() => CommonItem(
leftTitel: "有效时间", leftTitel: "有效时间".tr,
rightTitle: "${DateTool().dateToHNString(state.starTime.value)}-${DateTool().dateToHNString(state.endTime.value)}", rightTitle: "${DateTool().dateToHNString(state.starTime.value)}-${DateTool().dateToHNString(state.endTime.value)}",
isHaveDirection: true, isHaveDirection: true,
action: () async { action: () async {
@ -153,9 +154,7 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage> with Rout
Obx(() => CommonItem( Obx(() => CommonItem(
leftTitel: TranslationLoader.lanKeys!.addTime!.tr, leftTitel: TranslationLoader.lanKeys!.addTime!.tr,
rightTitle: DateTool().dateToYMDHNString(state.addTime.value.toString()), rightTitle: DateTool().dateToYMDHNString(state.addTime.value.toString()),
action: () { )),
})),
SizedBox(height: 10.h), SizedBox(height: 10.h),
Obx(() => CommonItem( Obx(() => CommonItem(
leftTitel: TranslationLoader.lanKeys!.stressFingerprint!.tr, 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), margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w, bottom: 30.w),
padding: EdgeInsets.only(top: 25.w, bottom: 25.w), padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
onClick: () { onClick: () {
showIosTipViewDialog(context); ShowTipView().showIosTipWithContentDialog("确定要删除吗?".tr, () async {
logic.senderAddFingerprint();
});
}), }),
], ],
), ),
@ -219,7 +220,7 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage> with Rout
controller: state.changeNameController, controller: state.changeNameController,
sureClick: () { sureClick: () {
if(state.changeNameController.text.isEmpty){ if(state.changeNameController.text.isEmpty){
logic.showToast("请输入姓名"); logic.showToast("请输入姓名".tr);
return; return;
} }
Get.back(); Get.back();
@ -233,25 +234,25 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage> with Rout
}); });
} }
void showIosTipViewDialog(BuildContext context) { // void showIosTipViewDialog(BuildContext context) {
showDialog( // showDialog(
context: context, // context: context,
builder: (BuildContext context) { // builder: (BuildContext context) {
return ShowIosTipView( // return ShowIosTipView(
title: "提示", // title: "提示",
tipTitle: "确定要删除吗?", // tipTitle: "确定要删除吗?",
sureClick: () { // sureClick: () {
Get.back(); // Get.back();
// // //
logic.senderAddFingerprint(); // logic.senderAddFingerprint();
}, // },
cancelClick: () { // cancelClick: () {
Get.back(); // Get.back();
}, // },
); // );
} // }
); // );
} // }
@override @override
void didChangeDependencies() { void didChangeDependencies() {

View File

@ -3,6 +3,7 @@ import 'dart:async';
// import 'package:flutter_reactive_ble/flutter_reactive_ble.dart'; // import 'package:flutter_reactive_ble/flutter_reactive_ble.dart';
import 'package:flutter_blue_plus/flutter_blue_plus.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/blue/io_type.dart';
import 'package:star_lock/tools/baseGetXController.dart'; import 'package:star_lock/tools/baseGetXController.dart';
import '../../../../blue/blue_manage.dart'; import '../../../../blue/blue_manage.dart';
@ -46,20 +47,20 @@ class FingerprintListLogic extends BaseGetXController{
// --- // ---
Future<void> _replyAddFingerprintBegin(Reply reply) async { Future<void> _replyAddFingerprintBegin(Reply reply) async {
int status = reply.data[2]; int status = reply.data[2];
print("status:$status"); Get.log("status:$status");
switch(status){ switch(status){
case 0x00: case 0x00:
// //
print("${reply.commandType!.typeValue} 数据解析成功"); Get.log("${reply.commandType!.typeValue} 数据解析成功");
state.isDeletFingerprintData = false; state.isDeletFingerprintData = false;
cancelBlueConnetctToastTimer(); cancelBlueConnetctToastTimer();
dismissEasyLoading(); dismissEasyLoading();
deletAllFingerprintsData(); deletAllFingerprintsData();
break; break;
case 0x06: case 0x06:
// //
print("${reply.commandType!.typeValue} 需要鉴权"); Get.log("${reply.commandType!.typeValue} 需要鉴权");
var privateKey = await Storage.getStringList(saveBluePrivateKey); var privateKey = await Storage.getStringList(saveBluePrivateKey);
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!); List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
@ -83,18 +84,18 @@ class FingerprintListLogic extends BaseGetXController{
); );
break; break;
case 0x07: case 0x07:
// //
print("${reply.commandType!.typeValue} 用户无权限"); Get.log("${reply.commandType!.typeValue} 用户无权限");
break; break;
case 0x09: case 0x09:
// //
print("${reply.commandType!.typeValue} 权限校验错误"); Get.log("${reply.commandType!.typeValue} 权限校验错误");
break; break;
default: default:
// //
print("${reply.commandType!.typeValue} 失败"); Get.log("${reply.commandType!.typeValue} 失败");
break; break;
} }
@ -107,22 +108,22 @@ class FingerprintListLogic extends BaseGetXController{
switch(status){ switch(status){
case 0x00: case 0x00:
// //
print("${reply.commandType}数据解析成功"); Get.log("${reply.commandType}数据解析成功");
// _getLockStatus(); // _getLockStatus();
break; break;
case 0x06: case 0x06:
// //
print("${reply.commandType}需要鉴权"); Get.log("${reply.commandType}需要鉴权");
break; break;
case 0x07: case 0x07:
// //
print("${reply.commandType}用户无权限"); Get.log("${reply.commandType}用户无权限");
break; break;
case 0x09: case 0x09:
// //
print("${reply.commandType}权限校验错误"); Get.log("${reply.commandType}权限校验错误");
break; break;
default: default:
@ -138,28 +139,28 @@ class FingerprintListLogic extends BaseGetXController{
int status = reply.data[2]; int status = reply.data[2];
switch(status){ switch(status){
case 0x00: case 0x00:
// //
print("${reply.commandType}数据解析成功"); Get.log("${reply.commandType}数据解析成功");
// _getLockStatus(); // _getLockStatus();
break; break;
case 0x06: case 0x06:
// //
print("${reply.commandType}需要鉴权"); Get.log("${reply.commandType}需要鉴权");
break; break;
case 0x07: case 0x07:
// //
print("${reply.commandType}用户无权限"); Get.log("${reply.commandType}用户无权限");
break; break;
case 0x09: case 0x09:
// //
print("${reply.commandType}权限校验错误"); Get.log("${reply.commandType}权限校验错误");
break; break;
default: default:
// //
print("${reply.commandType}失败"); Get.log("${reply.commandType}失败");
break; break;
} }
@ -209,33 +210,29 @@ class FingerprintListLogic extends BaseGetXController{
// //
var serialNo = reply.data.sublist(17, 21); var serialNo = reply.data.sublist(17, 21);
print("serialNo:$serialNo"); Get.log("serialNo:$serialNo");
switch(status){ switch(status){
case 0x00: case 0x00:
// //
print("${reply.commandType}数据解析成功"); Get.log("${reply.commandType}数据解析成功");
// _getLockStatus(); // _getLockStatus();
break; break;
case 0x06: case 0x06:
// //
print("${reply.commandType}需要鉴权"); Get.log("${reply.commandType}需要鉴权");
break; break;
case 0x07: case 0x07:
// //
print("${reply.commandType}用户无权限"); Get.log("${reply.commandType}用户无权限");
break; break;
case 0x09: case 0x09:
// //
print("${reply.commandType}权限校验错误"); Get.log("${reply.commandType}权限校验错误");
break; break;
default: default:
// //
print("${reply.commandType}失败"); Get.log("${reply.commandType}失败");
break; break;
} }
} }
@ -349,7 +346,6 @@ class FingerprintListLogic extends BaseGetXController{
} else { } else {
if (entity.data!.list!.isNotEmpty) { if (entity.data!.list!.isNotEmpty) {
state.fingerprintItemListData.value.addAll(entity.data!.list!); state.fingerprintItemListData.value.addAll(entity.data!.list!);
print("state.itemDataList.value.length:${state.fingerprintItemListData.value.length}");
pageNo++; pageNo++;
} }
} }
@ -365,7 +361,7 @@ class FingerprintListLogic extends BaseGetXController{
fingerprintId = state.deletKeyID; fingerprintId = state.deletKeyID;
type = "0"; type = "0";
} }
print("delet fingerprintId $fingerprintId"); Get.log("delet fingerprintId $fingerprintId");
var entity = await ApiRepository.to.deletFingerprintsData( var entity = await ApiRepository.to.deletFingerprintsData(
fingerprintId: fingerprintId, fingerprintId: fingerprintId,
lockId: state.lockId.value.toString(), lockId: state.lockId.value.toString(),
@ -374,13 +370,13 @@ class FingerprintListLogic extends BaseGetXController{
); );
if(entity.errorCode!.codeIsSuccessful){ if(entity.errorCode!.codeIsSuccessful){
if(state.isDeletAll == false){ if(state.isDeletAll == false){
showToast("删除成功", something:(){ showToast("删除成功".tr, something:(){
state.isDeletFingerprintData = false; state.isDeletFingerprintData = false;
pageNo = 1; pageNo = 1;
getFingerprintsListData(); getFingerprintsListData();
}); });
}else{ }else{
showToast("重置成功", something:(){ showToast("重置成功".tr, something:(){
state.isDeletFingerprintData = false; state.isDeletFingerprintData = false;
pageNo = 1; pageNo = 1;
getFingerprintsListData(); getFingerprintsListData();
@ -404,11 +400,11 @@ class FingerprintListLogic extends BaseGetXController{
// (fingerprintItemData.fingerprintType! != 1) ? (fingerprintItemData.endDate! < DateTime.now().millisecondsSinceEpoch ? "已失效" : "") : "" // (fingerprintItemData.fingerprintType! != 1) ? (fingerprintItemData.endDate! < DateTime.now().millisecondsSinceEpoch ? "已失效" : "") : ""
if(fingerprintItemData.fingerprintStatus == 1){ if(fingerprintItemData.fingerprintStatus == 1){
if(fingerprintItemData.startDate! > DateTime.now().millisecondsSinceEpoch){ if(fingerprintItemData.startDate! > DateTime.now().millisecondsSinceEpoch){
keyTypeStr = "未生效"; keyTypeStr = "未生效".tr;
} }
}else if(fingerprintItemData.fingerprintStatus == 2){ }else if(fingerprintItemData.fingerprintStatus == 2){
keyTypeStr = "已失效"; keyTypeStr = "已失效".tr;
} }
return keyTypeStr; return keyTypeStr;
} }
@ -416,7 +412,7 @@ class FingerprintListLogic extends BaseGetXController{
String getKeyDateType(FingerprintItemData fingerprintItemData){ String getKeyDateType(FingerprintItemData fingerprintItemData){
var keyDateTypeStr = "";// :1;23:4 var keyDateTypeStr = "";// :1;23:4
if(fingerprintItemData.fingerprintType! == 1){ if(fingerprintItemData.fingerprintType! == 1){
keyDateTypeStr = "${DateTool().dateToYMDHNString(fingerprintItemData.createDate.toString())} 永久"; keyDateTypeStr = "${DateTool().dateToYMDHNString(fingerprintItemData.createDate.toString())} ${"永久".tr}";
}else if(fingerprintItemData.fingerprintType! == 2){ }else if(fingerprintItemData.fingerprintType! == 2){
keyDateTypeStr = "${DateTool().dateToYMDHNString(fingerprintItemData.startDate.toString())} - ${DateTool().dateToYMDHNString(fingerprintItemData.endDate.toString())} 限时"; keyDateTypeStr = "${DateTool().dateToYMDHNString(fingerprintItemData.startDate.toString())} - ${DateTool().dateToYMDHNString(fingerprintItemData.endDate.toString())} 限时";
}else if(fingerprintItemData.fingerprintType! == 4){ }else if(fingerprintItemData.fingerprintType! == 4){
@ -433,7 +429,6 @@ class FingerprintListLogic extends BaseGetXController{
// //
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot); var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
// print("aaaaaaa:$isDemoMode");
if(isDemoMode == false){ if(isDemoMode == false){
_initReplySubscription(); _initReplySubscription();
@ -445,14 +440,7 @@ class FingerprintListLogic extends BaseGetXController{
Future<void> onInit() async { Future<void> onInit() async {
// TODO: implement onInit // TODO: implement onInit
super.onInit(); super.onInit();
print("onInit()"); Get.log("onInit()");
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
if(isDemoMode == false) {
// senderQueryingFingerprintStatus();
// senderCheckingCardStatus();
// senderCheckingUserInfoCount();
}
} }
@override @override

View File

@ -14,6 +14,7 @@ import '../../../../tools/appRouteObserver.dart';
import '../../../../tools/keySearchWidget.dart'; import '../../../../tools/keySearchWidget.dart';
import '../../../../tools/noData.dart'; import '../../../../tools/noData.dart';
import '../../../../tools/showIosTipView.dart'; import '../../../../tools/showIosTipView.dart';
import '../../../../tools/showTipView.dart';
import '../../../../tools/storage.dart'; import '../../../../tools/storage.dart';
import '../../../../tools/submitBtn.dart'; import '../../../../tools/submitBtn.dart';
import '../../../../tools/titleAppBar.dart'; import '../../../../tools/titleAppBar.dart';
@ -67,10 +68,16 @@ class _FingerprintListPageState extends State<FingerprintListPage> with RouteAwa
onPressed: () async { onPressed: () async {
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot); var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
if (isDemoMode == false) { 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 { } else {
// Get.toNamed(Routers.selectLockTypePage); logic.showToast("演示模式".tr);
logic.showToast("演示模式");
} }
}, },
), ),
@ -134,11 +141,17 @@ class _FingerprintListPageState extends State<FingerprintListPage> with RouteAwa
children: [ children: [
SlidableAction( SlidableAction(
onPressed: (BuildContext context){ 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, backgroundColor: Colors.red,
// foregroundColor: Colors.white, // foregroundColor: Colors.white,
label: '删除', label: '删除'.tr,
padding: EdgeInsets.only(left: 5.w, right: 5.w), 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)); ) : 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) { Widget _keyItem(String lockTypeIcon, String lockTypeTitle, String ifInvalidation, String showTime, Function() action) {
return GestureDetector( return GestureDetector(
onTap: action, onTap: action,
@ -263,37 +253,60 @@ class _FingerprintListPageState extends State<FingerprintListPage> with RouteAwa
); );
} }
void showDeletAlertDialog() { // void showIosTipViewDialog(int? fingerprintId) {
showCupertinoDialog( // showDialog(
context: Get.context!, // context: Get.context!,
builder: (context) { // builder: (BuildContext context) {
return CupertinoAlertDialog( // return ShowIosTipView(
title: const Text("提示"), // title: "提示",
content: const Text('重置后,该锁的指纹都将被删除哦,确认要重置吗?'), // tipTitle: "确定要删除吗?",
actions: [ // sureClick: () async {
CupertinoDialogAction( // Get.back();
child: Text(TranslationLoader.lanKeys!.cancel!.tr), // state.isDeletFingerprintData = true;
onPressed: () { // state.isDeletAll = false;
Navigator.pop(context); // state.deletKeyID = fingerprintId.toString();
}, // state.deletUserID = (await Storage.getUid())!;
), // logic.senderAddFingerprint();
CupertinoDialogAction( // },
child: Text(TranslationLoader.lanKeys!.sure!.tr), // cancelClick: () {
onPressed: () { // Get.back();
Navigator.pop(context); // },
state.isDeletFingerprintData = true; // );
state.isDeletAll = true; // },
state.deletKeyID = "1"; // );
state.deletUserID = "DeleteAll!@#"; // }
state.deletFingerNo = 255;
logic.senderAddFingerprint(); // 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 @override
void didChangeDependencies() { void didChangeDependencies() {

View File

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

View File

@ -1,4 +1,4 @@
import 'dart:ffi';
import 'dart:io'; import 'dart:io';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -25,31 +25,10 @@ class MinePersonInfoPage extends StatefulWidget {
State<MinePersonInfoPage> createState() => _MinePersonInfoPageState(); State<MinePersonInfoPage> createState() => _MinePersonInfoPageState();
} }
class _MinePersonInfoPageState extends State<MinePersonInfoPage> class _MinePersonInfoPageState extends State<MinePersonInfoPage> {
// with WidgetsBindingObserver
{
final logic = Get.put(MinePersonInfoLogic()); final logic = Get.put(MinePersonInfoLogic());
final state = Get.find<MinePersonInfoLogic>().state; 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 @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
@ -71,21 +50,6 @@ class _MinePersonInfoPageState extends State<MinePersonInfoPage>
borderRadius: BorderRadius.circular(36.w), borderRadius: BorderRadius.circular(36.w),
child: CustomNetworkImage(url:state.headUrl.value, defaultUrl: 'images/controls_user.png', width:72.w, height:72.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 { action: () async {
// //
if (Platform.isAndroid) { if (Platform.isAndroid) {
@ -327,16 +291,12 @@ class _MinePersonInfoPageState extends State<MinePersonInfoPage>
if (status.isGranted) { if (status.isGranted) {
selectImage(); selectImage();
} else { } else {
// setState(() {
// state.hasPhotoPermission.value = false; //
// });
_requestPhotoPermission(); _requestPhotoPermission();
} }
} }
@override @override
void dispose() { void dispose() {
// WidgetsBinding.instance.removeObserver(this); //
super.dispose(); super.dispose();
} }
} }

View File

@ -1,12 +1,10 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import '../app_settings/app_colors.dart'; import '../app_settings/app_colors.dart';
import '../translations/trans_lib.dart';
class KeySearchWidget extends StatelessWidget { class KeySearchWidget extends StatelessWidget {
TextEditingController editingController; TextEditingController editingController;
@ -33,8 +31,7 @@ class KeySearchWidget extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Padding( Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(top: 15.h, bottom: 15.h, right: 5.w, left: 10.w),
top: 15.h, bottom: 15.h, right: 5.w, left: 10.w),
child: Image.asset( child: Image.asset(
'images/main/icon_main_search.png', 'images/main/icon_main_search.png',
width: 40.w, width: 40.w,
@ -42,7 +39,7 @@ class KeySearchWidget extends StatelessWidget {
), ),
), ),
Expanded( Expanded(
child: Container( child: SizedBox(
height: 60.h, height: 60.h,
// width: 1.sw, // width: 1.sw,
// color: Colors.red, // color: Colors.red,
@ -58,22 +55,18 @@ class KeySearchWidget extends StatelessWidget {
autofocus: false, autofocus: false,
textAlign: TextAlign.start, textAlign: TextAlign.start,
onChanged: (value) { onChanged: (value) {
print("onChanged:$value"); Get.log("onChanged:$value");
}, },
onEditingComplete: () { onEditingComplete: () {
print("onEditingComplete:"); Get.log("onEditingComplete:");
}, },
onSubmitted: (value) { onSubmitted: (value) {
onSubmittedAction!(); onSubmittedAction!();
}, },
decoration: InputDecoration( decoration: InputDecoration(
// //
// contentPadding: const EdgeInsets.only( hintText:"搜索".tr,
// top: 12.0, left: -19.0, right: -15.0, bottom: 8.0),
// hintText: TranslationLoader.lanKeys!.pleaseEnter!.tr,
hintText:"搜索",
hintStyle: TextStyle(fontSize: 22.sp), hintStyle: TextStyle(fontSize: 22.sp),
// border: InputBorder.none,
focusedBorder: const OutlineInputBorder(borderSide: BorderSide(width: 0, color: Colors.transparent)), focusedBorder: const OutlineInputBorder(borderSide: BorderSide(width: 0, color: Colors.transparent)),
disabledBorder: 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)), 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(); var endTimeTimestamp = DateTool().dateToTimestamp(state.endTime.value, 0).toString();
if (int.parse(starDateTimestamp) >= int.parse(endDateTimestamp)) { if (int.parse(starDateTimestamp) >= int.parse(endDateTimestamp)) {
showToast("失效日期要大于生效日期"); showToast("失效日期要大于生效日期".tr);
return; return;
} }
if (int.parse(starTimeTimestamp) >= int.parse(endTimeTimestamp)) { if (int.parse(starTimeTimestamp) >= int.parse(endTimeTimestamp)) {
showToast("失效时间要大于生效时间"); showToast("失效时间要大于生效时间".tr);
return; return;
} }
Map<String, dynamic> resultMap = {}; Map<String, dynamic> resultMap = {};

View File

@ -32,7 +32,7 @@ class _SeletKeyCyclicDatePageState extends State<SeletKeyCyclicDatePage> {
return Scaffold( return Scaffold(
backgroundColor: AppColors.mainBackgroundColor, backgroundColor: AppColors.mainBackgroundColor,
appBar: TitleAppBar( appBar: TitleAppBar(
barTitle: "有效期", barTitle: "有效期".tr,
haveBack: true, haveBack: true,
backgroundColor: AppColors.mainColor), backgroundColor: AppColors.mainColor),
body: ListView( body: ListView(
@ -68,7 +68,7 @@ class _SeletKeyCyclicDatePageState extends State<SeletKeyCyclicDatePage> {
child: Column( child: Column(
children: [ children: [
Obx(() => CommonItem( Obx(() => CommonItem(
leftTitel: "生效日期", leftTitel: "生效日期".tr,
rightTitle: state.starDate.value, rightTitle: state.starDate.value,
isHaveDirection: true, isHaveDirection: true,
isHaveLine: true, isHaveLine: true,
@ -79,7 +79,7 @@ class _SeletKeyCyclicDatePageState extends State<SeletKeyCyclicDatePage> {
}); });
})), })),
Obx(() => CommonItem( Obx(() => CommonItem(
leftTitel: "失效日期", leftTitel: "失效日期".tr,
rightTitle: state.endDate.value, rightTitle: state.endDate.value,
isHaveDirection: true, isHaveDirection: true,
action: () { action: () {
@ -198,7 +198,7 @@ class _SeletKeyCyclicDatePageState extends State<SeletKeyCyclicDatePage> {
child: Column( child: Column(
children: [ children: [
Obx(() => CommonItem( Obx(() => CommonItem(
leftTitel: "生效时间", leftTitel: "生效时间".tr,
rightTitle: state.starTime.value, rightTitle: state.starTime.value,
isHaveDirection: true, isHaveDirection: true,
isHaveLine: true, isHaveLine: true,
@ -208,7 +208,7 @@ class _SeletKeyCyclicDatePageState extends State<SeletKeyCyclicDatePage> {
}); });
})), })),
Obx(() => CommonItem( Obx(() => CommonItem(
leftTitel:"失效时间", leftTitel:"失效时间".tr,
rightTitle: state.endTime.value, rightTitle: state.endTime.value,
isHaveDirection: true, isHaveDirection: true,
action: () { action: () {

View File

@ -1,8 +1,6 @@
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import '../translations/trans_lib.dart'; import '../translations/trans_lib.dart';