修复登录uid类型
This commit is contained in:
parent
0a6259607e
commit
4247db112f
@ -191,13 +191,15 @@ class BlueManage {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// print("33333333333333333333333");
|
/// 用来判断是否返回了连接结果 还是放了一段时间后蓝牙主动断开的
|
||||||
|
var isReturnedConnectResults = false;
|
||||||
_currentConnectionStream = _flutterReactiveBle!.connectToDevice(id: connectDeviceMacAddress, connectionTimeout: const Duration(seconds: 5)).listen((connectionStateUpdate) async {
|
_currentConnectionStream = _flutterReactiveBle!.connectToDevice(id: connectDeviceMacAddress, connectionTimeout: const Duration(seconds: 5)).listen((connectionStateUpdate) async {
|
||||||
// 获取状态
|
// 获取状态
|
||||||
deviceConnectionState = connectionStateUpdate.connectionState;
|
deviceConnectionState = connectionStateUpdate.connectionState;
|
||||||
stopScan();
|
stopScan();
|
||||||
print('2 deviceConnectionState:$deviceConnectionState connectionStateUpdate.connectionState:${connectionStateUpdate.connectionState}');
|
print('2 deviceConnectionState:$deviceConnectionState connectionStateUpdate.connectionState:${connectionStateUpdate.connectionState}');
|
||||||
if (connectionStateUpdate.connectionState == DeviceConnectionState.connected) {
|
if (connectionStateUpdate.connectionState == DeviceConnectionState.connected) {
|
||||||
|
isReturnedConnectResults = true;
|
||||||
// 如果状态是连接的开始发现服务
|
// 如果状态是连接的开始发现服务
|
||||||
try {
|
try {
|
||||||
_subScribeToCharacteristic(QualifiedCharacteristic(characteristicId: _characteristicIdSubscription, serviceId: _serviceIdConnect, deviceId: connectDeviceMacAddress));
|
_subScribeToCharacteristic(QualifiedCharacteristic(characteristicId: _characteristicIdSubscription, serviceId: _serviceIdConnect, deviceId: connectDeviceMacAddress));
|
||||||
@ -211,9 +213,14 @@ class BlueManage {
|
|||||||
print('Error occurred when discovering services: $e');
|
print('Error occurred when discovering services: $e');
|
||||||
rethrow;
|
rethrow;
|
||||||
}
|
}
|
||||||
} else {
|
} else if (connectionStateUpdate.connectionState == DeviceConnectionState.disconnected) {
|
||||||
|
// 如果状态是断开的
|
||||||
deviceConnectionState = connectionStateUpdate.connectionState;
|
deviceConnectionState = connectionStateUpdate.connectionState;
|
||||||
connectStateCallBack(deviceConnectionState!);
|
if(isReturnedConnectResults == false){
|
||||||
|
isReturnedConnectResults = true;
|
||||||
|
// 如果是在连接中断开的
|
||||||
|
connectStateCallBack(deviceConnectionState!);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
print('ConnectionState for device $connectDeviceMacAddress : ${connectionStateUpdate.connectionState}');
|
print('ConnectionState for device $connectDeviceMacAddress : ${connectionStateUpdate.connectionState}');
|
||||||
}, onError: (Object e) {
|
}, onError: (Object e) {
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
class LoginData {
|
class LoginData {
|
||||||
LoginData({
|
LoginData({
|
||||||
this.accessToken,
|
this.accessToken,
|
||||||
this.userid,
|
this.userid,
|
||||||
this.expiresAt,
|
this.expiresAt,
|
||||||
this.expiresAtString,
|
this.expiresAtString,
|
||||||
this.mobile,
|
this.mobile,
|
||||||
this.headUrl,
|
this.headUrl,
|
||||||
this.email,
|
this.email,
|
||||||
this.nickname,
|
this.nickname,
|
||||||
@ -32,7 +32,7 @@ class LoginData {
|
|||||||
String? email;
|
String? email;
|
||||||
String? nickname;
|
String? nickname;
|
||||||
bool? haveSafeAnswer;
|
bool? haveSafeAnswer;
|
||||||
String? uid;
|
int? uid;
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
final map = <String, dynamic>{};
|
final map = <String, dynamic>{};
|
||||||
|
|||||||
@ -111,12 +111,16 @@ class AddICCardLogic extends BaseGetXController{
|
|||||||
//成功
|
//成功
|
||||||
print("${reply.commandType!.typeValue} 数据解析成功");
|
print("${reply.commandType!.typeValue} 数据解析成功");
|
||||||
// print("添加指纹确认成功,调用添加指纹接口");
|
// print("添加指纹确认成功,调用添加指纹接口");
|
||||||
|
if(state.cardNumber.value == (reply.data[6]).toString()){
|
||||||
|
return;
|
||||||
|
}else{
|
||||||
|
state.cardNumber.value = (reply.data[6]).toString();
|
||||||
|
}
|
||||||
if(state.isCoerced.value == "1"){
|
if(state.isCoerced.value == "1"){
|
||||||
// 非胁迫
|
// 非胁迫
|
||||||
int addResultStatus = reply.data[5];
|
int addResultStatus = reply.data[5];
|
||||||
if(addResultStatus == 0){
|
if(addResultStatus == 0){
|
||||||
// 成功更新序列号
|
// 成功更新序列号
|
||||||
state.cardNumber.value = (reply.data[6]).toString();
|
|
||||||
addICCardData();
|
addICCardData();
|
||||||
}else if(addResultStatus == 255){
|
}else if(addResultStatus == 255){
|
||||||
// 255 自动退出
|
// 255 自动退出
|
||||||
|
|||||||
@ -1,7 +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/services.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';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
@ -10,7 +9,6 @@ import '../../../../appRouters.dart';
|
|||||||
import '../../../../app_settings/app_colors.dart';
|
import '../../../../app_settings/app_colors.dart';
|
||||||
import '../../../../blue/blue_manage.dart';
|
import '../../../../blue/blue_manage.dart';
|
||||||
import '../../../../tools/appRouteObserver.dart';
|
import '../../../../tools/appRouteObserver.dart';
|
||||||
import '../../../../tools/dateTool.dart';
|
|
||||||
import '../../../../tools/keySearchWidget.dart';
|
import '../../../../tools/keySearchWidget.dart';
|
||||||
import '../../../../tools/left_slide_actions.dart';
|
import '../../../../tools/left_slide_actions.dart';
|
||||||
import '../../../../tools/noData.dart';
|
import '../../../../tools/noData.dart';
|
||||||
@ -243,15 +241,13 @@ class _CardListPageState extends State<CardListPage> with RouteAware {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void showDeletAlertDialog(
|
void showDeletAlertDialog(BuildContext context) {
|
||||||
BuildContext context,
|
|
||||||
) {
|
|
||||||
showCupertinoDialog(
|
showCupertinoDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
return CupertinoAlertDialog(
|
return CupertinoAlertDialog(
|
||||||
title: const Text("提示"),
|
title: const Text("提示"),
|
||||||
content: const Text('重置后该锁的卡都将被删除哦,确认要重置吗?'),
|
content: const Text('重置后,该锁的卡都将被删除哦,确认要重置吗?'),
|
||||||
actions: [
|
actions: [
|
||||||
CupertinoDialogAction(
|
CupertinoDialogAction(
|
||||||
child: Text(TranslationLoader.lanKeys!.cancel!.tr),
|
child: Text(TranslationLoader.lanKeys!.cancel!.tr),
|
||||||
|
|||||||
@ -62,7 +62,7 @@ class AddFingerprintLogic extends BaseGetXController {
|
|||||||
|
|
||||||
// 最大图片数
|
// 最大图片数
|
||||||
state.maxRegCount.value = reply.data[10];
|
state.maxRegCount.value = reply.data[10];
|
||||||
|
print("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:
|
||||||
@ -130,7 +130,7 @@ class AddFingerprintLogic extends BaseGetXController {
|
|||||||
|
|
||||||
// 当前注册数
|
// 当前注册数
|
||||||
state.regIndex.value = reply.data[6];
|
state.regIndex.value = reply.data[6];
|
||||||
print("state.addFingerprintProcessNumber.value:${state.regIndex.value}");
|
print("state.regIndex.value:${state.regIndex.value}");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 0x06:
|
case 0x06:
|
||||||
@ -164,9 +164,14 @@ class AddFingerprintLogic extends BaseGetXController {
|
|||||||
//成功
|
//成功
|
||||||
print("${reply.commandType!.typeValue} 数据解析成功");
|
print("${reply.commandType!.typeValue} 数据解析成功");
|
||||||
// print("添加指纹确认成功,调用添加指纹接口");
|
// print("添加指纹确认成功,调用添加指纹接口");
|
||||||
|
if(state.fingerprintNumber.value == (reply.data[6]).toString()){
|
||||||
|
return;
|
||||||
|
}else{
|
||||||
|
state.fingerprintNumber.value = (reply.data[6]).toString();
|
||||||
|
}
|
||||||
if(state.isCoerced.value == "1"){
|
if(state.isCoerced.value == "1"){
|
||||||
// 非胁迫指纹
|
// 非胁迫指纹
|
||||||
addFingerprintsData(reply.data[6].toString());
|
addFingerprintsData();
|
||||||
}else{
|
}else{
|
||||||
// 如果是胁迫指纹在 添加完之后以后再调用添加胁迫指纹的
|
// 如果是胁迫指纹在 添加完之后以后再调用添加胁迫指纹的
|
||||||
senderAddStressFingerprint();
|
senderAddStressFingerprint();
|
||||||
@ -203,7 +208,7 @@ class AddFingerprintLogic extends BaseGetXController {
|
|||||||
//成功
|
//成功
|
||||||
print("${reply.commandType!.typeValue} 数据解析成功");
|
print("${reply.commandType!.typeValue} 数据解析成功");
|
||||||
// print("添加指纹确认成功,调用添加指纹接口");
|
// print("添加指纹确认成功,调用添加指纹接口");
|
||||||
addFingerprintsData(reply.data[6].toString());
|
addFingerprintsData();
|
||||||
break;
|
break;
|
||||||
case 0x06:
|
case 0x06:
|
||||||
//需要权限
|
//需要权限
|
||||||
@ -337,13 +342,13 @@ class AddFingerprintLogic extends BaseGetXController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 添加指纹
|
// 添加指纹
|
||||||
void addFingerprintsData(String fingerprintUserNo) async{
|
void addFingerprintsData() async{
|
||||||
var entity = await ApiRepository.to.addFingerprintsData(
|
var entity = await ApiRepository.to.addFingerprintsData(
|
||||||
lockId: state.lockId.value.toString(),
|
lockId: state.lockId.value.toString(),
|
||||||
endDate: state.endDate.value,
|
endDate: state.endDate.value,
|
||||||
addType:state.addType.value,
|
addType:state.addType.value,
|
||||||
fingerprintName: state.fingerprintName.value,
|
fingerprintName: state.fingerprintName.value,
|
||||||
fingerprintNumber: fingerprintUserNo,
|
fingerprintNumber: state.fingerprintNumber.value,
|
||||||
fingerprintType: state.fingerprintType.value,
|
fingerprintType: state.fingerprintType.value,
|
||||||
isCoerced: state.isCoerced.value,
|
isCoerced: state.isCoerced.value,
|
||||||
startDate: state.startDate.value,
|
startDate: state.startDate.value,
|
||||||
@ -351,16 +356,16 @@ class AddFingerprintLogic extends BaseGetXController {
|
|||||||
);
|
);
|
||||||
if(entity.errorCode!.codeIsSuccessful){
|
if(entity.errorCode!.codeIsSuccessful){
|
||||||
// Toast.show(msg: "添加成功");
|
// Toast.show(msg: "添加成功");
|
||||||
updateFingerprintUserNoLoadData(entity.data!.fingerprintId.toString(), fingerprintUserNo);
|
updateFingerprintUserNoLoadData(entity.data!.fingerprintId.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 更新指纹用户账号
|
// 更新指纹用户账号
|
||||||
void updateFingerprintUserNoLoadData(String fingerprintId, String fingerprintUserNo) async{
|
void updateFingerprintUserNoLoadData(String fingerprintId) async{
|
||||||
var entity = await ApiRepository.to.updateFingerprintUserNoLoadData(
|
var entity = await ApiRepository.to.updateFingerprintUserNoLoadData(
|
||||||
fingerprintId: fingerprintId,
|
fingerprintId: fingerprintId,
|
||||||
lockId: state.lockId.value.toString(),
|
lockId: state.lockId.value.toString(),
|
||||||
fingerprintUserNo: fingerprintUserNo,
|
fingerprintUserNo: state.fingerprintNumber.value,
|
||||||
);
|
);
|
||||||
if(entity.errorCode!.codeIsSuccessful){
|
if(entity.errorCode!.codeIsSuccessful){
|
||||||
Toast.show(msg: "添加成功");
|
Toast.show(msg: "添加成功");
|
||||||
|
|||||||
@ -119,23 +119,28 @@ class _AddFingerprintPageState extends State<AddFingerprintPage> with RouteAware
|
|||||||
}
|
}
|
||||||
|
|
||||||
String getIconNumber(int number){
|
String getIconNumber(int number){
|
||||||
|
String iconPath = "";
|
||||||
switch(number){
|
switch(number){
|
||||||
|
case 0:
|
||||||
|
iconPath = 'images/main/icon_addFingerprint_fingerprint_one.png';
|
||||||
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
return 'images/main/icon_addFingerprint_fingerprint_two.png';
|
iconPath = 'images/main/icon_addFingerprint_fingerprint_two.png';
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
return 'images/main/icon_addFingerprint_fingerprint_three.png';
|
iconPath = 'images/main/icon_addFingerprint_fingerprint_three.png';
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
return 'images/main/icon_addFingerprint_fingerprint_four.png';
|
iconPath = 'images/main/icon_addFingerprint_fingerprint_four.png';
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
return 'images/main/icon_addFingerprint_fingerprint_five.png';
|
iconPath = 'images/main/icon_addFingerprint_fingerprint_five.png';
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return 'images/main/icon_addFingerprint_fingerprint_one.png';
|
iconPath = 'images/main/icon_addFingerprint_fingerprint_four.png';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
return iconPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
@ -8,6 +8,8 @@ class AddFingerprintState{
|
|||||||
var maxRegCount = 0.obs;// 最大注册次数
|
var maxRegCount = 0.obs;// 最大注册次数
|
||||||
var regIndex = 0.obs;// 当前注册次数
|
var regIndex = 0.obs;// 当前注册次数
|
||||||
|
|
||||||
|
var fingerprintNumber = "".obs;
|
||||||
|
|
||||||
final lockId = 0.obs;
|
final lockId = 0.obs;
|
||||||
final endDate = "".obs;
|
final endDate = "".obs;
|
||||||
final addType = "".obs;
|
final addType = "".obs;
|
||||||
|
|||||||
@ -250,7 +250,7 @@ class _FingerprintListPageState extends State<FingerprintListPage> with RouteAwa
|
|||||||
builder: (context) {
|
builder: (context) {
|
||||||
return CupertinoAlertDialog(
|
return CupertinoAlertDialog(
|
||||||
title: const Text("提示"),
|
title: const Text("提示"),
|
||||||
content: const Text('重置后,改为该锁的指纹都将被删除哦,确认要重置吗?'),
|
content: const Text('重置后,该锁的指纹都将被删除哦,确认要重置吗?'),
|
||||||
actions: [
|
actions: [
|
||||||
CupertinoDialogAction(
|
CupertinoDialogAction(
|
||||||
child: Text(TranslationLoader.lanKeys!.cancel!.tr),
|
child: Text(TranslationLoader.lanKeys!.cancel!.tr),
|
||||||
|
|||||||
@ -269,6 +269,7 @@ class LockSetLogic extends BaseGetXController {
|
|||||||
showEasyLoading();
|
showEasyLoading();
|
||||||
showBlueConnetctToastTimer(isShowBlueConnetctToast: false, action: (){
|
showBlueConnetctToastTimer(isShowBlueConnetctToast: false, action: (){
|
||||||
dismissEasyLoading();
|
dismissEasyLoading();
|
||||||
|
print("1111111");
|
||||||
showDeletAlertTipDialog(Get.context!);
|
showDeletAlertTipDialog(Get.context!);
|
||||||
});
|
});
|
||||||
BlueManage().bludSendData(BlueManage().connectDeviceName, (DeviceConnectionState connectionState) async {
|
BlueManage().bludSendData(BlueManage().connectDeviceName, (DeviceConnectionState connectionState) async {
|
||||||
@ -297,7 +298,10 @@ class LockSetLogic extends BaseGetXController {
|
|||||||
} else if (connectionState == DeviceConnectionState.disconnected) {
|
} else if (connectionState == DeviceConnectionState.disconnected) {
|
||||||
dismissEasyLoading();
|
dismissEasyLoading();
|
||||||
cancelBlueConnetctToastTimer();
|
cancelBlueConnetctToastTimer();
|
||||||
showDeletAlertTipDialog(Get.context!);
|
print("222222");
|
||||||
|
if(state.ifCurrentScreen.value == true){
|
||||||
|
showDeletAlertTipDialog(Get.context!);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -307,6 +311,7 @@ class LockSetLogic extends BaseGetXController {
|
|||||||
showEasyLoading();
|
showEasyLoading();
|
||||||
showBlueConnetctToastTimer(isShowBlueConnetctToast: false, action: (){
|
showBlueConnetctToastTimer(isShowBlueConnetctToast: false, action: (){
|
||||||
dismissEasyLoading();
|
dismissEasyLoading();
|
||||||
|
print("333333");
|
||||||
showDeletAlertTipDialog(Get.context!);
|
showDeletAlertTipDialog(Get.context!);
|
||||||
});
|
});
|
||||||
BlueManage().bludSendData(BlueManage().connectDeviceName, (DeviceConnectionState connectionState) async {
|
BlueManage().bludSendData(BlueManage().connectDeviceName, (DeviceConnectionState connectionState) async {
|
||||||
@ -331,7 +336,10 @@ class LockSetLogic extends BaseGetXController {
|
|||||||
} else if (connectionState == DeviceConnectionState.disconnected) {
|
} else if (connectionState == DeviceConnectionState.disconnected) {
|
||||||
dismissEasyLoading();
|
dismissEasyLoading();
|
||||||
cancelBlueConnetctToastTimer();
|
cancelBlueConnetctToastTimer();
|
||||||
showDeletAlertTipDialog(Get.context!);
|
print("444444");
|
||||||
|
if(state.ifCurrentScreen.value == true){
|
||||||
|
showDeletAlertTipDialog(Get.context!);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -539,7 +547,7 @@ class LockSetLogic extends BaseGetXController {
|
|||||||
state.deletWaitScanCompleter = Completer();
|
state.deletWaitScanCompleter = Completer();
|
||||||
state.deletWaitScanTimer = Timer.periodic(const Duration(seconds: 1), (timer) {
|
state.deletWaitScanTimer = Timer.periodic(const Duration(seconds: 1), (timer) {
|
||||||
//定时任务
|
//定时任务
|
||||||
if(index >= 5){
|
if(index >= 7){
|
||||||
// 当超过10秒的时候还是没有搜索到,完成任务,关闭扫描,取消定时器,弹窗提示
|
// 当超过10秒的时候还是没有搜索到,完成任务,关闭扫描,取消定时器,弹窗提示
|
||||||
if(state.deletWaitScanTimer != null){
|
if(state.deletWaitScanTimer != null){
|
||||||
state.deletWaitScanTimer!.cancel();
|
state.deletWaitScanTimer!.cancel();
|
||||||
@ -549,6 +557,7 @@ class LockSetLogic extends BaseGetXController {
|
|||||||
}
|
}
|
||||||
BlueManage().stopScan();
|
BlueManage().stopScan();
|
||||||
dismissEasyLoading();
|
dismissEasyLoading();
|
||||||
|
print("555555");
|
||||||
showDeletAlertTipDialog(Get.context!);
|
showDeletAlertTipDialog(Get.context!);
|
||||||
}else{
|
}else{
|
||||||
// 每秒判断获取是否搜到了当前设备
|
// 每秒判断获取是否搜到了当前设备
|
||||||
@ -596,6 +605,7 @@ class LockSetLogic extends BaseGetXController {
|
|||||||
}
|
}
|
||||||
}else if(state.currentDeviceUUid.value[31] == "0"){
|
}else if(state.currentDeviceUUid.value[31] == "0"){
|
||||||
// 未配对 表示这把锁已被强制初始化 处于可添加状态 直接弹窗删除即可
|
// 未配对 表示这把锁已被强制初始化 处于可添加状态 直接弹窗删除即可
|
||||||
|
print("666666");
|
||||||
showDeletAlertTipDialog(Get.context!);
|
showDeletAlertTipDialog(Get.context!);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -712,7 +712,7 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
|
|||||||
builder: (context) {
|
builder: (context) {
|
||||||
return CupertinoAlertDialog(
|
return CupertinoAlertDialog(
|
||||||
title: const Text("提示"),
|
title: const Text("提示"),
|
||||||
content: const Text('创建公司号,考勤功能才能使用'),
|
content: const Text('创建公司后,考勤功能才能使用'),
|
||||||
actions: [
|
actions: [
|
||||||
CupertinoDialogAction(
|
CupertinoDialogAction(
|
||||||
child: Text(TranslationLoader.lanKeys!.cancel!.tr),
|
child: Text(TranslationLoader.lanKeys!.cancel!.tr),
|
||||||
|
|||||||
@ -415,18 +415,29 @@ class LockDetailLogic extends BaseGetXController {
|
|||||||
// state.animationController.reset();
|
// state.animationController.reset();
|
||||||
// state.animationController.forward();
|
// state.animationController.forward();
|
||||||
});
|
});
|
||||||
|
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||||
|
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||||
|
|
||||||
|
var signKey = await Storage.getStringList(saveBlueSignKey);
|
||||||
|
List<int> signKeyDataList = changeStringListToIntList(signKey!);
|
||||||
|
|
||||||
|
var token = await Storage.getStringList(saveBlueToken);
|
||||||
|
List<int> getTokenList = changeStringListToIntList(token!);
|
||||||
|
|
||||||
|
print("openDoorTokenPubToken:$getTokenList getPrivateKeyList:$getPrivateKeyList");
|
||||||
|
// List<int>listData = await IoSenderManage.senderOpenLock(
|
||||||
|
// keyID: BlueManage().connectDeviceName,
|
||||||
|
// userID: await Storage.getUid(),
|
||||||
|
// openMode: openMode,
|
||||||
|
// openTime: DateTime.now().millisecondsSinceEpoch ~/ 1000,
|
||||||
|
// onlineToken: state.lockNetToken,
|
||||||
|
// token: getTokenList,
|
||||||
|
// needAuthor: 1,
|
||||||
|
// signKey: signKeyDataList,
|
||||||
|
// privateKey: getPrivateKeyList,
|
||||||
|
// );
|
||||||
BlueManage().bludSendData(state.keyInfos.value.bluetooth!.bluetoothDeviceName!, (DeviceConnectionState deviceConnectionState) async {
|
BlueManage().bludSendData(state.keyInfos.value.bluetooth!.bluetoothDeviceName!, (DeviceConnectionState deviceConnectionState) async {
|
||||||
if (deviceConnectionState == DeviceConnectionState.connected){
|
if (deviceConnectionState == DeviceConnectionState.connected){
|
||||||
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
|
||||||
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
|
||||||
|
|
||||||
var signKey = await Storage.getStringList(saveBlueSignKey);
|
|
||||||
List<int> signKeyDataList = changeStringListToIntList(signKey!);
|
|
||||||
|
|
||||||
var token = await Storage.getStringList(saveBlueToken);
|
|
||||||
List<int> getTokenList = changeStringListToIntList(token!);
|
|
||||||
|
|
||||||
print("openDoorTokenPubToken:$getTokenList getPrivateKeyList:$getPrivateKeyList");
|
|
||||||
IoSenderManage.senderOpenLock(
|
IoSenderManage.senderOpenLock(
|
||||||
keyID: BlueManage().connectDeviceName,
|
keyID: BlueManage().connectDeviceName,
|
||||||
userID: await Storage.getUid(),
|
userID: await Storage.getUid(),
|
||||||
|
|||||||
@ -38,9 +38,12 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
void initState() {
|
void initState() {
|
||||||
// TODO: implement initState
|
// TODO: implement initState
|
||||||
super.initState();
|
super.initState();
|
||||||
|
Get.log("LockDetailPage initState1111");
|
||||||
|
|
||||||
print("LockDetailPage isOnlyOneData==${widget.isOnlyOneData}");
|
print("LockDetailPage isOnlyOneData==${widget.isOnlyOneData}");
|
||||||
state.keyInfos.value = widget.lockListInfoItemEntity;
|
state.keyInfos.value = widget.lockListInfoItemEntity;
|
||||||
state.lockUserNo = state.keyInfos.value.lockUserNo!;
|
state.lockUserNo = state.keyInfos.value.lockUserNo!;
|
||||||
|
print("state.lockUserNo==${state.lockUserNo}");
|
||||||
state.senderUserId = state.keyInfos.value.senderUserId!;
|
state.senderUserId = state.keyInfos.value.senderUserId!;
|
||||||
state.isAttendance.value = state.keyInfos.value.lockSetting!.attendance!;
|
state.isAttendance.value = state.keyInfos.value.lockSetting!.attendance!;
|
||||||
state.isOpenLockNeedOnline.value =
|
state.isOpenLockNeedOnline.value =
|
||||||
@ -48,8 +51,7 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
state.electricQuantity.value = state.keyInfos.value.electricQuantity!;
|
state.electricQuantity.value = state.keyInfos.value.electricQuantity!;
|
||||||
state.isOpenPassageMode.value = state.keyInfos.value.passageMode!;
|
state.isOpenPassageMode.value = state.keyInfos.value.passageMode!;
|
||||||
|
|
||||||
BlueManage().connectDeviceName =
|
BlueManage().connectDeviceName = state.keyInfos.value.bluetooth!.bluetoothDeviceName!;
|
||||||
state.keyInfos.value.bluetooth!.bluetoothDeviceName!;
|
|
||||||
|
|
||||||
List<int> publicKeyData =
|
List<int> publicKeyData =
|
||||||
state.keyInfos.value.bluetooth!.publicKey!.cast<int>();
|
state.keyInfos.value.bluetooth!.publicKey!.cast<int>();
|
||||||
@ -611,14 +613,13 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
// state.animationController.forward();
|
// state.animationController.forward();
|
||||||
// state.animationController.dispose();
|
// state.animationController.dispose();
|
||||||
super.dispose();
|
super.dispose();
|
||||||
BlueManage().disconnect(BlueManage().connectDeviceMacAddress);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// 从上级界面进入 当前界面即将出现
|
/// 从上级界面进入 当前界面即将出现
|
||||||
@override
|
@override
|
||||||
void didPush() {
|
void didPush() {
|
||||||
super.didPush();
|
super.didPush();
|
||||||
// print("LockDetailPage===didPush");
|
print("LockDetailPage===didPush");
|
||||||
state.ifCurrentScreen.value = true;
|
state.ifCurrentScreen.value = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -626,10 +627,11 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
@override
|
@override
|
||||||
void didPop() {
|
void didPop() {
|
||||||
super.didPop();
|
super.didPop();
|
||||||
// print("LockDetailPage===didPop");
|
print("LockDetailPage===didPop");
|
||||||
state.ifCurrentScreen.value = false;
|
state.ifCurrentScreen.value = false;
|
||||||
logic.cancelBlueConnetctToastTimer();
|
logic.cancelBlueConnetctToastTimer();
|
||||||
BlueManage().stopScan();
|
BlueManage().stopScan();
|
||||||
|
BlueManage().disconnect(BlueManage().connectDeviceMacAddress);
|
||||||
state.openLockBtnState.value = 0;
|
state.openLockBtnState.value = 0;
|
||||||
state.animationController.reset();
|
state.animationController.reset();
|
||||||
state.animationController.forward();
|
state.animationController.forward();
|
||||||
@ -641,14 +643,14 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
void didPopNext() {
|
void didPopNext() {
|
||||||
super.didPopNext();
|
super.didPopNext();
|
||||||
state.ifCurrentScreen.value = true;
|
state.ifCurrentScreen.value = true;
|
||||||
// print("LockDetailPage===didPopNext");
|
print("LockDetailPage===didPopNext");
|
||||||
}
|
}
|
||||||
|
|
||||||
/// 进入下级界面 当前界面即将消失
|
/// 进入下级界面 当前界面即将消失
|
||||||
@override
|
@override
|
||||||
void didPushNext() {
|
void didPushNext() {
|
||||||
super.didPushNext();
|
super.didPushNext();
|
||||||
// print("LockDetailPage===didPushNext");
|
print("LockDetailPage===didPushNext");
|
||||||
state.ifCurrentScreen.value = false;
|
state.ifCurrentScreen.value = false;
|
||||||
logic.cancelBlueConnetctToastTimer();
|
logic.cancelBlueConnetctToastTimer();
|
||||||
BlueManage().stopScan();
|
BlueManage().stopScan();
|
||||||
|
|||||||
@ -1,5 +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/services.dart';
|
||||||
// import 'package:flutter_pickers/pickers.dart';
|
// import 'package:flutter_pickers/pickers.dart';
|
||||||
// import 'package:flutter_pickers/time_picker/model/date_mode.dart';
|
// import 'package:flutter_pickers/time_picker/model/date_mode.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
@ -269,24 +270,35 @@ class _AddRemoteControlPageState extends State<AddRemoteControlPage> {
|
|||||||
// 接受者信息输入框
|
// 接受者信息输入框
|
||||||
Widget getTFWidget(String tfStr) {
|
Widget getTFWidget(String tfStr) {
|
||||||
return Container(
|
return Container(
|
||||||
height: 50.h,
|
// color: Colors.red,
|
||||||
|
height: 65.h,
|
||||||
width: 300.w,
|
width: 300.w,
|
||||||
|
padding: EdgeInsets.only(top: 5.h),
|
||||||
child: Row(
|
child: Row(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: TextField(
|
child: TextField(
|
||||||
//输入框一行
|
//输入框一行
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
|
inputFormatters: <TextInputFormatter>[
|
||||||
|
FilteringTextInputFormatter.deny('\n'),
|
||||||
|
LengthLimitingTextInputFormatter(18),
|
||||||
|
],
|
||||||
controller: state.nameController,
|
controller: state.nameController,
|
||||||
autofocus: false,
|
autofocus: false,
|
||||||
textAlign: TextAlign.end,
|
textAlign: TextAlign.end,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
//输入里面输入文字内边距设置
|
//输入里面输入文字内边距设置
|
||||||
contentPadding: const EdgeInsets.only(top: 12.0, bottom: 8.0),
|
// contentPadding: const EdgeInsets.only(top: 12.0, bottom: 8.0),
|
||||||
hintText: tfStr,
|
hintText: tfStr,
|
||||||
hintStyle: TextStyle(fontSize: 24.sp),
|
hintStyle: TextStyle(fontSize: 22.sp),
|
||||||
//不需要输入框下划线
|
focusedBorder: const OutlineInputBorder(borderSide: BorderSide(width: 0, color: Colors.transparent)),
|
||||||
border: InputBorder.none,
|
disabledBorder: const OutlineInputBorder(borderSide: BorderSide(width: 0, color: Colors.transparent)),
|
||||||
|
enabledBorder: const OutlineInputBorder(borderSide: BorderSide(width: 0, color: Colors.transparent)),
|
||||||
|
border: const OutlineInputBorder(borderSide: BorderSide(width: 0, color: Colors.transparent)),
|
||||||
|
contentPadding: const EdgeInsets.symmetric(vertical: 0),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import 'package:get/get.dart';
|
|||||||
|
|
||||||
import '../../../../appRouters.dart';
|
import '../../../../appRouters.dart';
|
||||||
import '../../../../app_settings/app_colors.dart';
|
import '../../../../app_settings/app_colors.dart';
|
||||||
|
import '../../../../tools/keySearchWidget.dart';
|
||||||
import '../../../../tools/noData.dart';
|
import '../../../../tools/noData.dart';
|
||||||
import '../../../../tools/showIosTipView.dart';
|
import '../../../../tools/showIosTipView.dart';
|
||||||
import '../../../../tools/storage.dart';
|
import '../../../../tools/storage.dart';
|
||||||
@ -54,7 +55,12 @@ class _RemoteControlListPageState extends State<RemoteControlListPage> {
|
|||||||
),
|
),
|
||||||
body: Column(
|
body: Column(
|
||||||
children: [
|
children: [
|
||||||
_searchWidget(),
|
KeySearchWidget(
|
||||||
|
editingController: state.searchController,
|
||||||
|
onSubmittedAction: () {
|
||||||
|
|
||||||
|
},
|
||||||
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 20.h,
|
height: 20.h,
|
||||||
),
|
),
|
||||||
@ -100,50 +106,6 @@ class _RemoteControlListPageState extends State<RemoteControlListPage> {
|
|||||||
// return title;
|
// return title;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
Widget _searchWidget() {
|
|
||||||
return Container(
|
|
||||||
height: 60.h,
|
|
||||||
margin: EdgeInsets.only(top: 20.w, left: 20.w, right: 10.w),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: Colors.white, borderRadius: BorderRadius.circular(5)),
|
|
||||||
child: TextField(
|
|
||||||
//输入框一行
|
|
||||||
maxLines: 1,
|
|
||||||
controller: state.searchController,
|
|
||||||
autofocus: false,
|
|
||||||
onChanged: (value) {
|
|
||||||
print("onChanged:$value");
|
|
||||||
},
|
|
||||||
onEditingComplete: () {
|
|
||||||
print("onEditingComplete:");
|
|
||||||
},
|
|
||||||
onSubmitted: (value) {
|
|
||||||
// 调用遥控列表
|
|
||||||
|
|
||||||
},
|
|
||||||
decoration: InputDecoration(
|
|
||||||
//输入里面输入文字内边距设置
|
|
||||||
contentPadding: const EdgeInsets.only(
|
|
||||||
top: 12.0, left: -19.0, right: -15.0, bottom: 8.0),
|
|
||||||
hintText: TranslationLoader.lanKeys!.pleaseEnter!.tr,
|
|
||||||
hintStyle: TextStyle(fontSize: 22.sp, height: 3.0),
|
|
||||||
//不需要输入框下划线
|
|
||||||
border: InputBorder.none,
|
|
||||||
//左边图标设置
|
|
||||||
icon: Padding(
|
|
||||||
padding: EdgeInsets.only(
|
|
||||||
top: 20.h, bottom: 20.h, right: 20.w, left: 10.w),
|
|
||||||
child: Image.asset(
|
|
||||||
'images/main/icon_main_search.png',
|
|
||||||
width: 40.w,
|
|
||||||
height: 40.w,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget _buildMainUI() {
|
Widget _buildMainUI() {
|
||||||
String typeImgName = 'images/icon_card.png';
|
String typeImgName = 'images/icon_card.png';
|
||||||
|
|
||||||
@ -252,7 +214,7 @@ class _RemoteControlListPageState extends State<RemoteControlListPage> {
|
|||||||
builder: (context) {
|
builder: (context) {
|
||||||
return CupertinoAlertDialog(
|
return CupertinoAlertDialog(
|
||||||
title: const Text("提示"),
|
title: const Text("提示"),
|
||||||
content: const Text('重置后信息都会清除哦,确认要重置吗?'),
|
content: const Text('重置后遥控信息都会清除哦,确认要重置吗?'),
|
||||||
actions: [
|
actions: [
|
||||||
CupertinoDialogAction(
|
CupertinoDialogAction(
|
||||||
child: Text(TranslationLoader.lanKeys!.cancel!.tr),
|
child: Text(TranslationLoader.lanKeys!.cancel!.tr),
|
||||||
|
|||||||
@ -38,7 +38,7 @@ class _AbountPageState extends State<AbountPage> {
|
|||||||
),
|
),
|
||||||
SizedBox(height: 20.h),
|
SizedBox(height: 20.h),
|
||||||
Text(
|
Text(
|
||||||
"星锁 1.0.0.04(preRelease-20240108-1)",
|
"星锁 1.0.0.06(preRelease-20240115)",
|
||||||
style: TextStyle(fontSize: 24.sp, color: AppColors.blackColor),
|
style: TextStyle(fontSize: 24.sp, color: AppColors.blackColor),
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import 'dart:typed_data';
|
|||||||
|
|
||||||
import 'package:flutter/cupertino.dart';
|
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_reactive_ble/flutter_reactive_ble.dart';
|
import 'package:flutter_reactive_ble/flutter_reactive_ble.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';
|
||||||
@ -157,6 +158,8 @@ class _NearbyLockPageState extends State<NearbyLockPage> with RouteAware {
|
|||||||
super.didPop();
|
super.didPop();
|
||||||
Get.log("NearbyLockLogic didPop()");
|
Get.log("NearbyLockLogic didPop()");
|
||||||
|
|
||||||
|
EasyLoading.isShow ? EasyLoading.dismiss() : null;
|
||||||
|
|
||||||
state.ifCurrentScreen.value = false;
|
state.ifCurrentScreen.value = false;
|
||||||
logic.cancelBlueConnetctToastTimer();
|
logic.cancelBlueConnetctToastTimer();
|
||||||
logic.stopScanBlueList();
|
logic.stopScanBlueList();
|
||||||
|
|||||||
@ -17,7 +17,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
|||||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||||
# In Windows, build-name is used as the major, minor, and patch parts
|
# In Windows, build-name is used as the major, minor, and patch parts
|
||||||
# of the product and file versions while build-number is used as the build suffix.
|
# of the product and file versions while build-number is used as the build suffix.
|
||||||
version: 1.0.0+1
|
version: 1.0.0+6
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: '>=2.12.0 <3.0.0'
|
sdk: '>=2.12.0 <3.0.0'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user