Merge branch 'master' of gitee.com:starlock-cn/app-starlock

This commit is contained in:
Daisy 2024-05-16 10:20:07 +08:00
commit 05414a9c2d
39 changed files with 753 additions and 733 deletions

View File

@ -4,6 +4,7 @@
*.pyc *.pyc
*.swp *.swp
.DS_Store .DS_Store
../.DS_Store
.atom/ .atom/
.buildlog/ .buildlog/
.history .history
@ -42,3 +43,6 @@ app.*.map.json
/android/app/debug /android/app/debug
/android/app/profile /android/app/profile
/android/app/release /android/app/release

View File

@ -680,6 +680,7 @@
"型号": "Model", "型号": "Model",
"密码生成后请在当日2359前使用一次进行激活否则过0点后未激活则失效。密码激活后有效期内不限次数使用。": "After the password is generated, please use it once for activation before 23:59 on the same day, otherwise it will be invalid after 0 o'clock. After the password is activated, it can be used unlimited times within the validity period.", "密码生成后请在当日2359前使用一次进行激活否则过0点后未激活则失效。密码激活后有效期内不限次数使用。": "After the password is generated, please use it once for activation before 23:59 on the same day, otherwise it will be invalid after 0 o'clock. After the password is activated, it can be used unlimited times within the validity period.",
"密码生成后请在当日2359前使用否则过0点后失效。清空码用于清空今天0点之前生成的所有密码。": "After the password is generated, please use it before 23:59 on the same day, otherwise it will be invalid after 0 o'clock. The clear code is used to clear all the passwords generated before 0 o'clock today.", "密码生成后请在当日2359前使用否则过0点后失效。清空码用于清空今天0点之前生成的所有密码。": "After the password is generated, please use it before 23:59 on the same day, otherwise it will be invalid after 0 o'clock. The clear code is used to clear all the passwords generated before 0 o'clock today.",
"密码生成后请在当日2359前使用否则过0点后失效。": "After the password is generated, please use it before 23:59 on the same day, otherwise it will be invalid after 0 o'clock.",
"相机": "camera", "相机": "camera",
"相册": "photos", "相册": "photos",
"读写": "storage", "读写": "storage",
@ -839,6 +840,9 @@
"固件版本": "Firmware version", "固件版本": "Firmware version",
"手动升级": "Manual upgrade", "手动升级": "Manual upgrade",
"设备连接中...": "Device Connecting...", "设备连接中...": "Device Connecting...",
"升级过程中无法开锁,请先开锁后再升级": "The lock cannot be unlocked during the upgrade, please unlock the lock before upgrading", "未避免异常情况,请在门打开时升级": "Unavoidable exceptions, please upgrade when the door is open",
"钥匙无效": "The key is invalid" "钥匙无效": "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..."
} }

View File

@ -707,6 +707,7 @@
"型号": "型号", "型号": "型号",
"密码生成后请在当日2359前使用一次进行激活否则过0点后未激活则失效。密码激活后有效期内不限次数使用。": "密码生成后请在当日2359前使用一次进行激活否则过0点后未激活则失效。密码激活后有效期内不限次数使用。", "密码生成后请在当日2359前使用一次进行激活否则过0点后未激活则失效。密码激活后有效期内不限次数使用。": "密码生成后请在当日2359前使用一次进行激活否则过0点后未激活则失效。密码激活后有效期内不限次数使用。",
"密码生成后请在当日2359前使用否则过0点后失效。清空码用于清空今天0点之前生成的所有密码。":"密码生成后请在当日2359前使用否则过0点后失效。清空码用于清空今天0点之前生成的所有密码。", "密码生成后请在当日2359前使用否则过0点后失效。清空码用于清空今天0点之前生成的所有密码。":"密码生成后请在当日2359前使用否则过0点后失效。清空码用于清空今天0点之前生成的所有密码。",
"密码生成后请在当日2359前使用否则过0点后失效。": "密码生成后请在当日2359前使用否则过0点后失效。",
"密码不一致哦":"密码不一致哦", "密码不一致哦":"密码不一致哦",
"相机": "相机", "相机": "相机",
@ -867,6 +868,9 @@
"固件版本": "固件版本", "固件版本": "固件版本",
"手动升级": "手动升级", "手动升级": "手动升级",
"设备连接中...": "设备连接中...", "设备连接中...": "设备连接中...",
"升级过程中无法开锁,请先开锁后再升级": "升级过程中无法开锁,请先开锁后再升级", "未避免异常情况,请在门打开时升级": "未避免异常情况,请在门打开时升级",
"钥匙无效": "钥匙无效" "钥匙无效": "钥匙无效",
"操作失败,请确认锁是否在附近,或重启手机蓝牙后再试。": "操作失败,请确认锁是否在附近,或重启手机蓝牙后再试。",
"如果是全自动锁,请使屏幕变亮": "如果是全自动锁,请使屏幕变亮",
"正在尝试闭锁……": "正在尝试闭锁……"
} }

View File

@ -682,6 +682,7 @@
"型号": "型号", "型号": "型号",
"密码生成后请在当日2359前使用一次进行激活否则过0点后未激活则失效。密码激活后有效期内不限次数使用。": "密码生成后请在当日2359前使用一次进行激活否则过0点后未激活则失效。密码激活后有效期内不限次数使用。", "密码生成后请在当日2359前使用一次进行激活否则过0点后未激活则失效。密码激活后有效期内不限次数使用。": "密码生成后请在当日2359前使用一次进行激活否则过0点后未激活则失效。密码激活后有效期内不限次数使用。",
"密码生成后请在当日2359前使用否则过0点后失效。清空码用于清空今天0点之前生成的所有密码。": "密码生成后请在当日2359前使用否则过0点后失效。清空码用于清空今天0点之前生成的所有密码。", "密码生成后请在当日2359前使用否则过0点后失效。清空码用于清空今天0点之前生成的所有密码。": "密码生成后请在当日2359前使用否则过0点后失效。清空码用于清空今天0点之前生成的所有密码。",
"密码生成后请在当日2359前使用否则过0点后失效。": "密码生成后请在当日2359前使用否则过0点后失效。",
"密码不一致哦": "密码不一致哦", "密码不一致哦": "密码不一致哦",
"相机": "相机", "相机": "相机",
"相册": "相册", "相册": "相册",
@ -837,7 +838,9 @@
"固件版本": "固件版本", "固件版本": "固件版本",
"手动升级": "手动升级", "手动升级": "手动升级",
"设备连接中...": "设备连接中...", "设备连接中...": "设备连接中...",
"升级过程中无法开锁,请先开锁后再升级": "升级过程中无法开锁,请先开锁后再升级", "未避免异常情况,请在门打开时升级": "未避免异常情况,请在门打开时升级",
"钥匙无效": "钥匙无效" "钥匙无效": "钥匙无效",
"操作失败,请确认锁是否在附近,或重启手机蓝牙后再试。": "操作失败,请确认锁是否在附近,或重启手机蓝牙后再试。",
"如果是全自动锁,请使屏幕变亮": "如果是全自动锁,请使屏幕变亮",
"正在尝试闭锁……": "正在尝试闭锁……"
} }

View File

@ -309,25 +309,25 @@ SPEC CHECKSUMS:
audio_session: 088d2483ebd1dc43f51d253d4a1c517d9a2e7207 audio_session: 088d2483ebd1dc43f51d253d4a1c517d9a2e7207
audioplayers_darwin: 877d9a4d06331c5c374595e46e16453ac7eafa40 audioplayers_darwin: 877d9a4d06331c5c374595e46e16453ac7eafa40
auto_orientation: 102ed811a5938d52c86520ddd7ecd3a126b5d39d auto_orientation: 102ed811a5938d52c86520ddd7ecd3a126b5d39d
camera_avfoundation: 8b8d780bcfb6a4a02b0fbe2b4bd17b5b71946e68 camera_avfoundation: 759172d1a77ae7be0de08fc104cfb79738b8a59e
connectivity_plus: bf0076dd84a130856aa636df1c71ccaff908fa1d connectivity_plus: bf0076dd84a130856aa636df1c71ccaff908fa1d
device_info_plus: e5c5da33f982a436e103237c0c85f9031142abed device_info_plus: e5c5da33f982a436e103237c0c85f9031142abed
DKImagePickerController: 0a24ebfe7b48beeb74c27531540aaa2cc1dac6cf DKImagePickerController: 0a24ebfe7b48beeb74c27531540aaa2cc1dac6cf
DKPhotoGallery: fdfad5125a9fdda9cc57df834d49df790dbb4179 DKPhotoGallery: fdfad5125a9fdda9cc57df834d49df790dbb4179
EMASRest: 8df6f87836767a9415ad5cc4af739bc9d215b475 EMASRest: 8df6f87836767a9415ad5cc4af739bc9d215b475
file_picker: ce3938a0df3cc1ef404671531facef740d03f920 file_picker: ce3938a0df3cc1ef404671531facef740d03f920
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
flutter_blue_plus: 4837da7d00cf5d441fdd6635b3a57f936778ea96 flutter_blue_plus: 4837da7d00cf5d441fdd6635b3a57f936778ea96
flutter_local_notifications: 4cde75091f6327eb8517fa068a0a5950212d2086 flutter_local_notifications: 4cde75091f6327eb8517fa068a0a5950212d2086
flutter_native_contact_picker: bd430ba0fbf82768bb50c2c52a69a65759a8f907 flutter_native_contact_picker: bd430ba0fbf82768bb50c2c52a69a65759a8f907
flutter_pcm_sound: de0572ca4f99091cc2abfcc31601b8a4ddd33c0e flutter_pcm_sound: de0572ca4f99091cc2abfcc31601b8a4ddd33c0e
flutter_voice_processor: 2b89b93d69b02227ae3fd58589ee0bcfa3ca2a82 flutter_voice_processor: 2b89b93d69b02227ae3fd58589ee0bcfa3ca2a82
fluttertoast: 31b00dabfa7fb7bacd9e7dbee580d7a2ff4bf265 fluttertoast: 9f2f8e81bb5ce18facb9748d7855bf5a756fe3db
fluwx: daa284756ce53442b3d0417ceeda66e981906811 fluwx: daa284756ce53442b3d0417ceeda66e981906811
google_maps_flutter_ios: d1318b4ff711612cab16862d7a87e31a7403d458 google_maps_flutter_ios: f135b968a67c05679e0a53538e900b5c174b0d99
GoogleMaps: 20d7b12be49a14287f797e88e0e31bc4156aaeb4 GoogleMaps: 20d7b12be49a14287f797e88e0e31bc4156aaeb4
image_gallery_saver: cb43cc43141711190510e92c460eb1655cd343cb image_gallery_saver: cb43cc43141711190510e92c460eb1655cd343cb
image_picker_ios: 99dfe1854b4fa34d0364e74a78448a0151025425 image_picker_ios: b545a5f16c0fa88e3ecbbce3ed4de45567a8ec18
ios-voice-processor: 8e32d7f980a06d392d128ef1cd19cf6ddcaca3c1 ios-voice-processor: 8e32d7f980a06d392d128ef1cd19cf6ddcaca3c1
JCore: 05f0f3489672ea3fa55338bae4866224bc092b1f JCore: 05f0f3489672ea3fa55338bae4866224bc092b1f
JPush: 76668b765fcfd7c15f86b05ca0e5cdc01945ce23 JPush: 76668b765fcfd7c15f86b05ca0e5cdc01945ce23
@ -335,18 +335,18 @@ SPEC CHECKSUMS:
just_audio: baa7252489dbcf47a4c7cc9ca663e9661c99aafa just_audio: baa7252489dbcf47a4c7cc9ca663e9661c99aafa
network_info_plus: 6d0c3eb8367b8164fa3fb0c19875e3f59d49697f network_info_plus: 6d0c3eb8367b8164fa3fb0c19875e3f59d49697f
package_info_plus: 6c92f08e1f853dc01228d6f553146438dafcd14e package_info_plus: 6c92f08e1f853dc01228d6f553146438dafcd14e
path_provider_foundation: 3784922295ac71e43754bd15e0653ccfd36a147c path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
permission_handler_apple: 9878588469a2b0d0fc1e048d9f43605f92e6cec2 permission_handler_apple: 9878588469a2b0d0fc1e048d9f43605f92e6cec2
ReachabilitySwift: 2128f3a8c9107e1ad33574c6e58e8285d460b149 ReachabilitySwift: 2128f3a8c9107e1ad33574c6e58e8285d460b149
SDWebImage: 40b0b4053e36c660a764958bff99eed16610acbb SDWebImage: 40b0b4053e36c660a764958bff99eed16610acbb
shared_preferences_foundation: b4c3b4cddf1c21f02770737f147a3f5da9d39695 shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78
sqflite: 673a0e54cc04b7d6dba8d24fb8095b31c3a99eec sqflite: 673a0e54cc04b7d6dba8d24fb8095b31c3a99eec
SwiftyGif: 706c60cf65fa2bc5ee0313beece843c8eb8194d4 SwiftyGif: 706c60cf65fa2bc5ee0313beece843c8eb8194d4
system_settings: 8f5cdbfa72c677fc8d665b863bcc20d393d87e9d system_settings: 8f5cdbfa72c677fc8d665b863bcc20d393d87e9d
Toast: 1f5ea13423a1e6674c4abdac5be53587ae481c4e Toast: 1f5ea13423a1e6674c4abdac5be53587ae481c4e
url_launcher_ios: bbd758c6e7f9fd7b5b1d4cde34d2b95fcce5e812 url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe
video_player_avfoundation: 02011213dab73ae3687df27ce441fbbcc82b5579 video_player_avfoundation: 7c6c11d8470e1675df7397027218274b6d2360b3
webview_flutter_wkwebview: 4f3e50f7273d31e5500066ed267e3ae4309c5ae4 webview_flutter_wkwebview: be0f0d33777f1bfd0c9fdcb594786704dbf65f36
WechatOpenSDK-XCFramework: 36fb2bea0754266c17184adf4963d7e6ff98b69f WechatOpenSDK-XCFramework: 36fb2bea0754266c17184adf4963d7e6ff98b69f
PODFILE CHECKSUM: 317f9473a5705c6fe4d79d95e81676f248048fdc PODFILE CHECKSUM: 317f9473a5705c6fe4d79d95e81676f248048fdc

View File

@ -853,6 +853,7 @@
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = 7D53BZAN75; DEVELOPMENT_TEAM = 7D53BZAN75;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
PRODUCT_NAME = Runner; PRODUCT_NAME = Runner;
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
@ -868,6 +869,7 @@
buildSettings = { buildSettings = {
CODE_SIGN_ENTITLEMENTS = "Runner/RunnerProfile-dev.entitlements"; CODE_SIGN_ENTITLEMENTS = "Runner/RunnerProfile-dev.entitlements";
DEVELOPMENT_TEAM = 7D53BZAN75; DEVELOPMENT_TEAM = 7D53BZAN75;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
PRODUCT_NAME = Runner; PRODUCT_NAME = Runner;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO; SUPPORTS_MACCATALYST = NO;
@ -882,6 +884,7 @@
buildSettings = { buildSettings = {
CODE_SIGN_ENTITLEMENTS = "Runner/RunnerRelease-dev.entitlements"; CODE_SIGN_ENTITLEMENTS = "Runner/RunnerRelease-dev.entitlements";
DEVELOPMENT_TEAM = 7D53BZAN75; DEVELOPMENT_TEAM = 7D53BZAN75;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
PRODUCT_NAME = Runner; PRODUCT_NAME = Runner;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO; SUPPORTS_MACCATALYST = NO;
@ -896,6 +899,7 @@
buildSettings = { buildSettings = {
CODE_SIGN_ENTITLEMENTS = "Runner/RunnerDebug-pre.entitlements"; CODE_SIGN_ENTITLEMENTS = "Runner/RunnerDebug-pre.entitlements";
DEVELOPMENT_TEAM = 7D53BZAN75; DEVELOPMENT_TEAM = 7D53BZAN75;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
PRODUCT_NAME = Runner; PRODUCT_NAME = Runner;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO; SUPPORTS_MACCATALYST = NO;
@ -910,6 +914,7 @@
buildSettings = { buildSettings = {
CODE_SIGN_ENTITLEMENTS = "Runner/RunnerProfile-pre.entitlements"; CODE_SIGN_ENTITLEMENTS = "Runner/RunnerProfile-pre.entitlements";
DEVELOPMENT_TEAM = 7D53BZAN75; DEVELOPMENT_TEAM = 7D53BZAN75;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
PRODUCT_NAME = Runner; PRODUCT_NAME = Runner;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO; SUPPORTS_MACCATALYST = NO;
@ -924,6 +929,7 @@
buildSettings = { buildSettings = {
CODE_SIGN_ENTITLEMENTS = "Runner/RunnerRelease-pre.entitlements"; CODE_SIGN_ENTITLEMENTS = "Runner/RunnerRelease-pre.entitlements";
DEVELOPMENT_TEAM = 7D53BZAN75; DEVELOPMENT_TEAM = 7D53BZAN75;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
PRODUCT_NAME = Runner; PRODUCT_NAME = Runner;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO; SUPPORTS_MACCATALYST = NO;
@ -938,6 +944,7 @@
buildSettings = { buildSettings = {
CODE_SIGN_ENTITLEMENTS = "Runner/RunnerDebug-sky.entitlements"; CODE_SIGN_ENTITLEMENTS = "Runner/RunnerDebug-sky.entitlements";
DEVELOPMENT_TEAM = NAQ5PL2DYC; DEVELOPMENT_TEAM = NAQ5PL2DYC;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
PRODUCT_NAME = Runner; PRODUCT_NAME = Runner;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO; SUPPORTS_MACCATALYST = NO;
@ -952,6 +959,7 @@
buildSettings = { buildSettings = {
CODE_SIGN_ENTITLEMENTS = "Runner/RunnerProfile-sky.entitlements"; CODE_SIGN_ENTITLEMENTS = "Runner/RunnerProfile-sky.entitlements";
DEVELOPMENT_TEAM = NAQ5PL2DYC; DEVELOPMENT_TEAM = NAQ5PL2DYC;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
PRODUCT_NAME = Runner; PRODUCT_NAME = Runner;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO; SUPPORTS_MACCATALYST = NO;
@ -966,6 +974,7 @@
buildSettings = { buildSettings = {
CODE_SIGN_ENTITLEMENTS = "Runner/RunnerRelease-sky.entitlements"; CODE_SIGN_ENTITLEMENTS = "Runner/RunnerRelease-sky.entitlements";
DEVELOPMENT_TEAM = NAQ5PL2DYC; DEVELOPMENT_TEAM = NAQ5PL2DYC;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
PRODUCT_NAME = Runner; PRODUCT_NAME = Runner;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO; SUPPORTS_MACCATALYST = NO;
@ -980,6 +989,7 @@
buildSettings = { buildSettings = {
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
DEVELOPMENT_TEAM = P8997RW3V8; DEVELOPMENT_TEAM = P8997RW3V8;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
PRODUCT_NAME = Runner; PRODUCT_NAME = Runner;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO; SUPPORTS_MACCATALYST = NO;
@ -994,6 +1004,7 @@
buildSettings = { buildSettings = {
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
DEVELOPMENT_TEAM = P8997RW3V8; DEVELOPMENT_TEAM = P8997RW3V8;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
PRODUCT_NAME = Runner; PRODUCT_NAME = Runner;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO; SUPPORTS_MACCATALYST = NO;
@ -1008,6 +1019,7 @@
buildSettings = { buildSettings = {
CODE_SIGN_ENTITLEMENTS = "Runner/RunnerRelease-xhj.entitlements"; CODE_SIGN_ENTITLEMENTS = "Runner/RunnerRelease-xhj.entitlements";
DEVELOPMENT_TEAM = P8997RW3V8; DEVELOPMENT_TEAM = P8997RW3V8;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
PRODUCT_NAME = Runner; PRODUCT_NAME = Runner;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO; SUPPORTS_MACCATALYST = NO;

View File

@ -373,7 +373,7 @@ abstract class Routers {
static const getDeviceListPage = '/getDeviceListPage'; // static const getDeviceListPage = '/getDeviceListPage'; //
static const getNameListPage = '/getNameListPage'; // static const getNameListPage = '/getNameListPage'; //
static const authorityManagementPage = '/authorityManagementPage'; // static const authorityManagementPage = '/authorityManagementPage'; //
static const massSendLockGroupPage = '/massSendLockGroupPage'; // static const massSendLockGroupListPage = '/massSendLockGroupListPage'; //
static const massSendReceiverPage = '/massSendReceiverPage'; // static const massSendReceiverPage = '/massSendReceiverPage'; //
static const lockUserListPage = '/lockUserListPage'; // static const lockUserListPage = '/lockUserListPage'; //
static const administratorDetailsPage = '/administratorDetailsPage'; // static const administratorDetailsPage = '/administratorDetailsPage'; //
@ -911,7 +911,7 @@ abstract class AppRouters {
name: Routers.configuringWifiPage, name: Routers.configuringWifiPage,
page: () => const ConfiguringWifiPage()), page: () => const ConfiguringWifiPage()),
GetPage( GetPage(
name: Routers.massSendLockGroupPage, name: Routers.massSendLockGroupListPage,
page: () => const MassSendLockGroupListPage()), page: () => const MassSendLockGroupListPage()),
GetPage( GetPage(
name: Routers.massSendReceiverPage, name: Routers.massSendReceiverPage,

View File

@ -696,7 +696,8 @@ class BlueManage {
// if(bluetoothConnectDevice != null && bluetoothConnectDevice!.connectionState == BluetoothConnectionState.connected){ // if(bluetoothConnectDevice != null && bluetoothConnectDevice!.connectionState == BluetoothConnectionState.connected){
connectDeviceMacAddress = ""; connectDeviceMacAddress = "";
if (bluetoothConnectionState == BluetoothConnectionState.connected) { if (bluetoothConnectionState == BluetoothConnectionState.connected) {
await bluetoothConnectDevice!.disconnect(); //
await bluetoothConnectDevice!.disconnect(timeout: 1);
AppLog.log("断开连接成功"); AppLog.log("断开连接成功");
} }
// } // }

View File

@ -66,8 +66,8 @@ class AddUserCommand extends SenderProtocol {
return 'AddUserCommand{lockID: $lockID, authUserID: $authUserID,' return 'AddUserCommand{lockID: $lockID, authUserID: $authUserID,'
'keyID: $keyID, userID: $userID, openMode: $openMode, ' 'keyID: $keyID, userID: $userID, openMode: $openMode, '
'keyType: $keyType, ' 'keyType: $keyType, '
'startDate:${DateTool().dateIntToYMDHNString(startDate)} , ' 'startDate:$startDate startDateStr:${ DateTool().dateIntToYMDHNString(startDate)} , '
'expireDate: ${DateTool().dateIntToYMDHNString(expireDate)} , ' 'expireDate:$expireDate expireDateStr: ${DateTool().dateIntToYMDHNString(expireDate)} , '
'useCountLimit: $useCountLimit, isRound: $isRound, ' 'useCountLimit: $useCountLimit, isRound: $isRound, '
'weekRound: $weekRound, startHour: $startHour, ' 'weekRound: $weekRound, startHour: $startHour, '
'startMin: $startMin, endHour: $endHour, ' 'startMin: $startMin, endHour: $endHour, '

View File

@ -26,7 +26,7 @@ class GetStarLockStatuInfoCommand extends SenderProtocol {
@override @override
String toString() { String toString() {
return 'GetStarLockStatuInfoCommand{lockID: $lockID, ' return 'GetStarLockStatuInfoCommand{lockID: $lockID, '
'utcTimeStamp: ${DateTool().dateIntToYMDHNString(utcTimeStamp)}, unixTimeStamp: ${DateTool().dateIntToYMDHNString(unixTimeStamp)}, ' 'utcTimeStamp:$utcTimeStamp utcTimeStamp: ${DateTool().dateIntToYMDHNString(utcTimeStamp)}, unixTimeStamp:unixTimeStamp unixTimeStamp: ${DateTool().dateIntToYMDHNString(unixTimeStamp)}, '
'userID: $userID, privateKey: $privateKey}'; 'userID: $userID, privateKey: $privateKey}';
} }

View File

@ -16,7 +16,6 @@ abstract class Reply{
Reply.parseData(this.commandType, List<int> dataDetail); Reply.parseData(this.commandType, List<int> dataDetail);
void errorWithStstus(int status){ void errorWithStstus(int status){
switch(status){ switch(status){
case 0x00: case 0x00:
// //
@ -119,7 +118,7 @@ abstract class Reply{
break; break;
case 0x16: case 0x16:
// ... // ...
AppLog.log("$logTag ${commandType!.typeName}正在开锁中..."); AppLog.log("$logTag ${commandType!.typeName} $status 正在开锁中...");
showErrorMessage("正在开锁中..."); showErrorMessage("正在开锁中...");
break; break;
case 0xff: case 0xff:
@ -129,7 +128,7 @@ abstract class Reply{
break; break;
default: default:
// //
AppLog.log("$logTag ${commandType!.typeName} 蓝牙返回其他错误问题"); AppLog.log("$logTag ${commandType!.typeName} $status 蓝牙返回其他错误问题");
break; break;
} }
} }

View File

@ -1,5 +1,6 @@
import 'dart:async'; import 'dart:async';
import 'package:star_lock/app_settings/app_settings.dart';
import 'package:star_lock/blue/io_protocol/io_cleanUpUsers.dart'; import 'package:star_lock/blue/io_protocol/io_cleanUpUsers.dart';
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart'; import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
import 'package:star_lock/main/lockMian/entity/lockListInfo_entity.dart'; import 'package:star_lock/main/lockMian/entity/lockListInfo_entity.dart';
@ -156,17 +157,30 @@ class SenderBeforeDataManage {
} }
LockListInfoItemEntity currentKeyInfo = CommonDataManage().currentKeyInfo; LockListInfoItemEntity currentKeyInfo = CommonDataManage().currentKeyInfo;
DateTime startTime = DateTime.fromMillisecondsSinceEpoch(currentKeyInfo.startDate! ~/ 1000); DateTime? startTime;
DateTime endTime = DateTime.fromMillisecondsSinceEpoch(currentKeyInfo.endDate! ~/ 1000); DateTime? endTime;
bool isRound = currentKeyInfo.keyType == XSConstantMacro.keyTypeLoop; var startDateTime = 0;
var endDateTime = 0;
bool isRound = false;
var useCountLimit = 0xffff;
if(currentKeyInfo.keyType == XSConstantMacro.keyTypeTime){
//
startDateTime = currentKeyInfo.startDate! ~/ 1000;
endDateTime = currentKeyInfo.endDate! ~/ 1000;
}else if(currentKeyInfo.keyType == XSConstantMacro.keyTypeLoop){
//
isRound = true;
startTime = DateTime.fromMillisecondsSinceEpoch(currentKeyInfo.startDate!);
endTime = DateTime.fromMillisecondsSinceEpoch(currentKeyInfo.endDate!);
var startDateTime = currentKeyInfo.startDate! ~/ 1000;
var endDateTime = currentKeyInfo.endDate! ~/ 1000;
if (isRound) {
//
startDateTime = DateTool().dateToTimestamp(DateTool().dateToYMDString(currentKeyInfo.startDate!.toString()), 1) ~/ 1000; startDateTime = DateTool().dateToTimestamp(DateTool().dateToYMDString(currentKeyInfo.startDate!.toString()), 1) ~/ 1000;
endDateTime = (DateTool().dateToTimestamp(DateTool().dateToYMDString(currentKeyInfo.endDate!.toString()), 1) + CommonDataManage().dayLatestTime) ~/ 1000; endDateTime = (DateTool().dateToTimestamp(DateTool().dateToYMDString(currentKeyInfo.endDate!.toString()), 1) + CommonDataManage().dayLatestTime) ~/ 1000;
} }else if(currentKeyInfo.keyType == XSConstantMacro.keyTypeOnce){
//
useCountLimit = 1;
}
AppLog.log("startTime.hour:${startTime?.hour} startTime.minute:${startTime?.minute} endTime.hour:${endTime?.hour} endTime.minute:${endTime?.minute}}");
var addUserData = AddUserCommand( var addUserData = AddUserCommand(
lockID: BlueManage().connectDeviceName, lockID: BlueManage().connectDeviceName,
authUserID: currentKeyInfo.senderUserId!.toString(), authUserID: currentKeyInfo.senderUserId!.toString(),
@ -176,16 +190,16 @@ class SenderBeforeDataManage {
keyType: 0, keyType: 0,
startDate: startDateTime, startDate: startDateTime,
expireDate: endDateTime, expireDate: endDateTime,
useCountLimit: 0xFFFF, useCountLimit: useCountLimit,
isRound: isRound ? 1 : 0, isRound: isRound ? 1 : 0,
weekRound: isRound weekRound: isRound
? DateTool().accordingTheCycleIntoTheCorrespondingNumber( ? DateTool().accordingTheCycleIntoTheCorrespondingNumber(
currentKeyInfo.weekDays!) currentKeyInfo.weekDays!)
: 0, : 0,
startHour: isRound ? startTime.hour : 0, startHour: isRound ? startTime!.hour : 0,
startMin: isRound ? startTime.minute : 0, startMin: isRound ? startTime!.minute : 0,
endHour: isRound ? endTime.hour : 0, endHour: isRound ? endTime!.hour : 0,
endMin: isRound ? endTime.minute : 0, endMin: isRound ? endTime!.minute : 0,
role: currentKeyInfo.keyRight == 1 ? 1 : 0, role: currentKeyInfo.keyRight == 1 ? 1 : 0,
password: "123456", password: "123456",
needAuthor: 1, needAuthor: 1,

View File

@ -214,8 +214,9 @@ class _VolumeAuthorizationLockPageState extends State<VolumeAuthorizationLockPag
: _lockIdList.length.toString(), : _lockIdList.length.toString(),
isHaveDirection: true, isHaveDirection: true,
action: () { action: () {
Navigator.pushNamed(context, Routers.massSendLockGroupPage) Navigator.pushNamed(context, Routers.massSendLockGroupListPage, arguments: {
.then((value) { "keyLimits":"1"
}).then((value) {
//ID列表 //ID列表
if (value != null) { if (value != null) {
value as Map<String, dynamic>; value as Map<String, dynamic>;

View File

@ -33,13 +33,13 @@ class CardListLogic extends BaseGetXController {
_replyAddICCardBegin(reply); _replyAddICCardBegin(reply);
} }
if(reply is SenderCheckingCardStatusReply) { // if(reply is SenderCheckingCardStatusReply) {
_replyReferEventRecordNumber(reply); // _replyReferEventRecordNumber(reply);
} // }
//
if(reply is SenderCheckingUserInfoCountReply){ // if(reply is SenderCheckingUserInfoCountReply){
_replyCheckingUserInfoCount(reply); // _replyCheckingUserInfoCount(reply);
} // }
}); });
} }
@ -94,134 +94,134 @@ class CardListLogic extends BaseGetXController {
} }
} }
// // //
Future<void> _replyReferEventRecordNumber(Reply reply) async { // Future<void> _replyReferEventRecordNumber(Reply reply) async {
int status = reply.data[2]; // int status = reply.data[2];
switch(status){ // switch(status){
case 0x00: // case 0x00:
// // //
// _getLockStatus(); // // _getLockStatus();
break; // break;
case 0x06: // case 0x06:
// // //
break; // break;
default: // default:
// // //
break; // break;
} // }
} // }
//
// // ()
// Future<void> _replyCheckingUserInfoCount(Reply reply) async {
// int status = reply.data[2];
//
// //
// int userNum = reply.data[5];
//
// //
// int fingerNum = reply.data[6];
//
// //
// int pwdNum = reply.data[7];
//
// //
// int cardNum = reply.data[8];
//
// //
// int logsNum = reply.data[9];
//
// //
// int verNo = reply.data[10];
//
// //
// int maxAdminFingerNum = reply.data[11];
//
// //
// int maxUserFingerNum = reply.data[12];
//
// //
// int maxAdminPassNum = reply.data[13];
//
// //
// int maxUserPassNum = reply.data[14];
//
// //
// int maxAdminCardNum = reply.data[15];
//
// //
// int maxUserCardNum = reply.data[16];
//
// //
// var serialNo = reply.data.sublist(17, 21);
//
// switch(status){
// case 0x00:
// //
// // _getLockStatus();
// break;
// case 0x06:
// //
// break;
// default:
// //
// break;
// }
// }
// () // //
Future<void> _replyCheckingUserInfoCount(Reply reply) async { // Future<void> senderCheckingCardStatus() async {
int status = reply.data[2]; // BlueManage().bludSendData(BlueManage().connectDeviceName, (BluetoothConnectionState state) async {
// if (state == BluetoothConnectionState.connected) {
// // var privateKey = await Storage.getStringList(saveBluePrivateKey);
int userNum = reply.data[5]; // List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
//
// // var token = await Storage.getStringList(saveBlueToken);
int fingerNum = reply.data[6]; // List<int> getTokenList = changeStringListToIntList(token!);
//
// // var publicKey = await Storage.getStringList(saveBluePublicKey);
int pwdNum = reply.data[7]; // List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
//
// // IoSenderManage.senderCheckingCardStatusCommand(
int cardNum = reply.data[8]; // keyID:BlueManage().connectDeviceName,
// userID:await Storage.getUid(),
// // role:0xff,
int logsNum = reply.data[9]; // cardCount:20,
// cardNo:1,
// // token:getTokenList,
int verNo = reply.data[10]; // needAuthor:1,
// publicKey:getPublicKeyList,
// // privateKey:getPrivateKeyList,
int maxAdminFingerNum = reply.data[11]; // );
// }
// // });
int maxUserFingerNum = reply.data[12]; // }
//
// // // ()
int maxAdminPassNum = reply.data[13]; // Future<void> senderCheckingUserInfoCount() async {
// BlueManage().bludSendData(BlueManage().connectDeviceName, (BluetoothConnectionState state) async {
// // if (state == BluetoothConnectionState.connected) {
int maxUserPassNum = reply.data[14]; // var privateKey = await Storage.getStringList(saveBluePrivateKey);
// List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
// //
int maxAdminCardNum = reply.data[15]; // var token = await Storage.getStringList(saveBlueToken);
// List<int> getTokenList = changeStringListToIntList(token!);
// //
int maxUserCardNum = reply.data[16]; // var publicKey = await Storage.getStringList(saveBluePublicKey);
// List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
// //
var serialNo = reply.data.sublist(17, 21); // IoSenderManage.senderCheckingUserInfoCountCommand(
// keyID:BlueManage().connectDeviceName,
switch(status){ // userID:await Storage.getUid(),
case 0x00: // role:0xff,
// // nowTime:DateTime.now().millisecondsSinceEpoch~/1000,
// _getLockStatus(); // token:getTokenList,
break; // needAuthor:1,
case 0x06: // publicKey:getPublicKeyList,
// // privateKey:getPrivateKeyList,
break; // );
default: // }
// // });
break; // }
}
}
//
Future<void> senderCheckingCardStatus() async {
BlueManage().bludSendData(BlueManage().connectDeviceName, (BluetoothConnectionState state) async {
if (state == BluetoothConnectionState.connected) {
var privateKey = await Storage.getStringList(saveBluePrivateKey);
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
var token = await Storage.getStringList(saveBlueToken);
List<int> getTokenList = changeStringListToIntList(token!);
var publicKey = await Storage.getStringList(saveBluePublicKey);
List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
IoSenderManage.senderCheckingCardStatusCommand(
keyID:BlueManage().connectDeviceName,
userID:await Storage.getUid(),
role:0xff,
cardCount:20,
cardNo:1,
token:getTokenList,
needAuthor:1,
publicKey:getPublicKeyList,
privateKey:getPrivateKeyList,
);
}
});
}
// ()
Future<void> senderCheckingUserInfoCount() async {
BlueManage().bludSendData(BlueManage().connectDeviceName, (BluetoothConnectionState state) async {
if (state == BluetoothConnectionState.connected) {
var privateKey = await Storage.getStringList(saveBluePrivateKey);
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
var token = await Storage.getStringList(saveBlueToken);
List<int> getTokenList = changeStringListToIntList(token!);
var publicKey = await Storage.getStringList(saveBluePublicKey);
List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
IoSenderManage.senderCheckingUserInfoCountCommand(
keyID:BlueManage().connectDeviceName,
userID:await Storage.getUid(),
role:0xff,
nowTime:DateTime.now().millisecondsSinceEpoch~/1000,
token:getTokenList,
needAuthor:1,
publicKey:getPublicKeyList,
privateKey:getPrivateKeyList,
);
}
});
}
// //
Future<void> senderAddICCard() async { Future<void> senderAddICCard() async {
@ -262,19 +262,6 @@ class CardListLogic extends BaseGetXController {
privateKey:getPrivateKeyList, privateKey:getPrivateKeyList,
token: getTokenList, token: getTokenList,
); );
// IoSenderManage.senderAddICCardCommand(
// keyID:state.deletKeyID,
// userID:state.deletUserID,
// cardNo:state.deletCardNo,
// useCountLimit:0,
// startTime:0x11223344,
// endTime:0x11223344,
// needAuthor:1,
// signKey:signKeyDataList,
// privateKey:getPrivateKeyList,
// token: getTokenList,
// );
} else if (deviceConnectionState == BluetoothConnectionState.disconnected) { } else if (deviceConnectionState == BluetoothConnectionState.disconnected) {
dismissEasyLoading(); dismissEasyLoading();
cancelBlueConnetctToastTimer(); cancelBlueConnetctToastTimer();

View File

@ -1,5 +1,6 @@
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:star_lock/app_settings/app_settings.dart';
import '../../../../tools/dateTool.dart'; import '../../../../tools/dateTool.dart';
import '../../fingerprint/fingerprintList/fingerprintListData_entity.dart'; import '../../fingerprint/fingerprintList/fingerprintListData_entity.dart';
@ -25,7 +26,8 @@ class OtherTypeKeyChangeDateState{
fingerprintItemData.value = map["fingerprintItemData"]; fingerprintItemData.value = map["fingerprintItemData"];
} }
if(fingerprintItemData.value.startDate == 0 && fingerprintItemData.value.endDate == 0){ AppLog.log("fingerprintItemData.value.startDate:${fingerprintItemData.value.startDate} fingerprintItemData.value.endDate:${fingerprintItemData.value.endDate}");
if(fingerprintItemData.value.startDate == 0){
beginTime.value = DateTool().dateToYMDHNString(DateTime.now().millisecondsSinceEpoch.toString()); beginTime.value = DateTool().dateToYMDHNString(DateTime.now().millisecondsSinceEpoch.toString());
endTime.value = DateTool().dateToYMDHNString(DateTime.now().millisecondsSinceEpoch.toString()); endTime.value = DateTool().dateToYMDHNString(DateTime.now().millisecondsSinceEpoch.toString());
beginTimeTimestamp.value = DateTime.now().millisecondsSinceEpoch; beginTimeTimestamp.value = DateTime.now().millisecondsSinceEpoch;
@ -36,5 +38,7 @@ class OtherTypeKeyChangeDateState{
beginTimeTimestamp.value = fingerprintItemData.value.startDate!; beginTimeTimestamp.value = fingerprintItemData.value.startDate!;
endTimeTimestamp.value = fingerprintItemData.value.endDate!; endTimeTimestamp.value = fingerprintItemData.value.endDate!;
} }
AppLog.log("beginTime.value:${beginTime.value} endTime.value:${endTime.value} beginTimeTimestamp.value:${beginTimeTimestamp.value} endTimeTimestamp.value:${endTimeTimestamp.value}");
} }
} }

View File

@ -1,36 +1,44 @@
import 'dart:async'; import 'dart:async';
import 'dart:ffi';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:star_lock/app_settings/app_settings.dart';
import 'package:star_lock/tools/baseGetXController.dart'; import 'package:star_lock/tools/baseGetXController.dart';
import '../../../../../network/api_repository.dart'; import '../../../../../network/api_repository.dart';
import '../../../../../tools/eventBusEventManage.dart'; import '../../../../../tools/eventBusEventManage.dart';
import 'checkingInAddStaffSelectKey_entity.dart'; import 'checkingInAddStaffSelectKey_entity.dart';
import 'checkingInAddStaff_state.dart'; import 'checkingInAddStaff_state.dart';
typedef KeyClickCallback = void Function(List<CheckingInAddStaffKeyEntity> selectKeyList); typedef KeyClickCallback = void Function(
class CheckingInAddStaffLogic extends BaseGetXController{ List<CheckingInAddStaffKeyEntity> selectKeyList);
class CheckingInAddStaffLogic extends BaseGetXController {
CheckingInAddStaffState state = CheckingInAddStaffState(); CheckingInAddStaffState state = CheckingInAddStaffState();
// //
StreamSubscription? _getNumberEvent; StreamSubscription? _getNumberEvent;
void _initLoadDataAction() { void _initLoadDataAction() {
// eventBus // eventBus
_getNumberEvent = eventBus.on<ChickInAddStaffCardAndFingerprintBlockNumberEvent>().listen((event) { _getNumberEvent = eventBus
state.attendanceWayNumber.value = event.number; .on<ChickInAddStaffCardAndFingerprintBlockNumberEvent>()
isCanClickAction(); .listen((event) {
}); state.attendanceWayNumber.value = event.number;
isCanClickAction();
});
} }
// //
void addStaffLoadData() async{ void addStaffLoadData() async {
var usernameType = "1"; var usernameType = "1";
if(state.appUnHaveAccount.value && state.staffAccount.contains("@")){ if (state.appUnHaveAccount.value && state.staffAccount.contains("@")) {
usernameType = "2"; usernameType = "2";
} }
// app且没有钥匙时attendanceWayNumber // app且没有钥匙时attendanceWayNumber
if(state.appUnHaveAccount.value && state.selectPrintingMethodType.value == "1"){ if (state.appUnHaveAccount.value &&
state.selectPrintingMethodType.value == "1") {
state.attendanceWayNumber.value = state.staffAccountController.text; state.attendanceWayNumber.value = state.staffAccountController.text;
} }
@ -41,36 +49,38 @@ class CheckingInAddStaffLogic extends BaseGetXController{
have: state.appUnHaveAccount.value ? "2" : "1", have: state.appUnHaveAccount.value ? "2" : "1",
staffName: state.staffNameController.text, staffName: state.staffNameController.text,
countryCode: state.countryCode.value, countryCode: state.countryCode.value,
usernameType:usernameType, usernameType: usernameType,
); );
if(entity.errorCode!.codeIsSuccessful){ if (entity.errorCode!.codeIsSuccessful) {
eventBus.fire(RefreshCheckInSetDataEvent()); eventBus.fire(RefreshCheckInSetDataEvent());
eventBus.fire(RefreshCheckInListEvent()); eventBus.fire(RefreshCheckInListEvent());
Get.back(result: "addScuess"); Get.back(result: "addScuess");
}else if(entity.errorCode! == 425){ } else if (entity.errorCode! == 425) {
showToast(entity.errorMsg!); showToast(entity.errorMsg!);
} }
} }
// - 1APP234attendanceWay分别为用户名 // - 1APP234
void addStaffSelectKey(KeyClickCallback kyClickCallback) async{ // attendanceWay分别为用户名
void addStaffSelectKey(KeyClickCallback kyClickCallback) async {
var entity = await ApiRepository.to.addStaffSelectKeyData( var entity = await ApiRepository.to.addStaffSelectKeyData(
companyId: state.companyId.value, 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!; state.keyEntity.value = entity.data!;
kyClickCallback(state.keyEntity.value); kyClickCallback(state.keyEntity.value);
} }
} }
// //
void editStaffLoadData() async{ void editStaffLoadData() async {
var usernameType = "1"; var usernameType = "1";
if(state.appUnHaveAccount.value && state.staffAccount.contains("@")){ if (state.appUnHaveAccount.value && state.staffAccount.contains("@")) {
usernameType = "2"; usernameType = "2";
} }
var entity = await ApiRepository.to.editStaffData( var entity = await ApiRepository.to.editStaffData(
attendanceType: state.selectPrintingMethodType.value, attendanceType: state.selectPrintingMethodType.value,
attendanceWay: state.attendanceWayNumber.value, attendanceWay: state.attendanceWayNumber.value,
@ -126,11 +136,14 @@ class CheckingInAddStaffLogic extends BaseGetXController{
// //
void isCanClickAction() { 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; state.isCanClick.value =
}else{ state.staffNameIsNotEmpty && state.staffAccountIsNotEmpty;
state.isCanClick.value = state.staffNameIsNotEmpty && state.attendanceWayNumberIsNotEmpty; } else {
state.isCanClick.value =
state.staffNameIsNotEmpty && state.attendanceWayNumberIsNotEmpty;
} }
} }
@ -145,7 +158,6 @@ class CheckingInAddStaffLogic extends BaseGetXController{
@override @override
void onInit() { void onInit() {
// TODO: implement onInit
super.onInit(); super.onInit();
} }
@ -156,5 +168,4 @@ class CheckingInAddStaffLogic extends BaseGetXController{
_getNumberEvent!.cancel(); _getNumberEvent!.cancel();
} }
} }

View File

@ -1,4 +1,3 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
@ -6,7 +5,7 @@ import '../../../../lockMian/entity/lockListInfo_entity.dart';
import '../checkingInSetStaffList/checkingInStaffList_entity.dart'; import '../checkingInSetStaffList/checkingInStaffList_entity.dart';
import 'checkingInAddStaffSelectKey_entity.dart'; import 'checkingInAddStaffSelectKey_entity.dart';
class CheckingInAddStaffState{ class CheckingInAddStaffState {
final getKeyInfosData = LockListInfoItemEntity().obs; final getKeyInfosData = LockListInfoItemEntity().obs;
final companyId = "".obs; final companyId = "".obs;
final staffListItemData = CheckingInAddStaffListItemEntity().obs; final staffListItemData = CheckingInAddStaffListItemEntity().obs;
@ -14,36 +13,41 @@ class CheckingInAddStaffState{
final TextEditingController staffNameController = TextEditingController(); final TextEditingController staffNameController = TextEditingController();
final TextEditingController staffAccountController = TextEditingController(); final TextEditingController staffAccountController = TextEditingController();
final selectPrintingMethodType = "1".obs;// 1APP 2 3 4 5 final selectPrintingMethodType = "1".obs; // 1APP 2 3 4 5
final selectPrintingMethodStr = "APP".obs;// final selectPrintingMethodStr = "APP".obs; //
final countryName = "中国".tr.obs; final countryName = "中国".tr.obs;
final countryCode = "86".obs; final countryCode = "86".obs;
final appUnHaveAccount = true.obs;// final appUnHaveAccount = true.obs; //
final keyEntity = <CheckingInAddStaffKeyEntity>[].obs;// final keyEntity = <CheckingInAddStaffKeyEntity>[].obs; //
final isAdd = "1".obs; // 1 2 final isAdd = "1".obs; // 1 2
final attendanceWayNumber = "".obs; final attendanceWayNumber = "".obs;
final isCanClick = false.obs; final isCanClick = false.obs;
var staffName = ''.obs; var staffName = ''.obs;
var staffAccount = ''.obs; var staffAccount = ''.obs;
bool get staffNameIsNotEmpty => staffName.value.isNotEmpty; bool get staffNameIsNotEmpty => staffName.value.isNotEmpty;
bool get staffAccountIsNotEmpty => staffAccount.value.isNotEmpty; bool get staffAccountIsNotEmpty => staffAccount.value.isNotEmpty;
bool get attendanceWayNumberIsNotEmpty => attendanceWayNumber.value.isNotEmpty;
bool get attendanceWayNumberIsNotEmpty =>
attendanceWayNumber.value.isNotEmpty;
CheckingInAddStaffState() { CheckingInAddStaffState() {
Map map = Get.arguments; Map map = Get.arguments;
getKeyInfosData.value = map["getKeyInfosData"]; getKeyInfosData.value = map["getKeyInfosData"];
companyId.value = map["companyId"]; companyId.value = map["companyId"];
isAdd.value = map["isAdd"]; isAdd.value = map["isAdd"];
if(isAdd.value == "2"){ if (isAdd.value == "2") {
staffListItemData.value = map["staffListItem"]; staffListItemData.value = map["staffListItem"];
staffNameController.text = staffListItemData.value.staffName!; staffNameController.text = staffListItemData.value.staffName!;
selectPrintingMethodType.value = staffListItemData.value.attendanceType.toString(); selectPrintingMethodType.value =
switch(staffListItemData.value.attendanceType){ staffListItemData.value.attendanceType.toString();
switch (staffListItemData.value.attendanceType) {
case 1: case 1:
selectPrintingMethodStr.value = "APP"; selectPrintingMethodStr.value = "APP";
break; break;
@ -58,17 +62,12 @@ class CheckingInAddStaffState{
break; break;
} }
if(staffListItemData.value.attendanceWay!.isNotEmpty){ if (staffListItemData.value.attendanceWay!.isNotEmpty) {
if(staffListItemData.value.cardStatus != 0){ appUnHaveAccount.value = false;
appUnHaveAccount.value = false; attendanceWayNumber.value = staffListItemData.value.attendanceWay!;
attendanceWayNumber.value = staffListItemData.value.attendanceWay!; } else {
}else{
appUnHaveAccount.value = true;
}
}else{
appUnHaveAccount.value = true; appUnHaveAccount.value = true;
} }
} }
} }
} }

View File

@ -37,7 +37,7 @@ class CheckingInAddStaffListItemEntity {
int? staffId; int? staffId;
int? attendanceType; int? attendanceType;
int? countryCode; int? countryCode;
int? cardStatus; int? cardStatus;//0 1
String? attendanceWay; String? attendanceWay;
String? reason; String? reason;

View File

@ -137,16 +137,32 @@ class ElectronicKeyDetailLogic extends BaseGetXController {
Future<void> checkRealNameStatus(int realNameAuthStatus) async { Future<void> checkRealNameStatus(int realNameAuthStatus) async {
// //
if (realNameAuthStatus == 1) { if (realNameAuthStatus == 1) {
if (state.getRealName.value.isEmpty || AdvancedFunctionRecordEntity entity = await ApiRepository.to.keyCheckFace(
state.getIDCardNumber.value.isEmpty) { lockId: CommonDataManage().currentKeyInfo.lockId ?? 0,
ShowCupertinoAlertView() );
.showOpenAuthWithIDCardInfoAlert((idCard, realName) { if (entity.errorCode!.codeIsSuccessful) {
state.getIDCardNumber.value = idCard ?? ''; if (state.getRealName.value.isEmpty ||
state.getRealName.value = realName ?? ''; state.getIDCardNumber.value.isEmpty) {
ShowCupertinoAlertView()
.showOpenAuthWithIDCardInfoAlert((idCard, realName) {
state.getIDCardNumber.value = idCard ?? '';
state.getRealName.value = realName ?? '';
updateRealNameInfoWithAuthStatus(realNameAuthStatus);
});
} else {
updateRealNameInfoWithAuthStatus(realNameAuthStatus); updateRealNameInfoWithAuthStatus(realNameAuthStatus);
}); }
} else { } else if (entity.errorCode == 432) {
updateRealNameInfoWithAuthStatus(realNameAuthStatus); //432--
ShowCupertinoAlertView().showBuyTipWithContentAlert(
titleStr: '实名认证为付费功能,请购买后再使用'.tr,
sureClick: () {
Get.toNamed(Routers.advancedFeaturesWebPage,
arguments: {'isShop': false});
});
} else if (entity.errorCode == 433) {
//
ShowCupertinoAlertView().showContactAdministratorBuyAlert();
} }
} else { } else {
updateRealNameInfoWithAuthStatus(realNameAuthStatus); updateRealNameInfoWithAuthStatus(realNameAuthStatus);

View File

@ -227,13 +227,16 @@ class _ElectronicKeyDetailPageState extends State<ElectronicKeyDetailPage> {
Obx( Obx(
() => Visibility( () => Visibility(
// (state.keyInfo.value.lockSetting!.remoteUnlock == 1 ? true : false // (state.keyInfo.value.lockSetting!.remoteUnlock == 1 ? true : false
visible: CommonDataManage() // visible: CommonDataManage()
.currentKeyInfo // .currentKeyInfo
.lockSetting! // .lockSetting!
.remoteUnlock == // .remoteUnlock ==
1 // 1
? true // ? true
: false, // : false,
visible: (CommonDataManage().currentKeyInfo.lockSetting!.remoteUnlock == 1 && state.itemData.value.keyRight != 1)
? true
: false,
child: CommonItem( child: CommonItem(
leftTitel: "远程开锁".tr, leftTitel: "远程开锁".tr,
rightTitle: "", rightTitle: "",

View File

@ -201,8 +201,9 @@ class _MassSendElectronicKeyPageState extends State<MassSendElectronicKeyPage> {
: state.lockIdList.length.toString(), : state.lockIdList.length.toString(),
isHaveDirection: true, isHaveDirection: true,
action: () { action: () {
Navigator.pushNamed(context, Routers.massSendLockGroupPage) Navigator.pushNamed(context, Routers.massSendLockGroupListPage, arguments:{
.then((value) { "keyLimits":"2",
}).then((value) {
//ID列表 //ID列表
if (value != null) { if (value != null) {
value as Map<String, dynamic>; value as Map<String, dynamic>;

View File

@ -1,5 +1,4 @@
import 'package:flutter_native_contact_picker/flutter_native_contact_picker.dart'; import 'package:flutter_native_contact_picker/flutter_native_contact_picker.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
@ -25,5 +24,4 @@ class MassSendElectronicKeyState{
var isDemoMode = false; var isDemoMode = false;
final sendSucceedType = 0.obs; final sendSucceedType = 0.obs;
} }

View File

@ -10,7 +10,7 @@ class MassSendLockGroupListLogic extends BaseGetXController {
// //
Future<void> mockNetworkDataRequest() async { Future<void> mockNetworkDataRequest() async {
MassSendLockGroupListEntity entity = MassSendLockGroupListEntity entity =
await ApiRepository.to.lockGroupList('2'); await ApiRepository.to.lockGroupList(state.keyLimits);
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
if (entity.data != null) { if (entity.data != null) {
state.lockGroupList.value = entity.data!.groupList!; state.lockGroupList.value = entity.data!.groupList!;

View File

@ -4,4 +4,12 @@ class MassSendLockGroupListState {
var lockGroupList = [].obs; var lockGroupList = [].obs;
var selectLockIdList = [].obs; var selectLockIdList = [].obs;
var isVip = false.obs; var isVip = false.obs;
var keyLimits = '';// 1() 2
MassSendLockGroupListState(){
Map map = Get.arguments;
if(map["keyLimits"] != null){
keyLimits = map['keyLimits'];
}
}
} }

View File

@ -28,18 +28,18 @@ class FaceListLogic extends BaseGetXController {
_replySubscription = _replySubscription =
EventBusManager().eventBus!.on<Reply>().listen((reply) { EventBusManager().eventBus!.on<Reply>().listen((reply) {
// () // ()
if ((reply is SenderAddFaceReply) && (state.ifCurrentScreen == true)) { if ((reply is SenderAddFaceReply) && (state.ifCurrentScreen.value == true)) {
_replyAddFaceBegin(reply); _replyAddFaceBegin(reply);
} }
if (reply is SenderQueryingFaceStatusReply) { // if (reply is SenderQueryingFaceStatusReply) {
// // //
_replyQueryingFaceStatus(reply); // _replyQueryingFaceStatus(reply);
} // }
//
if (reply is SenderCheckingUserInfoCountReply) { // if (reply is SenderCheckingUserInfoCountReply) {
_replyCheckingUserInfoCount(reply); // _replyCheckingUserInfoCount(reply);
} // }
}); });
} }
@ -89,19 +89,6 @@ class FaceListLogic extends BaseGetXController {
privateKey:getPrivateKeyList, privateKey:getPrivateKeyList,
token: token, token: token,
); );
// IoSenderManage.senderAddFaceCommand(
// keyID: state.deletKeyID,
// userID: state.deletUserID,
// faceNo: state.deletFaceNo,
// useCountLimit: 0,
// startTime: 0x11223344,
// endTime: 0x11223344,
// needAuthor: 1,
// publicKey: publicKeyDataList,
// privateKey: getPrivateKeyList,
// token: getTokenList,
// );
break; break;
default: default:
// //
@ -109,158 +96,158 @@ class FaceListLogic extends BaseGetXController {
} }
} }
// // //
Future<void> _replyQueryingFaceStatus(Reply reply) async { // Future<void> _replyQueryingFaceStatus(Reply reply) async {
int status = reply.data[2]; // int status = reply.data[2];
//
// switch (status) {
// case 0x00:
// //
// // _getLockStatus();
// break;
// case 0x06:
// //
//
// break;
// default:
// //
// break;
// }
// }
switch (status) { // //
case 0x00: // Future<void> _replyReferEventRecordNumber(Reply reply) async {
// // int status = reply.data[2];
// _getLockStatus(); // switch (status) {
break; // case 0x00:
case 0x06: // //
// //
// // _getLockStatus();
// break;
// case 0x06:
// //
//
// break;
// default:
// //
// break;
// }
// }
break; // // ()
default: // Future<void> _replyCheckingUserInfoCount(Reply reply) async {
// // int status = reply.data[2];
break; //
} // //
} // int userNum = reply.data[5];
//
// //
// int fingerNum = reply.data[6];
//
// //
// int pwdNum = reply.data[7];
//
// //
// int cardNum = reply.data[8];
//
// //
// int logsNum = reply.data[9];
//
// //
// int verNo = reply.data[10];
//
// //
// int maxAdminFingerNum = reply.data[11];
//
// //
// int maxUserFingerNum = reply.data[12];
//
// //
// int maxAdminPassNum = reply.data[13];
//
// //
// int maxUserPassNum = reply.data[14];
//
// //
// int maxAdminCardNum = reply.data[15];
//
// //
// int maxUserCardNum = reply.data[16];
//
// //
// var serialNo = reply.data.sublist(17, 21);
//
// switch (status) {
// case 0x00:
// //
// // _getLockStatus();
// break;
// case 0x06:
// //
//
// break;
// default:
// //
// break;
// }
// }
// // //
Future<void> _replyReferEventRecordNumber(Reply reply) async { // Future<void> senderQueryingFaceStatus() async {
int status = reply.data[2]; // BlueManage().bludSendData(BlueManage().connectDeviceName,
switch (status) { // (BluetoothConnectionState state) async {
case 0x00: // if (state == BluetoothConnectionState.connected) {
// // var privateKey = await Storage.getStringList(saveBluePrivateKey);
// List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
//
// var token = await Storage.getStringList(saveBlueToken);
// List<int> getTokenList = changeStringListToIntList(token!);
//
// var publicKey = await Storage.getStringList(saveBluePublicKey);
// List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
//
// IoSenderManage.senderQueryingFaceStatusCommand(
// keyID: BlueManage().connectDeviceName,
// userID: await Storage.getUid(),
// role: 0xff,
// faceCount: 20,
// faceNo: 1,
// token: getTokenList,
// needAuthor: 1,
// publicKey: getPublicKeyList,
// privateKey: getPrivateKeyList,
// );
// }
// });
// }
// _getLockStatus(); // // ()
break; // Future<void> senderCheckingUserInfoCount() async {
case 0x06: // BlueManage().bludSendData(BlueManage().connectDeviceName,
// // (BluetoothConnectionState state) async {
// if (state == BluetoothConnectionState.connected) {
break; // var privateKey = await Storage.getStringList(saveBluePrivateKey);
default: // List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
// //
break; // var token = await Storage.getStringList(saveBlueToken);
} // List<int> getTokenList = changeStringListToIntList(token!);
} //
// var publicKey = await Storage.getStringList(saveBluePublicKey);
// () // List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
Future<void> _replyCheckingUserInfoCount(Reply reply) async { //
int status = reply.data[2]; // IoSenderManage.senderCheckingUserInfoCountCommand(
// keyID: BlueManage().connectDeviceName,
// // userID: await Storage.getUid(),
int userNum = reply.data[5]; // role: 0xff,
// nowTime: DateTime.now().millisecondsSinceEpoch ~/ 1000,
// // token: getTokenList,
int fingerNum = reply.data[6]; // needAuthor: 1,
// publicKey: getPublicKeyList,
// // privateKey: getPrivateKeyList,
int pwdNum = reply.data[7]; // );
// }
// // });
int cardNum = reply.data[8]; // }
//
int logsNum = reply.data[9];
//
int verNo = reply.data[10];
//
int maxAdminFingerNum = reply.data[11];
//
int maxUserFingerNum = reply.data[12];
//
int maxAdminPassNum = reply.data[13];
//
int maxUserPassNum = reply.data[14];
//
int maxAdminCardNum = reply.data[15];
//
int maxUserCardNum = reply.data[16];
//
var serialNo = reply.data.sublist(17, 21);
switch (status) {
case 0x00:
//
// _getLockStatus();
break;
case 0x06:
//
break;
default:
//
break;
}
}
//
Future<void> senderQueryingFaceStatus() async {
BlueManage().bludSendData(BlueManage().connectDeviceName,
(BluetoothConnectionState state) async {
if (state == BluetoothConnectionState.connected) {
var privateKey = await Storage.getStringList(saveBluePrivateKey);
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
var token = await Storage.getStringList(saveBlueToken);
List<int> getTokenList = changeStringListToIntList(token!);
var publicKey = await Storage.getStringList(saveBluePublicKey);
List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
IoSenderManage.senderQueryingFaceStatusCommand(
keyID: BlueManage().connectDeviceName,
userID: await Storage.getUid(),
role: 0xff,
faceCount: 20,
faceNo: 1,
token: getTokenList,
needAuthor: 1,
publicKey: getPublicKeyList,
privateKey: getPrivateKeyList,
);
}
});
}
// ()
Future<void> senderCheckingUserInfoCount() async {
BlueManage().bludSendData(BlueManage().connectDeviceName,
(BluetoothConnectionState state) async {
if (state == BluetoothConnectionState.connected) {
var privateKey = await Storage.getStringList(saveBluePrivateKey);
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
var token = await Storage.getStringList(saveBlueToken);
List<int> getTokenList = changeStringListToIntList(token!);
var publicKey = await Storage.getStringList(saveBluePublicKey);
List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
IoSenderManage.senderCheckingUserInfoCountCommand(
keyID: BlueManage().connectDeviceName,
userID: await Storage.getUid(),
role: 0xff,
nowTime: DateTime.now().millisecondsSinceEpoch ~/ 1000,
token: getTokenList,
needAuthor: 1,
publicKey: getPublicKeyList,
privateKey: getPrivateKeyList,
);
}
});
}
// //
Future<void> senderAddFace() async { Future<void> senderAddFace() async {
@ -311,16 +298,26 @@ class FaceListLogic extends BaseGetXController {
} }
// //
void getFaceListData() async { Future<FingerprintListDataEntity> getFaceListData() async {
var entity = await ApiRepository.to.getFaceListData( var entity = await ApiRepository.to.getFaceListData(
lockId: state.lockId.value.toString(), lockId: state.lockId.value.toString(),
pageNo: '1', pageNo: pageNo.toString(),
pageSize: '20', pageSize: pageSize.toString(),
searchStr: state.searchController.text, searchStr: state.searchController.text,
); );
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
state.faceItemListData.value = entity.data!.list!; // state.faceItemListData.value = entity.data!.list!;
if (pageNo == 1) {
state.faceItemListData.value = entity.data!.list!;
pageNo++;
} else {
if (entity.data!.list!.isNotEmpty) {
state.faceItemListData.value.addAll(entity.data!.list!);
pageNo++;
}
}
} }
return entity;
} }
// //
@ -336,8 +333,10 @@ class FaceListLogic extends BaseGetXController {
lockId: state.lockId.value, lockId: state.lockId.value,
); );
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
showToast("删除成功"); showToast("删除成功", something: (){
getFaceListData(); pageNo = 1;
getFaceListData();
});
} }
} }
@ -353,8 +352,10 @@ class FaceListLogic extends BaseGetXController {
lockId: state.lockId.value, lockId: state.lockId.value,
); );
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
showToast("重置成功"); showToast("重置成功", something: (){
getFaceListData(); pageNo = 1;
getFaceListData();
});
} }
} }
@ -388,6 +389,7 @@ class FaceListLogic extends BaseGetXController {
late StreamSubscription _teamEvent; late StreamSubscription _teamEvent;
void _initRefreshAction() { void _initRefreshAction() {
_teamEvent = eventBus.on<OtherTypeRefreshListEvent>().listen((event) { _teamEvent = eventBus.on<OtherTypeRefreshListEvent>().listen((event) {
pageNo = 1;
getFaceListData(); getFaceListData();
}); });
} }
@ -403,8 +405,6 @@ class FaceListLogic extends BaseGetXController {
_initReplySubscription(); _initReplySubscription();
_initRefreshAction(); _initRefreshAction();
getFaceListData();
} }
} }

View File

@ -10,6 +10,7 @@ import 'package:star_lock/tools/showTipView.dart';
import '../../../../appRouters.dart'; import '../../../../appRouters.dart';
import '../../../../app_settings/app_colors.dart'; import '../../../../app_settings/app_colors.dart';
import '../../../../tools/EasyRefreshTool.dart';
import '../../../../tools/appRouteObserver.dart'; import '../../../../tools/appRouteObserver.dart';
import '../../../../tools/noData.dart'; import '../../../../tools/noData.dart';
import '../../../../tools/storage.dart'; import '../../../../tools/storage.dart';
@ -29,6 +30,23 @@ class _FaceListPageState extends State<FaceListPage> with RouteAware {
final logic = Get.put(FaceListLogic()); final logic = Get.put(FaceListLogic());
final state = Get.find<FaceListLogic>().state; final state = Get.find<FaceListLogic>().state;
Future<void> getHttpData() async {
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
if (isDemoMode == false) {
logic.getFaceListData().then((FingerprintListDataEntity value){
if(mounted) setState(() {});
});
}
}
@override
void initState() {
super.initState();
getHttpData();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
@ -62,34 +80,45 @@ class _FaceListPageState extends State<FaceListPage> with RouteAware {
), ),
], ],
), ),
body: Column( body: EasyRefreshTool(
children: [ onRefresh: (){
KeySearchWidget( logic.pageNo = 1;
editingController: state.searchController, getHttpData();
onSubmittedAction: () { },
logic.getFaceListData(); onLoad: (){
}, getHttpData();
), },
SizedBox( child: Column(
height: 20.h, children: [
), KeySearchWidget(
Expanded(child: _buildMainUI()), editingController: state.searchController,
AddBottomWhiteBtn( onSubmittedAction: () {
btnName: logic.pageNo = 1;
'${TranslationLoader.lanKeys!.add!.tr}${TranslationLoader.lanKeys!.face!.tr}', getHttpData();
onClick: () async { },
var data = ),
await Get.toNamed(Routers.addFaceTypePage, arguments: { SizedBox(
"lockId": state.lockId.value, height: 20.h,
"fromType": 1 // 1 2 ),
}); Expanded(child: _buildMainUI()),
if (data != null) { AddBottomWhiteBtn(
logic.getFaceListData(); btnName:
} '${TranslationLoader.lanKeys!.add!.tr}${TranslationLoader.lanKeys!.face!.tr}',
}, onClick: () async {
), var data =
SizedBox(height: 64.h) await Get.toNamed(Routers.addFaceTypePage, arguments: {
], "lockId": state.lockId.value,
"fromType": 1 // 1 2
});
if (data != null) {
logic.pageNo = 1;
getHttpData();
}
},
),
SizedBox(height: 64.h)
],
),
), ),
); );
} }

View File

@ -5,6 +5,7 @@ import 'package:flutter_blue_plus/flutter_blue_plus.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:permission_handler/permission_handler.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/common/XSConstantMacro/XSConstantMacro.dart';
import 'package:star_lock/widget/permission/permission_dialog.dart'; import 'package:star_lock/widget/permission/permission_dialog.dart';
@ -40,26 +41,11 @@ class LockDetailLogic extends BaseGetXController {
_replyOpenLock(reply); _replyOpenLock(reply);
} }
//
// if(reply is EditUserReply){
// _replyEditUserKey(reply);
// }
//
// if (reply is GetStarLockStatuInfoReply && state.ifCurrentScreen.value == true) {
// _replyGetStarLockStatusInfo(reply);
// }
// //
if (reply is SenderReferEventRecordTimeReply && if (reply is SenderReferEventRecordTimeReply &&
state.ifCurrentScreen.value == true) { state.ifCurrentScreen.value == true) {
_replyReferEventRecordTime(reply); _replyReferEventRecordTime(reply);
} }
//
// if ((reply is AddUserReply) && (state.ifCurrentScreen.value == true)) {
// _replyAddUserKey(reply);
// }
}); });
} }
@ -74,10 +60,7 @@ class LockDetailLogic extends BaseGetXController {
cancelBlueConnetctToastTimer(); cancelBlueConnetctToastTimer();
state.iSClosedUnlockSuccessfulPopup.value = true; state.iSClosedUnlockSuccessfulPopup.value = true;
if (state.closedUnlockSuccessfulTimer != null) { state.closedUnlockSuccessfulTimer?.cancel();
state.closedUnlockSuccessfulTimer!.cancel();
state.closedUnlockSuccessfulTimer = null;
}
// 3 // 3
state.closedUnlockSuccessfulTimer = Timer.periodic(3.seconds, (timer) { state.closedUnlockSuccessfulTimer = Timer.periodic(3.seconds, (timer) {
state.iSClosedUnlockSuccessfulPopup.value = false; state.iSClosedUnlockSuccessfulPopup.value = false;
@ -98,9 +81,7 @@ class LockDetailLogic extends BaseGetXController {
uploadElectricQuantityRequest(); uploadElectricQuantityRequest();
getLockRecordLastUploadDataTime(); getLockRecordLastUploadDataTime();
state.openLockBtnState.value = 0; resetOpenDoorState();
eventBus.fire(RefreshLockDetailInfoDataEvent());
break; break;
case 0x06: case 0x06:
// //
@ -128,49 +109,77 @@ class LockDetailLogic extends BaseGetXController {
break; break;
case 0x16: case 0x16:
// ... // ...
state.openLockBtnState.value = 0; resetOpenDoorState();
eventBus.fire(RefreshLockDetailInfoDataEvent());
showToast("正在开锁中...".tr, something: () { showToast("正在开锁中...".tr, something: () {
cancelBlueConnetctToastTimer(); cancelBlueConnetctToastTimer();
}); });
break; break;
case 0x0d: case 0x0d:
// ... //
showToast('钥匙无效'.tr); showToast('钥匙无效'.tr);
state.openLockBtnState.value = 0; // state.animationController!.stop();
state.openDoorBtnisUneable.value = false; resetOpenDoorState();
state.animationController!.stop();
cancelBlueConnetctToastTimer(); cancelBlueConnetctToastTimer();
BlueManage().disconnect();
break;
case 0x0b:
//
showToast('钥匙过期'.tr);
resetOpenDoorState();
cancelBlueConnetctToastTimer();
BlueManage().disconnect();
break;
case 0x0a:
//
showToast("钥匙不存在");
resetOpenDoorState();
cancelBlueConnetctToastTimer();
BlueManage().disconnect();
break;
case 0x0c:
//
showToast("钥匙数量已到上限");
resetOpenDoorState();
cancelBlueConnetctToastTimer();
BlueManage().disconnect();
break;
case 0x0e:
//
showToast("钥匙已存在");
resetOpenDoorState();
cancelBlueConnetctToastTimer();
BlueManage().disconnect();
break;
case 0x0f:
//
showToast("用户已存在");
resetOpenDoorState();
cancelBlueConnetctToastTimer();
BlueManage().disconnect();
break; break;
default: default:
// //
state.openLockBtnState.value = 0; AppLog.log("开锁失败");
state.openDoorBtnisUneable.value = false; // state.animationController!.stop();
state.animationController!.stop(); resetOpenDoorState();
cancelBlueConnetctToastTimer(); cancelBlueConnetctToastTimer();
BlueManage().disconnect();
break; break;
} }
} }
// //
// Future<void> _replyGetStarLockStatusInfo(Reply reply) async { void closeLuckStatus() {
// int status = reply.data[2]; state.openLockBtnState.value = 0;
// switch (status) { state.openDoorBtnisUneable.value = false;
// case 0x00: state.animationController!.stop(canceled: true);
// // cancelBlueConnetctToastTimer();
// dismissEasyLoading(); }
// cancelBlueConnetctToastTimer();
//
// break;
// case 0x06:
// //
//
// break;
// default:
// //
// break;
// }
// }
// //
Future<void> _replyReferEventRecordTime(Reply reply) async { Future<void> _replyReferEventRecordTime(Reply reply) async {
@ -234,123 +243,12 @@ class LockDetailLogic extends BaseGetXController {
} }
} }
// //
// Future<void> _replyAddUserKey(Reply reply) async {
// var lockId = reply.data.sublist(2, 42);
//
// var token = reply.data.sublist(42, 46);
// List<String> strTokenList = changeIntListToStringList(token);
// Storage.setStringList(saveBlueToken, strTokenList);
//
// int status = reply.data[46];
//
// switch (status) {
// case 0x00:
// //
// cancelBlueConnetctToastTimer();
// state.lockUserNo = reply.data[47];
// _updateLockUserNo();
//
// break;
// case 0x06:
// //
// var privateKey = await Storage.getStringList(saveBluePrivateKey);
// List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
//
// var publicKey = await Storage.getStringList(saveBluePublicKey);
// List<int> publicKeyDataList = changeStringListToIntList(publicKey!);
//
// IoSenderManage.senderAddUser(
// lockID: BlueManage().connectDeviceName,
// authUserID: state.senderUserId.toString(),
// keyID: state.keyInfos.value.keyId.toString(),
// userID: await Storage.getUid(),
// openMode: 1,
// keyType: 0,
// startDate: state.keyInfos.value.startDate!~/10000,
// expireDate: state.keyInfos.value.endDate!~/10000,
// role: state.keyInfos.value.keyRight == 1 ? 1 : 0,
// password: "0",
// needAuthor: 1,
// publicKey: publicKeyDataList,
// privateKey: getPrivateKeyList,
// token: token);
// break;
// default:
// break;
// }
// }
// ()
// Future<void> addUserConnectBlue() async {
// showBlueConnetctToastTimer(action: () {
// state.openLockBtnState.value = 0;
// eventBus.fire(RefreshLockDetailInfoDataEvent());
// });
//
// // var listData = AddUserCommand(
// // lockID: BlueManage().connectDeviceName,
// // authUserID: state.senderUserId.toString(),
// // keyID: state.keyInfos.value.keyId.toString(),
// // userID: await Storage.getUid(),
// // openMode: 1,
// // keyType: 0,
// // startDate: state.keyInfos.value.startDate!~/10000,
// // expireDate: state.keyInfos.value.endDate!~/10000,
// // role: state.keyInfos.value.keyRight == 1 ? 1 : 0,
// // password: "123456",
// // needAuthor: 1,
// // publicKey: publicKeyDataList,
// // privateKey: getPrivateKeyList,
// // token: getTokenList).packageData();
// BlueManage().bludSendData(state.keyInfos.value.bluetooth!.bluetoothDeviceName!, (BluetoothConnectionState deviceConnectionState) async {
// if (deviceConnectionState == BluetoothConnectionState.connected) {
// //
// var privateKey = await Storage.getStringList(saveBluePrivateKey);
// List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
//
// var publicKey = await Storage.getStringList(saveBluePublicKey);
// List<int> publicKeyDataList = changeStringListToIntList(publicKey!);
//
// var token = await Storage.getStringList(saveBlueToken);
// List<int> getTokenList = [0, 0, 0, 0];
// if (token != null) {
// getTokenList = changeStringListToIntList(token);
// }
//
// IoSenderManage.senderAddUser(
// lockID: BlueManage().connectDeviceName,
// authUserID: state.senderUserId.toString(),
// keyID: state.keyInfos.value.keyId.toString(),
// userID: await Storage.getUid(),
// openMode: 1,
// keyType: 0,
// startDate: state.keyInfos.value.startDate!~/10000,
// expireDate: state.keyInfos.value.endDate!~/10000,
// role: state.keyInfos.value.keyRight == 1 ? 1 : 0,
// password: "0",
// needAuthor: 1,
// publicKey: publicKeyDataList,
// privateKey: getPrivateKeyList,
// token: getTokenList);
// } else if (deviceConnectionState == BluetoothConnectionState.disconnected) {
// cancelBlueConnetctToastTimer();
// if (state.ifCurrentScreen.value == true) {
// showBlueConnetctToast();
// }
//
// state.openLockBtnState.value = 0;
// eventBus.fire(RefreshLockDetailInfoDataEvent());
// }
// });
// }
// //
Future<void> openDoorAction() async { Future<void> openDoorAction() async {
showBlueConnetctToastTimer(action: () { showBlueConnetctToastTimer(action: () {
state.openLockBtnState.value = 0; resetOpenDoorState();
// BlueManage().stopScan(); // BlueManage().stopScan();
eventBus.fire(RefreshLockDetailInfoDataEvent()); BlueManage().disconnect();
}); });
var privateKey = await Storage.getStringList(saveBluePrivateKey); var privateKey = await Storage.getStringList(saveBluePrivateKey);
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!); List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
@ -383,8 +281,7 @@ class LockDetailLogic extends BaseGetXController {
showBlueConnetctToast(); showBlueConnetctToast();
} }
state.openLockBtnState.value = 0; resetOpenDoorState();
eventBus.fire(RefreshLockDetailInfoDataEvent());
} }
}); });
} }
@ -448,8 +345,7 @@ class LockDetailLogic extends BaseGetXController {
openDoorAction(); openDoorAction();
} else { } else {
showToast("网络访问失败,请检查网络是否正常".tr, something: () { showToast("网络访问失败,请检查网络是否正常".tr, something: () {
state.openLockBtnState.value = 0; resetOpenDoorState();
state.animationController!.forward();
cancelBlueConnetctToastTimer(); cancelBlueConnetctToastTimer();
state.lockNetToken = "0"; state.lockNetToken = "0";
openDoorAction(); openDoorAction();
@ -473,25 +369,6 @@ class LockDetailLogic extends BaseGetXController {
} }
} }
// NO
// void _updateLockUserNo() async {
// LockNetTokenEntity entity = await ApiRepository.to.updateLockUserNo(
// keyId: state.keyInfos.value.keyId.toString(),
// lockUserNo: state.lockUserNo.toString()
// );
// if (entity.errorCode!.codeIsSuccessful) {
// eventBus.fire(RefreshLockDetailInfoDataEvent());
// SchedulerBinding.instance.addPostFrameCallback((_) {
// eventBus.fire(RefreshLockListInfoDataEvent());
// });
// if (state.isOpenLockNeedOnline.value == 0) {
// openDoorAction();
// } else {
// getLockNetToken();
// }
// }
// }
// //
void getLockRecordLastUploadDataTime() async { void getLockRecordLastUploadDataTime() async {
LockOperatingRecordGetLastRecordTimeEntity entity = await ApiRepository.to LockOperatingRecordGetLastRecordTimeEntity entity = await ApiRepository.to
@ -599,6 +476,14 @@ class LockDetailLogic extends BaseGetXController {
return formattedTime; return formattedTime;
} }
void resetOpenDoorState() {
state.openLockBtnState.value = 0;
state.openDoorBtnisUneable.value = false;
state.animationController!.reset();
state.animationController!.forward();
eventBus.fire(RefreshLockDetailInfoDataEvent());
}
@override @override
Future<void> onReady() async { Future<void> onReady() async {
super.onReady(); super.onReady();

View File

@ -1,6 +1,7 @@
import 'dart:async'; import 'dart:async';
import 'package:flutter/material.dart'; import 'package:flutter/material.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';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
@ -94,8 +95,10 @@ class _LockDetailPageState extends State<LockDetailPage>
state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusDeleted || state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusDeleted ||
state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusReset) { state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusReset) {
state.openDoorBtnisUneable.value = false; state.openDoorBtnisUneable.value = false;
state.bottomBtnisEable.value = false;
} else { } else {
state.openDoorBtnisUneable.value = true; state.openDoorBtnisUneable.value = true;
state.bottomBtnisEable.value = true;
} }
state.isOnlyOneData = widget.isOnlyOneData; state.isOnlyOneData = widget.isOnlyOneData;
@ -400,9 +403,8 @@ class _LockDetailPageState extends State<LockDetailPage>
children: [ children: [
Visibility( Visibility(
visible: visible:
((state.keyInfos.value.keyType == XSConstantMacro.keyTypeTime || ((state.keyInfos.value.keyType == XSConstantMacro.keyTypeTime || state.keyInfos.value.keyType == XSConstantMacro.keyTypeLoop)
state.keyInfos.value.keyType == && //
XSConstantMacro.keyTypeLoop) && //
(DateTool().compareTimeGetDaysFromNow( (DateTool().compareTimeGetDaysFromNow(
state.keyInfos.value.endDate!) <= state.keyInfos.value.endDate!) <=
15 && 15 &&
@ -875,7 +877,7 @@ class _LockDetailPageState extends State<LockDetailPage>
// //
showWidgetArr.add(bottomItem('images/main/icon_main_addLock.png', '新增配件'.tr, showWidgetArr.add(bottomItem('images/main/icon_main_addLock.png', '新增配件'.tr,
state.openDoorBtnisUneable.value, state.bottomBtnisEable.value, () { state.bottomBtnisEable.value, () {
Navigator.pushNamed(context, Routers.accessoriesListPage); Navigator.pushNamed(context, Routers.accessoriesListPage);
})); }));
@ -914,7 +916,6 @@ class _LockDetailPageState extends State<LockDetailPage>
showWidgetArr.add(bottomItem( showWidgetArr.add(bottomItem(
'images/main/icon_main_clockingIn.png', 'images/main/icon_main_clockingIn.png',
TranslationLoader.lanKeys!.checkingIn!.tr, TranslationLoader.lanKeys!.checkingIn!.tr,
state.openDoorBtnisUneable.value,
state.bottomBtnisEable.value, () { state.bottomBtnisEable.value, () {
Get.toNamed(Routers.checkingInListPage, Get.toNamed(Routers.checkingInListPage,
arguments: state.keyInfos.value); arguments: state.keyInfos.value);
@ -924,7 +925,6 @@ class _LockDetailPageState extends State<LockDetailPage>
showWidgetArr.add(bottomItem( showWidgetArr.add(bottomItem(
'images/main/icon_main_operatingRecord.png', 'images/main/icon_main_operatingRecord.png',
TranslationLoader.lanKeys!.operatingRecord!.tr, TranslationLoader.lanKeys!.operatingRecord!.tr,
state.openDoorBtnisUneable.value,
state.bottomBtnisEable.value, () { state.bottomBtnisEable.value, () {
Get.toNamed(Routers.lockOperatingRecordPage, Get.toNamed(Routers.lockOperatingRecordPage,
arguments: {"keyInfo": state.keyInfos.value}); arguments: {"keyInfo": state.keyInfos.value});
@ -932,7 +932,7 @@ class _LockDetailPageState extends State<LockDetailPage>
// //
showWidgetArr.add(bottomItem('images/main/icon_main_set.png', showWidgetArr.add(bottomItem('images/main/icon_main_set.png',
TranslationLoader.lanKeys!.set!.tr, true, true, () { TranslationLoader.lanKeys!.set!.tr, true, () {
Get.toNamed(Routers.lockSetPage, arguments: { Get.toNamed(Routers.lockSetPage, arguments: {
"lockId": state.keyInfos.value.lockId, "lockId": state.keyInfos.value.lockId,
"isOnlyOneData": state.isOnlyOneData "isOnlyOneData": state.isOnlyOneData
@ -950,7 +950,6 @@ class _LockDetailPageState extends State<LockDetailPage>
showWidgetArr.add(bottomItem( showWidgetArr.add(bottomItem(
'images/main/icon_main_clockingIn.png', 'images/main/icon_main_clockingIn.png',
TranslationLoader.lanKeys!.checkingIn!.tr, TranslationLoader.lanKeys!.checkingIn!.tr,
state.openDoorBtnisUneable.value,
state.bottomBtnisEable.value, () { state.bottomBtnisEable.value, () {
Get.toNamed(Routers.checkingInListPage, Get.toNamed(Routers.checkingInListPage,
arguments: state.keyInfos.value); arguments: state.keyInfos.value);
@ -961,7 +960,6 @@ class _LockDetailPageState extends State<LockDetailPage>
showWidgetArr.add(bottomItem( showWidgetArr.add(bottomItem(
'images/main/icon_main_electronicKey.png', 'images/main/icon_main_electronicKey.png',
TranslationLoader.lanKeys!.electronicKey!.tr, TranslationLoader.lanKeys!.electronicKey!.tr,
state.openDoorBtnisUneable.value,
state.bottomBtnisEable.value, () { state.bottomBtnisEable.value, () {
Get.toNamed(Routers.electronicKeyListPage); Get.toNamed(Routers.electronicKeyListPage);
})); }));
@ -970,7 +968,6 @@ class _LockDetailPageState extends State<LockDetailPage>
showWidgetArr.add(bottomItem( showWidgetArr.add(bottomItem(
'images/main/icon_main_password.png', 'images/main/icon_main_password.png',
TranslationLoader.lanKeys!.password!.tr, TranslationLoader.lanKeys!.password!.tr,
state.openDoorBtnisUneable.value,
state.bottomBtnisEable.value, () { state.bottomBtnisEable.value, () {
Get.toNamed(Routers.passwordKeyListPage, Get.toNamed(Routers.passwordKeyListPage,
arguments: {"keyInfo": state.keyInfos.value}); arguments: {"keyInfo": state.keyInfos.value});
@ -981,7 +978,6 @@ class _LockDetailPageState extends State<LockDetailPage>
showWidgetArr.add(bottomItem( showWidgetArr.add(bottomItem(
'images/main/icon_main_icCard.png', 'images/main/icon_main_icCard.png',
TranslationLoader.lanKeys!.card!.tr, TranslationLoader.lanKeys!.card!.tr,
state.openDoorBtnisUneable.value,
state.bottomBtnisEable.value, () { state.bottomBtnisEable.value, () {
Get.toNamed(Routers.cardListPage, arguments: { Get.toNamed(Routers.cardListPage, arguments: {
"lockId": state.keyInfos.value.lockId, "lockId": state.keyInfos.value.lockId,
@ -994,7 +990,6 @@ class _LockDetailPageState extends State<LockDetailPage>
showWidgetArr.add(bottomItem( showWidgetArr.add(bottomItem(
'images/main/icon_main_fingerprint.png', 'images/main/icon_main_fingerprint.png',
TranslationLoader.lanKeys!.fingerprint!.tr, TranslationLoader.lanKeys!.fingerprint!.tr,
state.openDoorBtnisUneable.value,
state.bottomBtnisEable.value, () { state.bottomBtnisEable.value, () {
Get.toNamed(Routers.fingerprintListPage, arguments: { Get.toNamed(Routers.fingerprintListPage, arguments: {
"lockId": state.keyInfos.value.lockId, "lockId": state.keyInfos.value.lockId,
@ -1007,7 +1002,6 @@ class _LockDetailPageState extends State<LockDetailPage>
showWidgetArr.add(bottomItem( showWidgetArr.add(bottomItem(
'images/main/icon_main_remoteControl.png', 'images/main/icon_main_remoteControl.png',
TranslationLoader.lanKeys!.remoteControl!.tr, TranslationLoader.lanKeys!.remoteControl!.tr,
state.openDoorBtnisUneable.value,
state.bottomBtnisEable.value, () { state.bottomBtnisEable.value, () {
Get.toNamed(Routers.remoteControlListPage); Get.toNamed(Routers.remoteControlListPage);
})); }));
@ -1019,7 +1013,6 @@ class _LockDetailPageState extends State<LockDetailPage>
bottomItem( bottomItem(
'images/main/icon_face.png', 'images/main/icon_face.png',
TranslationLoader.lanKeys!.humanFace!.tr, TranslationLoader.lanKeys!.humanFace!.tr,
state.openDoorBtnisUneable.value,
state.bottomBtnisEable.value, () { state.bottomBtnisEable.value, () {
Get.toNamed(Routers.faceListPage, arguments: { Get.toNamed(Routers.faceListPage, arguments: {
"lockId": state.keyInfos.value.lockId, "lockId": state.keyInfos.value.lockId,
@ -1031,7 +1024,7 @@ class _LockDetailPageState extends State<LockDetailPage>
if (state.keyInfos.value.lockFeature!.isSupportIris == 1) { if (state.keyInfos.value.lockFeature!.isSupportIris == 1) {
showWidgetArr.add( showWidgetArr.add(
bottomItem('images/main/icon_iris.png', '虹膜'.tr, bottomItem('images/main/icon_iris.png', '虹膜'.tr,
state.openDoorBtnisUneable.value, state.bottomBtnisEable.value, () { state.bottomBtnisEable.value, () {
Get.toNamed(Routers.irisListPage, arguments: { Get.toNamed(Routers.irisListPage, arguments: {
"lockId": state.keyInfos.value.lockId, "lockId": state.keyInfos.value.lockId,
}); });
@ -1042,7 +1035,7 @@ class _LockDetailPageState extends State<LockDetailPage>
if (state.keyInfos.value.lockFeature!.palmVein == 1) { if (state.keyInfos.value.lockFeature!.palmVein == 1) {
showWidgetArr.add( showWidgetArr.add(
bottomItem('images/main/icon_palm.png', '手掌'.tr, bottomItem('images/main/icon_palm.png', '手掌'.tr,
state.openDoorBtnisUneable.value, state.bottomBtnisEable.value, () { state.bottomBtnisEable.value, () {
Get.toNamed(Routers.palmListPage, arguments: { Get.toNamed(Routers.palmListPage, arguments: {
"lockId": state.keyInfos.value.lockId, "lockId": state.keyInfos.value.lockId,
}); });
@ -1056,7 +1049,6 @@ class _LockDetailPageState extends State<LockDetailPage>
bottomItem( bottomItem(
'images/main/icon_catEyes.png', 'images/main/icon_catEyes.png',
TranslationLoader.lanKeys!.monitoring!.tr, TranslationLoader.lanKeys!.monitoring!.tr,
state.openDoorBtnisUneable.value,
state.bottomBtnisEable.value, () { state.bottomBtnisEable.value, () {
Get.toNamed(Routers.realTimePicturePage, arguments: { Get.toNamed(Routers.realTimePicturePage, arguments: {
"lockName": state.keyInfos.value.lockName, "lockName": state.keyInfos.value.lockName,
@ -1071,7 +1063,6 @@ class _LockDetailPageState extends State<LockDetailPage>
showWidgetArr.add(bottomItem( showWidgetArr.add(bottomItem(
'images/main/icon_main_authorizedAdmin.png', 'images/main/icon_main_authorizedAdmin.png',
TranslationLoader.lanKeys!.authorizedAdmin!.tr, TranslationLoader.lanKeys!.authorizedAdmin!.tr,
state.openDoorBtnisUneable.value,
state.bottomBtnisEable.value, () { state.bottomBtnisEable.value, () {
Get.toNamed(Routers.authorizedAdminListPage, Get.toNamed(Routers.authorizedAdminListPage,
arguments: {"keyInfo": state.keyInfos.value}); arguments: {"keyInfo": state.keyInfos.value});
@ -1084,7 +1075,6 @@ class _LockDetailPageState extends State<LockDetailPage>
bottomItem( bottomItem(
'images/main/icon_main_operatingRecord.png', 'images/main/icon_main_operatingRecord.png',
TranslationLoader.lanKeys!.operatingRecord!.tr, TranslationLoader.lanKeys!.operatingRecord!.tr,
state.openDoorBtnisUneable.value,
state.bottomBtnisEable.value, () { state.bottomBtnisEable.value, () {
// Get.toNamed(Routers.lockOperatingRecordPage, // Get.toNamed(Routers.lockOperatingRecordPage,
// arguments: {"keyInfo": state.keyInfos.value}); // arguments: {"keyInfo": state.keyInfos.value});
@ -1098,7 +1088,6 @@ class _LockDetailPageState extends State<LockDetailPage>
endWiddget.add(bottomItem( endWiddget.add(bottomItem(
'images/main/icon_lockDetail_videoLog.png', 'images/main/icon_lockDetail_videoLog.png',
TranslationLoader.lanKeys!.videoLog!.tr, TranslationLoader.lanKeys!.videoLog!.tr,
state.openDoorBtnisUneable.value,
state.bottomBtnisEable.value, () { state.bottomBtnisEable.value, () {
Get.toNamed(Routers.videoLogPage, arguments: { Get.toNamed(Routers.videoLogPage, arguments: {
"lockId": state.keyInfos.value.lockId, "lockId": state.keyInfos.value.lockId,
@ -1110,7 +1099,6 @@ class _LockDetailPageState extends State<LockDetailPage>
bottomItem( bottomItem(
'images/main/icon_lockDetail_messageReminding.png', 'images/main/icon_lockDetail_messageReminding.png',
TranslationLoader.lanKeys!.messageReminding!.tr, TranslationLoader.lanKeys!.messageReminding!.tr,
state.openDoorBtnisUneable.value,
state.bottomBtnisEable.value, () { state.bottomBtnisEable.value, () {
Get.toNamed(Routers.msgNotificationPage, arguments: { Get.toNamed(Routers.msgNotificationPage, arguments: {
"lockId": state.keyInfos.value.lockId, "lockId": state.keyInfos.value.lockId,
@ -1121,7 +1109,7 @@ class _LockDetailPageState extends State<LockDetailPage>
endWiddget.add( endWiddget.add(
// //
bottomItem('images/main/icon_main_set.png', bottomItem('images/main/icon_main_set.png',
TranslationLoader.lanKeys!.set!.tr, true, true, () { TranslationLoader.lanKeys!.set!.tr, true, () {
// logic.clickItemBtnAction(10); // logic.clickItemBtnAction(10);
Get.toNamed(Routers.lockSetPage, arguments: { Get.toNamed(Routers.lockSetPage, arguments: {
"lockId": state.keyInfos.value.lockId, "lockId": state.keyInfos.value.lockId,
@ -1133,8 +1121,7 @@ class _LockDetailPageState extends State<LockDetailPage>
return showWidgetArr; return showWidgetArr;
} }
Widget bottomItem(String iconUrl, String name, bool openDoorBtnisUneable, Widget bottomItem(String iconUrl, String name, bool bottomBtnisEable, Function() onClick) {
bool bottomBtnisEable, Function() onClick) {
Widget child = F.sw( Widget child = F.sw(
defaultCall: () => Container( defaultCall: () => Container(
color: Colors.white, color: Colors.white,
@ -1149,10 +1136,8 @@ class _LockDetailPageState extends State<LockDetailPage>
child: Image.asset(iconUrl, child: Image.asset(iconUrl,
width: 42.w, width: 42.w,
height: 42.w, height: 42.w,
color: openDoorBtnisUneable color: bottomBtnisEable
? (bottomBtnisEable ? AppColors.mainColor
? AppColors.mainColor
: AppColors.lockDetailBottomBtnUneable)
: AppColors.lockDetailBottomBtnUneable, : AppColors.lockDetailBottomBtnUneable,
fit: BoxFit.fitWidth), fit: BoxFit.fitWidth),
), ),
@ -1162,11 +1147,7 @@ class _LockDetailPageState extends State<LockDetailPage>
child: Text(name, child: Text(name,
style: TextStyle( style: TextStyle(
fontSize: 20.sp, fontSize: 20.sp,
color: openDoorBtnisUneable color: bottomBtnisEable ? AppColors.blackColor : AppColors.lockDetailBottomBtnUneable),
? (bottomBtnisEable
? AppColors.blackColor
: AppColors.lockDetailBottomBtnUneable)
: AppColors.lockDetailBottomBtnUneable),
textAlign: TextAlign.center)) textAlign: TextAlign.center))
], ],
), ),
@ -1186,10 +1167,8 @@ class _LockDetailPageState extends State<LockDetailPage>
child: Image.asset(iconUrl, child: Image.asset(iconUrl,
width: 42.w, width: 42.w,
height: 42.w, height: 42.w,
color: openDoorBtnisUneable color: bottomBtnisEable
? (bottomBtnisEable ? AppColors.mainColor
? AppColors.mainColor
: AppColors.lockDetailBottomBtnUneable)
: AppColors.lockDetailBottomBtnUneable, : AppColors.lockDetailBottomBtnUneable,
fit: BoxFit.fitWidth), fit: BoxFit.fitWidth),
), ),
@ -1199,23 +1178,19 @@ class _LockDetailPageState extends State<LockDetailPage>
name, name,
style: TextStyle( style: TextStyle(
fontSize: 20.sp, fontSize: 20.sp,
color: openDoorBtnisUneable color: bottomBtnisEable
? (bottomBtnisEable ? AppColors.blackColor
? AppColors.blackColor
: AppColors.lockDetailBottomBtnUneable)
: AppColors.lockDetailBottomBtnUneable), : AppColors.lockDetailBottomBtnUneable),
), ),
], ],
), ),
)); ));
return GestureDetector( return GestureDetector(
onTap: openDoorBtnisUneable onTap: bottomBtnisEable
? (bottomBtnisEable ? onClick
? onClick : () {
: () { logic.showToast("请在锁旁边完成第一次开锁".tr);
logic.showToast("请在锁旁边完成第一次开锁".tr); },
})
: null,
child: child, child: child,
); );
} }
@ -1290,6 +1265,7 @@ class _LockDetailPageState extends State<LockDetailPage>
left: 155.w, left: 155.w,
child: GestureDetector( child: GestureDetector(
onTap: () { onTap: () {
state.closedUnlockSuccessfulTimer?.cancel();
setState(() { setState(() {
state.iSClosedUnlockSuccessfulPopup.value = false; state.iSClosedUnlockSuccessfulPopup.value = false;
}); });
@ -1345,7 +1321,7 @@ class _LockDetailPageState extends State<LockDetailPage>
state.iSOpenLock.value = true; state.iSOpenLock.value = true;
state.iSClosedUnlockSuccessfulPopup.value = false; state.iSClosedUnlockSuccessfulPopup.value = false;
state.openLockBtnState.value = 1; state.openLockBtnState.value = 1;
// state.animationController!.forward(); state.animationController!.forward();
AppLog.log("点击开锁"); AppLog.log("点击开锁");
if (state.isOpenLockNeedOnline.value == 0) { if (state.isOpenLockNeedOnline.value == 0) {
@ -1370,6 +1346,7 @@ class _LockDetailPageState extends State<LockDetailPage>
state.openLockBtnState.value = 1; state.openLockBtnState.value = 1;
state.animationController!.forward(); state.animationController!.forward();
EasyLoading.showToast("正在尝试闭锁……".tr, duration: 2000.milliseconds);
AppLog.log("长按闭锁"); AppLog.log("长按闭锁");
if (state.isOpenLockNeedOnline.value == 0) { if (state.isOpenLockNeedOnline.value == 0) {
// //

View File

@ -38,7 +38,7 @@ class LockOperatingRecordLogic extends BaseGetXController {
case 0x00: case 0x00:
// //
int dataLength = (reply.data[5] << 8) + reply.data[6]; int dataLength = (reply.data[5] << 8) + reply.data[6];
// AppLog.log("dataLength:$dataLength"); AppLog.log("dataLength:$dataLength");
// var dataLength = reply.data[5]; // var dataLength = reply.data[5];
if (dataLength > 0) { if (dataLength > 0) {
reply.data.removeRange(0, 7); reply.data.removeRange(0, 7);
@ -186,10 +186,12 @@ class LockOperatingRecordLogic extends BaseGetXController {
// //
void clearOperationRecordRequest() async { void clearOperationRecordRequest() async {
KeyOperationRecordEntity entity = KeyOperationRecordEntity entity = await ApiRepository.to.clearOperationRecord(CommonDataManage().currentKeyInfo.lockId.toString());
await ApiRepository.to.clearOperationRecord('28');
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
showToast("清除数据成功"); showToast("清除数据成功", something: (){
pageNo = 1;
mockNetworkDataRequest();
});
} }
} }

View File

@ -69,7 +69,7 @@ class LockEscalationLogic extends BaseGetXController {
} }
String md5Str = md5.convert(otaBin!).toString(); String md5Str = md5.convert(otaBin!).toString();
headJson!['fwMd5'] = md5Str; headJson!['fwMd5'] = md5Str;
ShowTipView().showIosTipWithContentDialog("升级过程中无法开锁,请先开锁后再升级".tr, ShowTipView().showIosTipWithContentDialog("未避免异常情况,请在门打开时升级".tr,
() async { () async {
blueOTAUpgrade(headJson!, [0, 0, 0, 0]); blueOTAUpgrade(headJson!, [0, 0, 0, 0]);
EasyLoading.show( EasyLoading.show(

View File

@ -113,7 +113,7 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage>
} }
})), })),
Obx(() => Visibility( Obx(() => Visibility(
visible: state.isCirculation.value, visible: state.isCirculation.value == false,
child: CommonItem( child: CommonItem(
leftTitel: "结束时间", leftTitel: "结束时间",
rightTitle: DateTool().dateToYMDHNString( rightTitle: DateTool().dateToYMDHNString(
@ -157,6 +157,10 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage>
'id': state.itemData.value.keyboardPwdId.toString() 'id': state.itemData.value.keyboardPwdId.toString()
}); });
}), }),
Visibility(
visible: state.itemData.value.isCustom == 0 && state.itemData.value.keyboardPwdType != 1 && state.itemData.value.keyboardPwdType != 4,
child:bottomTip()
),
Container(height: 40.h), Container(height: 40.h),
SizedBox( SizedBox(
width: ScreenUtil().screenWidth - 40.w, width: ScreenUtil().screenWidth - 40.w,
@ -243,6 +247,27 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage>
)); ));
} }
Widget bottomTip(){
return Column(
children: [
Container(
padding: EdgeInsets.all(20.w),
child: Row(
// crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Text(
"密码生成后请在当日2359前使用一次进行激活否则过0点后未激活则失效。".tr,
textAlign: TextAlign.start,
style: TextStyle(fontSize: 20.sp),
)),
],
),
),
],
);
}
// //
CupertinoSwitch _isAdmin() { CupertinoSwitch _isAdmin() {
return CupertinoSwitch( return CupertinoSwitch(

View File

@ -272,7 +272,7 @@ class PasswordKeyListLogic extends BaseGetXController {
switch (getPwdType) { switch (getPwdType) {
case 1: case 1:
// 1 6使 // 1 6使
useDateStr = '${sendDateStr.toLocal().toString().substring(0, 16)} ${"单次".tr}'; useDateStr = '${startDateStr.toLocal().toString().substring(0, 16)} ${"单次".tr}';
break; break;
case 2: case 2:
// 2 24使 // 2 24使
@ -285,7 +285,7 @@ class PasswordKeyListLogic extends BaseGetXController {
break; break;
case 4: case 4:
// 4 使使 // 4 使使
useDateStr = '${endDateStr.toLocal().toString().substring(0, 16)} ${"清空码".tr}'; useDateStr = '${startDateStr.toLocal().toString().substring(0, 16)} ${"清空码".tr}';
break; break;
case 5: case 5:
// 5 // 5

View File

@ -78,7 +78,7 @@ class NearbyLockLogic extends BaseGetXController {
} }
// //
if (reply is GetStarLockStatuInfoReply) { if (reply is GetStarLockStatuInfoReply && state.ifCurrentScreen.value) {
_replyGetStarLockStatusInfo(reply); _replyGetStarLockStatusInfo(reply);
} }

View File

@ -233,7 +233,7 @@ class SaveLockLogic extends BaseGetXController {
userID: await Storage.getUid(), userID: await Storage.getUid(),
openMode: 1, openMode: 1,
keyType: 1, keyType: 1,
startDate: DateTime.now().millisecondsSinceEpoch, startDate: DateTime.now().millisecondsSinceEpoch ~/ 1000,
expireDate: 0x11223344, expireDate: 0x11223344,
useCountLimit: 0xFFFF, useCountLimit: 0xFFFF,
isRound: 0, isRound: 0,

View File

@ -67,8 +67,9 @@ class _AddAuthorizedAdministratorPageState
: state.lockIdList.value.length.toString(), : state.lockIdList.value.length.toString(),
isHaveDirection: true, isHaveDirection: true,
action: () { action: () {
Navigator.pushNamed(context, Routers.massSendLockGroupPage) Navigator.pushNamed(context, Routers.massSendLockGroupListPage, arguments: {
.then((value) { "keyLimits":"1"
}).then((value) {
//ID列表 //ID列表
if (value != null) { if (value != null) {
value as Map<String, dynamic>; value as Map<String, dynamic>;
@ -109,8 +110,9 @@ class _AddAuthorizedAdministratorPageState
: state.lockIdList.value.length.toString(), : state.lockIdList.value.length.toString(),
isHaveDirection: true, isHaveDirection: true,
action: () { action: () {
Navigator.pushNamed(context, Routers.massSendLockGroupPage) Navigator.pushNamed(context, Routers.massSendLockGroupListPage,arguments:{
.then((value) { "keyLimits":"1",
}).then((value) {
//ID列表 //ID列表
if (value != null) { if (value != null) {
value as Map<String, dynamic>; value as Map<String, dynamic>;

View File

@ -35,9 +35,9 @@ class BaseProvider extends GetConnect with Api {
bool? isUnShowLoading = false, // loading bool? isUnShowLoading = false, // loading
bool? isUserBaseUrl = true, // 使baseUrl bool? isUserBaseUrl = true, // 使baseUrl
}) async { }) async {
AppLog.log("post: url:$url body:$body contentType:$contentType"); AppLog.log("post: url:$url body:$body");
if (isUnShowLoading == false){ if (isUnShowLoading == false){
AppLog.log("post: url:$url show loading"); // AppLog.log("post: url:$url show loading");
EasyLoading.show(); EasyLoading.show();
} }
if (isUserBaseUrl == false) { if (isUserBaseUrl == false) {

View File

@ -56,14 +56,17 @@ class BaseGetXController extends GetxController {
void showEasyLoading() => EasyLoading.show(); void showEasyLoading() => EasyLoading.show();
void dismissEasyLoading() { 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; Timer? _timer;
// CancelableOperation? _operation; // CancelableOperation? _operation;
void showBlueConnetctToastTimer({bool isShowBlueConnetctToast = true, Function? action}) { void showBlueConnetctToastTimer(
{bool isShowBlueConnetctToast = true, Function? action}) {
if (_timer != null && _timer!.isActive) { if (_timer != null && _timer!.isActive) {
_timer!.cancel(); _timer!.cancel();
_timer = null; _timer = null;
@ -88,9 +91,9 @@ class BaseGetXController extends GetxController {
} }
void showBlueConnetctToast() { void showBlueConnetctToast() {
bool isContains = BlueManage().connectDeviceName!.contains("T9A"); bool isContains = BlueManage().connectDeviceName.contains("T9A");
showToast( showToast(
"连接设备失败,请确保在设备附近,设备未被连接,设备已打开${isContains == true ? "如果是全自动锁,请使屏幕变亮" : ""}"); "${'操作失败,请确认锁是否在附近,或重启手机蓝牙后再试。'.tr}${isContains == true ? "如果是全自动锁,请使屏幕变亮" : ""}");
} }
void showToast(String status, {Function? something}) { void showToast(String status, {Function? something}) {
@ -116,6 +119,7 @@ class BaseGetXController extends GetxController {
void showOperationSuccessful({String? status, Function? something}) => void showOperationSuccessful({String? status, Function? something}) =>
showSuccess(status ?? "成功", something: something); showSuccess(status ?? "成功", something: something);
void showOperationFailed({String? status, Function? something}) => void showOperationFailed({String? status, Function? something}) =>
showError(status ?? "失败", something: something); showError(status ?? "失败", something: something);
@ -171,7 +175,8 @@ class BaseGetXController extends GetxController {
String useDateStr = ''; String useDateStr = '';
if (keyType == XSConstantMacro.keyTypeTime) { 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) { } else if (keyType == XSConstantMacro.keyTypeLong) {
// //
// DateTime dateStr = DateTime.fromMillisecondsSinceEpoch(indexEntity.date!); // DateTime dateStr = DateTime.fromMillisecondsSinceEpoch(indexEntity.date!);
@ -184,7 +189,8 @@ class BaseGetXController extends GetxController {
useDateStr = '单次'.tr; useDateStr = '单次'.tr;
} else if (keyType == XSConstantMacro.keyTypeLoop) { } 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; return useDateStr;
@ -214,5 +220,6 @@ class BaseGetXController extends GetxController {
///Extension_Int ///Extension_Int
extension Extension_Int on int { extension Extension_Int on int {
bool get codeIsSuccessful => this == 0; bool get codeIsSuccessful => this == 0;
bool get msgCodeIsSuccessful => this == 1; bool get msgCodeIsSuccessful => this == 1;
} }

View File

@ -32,14 +32,30 @@ class PermissionDialog {
return false; return false;
} }
bool application = true; bool application = true;
Map<Permission, PermissionStatus> statuses = await [ List<Permission> permissions = [
Permission.bluetooth,
Permission.bluetoothScan, Permission.bluetoothScan,
Permission.bluetoothConnect, Permission.bluetoothConnect,
].request(); ];
Future<bool> getPermissionStatus(List<Permission> permissions) async {
bool isGranted = true;
List<PermissionStatus> permissionStatus = [];
for (Permission per in permissions) {
permissionStatus.add(await per.status);
}
for (PermissionStatus per in permissionStatus) {
isGranted = isGranted && per.isGranted;
}
if (GetPlatform.isIOS) {
isGranted = permissionStatus[0].isGranted;
}
return isGranted;
}
Permission permission = Permission.bluetoothScan; Permission permission = Permission.bluetoothScan;
dynamic cache = await Storage.getString(titles[permission]); dynamic cache = await Storage.getString(titles[permission]);
bool isGranted = statuses.values.every((element) => element.isGranted); bool isGranted = await getPermissionStatus(permissions);
if (AppPlatform.isAndroid && !isGranted && cache is! String) { if (GetPlatform.isAndroid && !isGranted && cache is! String) {
application = await showCupertinoDialog( application = await showCupertinoDialog(
context: Get.context!, context: Get.context!,
builder: (context) { builder: (context) {
@ -69,16 +85,19 @@ class PermissionDialog {
if (application) { if (application) {
await Storage.setString(titles[permission], titles[permission]); await Storage.setString(titles[permission], titles[permission]);
} }
} else if (cache is String) { } else if (cache is! String) {
bool isDenied = statuses.values.every((element) => element.isDenied); await Storage.setString(titles[permission], titles[permission]);
if (isDenied) { } else {
bool isGranted = await getPermissionStatus(permissions);
if (!isGranted) {
showSet(permission); showSet(permission);
return false; return false;
} }
} }
if (application) { if (application) {
PermissionStatus status = await permission.request(); await permissions.request();
return status.isGranted; bool isGranted = await getPermissionStatus(permissions);
return isGranted;
} }
return false; return false;
} }

View File

@ -42,8 +42,9 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# 1.0.32+2024051001打包给欧阳回归测试 # 1.0.32+2024051001打包给欧阳回归测试
# 1.0.33+2024051401打包给欧阳回归测试 # 1.0.33+2024051401打包给欧阳回归测试
# 1.0.34+2024051402打包给欧阳回归测试 # 1.0.34+2024051402打包给欧阳回归测试
# 1.0.35+2024051501打包给欧阳回归测试
version: 1.0.34+2024051402 version: 1.0.35+2024051501
environment: environment:
sdk: '>=2.12.0 <3.0.0' sdk: '>=2.12.0 <3.0.0'
@ -178,6 +179,10 @@ dependencies:
file_picker: ^5.3.1 file_picker: ^5.3.1
dependency_overrides:
#强制设置google_maps_flutter_ios 为 2.5.2
google_maps_flutter_ios: 2.5.2
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:
sdk: flutter sdk: flutter