Merge branch 'master' of https://gitee.com/starlock-cn/app-starlock
# Conflicts: # star_lock/lib/main/lockDetail/lockDetail/lockDetail_logic.dart
This commit is contained in:
commit
406ca21a2b
4
star_lock/.gitignore
vendored
4
star_lock/.gitignore
vendored
@ -4,6 +4,7 @@
|
||||
*.pyc
|
||||
*.swp
|
||||
.DS_Store
|
||||
../.DS_Store
|
||||
.atom/
|
||||
.buildlog/
|
||||
.history
|
||||
@ -42,3 +43,6 @@ app.*.map.json
|
||||
/android/app/debug
|
||||
/android/app/profile
|
||||
/android/app/release
|
||||
|
||||
|
||||
|
||||
|
||||
@ -840,6 +840,9 @@
|
||||
"固件版本": "Firmware version",
|
||||
"手动升级": "Manual upgrade",
|
||||
"设备连接中...": "Device Connecting...",
|
||||
"升级过程中无法开锁,请先开锁后再升级": "The lock cannot be unlocked during the upgrade, please unlock the lock before upgrading",
|
||||
"钥匙无效": "The key is invalid"
|
||||
"未避免异常情况,请在门打开时升级": "Unavoidable exceptions, please upgrade when the door is open",
|
||||
"钥匙无效": "The key is invalid",
|
||||
"操作失败,请确认锁是否在附近,或重启手机蓝牙后再试。": "The operation failed. Please confirm whether the lock is nearby, or restart your phone's Bluetooth and try again.",
|
||||
"如果是全自动锁,请使屏幕变亮": "If it is a fully automatic lock, please make the screen brighter",
|
||||
"正在尝试闭锁……": "Attempting to lock..."
|
||||
}
|
||||
|
||||
@ -868,6 +868,9 @@
|
||||
"固件版本": "固件版本",
|
||||
"手动升级": "手动升级",
|
||||
"设备连接中...": "设备连接中...",
|
||||
"升级过程中无法开锁,请先开锁后再升级": "升级过程中无法开锁,请先开锁后再升级",
|
||||
"钥匙无效": "钥匙无效"
|
||||
"未避免异常情况,请在门打开时升级": "未避免异常情况,请在门打开时升级",
|
||||
"钥匙无效": "钥匙无效",
|
||||
"操作失败,请确认锁是否在附近,或重启手机蓝牙后再试。": "操作失败,请确认锁是否在附近,或重启手机蓝牙后再试。",
|
||||
"如果是全自动锁,请使屏幕变亮": "如果是全自动锁,请使屏幕变亮",
|
||||
"正在尝试闭锁……": "正在尝试闭锁……"
|
||||
}
|
||||
|
||||
@ -838,7 +838,9 @@
|
||||
"固件版本": "固件版本",
|
||||
"手动升级": "手动升级",
|
||||
"设备连接中...": "设备连接中...",
|
||||
"升级过程中无法开锁,请先开锁后再升级": "升级过程中无法开锁,请先开锁后再升级",
|
||||
"钥匙无效": "钥匙无效"
|
||||
|
||||
"未避免异常情况,请在门打开时升级": "未避免异常情况,请在门打开时升级",
|
||||
"钥匙无效": "钥匙无效",
|
||||
"操作失败,请确认锁是否在附近,或重启手机蓝牙后再试。": "操作失败,请确认锁是否在附近,或重启手机蓝牙后再试。",
|
||||
"如果是全自动锁,请使屏幕变亮": "如果是全自动锁,请使屏幕变亮",
|
||||
"正在尝试闭锁……": "正在尝试闭锁……"
|
||||
}
|
||||
|
||||
@ -309,14 +309,14 @@ SPEC CHECKSUMS:
|
||||
audio_session: 088d2483ebd1dc43f51d253d4a1c517d9a2e7207
|
||||
audioplayers_darwin: 877d9a4d06331c5c374595e46e16453ac7eafa40
|
||||
auto_orientation: 102ed811a5938d52c86520ddd7ecd3a126b5d39d
|
||||
camera_avfoundation: 8b8d780bcfb6a4a02b0fbe2b4bd17b5b71946e68
|
||||
camera_avfoundation: 759172d1a77ae7be0de08fc104cfb79738b8a59e
|
||||
connectivity_plus: bf0076dd84a130856aa636df1c71ccaff908fa1d
|
||||
device_info_plus: e5c5da33f982a436e103237c0c85f9031142abed
|
||||
DKImagePickerController: 0a24ebfe7b48beeb74c27531540aaa2cc1dac6cf
|
||||
DKPhotoGallery: fdfad5125a9fdda9cc57df834d49df790dbb4179
|
||||
EMASRest: 8df6f87836767a9415ad5cc4af739bc9d215b475
|
||||
file_picker: ce3938a0df3cc1ef404671531facef740d03f920
|
||||
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
|
||||
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
|
||||
flutter_blue_plus: 4837da7d00cf5d441fdd6635b3a57f936778ea96
|
||||
flutter_local_notifications: 4cde75091f6327eb8517fa068a0a5950212d2086
|
||||
flutter_native_contact_picker: bd430ba0fbf82768bb50c2c52a69a65759a8f907
|
||||
@ -324,10 +324,10 @@ SPEC CHECKSUMS:
|
||||
flutter_voice_processor: 2b89b93d69b02227ae3fd58589ee0bcfa3ca2a82
|
||||
fluttertoast: 9f2f8e81bb5ce18facb9748d7855bf5a756fe3db
|
||||
fluwx: daa284756ce53442b3d0417ceeda66e981906811
|
||||
google_maps_flutter_ios: d1318b4ff711612cab16862d7a87e31a7403d458
|
||||
google_maps_flutter_ios: f135b968a67c05679e0a53538e900b5c174b0d99
|
||||
GoogleMaps: 20d7b12be49a14287f797e88e0e31bc4156aaeb4
|
||||
image_gallery_saver: cb43cc43141711190510e92c460eb1655cd343cb
|
||||
image_picker_ios: 99dfe1854b4fa34d0364e74a78448a0151025425
|
||||
image_picker_ios: b545a5f16c0fa88e3ecbbce3ed4de45567a8ec18
|
||||
ios-voice-processor: 8e32d7f980a06d392d128ef1cd19cf6ddcaca3c1
|
||||
JCore: 05f0f3489672ea3fa55338bae4866224bc092b1f
|
||||
JPush: 76668b765fcfd7c15f86b05ca0e5cdc01945ce23
|
||||
@ -335,18 +335,18 @@ SPEC CHECKSUMS:
|
||||
just_audio: baa7252489dbcf47a4c7cc9ca663e9661c99aafa
|
||||
network_info_plus: 6d0c3eb8367b8164fa3fb0c19875e3f59d49697f
|
||||
package_info_plus: 6c92f08e1f853dc01228d6f553146438dafcd14e
|
||||
path_provider_foundation: 3784922295ac71e43754bd15e0653ccfd36a147c
|
||||
path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
|
||||
permission_handler_apple: 9878588469a2b0d0fc1e048d9f43605f92e6cec2
|
||||
ReachabilitySwift: 2128f3a8c9107e1ad33574c6e58e8285d460b149
|
||||
SDWebImage: 40b0b4053e36c660a764958bff99eed16610acbb
|
||||
shared_preferences_foundation: b4c3b4cddf1c21f02770737f147a3f5da9d39695
|
||||
shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78
|
||||
sqflite: 673a0e54cc04b7d6dba8d24fb8095b31c3a99eec
|
||||
SwiftyGif: 706c60cf65fa2bc5ee0313beece843c8eb8194d4
|
||||
system_settings: 8f5cdbfa72c677fc8d665b863bcc20d393d87e9d
|
||||
Toast: 1f5ea13423a1e6674c4abdac5be53587ae481c4e
|
||||
url_launcher_ios: bbd758c6e7f9fd7b5b1d4cde34d2b95fcce5e812
|
||||
video_player_avfoundation: 02011213dab73ae3687df27ce441fbbcc82b5579
|
||||
webview_flutter_wkwebview: 4f3e50f7273d31e5500066ed267e3ae4309c5ae4
|
||||
url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe
|
||||
video_player_avfoundation: 7c6c11d8470e1675df7397027218274b6d2360b3
|
||||
webview_flutter_wkwebview: be0f0d33777f1bfd0c9fdcb594786704dbf65f36
|
||||
WechatOpenSDK-XCFramework: 36fb2bea0754266c17184adf4963d7e6ff98b69f
|
||||
|
||||
PODFILE CHECKSUM: 317f9473a5705c6fe4d79d95e81676f248048fdc
|
||||
|
||||
@ -853,6 +853,7 @@
|
||||
CODE_SIGN_IDENTITY = "Apple Development";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
DEVELOPMENT_TEAM = 7D53BZAN75;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||
PRODUCT_NAME = Runner;
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||
@ -868,6 +869,7 @@
|
||||
buildSettings = {
|
||||
CODE_SIGN_ENTITLEMENTS = "Runner/RunnerProfile-dev.entitlements";
|
||||
DEVELOPMENT_TEAM = 7D53BZAN75;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||
PRODUCT_NAME = Runner;
|
||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||
SUPPORTS_MACCATALYST = NO;
|
||||
@ -882,6 +884,7 @@
|
||||
buildSettings = {
|
||||
CODE_SIGN_ENTITLEMENTS = "Runner/RunnerRelease-dev.entitlements";
|
||||
DEVELOPMENT_TEAM = 7D53BZAN75;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||
PRODUCT_NAME = Runner;
|
||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||
SUPPORTS_MACCATALYST = NO;
|
||||
@ -896,6 +899,7 @@
|
||||
buildSettings = {
|
||||
CODE_SIGN_ENTITLEMENTS = "Runner/RunnerDebug-pre.entitlements";
|
||||
DEVELOPMENT_TEAM = 7D53BZAN75;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||
PRODUCT_NAME = Runner;
|
||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||
SUPPORTS_MACCATALYST = NO;
|
||||
@ -910,6 +914,7 @@
|
||||
buildSettings = {
|
||||
CODE_SIGN_ENTITLEMENTS = "Runner/RunnerProfile-pre.entitlements";
|
||||
DEVELOPMENT_TEAM = 7D53BZAN75;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||
PRODUCT_NAME = Runner;
|
||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||
SUPPORTS_MACCATALYST = NO;
|
||||
@ -924,6 +929,7 @@
|
||||
buildSettings = {
|
||||
CODE_SIGN_ENTITLEMENTS = "Runner/RunnerRelease-pre.entitlements";
|
||||
DEVELOPMENT_TEAM = 7D53BZAN75;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||
PRODUCT_NAME = Runner;
|
||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||
SUPPORTS_MACCATALYST = NO;
|
||||
@ -938,6 +944,7 @@
|
||||
buildSettings = {
|
||||
CODE_SIGN_ENTITLEMENTS = "Runner/RunnerDebug-sky.entitlements";
|
||||
DEVELOPMENT_TEAM = NAQ5PL2DYC;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||
PRODUCT_NAME = Runner;
|
||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||
SUPPORTS_MACCATALYST = NO;
|
||||
@ -952,6 +959,7 @@
|
||||
buildSettings = {
|
||||
CODE_SIGN_ENTITLEMENTS = "Runner/RunnerProfile-sky.entitlements";
|
||||
DEVELOPMENT_TEAM = NAQ5PL2DYC;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||
PRODUCT_NAME = Runner;
|
||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||
SUPPORTS_MACCATALYST = NO;
|
||||
@ -966,6 +974,7 @@
|
||||
buildSettings = {
|
||||
CODE_SIGN_ENTITLEMENTS = "Runner/RunnerRelease-sky.entitlements";
|
||||
DEVELOPMENT_TEAM = NAQ5PL2DYC;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||
PRODUCT_NAME = Runner;
|
||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||
SUPPORTS_MACCATALYST = NO;
|
||||
@ -980,6 +989,7 @@
|
||||
buildSettings = {
|
||||
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
||||
DEVELOPMENT_TEAM = P8997RW3V8;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||
PRODUCT_NAME = Runner;
|
||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||
SUPPORTS_MACCATALYST = NO;
|
||||
@ -994,6 +1004,7 @@
|
||||
buildSettings = {
|
||||
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
||||
DEVELOPMENT_TEAM = P8997RW3V8;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||
PRODUCT_NAME = Runner;
|
||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||
SUPPORTS_MACCATALYST = NO;
|
||||
@ -1008,6 +1019,7 @@
|
||||
buildSettings = {
|
||||
CODE_SIGN_ENTITLEMENTS = "Runner/RunnerRelease-xhj.entitlements";
|
||||
DEVELOPMENT_TEAM = P8997RW3V8;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||
PRODUCT_NAME = Runner;
|
||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||
SUPPORTS_MACCATALYST = NO;
|
||||
|
||||
@ -118,7 +118,7 @@ abstract class Reply{
|
||||
break;
|
||||
case 0x16:
|
||||
// 正在开锁中...
|
||||
AppLog.log("$logTag ${commandType!.typeName}正在开锁中...");
|
||||
AppLog.log("$logTag ${commandType!.typeName} $status 正在开锁中...");
|
||||
showErrorMessage("正在开锁中...");
|
||||
break;
|
||||
case 0xff:
|
||||
@ -128,7 +128,7 @@ abstract class Reply{
|
||||
break;
|
||||
default:
|
||||
//失败
|
||||
AppLog.log("$logTag ${commandType!.typeName} 蓝牙返回其他错误问题");
|
||||
AppLog.log("$logTag ${commandType!.typeName} $status 蓝牙返回其他错误问题");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,36 +1,44 @@
|
||||
import 'dart:async';
|
||||
import 'dart:ffi';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/app_settings/app_settings.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
import '../../../../../network/api_repository.dart';
|
||||
import '../../../../../tools/eventBusEventManage.dart';
|
||||
import 'checkingInAddStaffSelectKey_entity.dart';
|
||||
import 'checkingInAddStaff_state.dart';
|
||||
|
||||
typedef KeyClickCallback = void Function(List<CheckingInAddStaffKeyEntity> selectKeyList);
|
||||
class CheckingInAddStaffLogic extends BaseGetXController{
|
||||
typedef KeyClickCallback = void Function(
|
||||
List<CheckingInAddStaffKeyEntity> selectKeyList);
|
||||
|
||||
class CheckingInAddStaffLogic extends BaseGetXController {
|
||||
CheckingInAddStaffState state = CheckingInAddStaffState();
|
||||
|
||||
// 下级界面修改成功后传递数据
|
||||
StreamSubscription? _getNumberEvent;
|
||||
|
||||
void _initLoadDataAction() {
|
||||
// 蓝牙协议通知传输跟蓝牙之外的数据传输类不一样 eventBus
|
||||
_getNumberEvent = eventBus.on<ChickInAddStaffCardAndFingerprintBlockNumberEvent>().listen((event) {
|
||||
state.attendanceWayNumber.value = event.number;
|
||||
isCanClickAction();
|
||||
});
|
||||
_getNumberEvent = eventBus
|
||||
.on<ChickInAddStaffCardAndFingerprintBlockNumberEvent>()
|
||||
.listen((event) {
|
||||
state.attendanceWayNumber.value = event.number;
|
||||
isCanClickAction();
|
||||
});
|
||||
}
|
||||
|
||||
// 添加员工
|
||||
void addStaffLoadData() async{
|
||||
void addStaffLoadData() async {
|
||||
var usernameType = "1";
|
||||
if(state.appUnHaveAccount.value && state.staffAccount.contains("@")){
|
||||
if (state.appUnHaveAccount.value && state.staffAccount.contains("@")) {
|
||||
usernameType = "2";
|
||||
}
|
||||
|
||||
// 当是app且没有钥匙时,直接把账号赋值给attendanceWayNumber
|
||||
if(state.appUnHaveAccount.value && state.selectPrintingMethodType.value == "1"){
|
||||
if (state.appUnHaveAccount.value &&
|
||||
state.selectPrintingMethodType.value == "1") {
|
||||
state.attendanceWayNumber.value = state.staffAccountController.text;
|
||||
}
|
||||
|
||||
@ -41,36 +49,38 @@ class CheckingInAddStaffLogic extends BaseGetXController{
|
||||
have: state.appUnHaveAccount.value ? "2" : "1",
|
||||
staffName: state.staffNameController.text,
|
||||
countryCode: state.countryCode.value,
|
||||
usernameType:usernameType,
|
||||
usernameType: usernameType,
|
||||
);
|
||||
if(entity.errorCode!.codeIsSuccessful){
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
eventBus.fire(RefreshCheckInSetDataEvent());
|
||||
eventBus.fire(RefreshCheckInListEvent());
|
||||
Get.back(result: "addScuess");
|
||||
}else if(entity.errorCode! == 425){
|
||||
} else if (entity.errorCode! == 425) {
|
||||
showToast(entity.errorMsg!);
|
||||
}
|
||||
}
|
||||
|
||||
// 考勤设置添加员工-选择钥匙 1为APP,2为密码,3为卡,4为指纹,返回数据中,attendanceWay分别为用户名、密码、卡号、指纹号
|
||||
void addStaffSelectKey(KeyClickCallback kyClickCallback) async{
|
||||
// 考勤设置添加员工-选择钥匙 1为APP,2为密码,3为卡,4为指纹,返回数据中,
|
||||
// attendanceWay分别为用户名、密码、卡号、指纹号
|
||||
void addStaffSelectKey(KeyClickCallback kyClickCallback) async {
|
||||
var entity = await ApiRepository.to.addStaffSelectKeyData(
|
||||
companyId: state.companyId.value,
|
||||
type:state.selectPrintingMethodType.value,
|
||||
type: state.selectPrintingMethodType.value,
|
||||
);
|
||||
if(entity.errorCode!.codeIsSuccessful){
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
state.keyEntity.value = entity.data!;
|
||||
kyClickCallback(state.keyEntity.value);
|
||||
}
|
||||
}
|
||||
|
||||
// 编辑员工
|
||||
void editStaffLoadData() async{
|
||||
void editStaffLoadData() async {
|
||||
var usernameType = "1";
|
||||
if(state.appUnHaveAccount.value && state.staffAccount.contains("@")){
|
||||
if (state.appUnHaveAccount.value && state.staffAccount.contains("@")) {
|
||||
usernameType = "2";
|
||||
}
|
||||
|
||||
|
||||
var entity = await ApiRepository.to.editStaffData(
|
||||
attendanceType: state.selectPrintingMethodType.value,
|
||||
attendanceWay: state.attendanceWayNumber.value,
|
||||
@ -126,11 +136,14 @@ class CheckingInAddStaffLogic extends BaseGetXController{
|
||||
|
||||
// 是否能点击
|
||||
void isCanClickAction() {
|
||||
if(state.selectPrintingMethodType.value == "1" && state.appUnHaveAccount.value){
|
||||
if (state.selectPrintingMethodType.value == "1" &&
|
||||
state.appUnHaveAccount.value) {
|
||||
// 没有账号的时候直接判断姓名和账号是否为空
|
||||
state.isCanClick.value = state.staffNameIsNotEmpty && state.staffAccountIsNotEmpty;
|
||||
}else{
|
||||
state.isCanClick.value = state.staffNameIsNotEmpty && state.attendanceWayNumberIsNotEmpty;
|
||||
state.isCanClick.value =
|
||||
state.staffNameIsNotEmpty && state.staffAccountIsNotEmpty;
|
||||
} else {
|
||||
state.isCanClick.value =
|
||||
state.staffNameIsNotEmpty && state.attendanceWayNumberIsNotEmpty;
|
||||
}
|
||||
}
|
||||
|
||||
@ -145,7 +158,6 @@ class CheckingInAddStaffLogic extends BaseGetXController{
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
// TODO: implement onInit
|
||||
super.onInit();
|
||||
}
|
||||
|
||||
@ -156,5 +168,4 @@ class CheckingInAddStaffLogic extends BaseGetXController{
|
||||
|
||||
_getNumberEvent!.cancel();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
@ -6,7 +5,7 @@ import '../../../../lockMian/entity/lockListInfo_entity.dart';
|
||||
import '../checkingInSetStaffList/checkingInStaffList_entity.dart';
|
||||
import 'checkingInAddStaffSelectKey_entity.dart';
|
||||
|
||||
class CheckingInAddStaffState{
|
||||
class CheckingInAddStaffState {
|
||||
final getKeyInfosData = LockListInfoItemEntity().obs;
|
||||
final companyId = "".obs;
|
||||
final staffListItemData = CheckingInAddStaffListItemEntity().obs;
|
||||
@ -14,36 +13,41 @@ class CheckingInAddStaffState{
|
||||
final TextEditingController staffNameController = TextEditingController();
|
||||
final TextEditingController staffAccountController = TextEditingController();
|
||||
|
||||
final selectPrintingMethodType = "1".obs;// 选择打卡类型 1APP 2密码 3卡 4指纹 5人脸
|
||||
final selectPrintingMethodStr = "APP".obs;// 选择打卡类型字符串
|
||||
final selectPrintingMethodType = "1".obs; // 选择打卡类型 1APP 2密码 3卡 4指纹 5人脸
|
||||
final selectPrintingMethodStr = "APP".obs; // 选择打卡类型字符串
|
||||
|
||||
final countryName = "中国".tr.obs;
|
||||
final countryCode = "86".obs;
|
||||
|
||||
final appUnHaveAccount = true.obs;// 默认没有账号
|
||||
final keyEntity = <CheckingInAddStaffKeyEntity>[].obs;// 选择钥匙数据
|
||||
final appUnHaveAccount = true.obs; // 默认没有账号
|
||||
final keyEntity = <CheckingInAddStaffKeyEntity>[].obs; // 选择钥匙数据
|
||||
|
||||
final isAdd = "1".obs; // 1添加 2编辑
|
||||
final attendanceWayNumber = "".obs;
|
||||
final isCanClick = false.obs;
|
||||
var staffName = ''.obs;
|
||||
var staffAccount = ''.obs;
|
||||
|
||||
bool get staffNameIsNotEmpty => staffName.value.isNotEmpty;
|
||||
|
||||
bool get staffAccountIsNotEmpty => staffAccount.value.isNotEmpty;
|
||||
bool get attendanceWayNumberIsNotEmpty => attendanceWayNumber.value.isNotEmpty;
|
||||
|
||||
bool get attendanceWayNumberIsNotEmpty =>
|
||||
attendanceWayNumber.value.isNotEmpty;
|
||||
|
||||
CheckingInAddStaffState() {
|
||||
Map map = Get.arguments;
|
||||
getKeyInfosData.value = map["getKeyInfosData"];
|
||||
companyId.value = map["companyId"];
|
||||
getKeyInfosData.value = map["getKeyInfosData"];
|
||||
companyId.value = map["companyId"];
|
||||
|
||||
isAdd.value = map["isAdd"];
|
||||
if(isAdd.value == "2"){
|
||||
staffListItemData.value = map["staffListItem"];
|
||||
if (isAdd.value == "2") {
|
||||
staffListItemData.value = map["staffListItem"];
|
||||
staffNameController.text = staffListItemData.value.staffName!;
|
||||
|
||||
selectPrintingMethodType.value = staffListItemData.value.attendanceType.toString();
|
||||
switch(staffListItemData.value.attendanceType){
|
||||
selectPrintingMethodType.value =
|
||||
staffListItemData.value.attendanceType.toString();
|
||||
switch (staffListItemData.value.attendanceType) {
|
||||
case 1:
|
||||
selectPrintingMethodStr.value = "APP";
|
||||
break;
|
||||
@ -58,17 +62,12 @@ class CheckingInAddStaffState{
|
||||
break;
|
||||
}
|
||||
|
||||
if(staffListItemData.value.attendanceWay!.isNotEmpty){
|
||||
if(staffListItemData.value.cardStatus != 0){
|
||||
appUnHaveAccount.value = false;
|
||||
attendanceWayNumber.value = staffListItemData.value.attendanceWay!;
|
||||
}else{
|
||||
appUnHaveAccount.value = true;
|
||||
}
|
||||
}else{
|
||||
if (staffListItemData.value.attendanceWay!.isNotEmpty) {
|
||||
appUnHaveAccount.value = false;
|
||||
attendanceWayNumber.value = staffListItemData.value.attendanceWay!;
|
||||
} else {
|
||||
appUnHaveAccount.value = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -37,7 +37,7 @@ class CheckingInAddStaffListItemEntity {
|
||||
int? staffId;
|
||||
int? attendanceType;
|
||||
int? countryCode;
|
||||
int? cardStatus;
|
||||
int? cardStatus;//0正常 1打卡失败
|
||||
String? attendanceWay;
|
||||
String? reason;
|
||||
|
||||
|
||||
@ -5,6 +5,7 @@ import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:permission_handler/permission_handler.dart';
|
||||
import 'package:star_lock/blue/io_protocol/io_getStarLockStatusInfo.dart';
|
||||
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
|
||||
|
||||
import 'package:star_lock/widget/permission/permission_dialog.dart';
|
||||
@ -33,7 +34,8 @@ class LockDetailLogic extends BaseGetXController {
|
||||
|
||||
// 监听设备返回的数据
|
||||
void initReplySubscription() {
|
||||
state.replySubscription = EventBusManager().eventBus!.on<Reply>().listen((reply) async {
|
||||
state.replySubscription =
|
||||
EventBusManager().eventBus!.on<Reply>().listen((reply) async {
|
||||
// 开门
|
||||
if (reply is OpenDoorReply && state.ifCurrentScreen.value == true) {
|
||||
_replyOpenLock(reply);
|
||||
@ -58,10 +60,7 @@ class LockDetailLogic extends BaseGetXController {
|
||||
cancelBlueConnetctToastTimer();
|
||||
|
||||
state.iSClosedUnlockSuccessfulPopup.value = true;
|
||||
if (state.closedUnlockSuccessfulTimer != null) {
|
||||
state.closedUnlockSuccessfulTimer!.cancel();
|
||||
state.closedUnlockSuccessfulTimer = null;
|
||||
}
|
||||
state.closedUnlockSuccessfulTimer?.cancel();
|
||||
// 如果没有点击关闭弹窗,3秒后自动关闭
|
||||
state.closedUnlockSuccessfulTimer = Timer.periodic(3.seconds, (timer) {
|
||||
state.iSClosedUnlockSuccessfulPopup.value = false;
|
||||
@ -174,6 +173,14 @@ class LockDetailLogic extends BaseGetXController {
|
||||
}
|
||||
}
|
||||
|
||||
//清除开锁动画以及状态
|
||||
void closeLuckStatus() {
|
||||
state.openLockBtnState.value = 0;
|
||||
state.openDoorBtnisUneable.value = false;
|
||||
state.animationController!.stop(canceled: true);
|
||||
cancelBlueConnetctToastTimer();
|
||||
}
|
||||
|
||||
// 根据时间查解析数据
|
||||
Future<void> _replyReferEventRecordTime(Reply reply) async {
|
||||
int status = reply.data[2];
|
||||
@ -267,7 +274,8 @@ class LockDetailLogic extends BaseGetXController {
|
||||
signKey: signKeyDataList,
|
||||
privateKey: getPrivateKeyList,
|
||||
);
|
||||
} else if (deviceConnectionState == BluetoothConnectionState.disconnected) {
|
||||
} else if (deviceConnectionState ==
|
||||
BluetoothConnectionState.disconnected) {
|
||||
cancelBlueConnetctToastTimer();
|
||||
if (state.ifCurrentScreen.value == true) {
|
||||
showBlueConnetctToast();
|
||||
@ -468,7 +476,7 @@ class LockDetailLogic extends BaseGetXController {
|
||||
return formattedTime;
|
||||
}
|
||||
|
||||
void resetOpenDoorState(){
|
||||
void resetOpenDoorState() {
|
||||
state.openLockBtnState.value = 0;
|
||||
state.openDoorBtnisUneable.value = false;
|
||||
state.animationController!.reset();
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
@ -1264,6 +1265,7 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
left: 155.w,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
state.closedUnlockSuccessfulTimer?.cancel();
|
||||
setState(() {
|
||||
state.iSClosedUnlockSuccessfulPopup.value = false;
|
||||
});
|
||||
@ -1344,6 +1346,7 @@ class _LockDetailPageState extends State<LockDetailPage>
|
||||
state.openLockBtnState.value = 1;
|
||||
state.animationController!.forward();
|
||||
|
||||
EasyLoading.showToast("正在尝试闭锁……".tr, duration: 2000.milliseconds);
|
||||
AppLog.log("长按闭锁");
|
||||
if (state.isOpenLockNeedOnline.value == 0) {
|
||||
// 不需要联网
|
||||
|
||||
@ -69,7 +69,7 @@ class LockEscalationLogic extends BaseGetXController {
|
||||
}
|
||||
String md5Str = md5.convert(otaBin!).toString();
|
||||
headJson!['fwMd5'] = md5Str;
|
||||
ShowTipView().showIosTipWithContentDialog("升级过程中无法开锁,请先开锁后再升级".tr,
|
||||
ShowTipView().showIosTipWithContentDialog("未避免异常情况,请在门打开时升级".tr,
|
||||
() async {
|
||||
blueOTAUpgrade(headJson!, [0, 0, 0, 0]);
|
||||
EasyLoading.show(
|
||||
|
||||
@ -56,14 +56,17 @@ class BaseGetXController extends GetxController {
|
||||
void showEasyLoading() => EasyLoading.show();
|
||||
|
||||
void dismissEasyLoading() {
|
||||
if(EasyLoading.isShow) EasyLoading.dismiss();
|
||||
if (EasyLoading.isShow) EasyLoading.dismiss();
|
||||
}
|
||||
|
||||
void showTitleEasyLoading(String showContent) => EasyLoading.show(status: showContent);
|
||||
void showTitleEasyLoading(String showContent) =>
|
||||
EasyLoading.show(status: showContent);
|
||||
|
||||
Timer? _timer;
|
||||
|
||||
// CancelableOperation? _operation;
|
||||
void showBlueConnetctToastTimer({bool isShowBlueConnetctToast = true, Function? action}) {
|
||||
void showBlueConnetctToastTimer(
|
||||
{bool isShowBlueConnetctToast = true, Function? action}) {
|
||||
if (_timer != null && _timer!.isActive) {
|
||||
_timer!.cancel();
|
||||
_timer = null;
|
||||
@ -88,9 +91,9 @@ class BaseGetXController extends GetxController {
|
||||
}
|
||||
|
||||
void showBlueConnetctToast() {
|
||||
bool isContains = BlueManage().connectDeviceName!.contains("T9A");
|
||||
bool isContains = BlueManage().connectDeviceName.contains("T9A");
|
||||
showToast(
|
||||
"连接设备失败,请确保在设备附近,设备未被连接,设备已打开${isContains == true ? "。如果是全自动锁,请使屏幕变亮" : ""}");
|
||||
"${'操作失败,请确认锁是否在附近,或重启手机蓝牙后再试。'.tr}${isContains == true ? "如果是全自动锁,请使屏幕变亮" : ""}");
|
||||
}
|
||||
|
||||
void showToast(String status, {Function? something}) {
|
||||
@ -116,6 +119,7 @@ class BaseGetXController extends GetxController {
|
||||
|
||||
void showOperationSuccessful({String? status, Function? something}) =>
|
||||
showSuccess(status ?? "成功", something: something);
|
||||
|
||||
void showOperationFailed({String? status, Function? something}) =>
|
||||
showError(status ?? "失败", something: something);
|
||||
|
||||
@ -171,7 +175,8 @@ class BaseGetXController extends GetxController {
|
||||
String useDateStr = '';
|
||||
if (keyType == XSConstantMacro.keyTypeTime) {
|
||||
//限期
|
||||
useDateStr = "${DateTool().dateToYMDHNString(startDate.toString())}-${DateTool().dateToYMDHNString(endDate.toString())} ${"限时".tr}";
|
||||
useDateStr =
|
||||
"${DateTool().dateToYMDHNString(startDate.toString())}-${DateTool().dateToYMDHNString(endDate.toString())} ${"限时".tr}";
|
||||
} else if (keyType == XSConstantMacro.keyTypeLong) {
|
||||
//永久
|
||||
// DateTime dateStr = DateTime.fromMillisecondsSinceEpoch(indexEntity.date!);
|
||||
@ -184,7 +189,8 @@ class BaseGetXController extends GetxController {
|
||||
useDateStr = '单次'.tr;
|
||||
} else if (keyType == XSConstantMacro.keyTypeLoop) {
|
||||
//循环
|
||||
useDateStr = "${DateTool().dateToYMDString(startDate.toString())}-${DateTool().dateToYMDString(endDate.toString())} ${"循环".tr}";
|
||||
useDateStr =
|
||||
"${DateTool().dateToYMDString(startDate.toString())}-${DateTool().dateToYMDString(endDate.toString())} ${"循环".tr}";
|
||||
}
|
||||
|
||||
return useDateStr;
|
||||
@ -214,5 +220,6 @@ class BaseGetXController extends GetxController {
|
||||
///Extension_Int
|
||||
extension Extension_Int on int {
|
||||
bool get codeIsSuccessful => this == 0;
|
||||
|
||||
bool get msgCodeIsSuccessful => this == 1;
|
||||
}
|
||||
|
||||
@ -179,6 +179,10 @@ dependencies:
|
||||
file_picker: ^5.3.1
|
||||
|
||||
|
||||
dependency_overrides:
|
||||
#强制设置google_maps_flutter_ios 为 2.5.2
|
||||
google_maps_flutter_ios: 2.5.2
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
sdk: flutter
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user