Merge branch 'master' of https://gitee.com/starlock-cn/app-starlock
# Conflicts: # star_lock/lib/main/lockDetail/card/addCardType/addCardManage/addCardTypeManage_tabbar.dart # star_lock/lib/network/api.dart
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
@ -50,7 +50,7 @@
|
||||
"sendGroupKey":"Send Group Key",
|
||||
"lock":"Lock",
|
||||
"pleaseAdd":"Please Add",
|
||||
"pleaseSelet":"Please Selet",
|
||||
"pleaseSelect":"Please Select",
|
||||
"remoteUnlockingAllowed":"Remote Unlocking Allowed",
|
||||
"pleaseEnter":"Please Enter",
|
||||
"getPassword":"Get Password",
|
||||
@ -170,7 +170,7 @@
|
||||
"allDay":"All Day",
|
||||
"save":"Save",
|
||||
"normallyOpenModeTip":"During the set normal opening time, the lock will remain open after opening until it is manually closed During the set normal opening time, the lock will remain open after opening until it is manually closed",
|
||||
"pleaseSeletLockVolume":"Please Selet Lock Volume",
|
||||
"pleaseSelectLockVolume":"Please Select Lock Volume",
|
||||
"lockSoundTip":"When the function is enabled, you can hear the prompt tone of the smart lock. Including low battery, incorrect password and so on.",
|
||||
"low":"Low",
|
||||
"lower":"Lower",
|
||||
@ -282,7 +282,7 @@
|
||||
"addGateway": "Add Gateway",
|
||||
"turnThePowerBackOn": "Turn The Power Back On",
|
||||
"indicatorLight": "Indicator Light",
|
||||
"seletGatewayTypeNextTip": "Repower the gateway and click Next when the indicator light flashes alternately",
|
||||
"selectGatewayTypeNextTip": "Repower the gateway and click Next when the indicator light flashes alternately",
|
||||
"selectGateway": "Select Gateway",
|
||||
"gatewayConfigurationWifiTip": "5G WiFi network is not supported, please choose 2.4G WiFi network for configuration",
|
||||
"wifiPassward": "WiFi Passward",
|
||||
@ -325,7 +325,7 @@
|
||||
"email":"Email",
|
||||
"mobileNumber":"Mobile phone number",
|
||||
"countryAndRegion":"Country And Region",
|
||||
"selet":"Selet",
|
||||
"select":"Select",
|
||||
"getVerificationCode":"Get Verification Code",
|
||||
|
||||
"businessCooperation":"Business Cooperation",
|
||||
@ -349,7 +349,7 @@
|
||||
"customMailTemplate":"Custom Mail Template",
|
||||
"record":"Record",
|
||||
"buyRealNameTip":"When an electronic key is sent to the user, the user can be required to authenticate with his real name before unlocking to ensure that he is operating. The real-name authentication calls the interface of the national Public security system. For the payment function, please purchase the number of times before using it.",
|
||||
"buyRealNameSeletYouWantBuyTip":"Please select the frequency of real name authentication you want",
|
||||
"buyRealNameSelectYouWantBuyTip":"Please select the frequency of real name authentication you want",
|
||||
"forTheFirstTime":"For the first time",
|
||||
"onceDay":"once a day",
|
||||
"weekOnce":"once a week",
|
||||
@ -417,9 +417,9 @@
|
||||
"whetherTheEmployeeHasPassword":"If The Employee Has A Password",
|
||||
"whetherTheEmployeeHasCard":"If The Employee Has A Card",
|
||||
"whetherTheEmployeeHasFingerprint":"If The Employee Has A Fingerprint",
|
||||
"seletPassword":"Selet Password",
|
||||
"seletCard":"Selet Card",
|
||||
"seletFingerprint":"Selet Fingerprint",
|
||||
"selectPassword":"Select Password",
|
||||
"selectCard":"Select Card",
|
||||
"selectFingerprint":"Select Fingerprint",
|
||||
"getKey":"Get Key",
|
||||
"getCard":"Get Card",
|
||||
"getFingerprint":"Get Fingerprint",
|
||||
|
||||
@ -50,7 +50,7 @@
|
||||
"sendGroupKey":"sendGroupKey",
|
||||
"lock":"lock",
|
||||
"pleaseAdd":"pleaseAdd",
|
||||
"pleaseSelet":"pleaseSelet",
|
||||
"pleaseSelect":"pleaseSelect",
|
||||
"remoteUnlockingAllowed":"remoteUnlockingAllowed",
|
||||
"pleaseEnter":"pleaseEnter",
|
||||
"getPassword":"getPassword",
|
||||
@ -170,7 +170,7 @@
|
||||
"allDay":"allDay",
|
||||
"save":"save",
|
||||
"normallyOpenModeTip":"normallyOpenModeTip",
|
||||
"pleaseSeletLockVolume":"pleaseSeletLockVolume",
|
||||
"pleaseSelectLockVolume":"pleaseSelectLockVolume",
|
||||
"lockSoundTip":"lockSoundTip",
|
||||
"low":"low",
|
||||
"lower":"lower",
|
||||
@ -282,7 +282,7 @@
|
||||
"addGateway": "addGateway",
|
||||
"turnThePowerBackOn": "turnThePowerBackOn",
|
||||
"indicatorLight": "indicatorLight",
|
||||
"seletGatewayTypeNextTip": "seletGatewayTypeNextTip",
|
||||
"selectGatewayTypeNextTip": "selectGatewayTypeNextTip",
|
||||
"selectGateway": "selectGateway",
|
||||
"gatewayConfigurationWifiTip": "gatewayConfigurationWifiTip",
|
||||
"wifiPassward": "wifiPassward",
|
||||
@ -325,7 +325,7 @@
|
||||
"email":"email",
|
||||
"mobileNumber":"mobileNumber",
|
||||
"countryAndRegion":"countryAndRegion",
|
||||
"selet":"selet",
|
||||
"select":"select",
|
||||
"getVerificationCode":"getVerificationCode",
|
||||
|
||||
"businessCooperation":"businessCooperation",
|
||||
@ -349,7 +349,7 @@
|
||||
"customMailTemplate":"customMailTemplate",
|
||||
"record":"record",
|
||||
"buyRealNameTip":"buyRealNameTip",
|
||||
"buyRealNameSeletYouWantBuyTip":"buyRealNameSeletYouWantBuyTip",
|
||||
"buyRealNameSelectYouWantBuyTip":"buyRealNameSelectYouWantBuyTip",
|
||||
"forTheFirstTime":"forTheFirstTime",
|
||||
"onceDay":"onceDay",
|
||||
"weekOnce":"weekOnce",
|
||||
@ -417,9 +417,9 @@
|
||||
"whetherTheEmployeeHasPassword":"whetherTheEmployeeHasPassword",
|
||||
"whetherTheEmployeeHasCard":"whetherTheEmployeeHasCard",
|
||||
"whetherTheEmployeeHasFingerprint":"whetherTheEmployeeHasFingerprint",
|
||||
"seletPassword":"seletPassword",
|
||||
"seletCard":"seletCard",
|
||||
"seletFingerprint":"seletFingerprint",
|
||||
"selectPassword":"selectPassword",
|
||||
"selectCard":"selectCard",
|
||||
"selectFingerprint":"selectFingerprint",
|
||||
"getKey":"getKey",
|
||||
"getCard":"getCard",
|
||||
"getFingerprint":"getFingerprint",
|
||||
|
||||
@ -50,7 +50,7 @@
|
||||
"sendGroupKey":"群发钥匙",
|
||||
"lock":"锁",
|
||||
"pleaseAdd":"请添加",
|
||||
"pleaseSelet":"请选择",
|
||||
"pleaseSelect":"请选择",
|
||||
"remoteUnlockingAllowed":"允许远程开锁",
|
||||
"pleaseEnter":"请输入",
|
||||
"getPassword":"获取密码",
|
||||
@ -170,7 +170,7 @@
|
||||
"allDay":"全天",
|
||||
"save":"保存",
|
||||
"normallyOpenModeTip":"在设置的常开时间内,锁被打开后将一直处于打开的状态,直到被手动关闭",
|
||||
"pleaseSeletLockVolume":"请选择锁音量",
|
||||
"pleaseSelectLockVolume":"请选择锁音量",
|
||||
"lockSoundTip":"功能开启后,你将可以听到智能锁的提示音。包括电量过低,密码错误等提示。",
|
||||
"low":"低",
|
||||
"lower":"较低",
|
||||
@ -282,7 +282,7 @@
|
||||
"addGateway": "添加网关",
|
||||
"turnThePowerBackOn": "重新通电",
|
||||
"indicatorLight": "指示灯",
|
||||
"seletGatewayTypeNextTip": "将网关重新通电,指示灯交替闪烁时点击下一步",
|
||||
"selectGatewayTypeNextTip": "将网关重新通电,指示灯交替闪烁时点击下一步",
|
||||
"selectGateway": "选择网关",
|
||||
"gatewayConfigurationWifiTip": "不支持5G WiFi网络,请选择2.4G WiFi网络进行配置",
|
||||
"wifiPassward": "WiFi密码",
|
||||
@ -325,7 +325,7 @@
|
||||
"email":"邮箱",
|
||||
"mobileNumber":"手机号",
|
||||
"countryAndRegion":"国家/地区",
|
||||
"selet":"选择",
|
||||
"select":"选择",
|
||||
"getVerificationCode":"获取验证码",
|
||||
|
||||
"businessCooperation":"商务合作",
|
||||
@ -350,7 +350,7 @@
|
||||
"record":"记录",
|
||||
|
||||
"buyRealNameTip":"给用户发送电子钥匙时,可以要求其开锁前先进行实名认证,以保证是他本人在操作。实名认证调用国家公安系统接口,为付费功能,请购买次数后再使用。",
|
||||
"buyRealNameSeletYouWantBuyTip":"请选择你希望的实名认证频数",
|
||||
"buyRealNameSelectYouWantBuyTip":"请选择你希望的实名认证频数",
|
||||
"forTheFirstTime":"仅首次",
|
||||
"onceDay":"每日一次",
|
||||
"weekOnce":"每周一次",
|
||||
@ -420,9 +420,9 @@
|
||||
"whetherTheEmployeeHasPassword":"员工是否有密码",
|
||||
"whetherTheEmployeeHasCard":"员工是否有卡",
|
||||
"whetherTheEmployeeHasFingerprint":"员工是否有指纹",
|
||||
"seletPassword":"选择密码",
|
||||
"seletCard":"选择卡",
|
||||
"seletFingerprint":"选择指纹",
|
||||
"selectPassword":"选择密码",
|
||||
"selectCard":"选择卡",
|
||||
"selectFingerprint":"选择指纹",
|
||||
"getKey":"获取钥匙",
|
||||
"getCard":"获取卡",
|
||||
"getFingerprint":"获取指纹",
|
||||
|
||||
BIN
star_lock/images/main/icon_addFace_step1.png
Normal file
|
After Width: | Height: | Size: 80 KiB |
BIN
star_lock/images/main/icon_addFace_step2.png
Normal file
|
After Width: | Height: | Size: 95 KiB |
|
Before Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 471 KiB After Width: | Height: | Size: 471 KiB |
|
Before Width: | Height: | Size: 350 KiB After Width: | Height: | Size: 350 KiB |
|
Before Width: | Height: | Size: 7.4 KiB After Width: | Height: | Size: 7.4 KiB |
|
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 6.7 KiB |
@ -63,7 +63,7 @@ PODS:
|
||||
- Flutter
|
||||
- google_maps_flutter_ios (0.0.1):
|
||||
- Flutter
|
||||
- GoogleMaps (< 9.0)
|
||||
- GoogleMaps (< 8.0)
|
||||
- GoogleMaps (6.2.1):
|
||||
- GoogleMaps/Maps (= 6.2.1)
|
||||
- GoogleMaps/Base (6.2.1)
|
||||
@ -85,7 +85,7 @@ PODS:
|
||||
- FlutterMacOS
|
||||
- permission_handler_apple (9.1.1):
|
||||
- Flutter
|
||||
- Protobuf (3.25.1)
|
||||
- Protobuf (3.25.0)
|
||||
- ReachabilitySwift (5.0.0)
|
||||
- reactive_ble_mobile (0.0.1):
|
||||
- Flutter
|
||||
@ -97,7 +97,7 @@ PODS:
|
||||
- sqflite (0.0.3):
|
||||
- Flutter
|
||||
- FMDB (>= 2.7.5)
|
||||
- SwiftProtobuf (1.25.2)
|
||||
- SwiftProtobuf (1.25.1)
|
||||
- Toast (4.0.0)
|
||||
- url_launcher_ios (0.0.1):
|
||||
- Flutter
|
||||
@ -241,7 +241,7 @@ SPEC CHECKSUMS:
|
||||
audio_session: 4f3e461722055d21515cf3261b64c973c062f345
|
||||
audioplayers_darwin: 877d9a4d06331c5c374595e46e16453ac7eafa40
|
||||
auto_orientation: 102ed811a5938d52c86520ddd7ecd3a126b5d39d
|
||||
camera_avfoundation: 8b8d780bcfb6a4a02b0fbe2b4bd17b5b71946e68
|
||||
camera_avfoundation: 3125e8cd1a4387f6f31c6c63abb8a55892a9eeeb
|
||||
connectivity_plus: bf0076dd84a130856aa636df1c71ccaff908fa1d
|
||||
device_info_plus: e5c5da33f982a436e103237c0c85f9031142abed
|
||||
EMASRest: 8df6f87836767a9415ad5cc4af739bc9d215b475
|
||||
@ -251,30 +251,30 @@ SPEC CHECKSUMS:
|
||||
flutter_sound: c60effa2a350fb977885f0db2fbc4c1ad5160900
|
||||
flutter_sound_core: 26c10e5832e76aaacfae252d8925232281c486ae
|
||||
flutter_voice_processor: 53afbf59ad3feb82f4a379fea9ed8dc98495210f
|
||||
fluttertoast: 31b00dabfa7fb7bacd9e7dbee580d7a2ff4bf265
|
||||
fluttertoast: fafc4fa4d01a6a9e4f772ecd190ffa525e9e2d9c
|
||||
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
|
||||
g711_flutter: 8f2769052d2cf3549f83d11e1c42d81d94441123
|
||||
google_maps_flutter_ios: d1318b4ff711612cab16862d7a87e31a7403d458
|
||||
google_maps_flutter_ios: abdac20d6ce8931f6ebc5f46616df241bfaa2cfd
|
||||
GoogleMaps: 20d7b12be49a14287f797e88e0e31bc4156aaeb4
|
||||
image_gallery_saver: cb43cc43141711190510e92c460eb1655cd343cb
|
||||
image_picker_ios: 99dfe1854b4fa34d0364e74a78448a0151025425
|
||||
image_picker_ios: 4a8aadfbb6dc30ad5141a2ce3832af9214a705b5
|
||||
ios-voice-processor: 8e32d7f980a06d392d128ef1cd19cf6ddcaca3c1
|
||||
just_audio: baa7252489dbcf47a4c7cc9ca663e9661c99aafa
|
||||
network_info_plus: 6d0c3eb8367b8164fa3fb0c19875e3f59d49697f
|
||||
package_info_plus: 6c92f08e1f853dc01228d6f553146438dafcd14e
|
||||
path_provider_foundation: 3784922295ac71e43754bd15e0653ccfd36a147c
|
||||
path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943
|
||||
permission_handler_apple: e76247795d700c14ea09e3a2d8855d41ee80a2e6
|
||||
Protobuf: d94761c33f1239c0a43a0817ca1a5f7f7c900241
|
||||
Protobuf: 6a4183ec1d51649eb2be7b86ccc286e5c539219c
|
||||
ReachabilitySwift: 985039c6f7b23a1da463388634119492ff86c825
|
||||
reactive_ble_mobile: 9ce6723d37ccf701dbffd202d487f23f5de03b4c
|
||||
shared_preferences_foundation: b4c3b4cddf1c21f02770737f147a3f5da9d39695
|
||||
shared_preferences_foundation: 5b919d13b803cadd15ed2dc053125c68730e5126
|
||||
sqflite: 31f7eba61e3074736dff8807a9b41581e4f7f15a
|
||||
SwiftProtobuf: 407a385e97fd206c4fbe880cc84123989167e0d1
|
||||
SwiftProtobuf: 69f02cd54fb03201c5e6bf8b76f687c5ef7541a3
|
||||
Toast: 91b396c56ee72a5790816f40d3a94dd357abc196
|
||||
url_launcher_ios: bbd758c6e7f9fd7b5b1d4cde34d2b95fcce5e812
|
||||
url_launcher_ios: bf5ce03e0e2088bad9cc378ea97fa0ed5b49673b
|
||||
video_player_avfoundation: 81e49bb3d9fb63dccf9fa0f6d877dc3ddbeac126
|
||||
webview_flutter_wkwebview: 4f3e50f7273d31e5500066ed267e3ae4309c5ae4
|
||||
webview_flutter_wkwebview: 2e2d318f21a5e036e2c3f26171342e95908bd60a
|
||||
|
||||
PODFILE CHECKSUM: 42aa7ffc6134b996f93caa6a9b6a2b5b580ff28a
|
||||
|
||||
COCOAPODS: 1.14.3
|
||||
COCOAPODS: 1.12.1
|
||||
|
||||
@ -6,18 +6,19 @@ import 'package:star_lock/main/lockDetail/doorLockLog/doorLockLog_page.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserList_page.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupList_page.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendReceiver/massSendReceiver_page.dart';
|
||||
import 'package:star_lock/main/lockDetail/lcokSet/addFamily/addFamily_page.dart';
|
||||
import 'package:star_lock/main/lockDetail/lcokSet/catEyeSet/catEyeCustomMode/catEyeCustomMode_page.dart';
|
||||
import 'package:star_lock/main/lockDetail/lcokSet/catEyeSet/catEyeSet/catEyeSet_page.dart';
|
||||
import 'package:star_lock/main/lockDetail/lcokSet/catEyeSet/videoSlot/videoSlot_page.dart';
|
||||
import 'package:star_lock/main/lockDetail/lcokSet/faceUnlock/faceUnlock_page.dart';
|
||||
import 'package:star_lock/main/lockDetail/lcokSet/familyDetails/familyDetails_page.dart';
|
||||
import 'package:star_lock/main/lockDetail/lcokSet/liveVideo/liveVideo_page.dart';
|
||||
import 'package:star_lock/main/lockDetail/lcokSet/lockUser/lockUser_page.dart';
|
||||
import 'package:star_lock/main/lockDetail/lcokSet/motorPower/motorPower_page.dart';
|
||||
import 'package:star_lock/main/lockDetail/lcokSet/msgNotification/msgNotification/msgNotification_page.dart';
|
||||
import 'package:star_lock/main/lockDetail/lcokSet/notificationMode/notificationMode_page.dart';
|
||||
import 'package:star_lock/main/lockDetail/lcokSet/openDoorDirection/openDoorDirection_page.dart';
|
||||
import 'package:star_lock/main/lockDetail/face/faceDetail/faceDetail_page.dart';
|
||||
import 'package:star_lock/main/lockDetail/lockSet/addFamily/addFamily_page.dart';
|
||||
import 'package:star_lock/main/lockDetail/lockSet/catEyeSet/catEyeCustomMode/catEyeCustomMode_page.dart';
|
||||
import 'package:star_lock/main/lockDetail/lockSet/catEyeSet/catEyeSet/catEyeSet_page.dart';
|
||||
import 'package:star_lock/main/lockDetail/lockSet/catEyeSet/videoSlot/videoSlot_page.dart';
|
||||
import 'package:star_lock/main/lockDetail/lockSet/faceUnlock/faceUnlock_page.dart';
|
||||
import 'package:star_lock/main/lockDetail/lockSet/familyDetails/familyDetails_page.dart';
|
||||
import 'package:star_lock/main/lockDetail/lockSet/liveVideo/liveVideo_page.dart';
|
||||
import 'package:star_lock/main/lockDetail/lockSet/lockUser/lockUser_page.dart';
|
||||
import 'package:star_lock/main/lockDetail/lockSet/motorPower/motorPower_page.dart';
|
||||
import 'package:star_lock/main/lockDetail/lockSet/msgNotification/msgNotification/msgNotification_page.dart';
|
||||
import 'package:star_lock/main/lockDetail/lockSet/notificationMode/notificationMode_page.dart';
|
||||
import 'package:star_lock/main/lockDetail/lockSet/openDoorDirection/openDoorDirection_page.dart';
|
||||
import 'package:star_lock/main/lockDetail/lockDetail/lockDetail_main_page.dart';
|
||||
import 'package:star_lock/main/lockDetail/passwordKey/passwordKeyDetailChangeDate/passwordKeyDetailChangeDate_page.dart';
|
||||
import 'package:star_lock/mine/about/webviewShow_page.dart';
|
||||
@ -40,7 +41,7 @@ import 'common/safetyVerification/safetyVerification_page.dart';
|
||||
import 'login/forgetPassword/starLock_forgetPassword_page.dart';
|
||||
import 'login/login/starLock_login_page.dart';
|
||||
import 'login/register/starLock_register_page.dart';
|
||||
import 'login/seletCountryRegion/seletCountryRegion_page.dart';
|
||||
import 'login/selectCountryRegion/selectCountryRegion_page.dart';
|
||||
import 'main/lockDetail/card/addCardType/addCardManage/addCardTypeManage_page.dart';
|
||||
import 'main/lockDetail/card/addICCard/addICCard_page.dart';
|
||||
import 'main/lockDetail/card/cardDetail/cardDetail_page.dart';
|
||||
@ -63,45 +64,45 @@ import 'main/lockDetail/face/addFace/addFace_page.dart';
|
||||
import 'main/lockDetail/face/addFaceType/addFaceTypeManage/addFaceTypeManage_page.dart';
|
||||
import 'main/lockDetail/face/faceList/faceList_page.dart';
|
||||
import 'main/lockDetail/fingerprint/addFingerprint/addFingerprint_page.dart';
|
||||
import 'main/lockDetail/fingerprint/addFingerprintSeletType/addFingerprintManage/addFingerprintTypeManage_page.dart';
|
||||
import 'main/lockDetail/fingerprint/addFingerprintSelectType/addFingerprintManage/addFingerprintTypeManage_page.dart';
|
||||
import 'main/lockDetail/fingerprint/addFingerprintTip/addFingerprintTip_page.dart';
|
||||
import 'main/lockDetail/fingerprint/fingerprintDetail/fingerprintDetail_page.dart';
|
||||
import 'main/lockDetail/fingerprint/fingerprintList/fingerprintList_page.dart';
|
||||
import 'main/lockDetail/lcokSet/automaticBlocking/automaticBlocking_page.dart';
|
||||
import 'main/lockDetail/lcokSet/basicInformation/adminOpenLockPassword/adminOpenLockPassword_page.dart';
|
||||
import 'main/lockDetail/lcokSet/basicInformation/basicInformation/basicInformation_page.dart';
|
||||
import 'main/lockDetail/lcokSet/basicInformation/editLockName/editLockName_page.dart';
|
||||
import 'main/lockDetail/lcokSet/basicInformation/lockSeletGrouping/lockSeletGrouping_page.dart';
|
||||
import 'main/lockDetail/lcokSet/basicInformation/uploadElectricQuantity/uploadElectricQuantity_page.dart';
|
||||
import 'main/lockDetail/lcokSet/burglarAlarm/burglarAlarm_page.dart';
|
||||
import 'main/lockDetail/lcokSet/catEyeSet/catEyeWorkMode/catEyeWorkMode_page.dart';
|
||||
import 'main/lockDetail/lcokSet/checkInCreatCompany/checkInCreatCompany_page.dart';
|
||||
import 'main/lockDetail/lcokSet/configuringWifi/configuringWifi_page.dart';
|
||||
import 'main/lockDetail/lcokSet/diagnose/diagnose_page.dart';
|
||||
import 'main/lockDetail/lcokSet/doorMagnetic/addDoorMagnetic/addDoorMagnetic_page.dart';
|
||||
import 'main/lockDetail/lcokSet/doorMagnetic/doorMagneticList/doorMagnetic_page.dart';
|
||||
import 'main/lockDetail/lcokSet/doorMagnetic/nearbyDoorMagnetic/nearbyDoorMagnetic_page.dart';
|
||||
import 'main/lockDetail/lcokSet/importOtherLockData/ImportOtherLockData_page.dart';
|
||||
import 'main/lockDetail/lcokSet/lockEscalation/lockEscalation_page.dart';
|
||||
import 'main/lockDetail/lcokSet/lockSet/lockSet_page.dart';
|
||||
import 'main/lockDetail/lcokSet/lockSoundSet/lockSoundSet_page.dart';
|
||||
import 'main/lockDetail/lcokSet/lockTime/lockTime_page.dart';
|
||||
import 'main/lockDetail/lcokSet/markedHouseState/markedHouseState_page.dart';
|
||||
import 'main/lockDetail/lcokSet/msgNotification/coerceOpenDoor/coerceFingerprint/coerceFingerprint_page.dart';
|
||||
import 'main/lockDetail/lcokSet/msgNotification/coerceOpenDoor/coerceFingerprintList/coerceFingerprintList_page.dart';
|
||||
import 'main/lockDetail/lcokSet/msgNotification/coerceOpenDoor/coerceOpenDoor/coerceOpenDoor_page.dart';
|
||||
import 'main/lockDetail/lcokSet/msgNotification/lowBatteryReminder/lowBatteryReminder_page.dart';
|
||||
import 'main/lockDetail/lcokSet/msgNotification/nDaysUnopened/nDaysUnopened_page.dart';
|
||||
import 'main/lockDetail/lcokSet/msgNotification/openDoorNotify/openDoorNotify_page.dart';
|
||||
import 'main/lockDetail/lcokSet/normallyOpenMode/normallyOpenMode_page.dart';
|
||||
import 'main/lockDetail/lcokSet/remoteUnlocking/remoteUnlocking_page.dart';
|
||||
import 'main/lockDetail/lcokSet/resetButton/resetButton_page.dart';
|
||||
import 'main/lockDetail/lcokSet/unlockQRCode/unlockQRCode_page.dart';
|
||||
import 'main/lockDetail/lcokSet/uploadData/uploadData_page.dart';
|
||||
import 'main/lockDetail/lcokSet/wirelessKeyboard/addWirelessKeyboard/addWirelessKeyboard_page.dart';
|
||||
import 'main/lockDetail/lcokSet/wirelessKeyboard/addWirelessKeyboardScreenNotLightOn/addWirelessKeyboardScreenNotLightOn_page.dart';
|
||||
import 'main/lockDetail/lcokSet/wirelessKeyboard/seletWirelessKeyboard/seletWirelessKeyboard_page.dart';
|
||||
import 'main/lockDetail/lcokSet/wirelessKeyboard/wirelessKeyboardList/wirelessKeyboard_page.dart';
|
||||
import 'main/lockDetail/lockSet/automaticBlocking/automaticBlocking_page.dart';
|
||||
import 'main/lockDetail/lockSet/basicInformation/adminOpenLockPassword/adminOpenLockPassword_page.dart';
|
||||
import 'main/lockDetail/lockSet/basicInformation/basicInformation/basicInformation_page.dart';
|
||||
import 'main/lockDetail/lockSet/basicInformation/editLockName/editLockName_page.dart';
|
||||
import 'main/lockDetail/lockSet/basicInformation/lockSelectGrouping/lockSelectGrouping_page.dart';
|
||||
import 'main/lockDetail/lockSet/basicInformation/uploadElectricQuantity/uploadElectricQuantity_page.dart';
|
||||
import 'main/lockDetail/lockSet/burglarAlarm/burglarAlarm_page.dart';
|
||||
import 'main/lockDetail/lockSet/catEyeSet/catEyeWorkMode/catEyeWorkMode_page.dart';
|
||||
import 'main/lockDetail/lockSet/checkInCreatCompany/checkInCreatCompany_page.dart';
|
||||
import 'main/lockDetail/lockSet/configuringWifi/configuringWifi_page.dart';
|
||||
import 'main/lockDetail/lockSet/diagnose/diagnose_page.dart';
|
||||
import 'main/lockDetail/lockSet/doorMagnetic/addDoorMagnetic/addDoorMagnetic_page.dart';
|
||||
import 'main/lockDetail/lockSet/doorMagnetic/doorMagneticList/doorMagnetic_page.dart';
|
||||
import 'main/lockDetail/lockSet/doorMagnetic/nearbyDoorMagnetic/nearbyDoorMagnetic_page.dart';
|
||||
import 'main/lockDetail/lockSet/importOtherLockData/ImportOtherLockData_page.dart';
|
||||
import 'main/lockDetail/lockSet/lockEscalation/lockEscalation_page.dart';
|
||||
import 'main/lockDetail/lockSet/lockSet/lockSet_page.dart';
|
||||
import 'main/lockDetail/lockSet/lockSoundSet/lockSoundSet_page.dart';
|
||||
import 'main/lockDetail/lockSet/lockTime/lockTime_page.dart';
|
||||
import 'main/lockDetail/lockSet/markedHouseState/markedHouseState_page.dart';
|
||||
import 'main/lockDetail/lockSet/msgNotification/coerceOpenDoor/coerceFingerprint/coerceFingerprint_page.dart';
|
||||
import 'main/lockDetail/lockSet/msgNotification/coerceOpenDoor/coerceFingerprintList/coerceFingerprintList_page.dart';
|
||||
import 'main/lockDetail/lockSet/msgNotification/coerceOpenDoor/coerceOpenDoor/coerceOpenDoor_page.dart';
|
||||
import 'main/lockDetail/lockSet/msgNotification/lowBatteryReminder/lowBatteryReminder_page.dart';
|
||||
import 'main/lockDetail/lockSet/msgNotification/nDaysUnopened/nDaysUnopened_page.dart';
|
||||
import 'main/lockDetail/lockSet/msgNotification/openDoorNotify/openDoorNotify_page.dart';
|
||||
import 'main/lockDetail/lockSet/normallyOpenMode/normallyOpenMode_page.dart';
|
||||
import 'main/lockDetail/lockSet/remoteUnlocking/remoteUnlocking_page.dart';
|
||||
import 'main/lockDetail/lockSet/resetButton/resetButton_page.dart';
|
||||
import 'main/lockDetail/lockSet/unlockQRCode/unlockQRCode_page.dart';
|
||||
import 'main/lockDetail/lockSet/uploadData/uploadData_page.dart';
|
||||
import 'main/lockDetail/lockSet/wirelessKeyboard/addWirelessKeyboard/addWirelessKeyboard_page.dart';
|
||||
import 'main/lockDetail/lockSet/wirelessKeyboard/addWirelessKeyboardScreenNotLightOn/addWirelessKeyboardScreenNotLightOn_page.dart';
|
||||
import 'main/lockDetail/lockSet/wirelessKeyboard/selectWirelessKeyboard/selectWirelessKeyboard_page.dart';
|
||||
import 'main/lockDetail/lockSet/wirelessKeyboard/wirelessKeyboardList/wirelessKeyboard_page.dart';
|
||||
import 'main/lockDetail/monitoring/monitoring/lockMonitoring_page.dart';
|
||||
import 'main/lockDetail/monitoring/monitoringRealTimeScreen/monitoringRealTimeScreen_page.dart';
|
||||
import 'main/lockDetail/realTimePicture/realTimePicture_page.dart';
|
||||
@ -131,16 +132,16 @@ import 'main/lockDetail/passwordKey/passwordKeyDetail/passwordKeyDetail_page.dar
|
||||
import 'main/lockDetail/passwordKey/passwordKeyList/passwordKeyList_page.dart';
|
||||
import 'main/lockDetail/passwordKey/passwordKeyManage/passwordKeyManage_page.dart';
|
||||
import 'main/lockMian/lockMain/lockMain_page.dart';
|
||||
import 'mine/addLock/addLockSeletCountry/addLockSeletCountry_page.dart';
|
||||
import 'mine/addLock/addLockSelectCountry/addLockSelectCountry_page.dart';
|
||||
import 'mine/addLock/lockAddress/gaode/lockAddressGaoDe_page.dart';
|
||||
import 'mine/addLock/lockAddress/lockAddress/lockAddress_page.dart';
|
||||
import 'mine/addLock/nearbyLock/nearbyLock_page.dart';
|
||||
import 'mine/addLock/saveLock/saveLock_page.dart';
|
||||
import 'mine/addLock/seletLockType/seletLockType_page.dart';
|
||||
import 'mine/addLock/selectLockType/selectLockType_page.dart';
|
||||
import 'mine/gateway/addGateway/gatewayConfigurationWifi/gatewayConfigurationWifi_page.dart';
|
||||
import 'mine/gateway/addGateway/seletGateway/seletGatewayList_page.dart';
|
||||
import 'mine/gateway/addGateway/seletGatewayType/seletGatewayType_page.dart';
|
||||
import 'mine/gateway/addGateway/seletGatewayTypeNextTip/seletGatewayTypeNextTip_page.dart';
|
||||
import 'mine/gateway/addGateway/selectGateway/selectGatewayList_page.dart';
|
||||
import 'mine/gateway/addGateway/selectGatewayType/selectGatewayType_page.dart';
|
||||
import 'mine/gateway/addGateway/selectGatewayTypeNextTip/selectGatewayTypeNextTip_page.dart';
|
||||
import 'mine/gateway/gatewayConnectionLock/gatewayConnectionLockList_page.dart';
|
||||
import 'mine/gateway/gatewayDetail/gatewayDetail_page.dart';
|
||||
import 'mine/gateway/gatewayList/gatewayList_page.dart';
|
||||
@ -183,7 +184,7 @@ abstract class Routers {
|
||||
static const initial = '/'; // 加载页
|
||||
static const starLockMain = '/StarLockMain'; // 首页
|
||||
static const starLockMinePage = '/StarLockMinePage'; // 我的
|
||||
static const seletLockTypePage = '/SeletLockTypePage'; // 选择锁类型
|
||||
static const selectLockTypePage = '/SelectLockTypePage'; // 选择锁类型
|
||||
static const LockMallPage = '/LockMallPage'; // 商城页面
|
||||
static const addLockPage = '/AddLockPage'; // 选择锁类型
|
||||
static const nearbyLockPage = '/NearbyLockPage'; // 附近的锁
|
||||
@ -230,7 +231,7 @@ abstract class Routers {
|
||||
static const uploadElectricQuantityPage =
|
||||
'/UploadElectricQuantityPage'; // 更新锁电量
|
||||
static const editLockNamePage = '/EditLockNamePage'; // 修改锁名字
|
||||
static const lockSeletGroupingPage = '/LockSeletGroupingPage'; // 锁选择分组
|
||||
static const lockSelectGroupingPage = '/LockSelectGroupingPage'; // 锁选择分组
|
||||
static const groupEditLockPage = '/GroupEditLockPage'; // 编辑锁分组里面的锁
|
||||
static const adminOpenLockPasswordPage =
|
||||
'/AdminOpenLockPasswordPage'; // 管理员开锁密码
|
||||
@ -238,8 +239,8 @@ abstract class Routers {
|
||||
static const addWirelessKeyboardPage = '/AddWirelessKeyboardPage'; // 添加蓝牙键盘
|
||||
static const addWirelessKeyboardScreenNotLightOnPage =
|
||||
'/AddWirelessKeyboardScreenNotLightOnPage'; // 添加蓝牙键盘屏幕不亮时提示
|
||||
static const seletWirelessKeyboardPage =
|
||||
'/SeletWirelessKeyboardPage'; // 选择蓝牙键盘
|
||||
static const selectWirelessKeyboardPage =
|
||||
'/SelectWirelessKeyboardPage'; // 选择蓝牙键盘
|
||||
static const doorMagneticPage = '/DoorMagneticPage'; // 门磁列表
|
||||
static const addDoorMagneticPage = '/AddDoorMagneticPage'; // 添加门磁
|
||||
static const nearbyDoorMagneticPage = '/NearbyDoorMagneticPage'; // 附近的门磁
|
||||
@ -296,17 +297,17 @@ abstract class Routers {
|
||||
static const gatewayDetailPage = '/GatewayDetailPage'; // 我的-网关详情
|
||||
static const gatewayConnectionLockPage =
|
||||
'/GatewayConnectionLockPage'; // 我的-网关网关链接的锁
|
||||
static const seletGatewayTypePage = '/SeletGatewayTypePage'; // 我的-选择网关类型
|
||||
static const seletGatewayTypeNextTipPage =
|
||||
'/SeletGatewayTypeNextTipPage'; // 我的-选择网关类型下一步
|
||||
static const seletGatewayPage = '/SeletGatewayPage'; // 我的-选择网关
|
||||
static const selectGatewayTypePage = '/SelectGatewayTypePage'; // 我的-选择网关类型
|
||||
static const selectGatewayTypeNextTipPage =
|
||||
'/SelectGatewayTypeNextTipPage'; // 我的-选择网关类型下一步
|
||||
static const selectGatewayPage = '/SelectGatewayPage'; // 我的-选择网关
|
||||
static const gatewayConfigurationWifiPage =
|
||||
'/GatewayConfigurationWifiPage'; // 我的-网关配置wifi
|
||||
|
||||
static const messageListPage = '/MessageListPage'; // 我的-消息
|
||||
static const supportStaffPage = '/SupportStaffPage'; // 我的-客服
|
||||
static const valueAddedServicesPage = '/ValueAddedServicesPage'; // 我的-增值服务
|
||||
static const abountPage = '/AbountPage'; // 我的-关于
|
||||
static const aboutPage = '/AboutPage'; // 我的-关于
|
||||
|
||||
static const valueAddedServicesNoteAndEmailDetailPage =
|
||||
'/ValueAddedServicesNoteAndEmailDetailPage'; // 增值服务-短信邮件详情
|
||||
@ -350,7 +351,7 @@ abstract class Routers {
|
||||
static const starLockRegisterPage = '/StarLockRegisterPage'; // 注册
|
||||
static const starLockForgetPasswordPage =
|
||||
'/StarLockForgetPasswordPage'; // 忘记密码
|
||||
static const seletCountryRegionPage = '/SeletCountryRegionPage'; // 选择国家和地区
|
||||
static const selectCountryRegionPage = '/SelectCountryRegionPage'; // 选择国家和地区
|
||||
static const safetyVerificationPage = '/SafetyVerificationPage'; // 安全验证
|
||||
|
||||
static const keyOperationRecordPage = '/keyOperationRecordPage'; //钥匙详情-操作记录
|
||||
@ -372,13 +373,14 @@ abstract class Routers {
|
||||
static const webviewShowPage = '/webviewShowPage'; //网页
|
||||
static const demoModeLockDetailPage = '/DemoModeLockDetailPage'; // 演示模式锁详情页
|
||||
static const demoModeLockSetPage = '/DemoModeLockSetPage'; // 演示模式锁设置页
|
||||
static const addLockSeletCountryPage = '/AddLockSeletCountryPage'; // 演示模式锁设置页
|
||||
static const addLockSelectCountryPage =
|
||||
'/AddLockSelectCountryPage'; // 演示模式锁设置页
|
||||
static const faceUnlockPage = '/faceUnlockPage'; //面容开锁设置
|
||||
static const motorPowerPage = '/motorPowerPage'; //电机功率设置
|
||||
static const openDoorDirectionPage = '/openDoorDirectionPage'; //开门方向设置
|
||||
static const catEyeWorkModePage = '/catEyeWorkModePage'; //猫眼工作模式
|
||||
static const msgNotificationPage = '/msgNotificationPage'; //消息提醒
|
||||
static const addFaceTipPage = '/addFaceTipPage'; //添加人脸
|
||||
static const addFacePage = '/addFacePage'; //添加人脸
|
||||
static const nDaysUnopenedPage = '/nDaysUnopenedPage'; //N天未开门
|
||||
static const notificationModePage = '/notificationModePage'; //提醒方式
|
||||
static const openDoorNotifyPage = '/openDoorNotifyPage'; //家人到家
|
||||
@ -411,6 +413,8 @@ abstract class Routers {
|
||||
static const fingerprintDetailPage = '/FingerprintDetailPage'; // 指纹详情
|
||||
static const faceList = '/FaceList'; // 人脸列表
|
||||
static const addFaceTypeManagePage = '/AddFaceTypeManagePage'; // 添加人脸
|
||||
static const faceDetailPage = '/faceDetailPage'; // 人脸详情
|
||||
|
||||
static const passwordKeyDetailChangeDatePage =
|
||||
'/passwordKeyDetailChangeDatePage'; //密码更改时间
|
||||
static const realTimePicturePage = '/realTimePicturePage'; //实时监控画面
|
||||
@ -435,8 +439,8 @@ abstract class AppRouters {
|
||||
page: () => const StarLockMinePage(),
|
||||
),
|
||||
GetPage(
|
||||
name: Routers.seletLockTypePage,
|
||||
page: () => const SeletLockTypePage(),
|
||||
name: Routers.selectLockTypePage,
|
||||
page: () => const SelectLockTypePage(),
|
||||
),
|
||||
GetPage(
|
||||
name: Routers.LockMallPage,
|
||||
@ -551,8 +555,8 @@ abstract class AppRouters {
|
||||
page: () => const StarLockForgetPasswordPage(),
|
||||
),
|
||||
GetPage(
|
||||
name: Routers.seletCountryRegionPage,
|
||||
page: () => const SeletCountryRegionPage(),
|
||||
name: Routers.selectCountryRegionPage,
|
||||
page: () => const SelectCountryRegionPage(),
|
||||
),
|
||||
GetPage(
|
||||
name: Routers.lockSetPage,
|
||||
@ -571,8 +575,8 @@ abstract class AppRouters {
|
||||
page: () => const EditLockNamePage(),
|
||||
),
|
||||
GetPage(
|
||||
name: Routers.lockSeletGroupingPage,
|
||||
page: () => const LockSeletGroupingPage(),
|
||||
name: Routers.lockSelectGroupingPage,
|
||||
page: () => const LockSelectGroupingPage(),
|
||||
),
|
||||
GetPage(
|
||||
name: Routers.adminOpenLockPasswordPage,
|
||||
@ -591,8 +595,8 @@ abstract class AppRouters {
|
||||
page: () => const AddWirelessKeyboardScreenNotLightOnPage(),
|
||||
),
|
||||
GetPage(
|
||||
name: Routers.seletWirelessKeyboardPage,
|
||||
page: () => const SeletWirelessKeyboardPage(),
|
||||
name: Routers.selectWirelessKeyboardPage,
|
||||
page: () => const SelectWirelessKeyboardPage(),
|
||||
),
|
||||
GetPage(
|
||||
name: Routers.doorMagneticPage,
|
||||
@ -747,8 +751,8 @@ abstract class AppRouters {
|
||||
page: () => const ValueAddedServicesListPage(),
|
||||
),
|
||||
GetPage(
|
||||
name: Routers.abountPage,
|
||||
page: () => const AbountPage(),
|
||||
name: Routers.aboutPage,
|
||||
page: () => const AboutPage(),
|
||||
),
|
||||
GetPage(
|
||||
name: Routers.gatewayDetailPage,
|
||||
@ -759,16 +763,16 @@ abstract class AppRouters {
|
||||
page: () => const GatewayConnectionLockListPage(),
|
||||
),
|
||||
GetPage(
|
||||
name: Routers.seletGatewayTypePage,
|
||||
page: () => const SeletGatewayTypePage(),
|
||||
name: Routers.selectGatewayTypePage,
|
||||
page: () => const SelectGatewayTypePage(),
|
||||
),
|
||||
GetPage(
|
||||
name: Routers.seletGatewayTypeNextTipPage,
|
||||
page: () => const SeletGatewayTypeNextTipPage(),
|
||||
name: Routers.selectGatewayTypeNextTipPage,
|
||||
page: () => const SelectGatewayTypeNextTipPage(),
|
||||
),
|
||||
GetPage(
|
||||
name: Routers.seletGatewayPage,
|
||||
page: () => const SeletGatewayListPage(),
|
||||
name: Routers.selectGatewayPage,
|
||||
page: () => const SelectGatewayListPage(),
|
||||
),
|
||||
GetPage(
|
||||
name: Routers.gatewayConfigurationWifiPage,
|
||||
@ -924,8 +928,8 @@ abstract class AppRouters {
|
||||
name: Routers.demoModeLockDetailPage,
|
||||
page: () => const DemoModeLockDetailPage()),
|
||||
GetPage(
|
||||
name: Routers.addLockSeletCountryPage,
|
||||
page: () => const AddLockSeletCountryPage()),
|
||||
name: Routers.addLockSelectCountryPage,
|
||||
page: () => const AddLockSelectCountryPage()),
|
||||
GetPage(name: Routers.faceUnlockPage, page: () => const FaceUnlockPage()),
|
||||
GetPage(name: Routers.motorPowerPage, page: () => const MotorPowerPage()),
|
||||
GetPage(
|
||||
@ -937,7 +941,7 @@ abstract class AppRouters {
|
||||
GetPage(
|
||||
name: Routers.msgNotificationPage,
|
||||
page: () => const MsgNotificationPage()),
|
||||
GetPage(name: Routers.addFaceTipPage, page: () => const AddFaceTipPage()),
|
||||
GetPage(name: Routers.addFacePage, page: () => const AddFacePage()),
|
||||
GetPage(
|
||||
name: Routers.nDaysUnopenedPage, page: () => const NDaysUnopenedPage()),
|
||||
GetPage(
|
||||
@ -1013,6 +1017,7 @@ abstract class AppRouters {
|
||||
name: Routers.catEyeCustomModePage,
|
||||
page: () => const CatEyeCustomModePage()),
|
||||
GetPage(name: Routers.videoSlotPage, page: (() => const VideoSlotPage())),
|
||||
GetPage(name: Routers.liveVideoPage, page: (() => const LiveVideoPage()))
|
||||
GetPage(name: Routers.liveVideoPage, page: (() => const LiveVideoPage())),
|
||||
GetPage(name: Routers.faceDetailPage, page: (() => const FaceDetailPage())),
|
||||
];
|
||||
}
|
||||
|
||||
153
star_lock/lib/blue/io_protocol/io_addFace.dart
Normal file
@ -0,0 +1,153 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import '../io_tool/io_tool.dart';
|
||||
import '../sm4Encipher/sm4.dart';
|
||||
import '../io_reply.dart';
|
||||
import '../io_sender.dart';
|
||||
import '../io_type.dart';
|
||||
import 'package:crypto/crypto.dart' as crypto;
|
||||
|
||||
///TODO:添加人脸
|
||||
/*
|
||||
备注:
|
||||
删除单个人脸规则:UseCountLimit 设置为 0。删除全部指纹规则: UseCountLimit 设置为 0,FingerNo 设置为 255,userId 设置为“Delete All !@#”,只有门锁管理员才有权限
|
||||
**/
|
||||
class SenderAddFaceCommand extends SenderProtocol {
|
||||
String? keyID;
|
||||
String? userID;
|
||||
int? faceNo;
|
||||
int? useCountLimit;
|
||||
List<int>? token;
|
||||
int? startTime;
|
||||
int? endTime;
|
||||
int? needAuthor;
|
||||
List<int>? publicKey;
|
||||
List<int>? privateKey;
|
||||
|
||||
SenderAddFaceCommand({
|
||||
this.keyID,
|
||||
this.userID,
|
||||
this.faceNo,
|
||||
this.useCountLimit,
|
||||
this.token,
|
||||
this.startTime,
|
||||
this.endTime,
|
||||
this.needAuthor,
|
||||
this.publicKey,
|
||||
this.privateKey,
|
||||
}) : super(CommandType.generalExtendedCommond);
|
||||
|
||||
@override
|
||||
List<int> messageDetail() {
|
||||
List<int> data = [];
|
||||
List<int> subData = [];
|
||||
List<int> ebcData = [];
|
||||
|
||||
// 指令类型
|
||||
int type = commandType!.typeValue;
|
||||
double typeDouble = type / 256;
|
||||
int type1 = typeDouble.toInt();
|
||||
int type2 = type % 256;
|
||||
data.add(type1);
|
||||
data.add(type2);
|
||||
|
||||
// 子命令类型--注册人脸开始
|
||||
data.add(81);
|
||||
|
||||
// keyID 40
|
||||
int keyIDLength = utf8.encode(keyID!).length;
|
||||
// print("${commandType!.typeValue}LockIDLength:$lockIDLength utf8.encode(lockID!)${utf8.encode(lockID!)}");
|
||||
subData.addAll(utf8.encode(keyID!));
|
||||
subData = getFixedLengthList(subData, 40 - keyIDLength);
|
||||
|
||||
//userID 20
|
||||
int userIDLength = utf8.encode(userID!).length;
|
||||
// print("${commandType!.typeValue}IDLength:$authUserIDLength utf8.encode(authUserID!)${utf8.encode(authUserID!)}");
|
||||
subData.addAll(utf8.encode(userID!));
|
||||
subData = getFixedLengthList(subData, 20 - userIDLength);
|
||||
|
||||
// PwdNo
|
||||
subData.add(faceNo!);
|
||||
|
||||
// UseCountLimit
|
||||
subData.add(useCountLimit!);
|
||||
|
||||
// token
|
||||
subData.addAll(token!);
|
||||
|
||||
// startTime 4
|
||||
subData.add((startTime! & 0xff000000) >> 24);
|
||||
subData.add((startTime! & 0xff0000) >> 16);
|
||||
subData.add((startTime! & 0xff00) >> 8);
|
||||
subData.add((startTime! & 0xff));
|
||||
|
||||
// endTime 4
|
||||
subData.add((endTime! & 0xff000000) >> 24);
|
||||
subData.add((endTime! & 0xff0000) >> 16);
|
||||
subData.add((endTime! & 0xff00) >> 8);
|
||||
subData.add((endTime! & 0xff));
|
||||
|
||||
if (needAuthor == 0) {
|
||||
//AuthCodeLen 1
|
||||
subData.add(0);
|
||||
} else {
|
||||
List<int> authCodeData = [];
|
||||
|
||||
//authUserID
|
||||
authCodeData.addAll(utf8.encode(userID!));
|
||||
|
||||
//KeyID
|
||||
authCodeData.addAll(utf8.encode(keyID!));
|
||||
|
||||
//token 4 首次请求 Token 填 0,如果锁需要鉴权操作者身份,则会分配动态口令并在应答消息中返回,二次请求时带上。
|
||||
authCodeData.addAll(token!);
|
||||
|
||||
authCodeData.addAll(publicKey!);
|
||||
|
||||
print("${commandType!.typeValue}-authCodeData:$authCodeData");
|
||||
|
||||
// 把KeyID、authUserID、时间戳、公钥通过md5加密之后就是authCode
|
||||
var authCode = crypto.md5.convert(authCodeData);
|
||||
|
||||
subData.add(authCode.bytes.length);
|
||||
subData.addAll(authCode.bytes);
|
||||
}
|
||||
|
||||
data.add(subData.length);
|
||||
data.addAll(subData);
|
||||
|
||||
if ((data.length % 16) != 0) {
|
||||
int add = (16 - data.length % 16);
|
||||
for (int i = 0; i < add; i++) {
|
||||
data.add(0);
|
||||
}
|
||||
}
|
||||
print("${commandType!.typeName} SM4Data:$data");
|
||||
// 拿到数据之后通过LockId进行SM4 ECB加密 key:544d485f633335373034383064613864
|
||||
ebcData = SM4.encrypt(data, key: privateKey, mode: SM4CryptoMode.ECB);
|
||||
return ebcData;
|
||||
}
|
||||
}
|
||||
|
||||
class SenderAddFaceReply extends Reply {
|
||||
SenderAddFaceReply.parseData(CommandType commandType, List<int> dataDetail)
|
||||
: super.parseData(commandType, dataDetail) {
|
||||
data = dataDetail;
|
||||
}
|
||||
}
|
||||
|
||||
class SenderAddFaceProcessReply extends Reply {
|
||||
SenderAddFaceProcessReply.parseData(
|
||||
CommandType commandType, List<int> dataDetail)
|
||||
: super.parseData(commandType, dataDetail) {
|
||||
data = dataDetail;
|
||||
}
|
||||
}
|
||||
|
||||
class SenderAddFaceConfirmationReply extends Reply {
|
||||
SenderAddFaceConfirmationReply.parseData(
|
||||
CommandType commandType, List<int> dataDetail)
|
||||
: super.parseData(commandType, dataDetail) {
|
||||
data = dataDetail;
|
||||
}
|
||||
}
|
||||
118
star_lock/lib/blue/io_protocol/io_queryingFaceStatus.dart
Normal file
@ -0,0 +1,118 @@
|
||||
//TODO:查询指纹状态
|
||||
import 'dart:convert';
|
||||
|
||||
import '../io_reply.dart';
|
||||
import '../io_sender.dart';
|
||||
import '../io_tool/io_tool.dart';
|
||||
import '../io_type.dart';
|
||||
import '../sm4Encipher/sm4.dart';
|
||||
import 'package:crypto/crypto.dart' as crypto;
|
||||
|
||||
class SenderQueryingFaceStatusCommand extends SenderProtocol {
|
||||
String? keyID;
|
||||
String? userID;
|
||||
int? role;
|
||||
int? fingerCount;
|
||||
int? fingerNo;
|
||||
List<int>? token;
|
||||
int? needAuthor;
|
||||
List<int>? publicKey;
|
||||
List<int>? privateKey;
|
||||
|
||||
SenderQueryingFaceStatusCommand({
|
||||
this.keyID,
|
||||
this.userID,
|
||||
this.role,
|
||||
this.fingerCount,
|
||||
this.fingerNo,
|
||||
this.token,
|
||||
this.needAuthor,
|
||||
this.publicKey,
|
||||
this.privateKey,
|
||||
}) : super(CommandType.generalExtendedCommond);
|
||||
|
||||
@override
|
||||
List<int> messageDetail() {
|
||||
List<int> data = [];
|
||||
List<int> subData = [];
|
||||
List<int> ebcData = [];
|
||||
|
||||
// 指令类型
|
||||
int type = commandType!.typeValue;
|
||||
double typeDouble = type / 256;
|
||||
int type1 = typeDouble.toInt();
|
||||
int type2 = type % 256;
|
||||
data.add(type1);
|
||||
data.add(type2);
|
||||
|
||||
// 子命令类型--查询人脸状态
|
||||
data.add(80);
|
||||
|
||||
// keyID 40
|
||||
int keyIDLength = utf8.encode(keyID!).length;
|
||||
subData.addAll(utf8.encode(keyID!));
|
||||
subData = getFixedLengthList(subData, 40 - keyIDLength);
|
||||
|
||||
//userID 20
|
||||
int userIDLength = utf8.encode(userID!).length;
|
||||
subData.addAll(utf8.encode(userID!));
|
||||
subData = getFixedLengthList(subData, 20 - userIDLength);
|
||||
|
||||
// role
|
||||
subData.add(role!);
|
||||
|
||||
// fingerCount
|
||||
subData.add(fingerCount!);
|
||||
|
||||
// FingerNo
|
||||
subData.add(fingerNo!);
|
||||
|
||||
if (needAuthor == 0) {
|
||||
//AuthCodeLen 1
|
||||
subData.add(0);
|
||||
} else {
|
||||
List<int> authCodeData = [];
|
||||
|
||||
//authUserID
|
||||
authCodeData.addAll(utf8.encode(userID!));
|
||||
|
||||
//KeyID
|
||||
authCodeData.addAll(utf8.encode(keyID!));
|
||||
|
||||
//token 4 首次请求 Token 填 0,如果锁需要鉴权操作者身份,则会分配动态口令并在应答消息中返回,二次请求时带上。
|
||||
authCodeData.addAll(token!);
|
||||
|
||||
authCodeData.addAll(publicKey!);
|
||||
|
||||
print("${commandType!.typeValue}-authCodeData:$authCodeData");
|
||||
|
||||
// 把KeyID、authUserID、时间戳、公钥通过md5加密之后就是authCode
|
||||
var authCode = crypto.md5.convert(authCodeData);
|
||||
|
||||
subData.add(authCode.bytes.length);
|
||||
subData.addAll(authCode.bytes);
|
||||
}
|
||||
|
||||
data.add(subData.length);
|
||||
data.addAll(subData);
|
||||
|
||||
if ((data.length % 16) != 0) {
|
||||
int add = (16 - data.length % 16);
|
||||
for (int i = 0; i < add; i++) {
|
||||
data.add(0);
|
||||
}
|
||||
}
|
||||
print("${commandType!.typeName} SM4Data:$data");
|
||||
// 拿到数据之后通过LockId进行SM4 ECB加密 key:544d485f633335373034383064613864
|
||||
ebcData = SM4.encrypt(data, key: privateKey, mode: SM4CryptoMode.ECB);
|
||||
return ebcData;
|
||||
}
|
||||
}
|
||||
|
||||
class SenderQueryingFaceStatusReply extends Reply {
|
||||
SenderQueryingFaceStatusReply.parseData(
|
||||
CommandType commandType, List<int> dataDetail)
|
||||
: super.parseData(commandType, dataDetail) {
|
||||
data = dataDetail;
|
||||
}
|
||||
}
|
||||
@ -1,14 +1,14 @@
|
||||
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||
import 'package:star_lock/blue/blue_manage.dart';
|
||||
import 'package:star_lock/blue/io_protocol/io_addFace.dart';
|
||||
import 'package:star_lock/blue/io_protocol/io_changeAdministratorPassword.dart';
|
||||
import 'package:star_lock/blue/io_protocol/io_deletUser.dart';
|
||||
import 'package:star_lock/blue/io_protocol/io_editUser.dart';
|
||||
import 'package:star_lock/blue/io_protocol/io_factoryDataReset.dart';
|
||||
import 'package:star_lock/blue/io_protocol/io_getLockStatu.dart';
|
||||
import 'package:star_lock/blue/io_protocol/io_queryingFaceStatus.dart';
|
||||
import 'package:star_lock/blue/io_protocol/io_readAdminPassword.dart';
|
||||
import 'package:star_lock/blue/io_protocol/io_readSupportFunctionsNoParameters.dart';
|
||||
import 'package:star_lock/blue/io_protocol/io_readSupportFunctionsWithParameters.dart';
|
||||
@ -44,29 +44,31 @@ import 'io_tool/manager_event_bus.dart';
|
||||
import 'sm4Encipher/sm4.dart';
|
||||
|
||||
class CommandReciverManager {
|
||||
|
||||
static void appDataReceive(List<int> data) async {
|
||||
///解析数据
|
||||
if(data.isEmpty){
|
||||
if (data.isEmpty) {
|
||||
return;
|
||||
}
|
||||
int dataSize = data.length;
|
||||
// 当小于包头加起来13个字节
|
||||
if(dataSize < 13){
|
||||
if (dataSize < 13) {
|
||||
return;
|
||||
}
|
||||
|
||||
print("appDataReceiveData:$data"); // &&(data[4] == 0x11)
|
||||
if((data[0] == 0xEF)&&(data[1] == 0x01)&&(data[2] == 0xEE)&&(data[3] == 0x02)){
|
||||
var tmpType = (data[7] & 0x0f);// 包标识
|
||||
print("appDataReceiveData:$data"); // &&(data[4] == 0x11)
|
||||
if ((data[0] == 0xEF) &&
|
||||
(data[1] == 0x01) &&
|
||||
(data[2] == 0xEE) &&
|
||||
(data[3] == 0x02)) {
|
||||
var tmpType = (data[7] & 0x0f); // 包标识
|
||||
// print("temType:$tmpType");
|
||||
|
||||
var dataLen = data[8] * 256 + data[9];// 高16位用来指示后面数据块内容的长度
|
||||
var oriLen = data[10] * 256 + data[11];// 低16位用来指示数据加密前的原长度
|
||||
var dataLen = data[8] * 256 + data[9]; // 高16位用来指示后面数据块内容的长度
|
||||
var oriLen = data[10] * 256 + data[11]; // 低16位用来指示数据加密前的原长度
|
||||
// print("dataLen:$dataLen oriLen:$oriLen");
|
||||
// List<int> dataList = [];
|
||||
List<int> oriDataList = [];
|
||||
switch(tmpType){
|
||||
switch (tmpType) {
|
||||
case 0: //不加密
|
||||
// for (var i = 0; i < oriLen ; i++) {
|
||||
// oriDataList.add(data[12 + i]);
|
||||
@ -84,7 +86,9 @@ class CommandReciverManager {
|
||||
|
||||
// 解密
|
||||
// String key = SM4.createHexKey(key: IoManager().getCurrentDeviceLockId);
|
||||
oriDataList = SM4.decrypt(getDataList, key: utf8.encode(BlueManage().connectDeviceName), mode: SM4CryptoMode.ECB);
|
||||
oriDataList = SM4.decrypt(getDataList,
|
||||
key: utf8.encode(BlueManage().connectDeviceName),
|
||||
mode: SM4CryptoMode.ECB);
|
||||
oriDataList = oriDataList.sublist(0, oriLen);
|
||||
// print("SM4 oriDataList:$oriDataList");
|
||||
break;
|
||||
@ -98,11 +102,11 @@ class CommandReciverManager {
|
||||
// print("getPrivateKeyList$getPrivateKeyList");
|
||||
|
||||
// 解密
|
||||
oriDataList = SM4.decrypt(getDataList, key: getPrivateKeyList, mode: SM4CryptoMode.ECB);
|
||||
oriDataList = SM4.decrypt(getDataList,
|
||||
key: getPrivateKeyList, mode: SM4CryptoMode.ECB);
|
||||
oriDataList = oriDataList.sublist(0, oriLen);
|
||||
print("SM4 oriDataList:$oriDataList");
|
||||
break;
|
||||
|
||||
}
|
||||
parseData(oriDataList).then((value) {
|
||||
EasyLoading.dismiss();
|
||||
@ -113,14 +117,14 @@ class CommandReciverManager {
|
||||
}
|
||||
|
||||
static Future<Reply?> parseData(List<int> data) async {
|
||||
if(data.isNotEmpty){
|
||||
if (data.isNotEmpty) {
|
||||
var cmd = data[0] * 256 + data[1];
|
||||
CommandType commandType = ExtensionCommandType.getCommandType(cmd);
|
||||
CommandType commandType = ExtensionCommandType.getCommandType(cmd);
|
||||
await IoManager().increaseCommandIndex();
|
||||
// data.removeRange(0, 2);
|
||||
// print("111111data cmd:$cmd commandType:$commandType data:$data");
|
||||
var reply;
|
||||
switch(commandType) {
|
||||
switch (commandType) {
|
||||
case CommandType.getLockPublicKey:
|
||||
{
|
||||
reply = GetPublicKeyReply.parseData(commandType, data);
|
||||
@ -180,17 +184,19 @@ class CommandReciverManager {
|
||||
{
|
||||
// 子命令类型
|
||||
int subType = data[3];
|
||||
switch(subType){
|
||||
switch (subType) {
|
||||
case 2:
|
||||
{
|
||||
// 修改管理员密码
|
||||
reply = ChangeAdministratorPasswordReply.parseData(commandType, data);
|
||||
reply = ChangeAdministratorPasswordReply.parseData(
|
||||
commandType, data);
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
{
|
||||
// 设置开锁密码
|
||||
reply = SenderCustomPasswordsReply.parseData(commandType, data);
|
||||
reply =
|
||||
SenderCustomPasswordsReply.parseData(commandType, data);
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
@ -202,13 +208,15 @@ class CommandReciverManager {
|
||||
case 15:
|
||||
{
|
||||
// 查询用户、指纹、密码、卡片数量(用于判断是否同步)
|
||||
reply = SenderCheckingUserInfoCountReply.parseData(commandType, data);
|
||||
reply = SenderCheckingUserInfoCountReply.parseData(
|
||||
commandType, data);
|
||||
}
|
||||
break;
|
||||
case 20:
|
||||
{
|
||||
// 查询卡片状态
|
||||
reply = SenderCheckingCardStatusReply.parseData(commandType, data);
|
||||
reply = SenderCheckingCardStatusReply.parseData(
|
||||
commandType, data);
|
||||
}
|
||||
break;
|
||||
case 21:
|
||||
@ -220,43 +228,50 @@ class CommandReciverManager {
|
||||
case 22:
|
||||
{
|
||||
// 注册卡片确认
|
||||
reply = SenderAddICCardConfirmationReply.parseData(commandType, data);
|
||||
reply = SenderAddICCardConfirmationReply.parseData(
|
||||
commandType, data);
|
||||
}
|
||||
break;
|
||||
case 30:
|
||||
{
|
||||
// 查询指纹状态
|
||||
reply = SenderQueryingFingerprintStatusReply.parseData(commandType, data);
|
||||
reply = SenderQueryingFingerprintStatusReply.parseData(
|
||||
commandType, data);
|
||||
}
|
||||
break;
|
||||
case 31:
|
||||
{
|
||||
// 注册指纹开始
|
||||
reply = SenderAddFingerprintReply.parseData(commandType, data);
|
||||
reply =
|
||||
SenderAddFingerprintReply.parseData(commandType, data);
|
||||
}
|
||||
break;
|
||||
case 32:
|
||||
{
|
||||
// 注册指纹确认
|
||||
reply = SenderAddFingerprintConfirmationReply.parseData(commandType, data);
|
||||
reply = SenderAddFingerprintConfirmationReply.parseData(
|
||||
commandType, data);
|
||||
}
|
||||
break;
|
||||
case 33:
|
||||
{
|
||||
// 注册指纹过程
|
||||
reply = SenderAddFingerprintProcessReply.parseData(commandType, data);
|
||||
reply = SenderAddFingerprintProcessReply.parseData(
|
||||
commandType, data);
|
||||
}
|
||||
break;
|
||||
case 40:
|
||||
{
|
||||
// 事件查询记录
|
||||
reply = SenderReferEventRecordNumberReply.parseData(commandType, data);
|
||||
reply = SenderReferEventRecordNumberReply.parseData(
|
||||
commandType, data);
|
||||
}
|
||||
break;
|
||||
case 41:
|
||||
{
|
||||
// 事件查询记录
|
||||
reply = SenderReferEventRecordTimeReply.parseData(commandType, data);
|
||||
reply = SenderReferEventRecordTimeReply.parseData(
|
||||
commandType, data);
|
||||
}
|
||||
break;
|
||||
// case 50:
|
||||
@ -268,55 +283,92 @@ class CommandReciverManager {
|
||||
case 51:
|
||||
{
|
||||
// wifi配网结果
|
||||
reply = SenderConfiguringWifiReply.parseData(commandType, data);
|
||||
reply =
|
||||
SenderConfiguringWifiReply.parseData(commandType, data);
|
||||
}
|
||||
break;
|
||||
case 60:
|
||||
{
|
||||
// 注册胁迫密码
|
||||
reply = SenderAddStressPasswordReply.parseData(commandType, data);
|
||||
reply =
|
||||
SenderAddStressPasswordReply.parseData(commandType, data);
|
||||
}
|
||||
break;
|
||||
case 61:
|
||||
{
|
||||
// 注册胁迫卡片
|
||||
reply = SenderAddStressICCardReply.parseData(commandType, data);
|
||||
reply =
|
||||
SenderAddStressICCardReply.parseData(commandType, data);
|
||||
}
|
||||
break;
|
||||
case 62:
|
||||
{
|
||||
// 注册胁迫指纹
|
||||
reply = SenderAddStressFingerprintReply.parseData(commandType, data);
|
||||
reply = SenderAddStressFingerprintReply.parseData(
|
||||
commandType, data);
|
||||
}
|
||||
break;
|
||||
case 70:
|
||||
{
|
||||
// 设置支持功能(不带参数)启用/禁用
|
||||
reply = SetSupportFunctionsNoParametersReply.parseData(commandType, data);
|
||||
reply = SetSupportFunctionsNoParametersReply.parseData(
|
||||
commandType, data);
|
||||
}
|
||||
break;
|
||||
case 71:
|
||||
{
|
||||
// 读取支持功能(不带参数)启用/禁用状态
|
||||
reply = ReadSupportFunctionsNoParametersReply.parseData(commandType, data);
|
||||
reply = ReadSupportFunctionsNoParametersReply.parseData(
|
||||
commandType, data);
|
||||
}
|
||||
break;
|
||||
case 72:
|
||||
{
|
||||
// 设置支持功能(带参数)
|
||||
reply = SetSupportFunctionsWithParametersReply.parseData(commandType, data);
|
||||
reply = SetSupportFunctionsWithParametersReply.parseData(
|
||||
commandType, data);
|
||||
}
|
||||
break;
|
||||
case 73:
|
||||
{
|
||||
// 读取支持功能(带参数)参数
|
||||
reply = ReadSupportFunctionsWithParametersReply.parseData(commandType, data);
|
||||
reply = ReadSupportFunctionsWithParametersReply.parseData(
|
||||
commandType, data);
|
||||
}
|
||||
break;
|
||||
case 74:
|
||||
{
|
||||
// 读取管理员密码
|
||||
reply = SenderReadAdminPasswordReply.parseData(commandType, data);
|
||||
reply =
|
||||
SenderReadAdminPasswordReply.parseData(commandType, data);
|
||||
}
|
||||
break;
|
||||
case 80:
|
||||
{
|
||||
// 查询人脸状态
|
||||
reply = SenderQueryingFaceStatusReply.parseData(
|
||||
commandType, data);
|
||||
}
|
||||
break;
|
||||
case 81:
|
||||
{
|
||||
// 注册人脸开始
|
||||
reply = SenderAddFaceReply.parseData(commandType, data);
|
||||
}
|
||||
break;
|
||||
case 82:
|
||||
{
|
||||
// 注册人脸确认
|
||||
reply = SenderAddFaceConfirmationReply.parseData(
|
||||
commandType, data);
|
||||
}
|
||||
break;
|
||||
|
||||
case 83:
|
||||
{
|
||||
// 注册人脸过程
|
||||
reply =
|
||||
SenderAddFaceProcessReply.parseData(commandType, data);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -326,5 +378,4 @@ class CommandReciverManager {
|
||||
return reply;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -90,7 +90,7 @@ class _StarLockLoginPageState extends State<StarLockLoginPage> {
|
||||
state.agree.value = !state.agree.value;
|
||||
logic.changeAgreeState();
|
||||
},
|
||||
child: Image.asset(state.agree.value ? 'images/icon_round_selet.png' : 'images/icon_round_unSelet.png', width: 30.w, height: 30.w,)
|
||||
child: Image.asset(state.agree.value ? 'images/icon_round_select.png' : 'images/icon_round_unSelect.png', width: 30.w, height: 30.w,)
|
||||
)),
|
||||
SizedBox(width: 15.w,),
|
||||
Flexible(
|
||||
|
||||
@ -41,7 +41,7 @@ class _StarLockRegisterPageState extends State<StarLockRegisterPage> {
|
||||
body: ListView(
|
||||
padding: EdgeInsets.only(top: 40.h, left: 40.w, right: 40.w),
|
||||
children: [
|
||||
topSeletCountryAndRegionWidget(),
|
||||
topSelectCountryAndRegionWidget(),
|
||||
middleTFWidget(),
|
||||
Obx(() {
|
||||
return SubmitBtn(
|
||||
@ -65,7 +65,7 @@ class _StarLockRegisterPageState extends State<StarLockRegisterPage> {
|
||||
));
|
||||
}
|
||||
|
||||
Widget topSeletCountryAndRegionWidget() {
|
||||
Widget topSelectCountryAndRegionWidget() {
|
||||
return Column(
|
||||
children: [
|
||||
SizedBox(height: 50.h),
|
||||
@ -142,7 +142,7 @@ class _StarLockRegisterPageState extends State<StarLockRegisterPage> {
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
var result = await Navigator.pushNamed(
|
||||
context, Routers.seletCountryRegionPage);
|
||||
context, Routers.selectCountryRegionPage);
|
||||
if (result != null) {
|
||||
result as Map<String, dynamic>;
|
||||
logic.state.countryCode.value = result['code'];
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:star_lock/app_settings/app_colors.dart';
|
||||
import 'package:star_lock/login/seletCountryRegion/common/countryRegionEntity.dart';
|
||||
import 'package:star_lock/login/selectCountryRegion/common/countryRegionEntity.dart';
|
||||
|
||||
class Utils {
|
||||
static String getImgPath(String name, {String format = 'png'}) {
|
||||
@ -2,7 +2,7 @@ import 'package:azlistview/azlistview.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/login/seletCountryRegion/common/countryRegionEntity.dart';
|
||||
import 'package:star_lock/login/selectCountryRegion/common/countryRegionEntity.dart';
|
||||
import 'package:star_lock/network/api_repository.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
|
||||
@ -11,14 +11,14 @@ import '../../tools/titleAppBar.dart';
|
||||
import '../../translations/trans_lib.dart';
|
||||
import 'common/index.dart';
|
||||
|
||||
class SeletCountryRegionPage extends StatefulWidget {
|
||||
const SeletCountryRegionPage({Key? key}) : super(key: key);
|
||||
class SelectCountryRegionPage extends StatefulWidget {
|
||||
const SelectCountryRegionPage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<SeletCountryRegionPage> createState() => _SeletCountryRegionPageState();
|
||||
State<SelectCountryRegionPage> createState() => _SelectCountryRegionPageState();
|
||||
}
|
||||
|
||||
class _SeletCountryRegionPageState extends State<SeletCountryRegionPage> {
|
||||
class _SelectCountryRegionPageState extends State<SelectCountryRegionPage> {
|
||||
List<CountryRegionModel> countriesList = [];
|
||||
|
||||
@override
|
||||
@ -72,7 +72,7 @@ class _SeletCountryRegionPageState extends State<SeletCountryRegionPage> {
|
||||
backgroundColor: const Color(0xFFFFFFFF),
|
||||
appBar: TitleAppBar(
|
||||
barTitle:
|
||||
"${TranslationLoader.lanKeys!.selet!.tr} ${TranslationLoader.lanKeys!.countryAndRegion!.tr}",
|
||||
"${TranslationLoader.lanKeys!.select!.tr} ${TranslationLoader.lanKeys!.countryAndRegion!.tr}",
|
||||
haveBack: true,
|
||||
backgroundColor: AppColors.mainColor,
|
||||
),
|
||||
@ -284,13 +284,13 @@ class AuthorizedAdminLogic extends BaseGetXController {
|
||||
},
|
||||
),
|
||||
CupertinoDialogAction(
|
||||
child: Text(TranslationLoader.lanKeys!.selet!.tr),
|
||||
child: Text(TranslationLoader.lanKeys!.select!.tr),
|
||||
onPressed: () async {
|
||||
//选择国家代码
|
||||
state.isCreateUser.value = true;
|
||||
Navigator.of(context).pop();
|
||||
|
||||
var result = await Get.toNamed(Routers.seletCountryRegionPage);
|
||||
var result = await Get.toNamed(Routers.selectCountryRegionPage);
|
||||
if (result != null) {
|
||||
result as Map<String, dynamic>;
|
||||
state.countryCode.value = result['code'];
|
||||
|
||||
@ -101,7 +101,7 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage> {
|
||||
),
|
||||
action: () async {
|
||||
var result = await Navigator.pushNamed(
|
||||
context, Routers.seletCountryRegionPage);
|
||||
context, Routers.selectCountryRegionPage);
|
||||
if (result != null) {
|
||||
result as Map<String, dynamic>;
|
||||
state.countryCode.value = result['code'];
|
||||
|
||||
@ -136,7 +136,7 @@ class _VolumeAuthorizationLockPageState
|
||||
),
|
||||
action: () async {
|
||||
var result = await Navigator.pushNamed(
|
||||
context, Routers.seletCountryRegionPage);
|
||||
context, Routers.selectCountryRegionPage);
|
||||
if (result != null) {
|
||||
result as Map<String, dynamic>;
|
||||
countryCode = result['code'];
|
||||
@ -203,7 +203,7 @@ class _VolumeAuthorizationLockPageState
|
||||
CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.lock!.tr,
|
||||
rightTitle: _lockIdList.isEmpty
|
||||
? TranslationLoader.lanKeys!.pleaseSelet!.tr
|
||||
? TranslationLoader.lanKeys!.pleaseSelect!.tr
|
||||
: _lockIdList.length.toString(),
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
@ -12,23 +11,29 @@ class AddCardManageTabbar extends StatefulWidget {
|
||||
var initialIndex = 1;
|
||||
var lockId = 0;
|
||||
var fromType = 0; // 1从添加钥匙列表进入 2从考勤添加员工入口进入
|
||||
var fromTypeTwoStaffName = "";// 从添加员工进入 传入员工名字
|
||||
var fromTypeTwoStaffName = ""; // 从添加员工进入 传入员工名字
|
||||
|
||||
AddCardManageTabbar(
|
||||
{Key? key, required this.initialIndex, required this.lockId, required this.fromType, required this.fromTypeTwoStaffName})
|
||||
{Key? key,
|
||||
required this.initialIndex,
|
||||
required this.lockId,
|
||||
required this.fromType,
|
||||
required this.fromTypeTwoStaffName})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
State<AddCardManageTabbar> createState() => _AddCardManageTabbarState();
|
||||
}
|
||||
|
||||
class _AddCardManageTabbarState extends State<AddCardManageTabbar> with SingleTickerProviderStateMixin {
|
||||
class _AddCardManageTabbarState extends State<AddCardManageTabbar>
|
||||
with SingleTickerProviderStateMixin {
|
||||
late TabController _tabController;
|
||||
|
||||
final List<ItemView> _itemTabs = <ItemView>[
|
||||
ItemView(title: TranslationLoader.lanKeys!.permanent!.tr, seletType: "0"),
|
||||
ItemView(title: TranslationLoader.lanKeys!.timeLimit!.tr, seletType: "1"),
|
||||
ItemView(title: TranslationLoader.lanKeys!.circulation!.tr, seletType: "2"),
|
||||
ItemView(title: TranslationLoader.lanKeys!.permanent!.tr, selectType: "0"),
|
||||
ItemView(title: TranslationLoader.lanKeys!.timeLimit!.tr, selectType: "1"),
|
||||
ItemView(
|
||||
title: TranslationLoader.lanKeys!.circulation!.tr, selectType: "2"),
|
||||
];
|
||||
|
||||
@override
|
||||
@ -41,8 +46,7 @@ class _AddCardManageTabbarState extends State<AddCardManageTabbar> with SingleTi
|
||||
length: _itemTabs.length,
|
||||
initialIndex: widget.initialIndex);
|
||||
_tabController.addListener(() {
|
||||
|
||||
if (_tabController.animation!.value==_tabController.index){
|
||||
if (_tabController.animation!.value == _tabController.index) {
|
||||
FocusScope.of(context).requestFocus(FocusNode());
|
||||
}
|
||||
});
|
||||
@ -52,17 +56,17 @@ class _AddCardManageTabbarState extends State<AddCardManageTabbar> with SingleTi
|
||||
Widget build(BuildContext context) {
|
||||
return Expanded(
|
||||
child: Column(
|
||||
children: [
|
||||
_tabBar(),
|
||||
_pageWidget(),
|
||||
],
|
||||
));
|
||||
children: [
|
||||
_tabBar(),
|
||||
_pageWidget(),
|
||||
],
|
||||
));
|
||||
}
|
||||
|
||||
TabBar _tabBar() {
|
||||
return TabBar(
|
||||
controller: _tabController,
|
||||
onTap: (index){
|
||||
onTap: (index) {
|
||||
FocusScope.of(context).requestFocus(FocusNode());
|
||||
},
|
||||
tabs: _itemTabs.map((ItemView item) => _tab(item)).toList(),
|
||||
@ -97,20 +101,21 @@ class _AddCardManageTabbarState extends State<AddCardManageTabbar> with SingleTi
|
||||
return Expanded(
|
||||
child: TabBarView(
|
||||
controller: _tabController,
|
||||
children: _itemTabs.map((ItemView item) => AddCardPage(
|
||||
seletType: item.seletType,
|
||||
lockId: widget.lockId,
|
||||
fromType: widget.fromType,
|
||||
fromTypeTwoStaffName:widget.fromTypeTwoStaffName
|
||||
)).toList(),
|
||||
children: _itemTabs
|
||||
.map((ItemView item) => AddCardPage(
|
||||
selectType: item.selectType,
|
||||
lockId: widget.lockId,
|
||||
fromType: widget.fromType,
|
||||
fromTypeTwoStaffName: widget.fromTypeTwoStaffName))
|
||||
.toList(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class ItemView {
|
||||
const ItemView({required this.title, required this.seletType});
|
||||
const ItemView({required this.title, required this.selectType});
|
||||
|
||||
final String title;
|
||||
final String seletType;
|
||||
final String selectType;
|
||||
}
|
||||
|
||||
@ -14,11 +14,11 @@ class AddCardTypeLogic extends BaseGetXController{
|
||||
var fingerprintType = 0; // 永久:1;限时2,单次3,循环:4
|
||||
var startDate = "";
|
||||
var endDate = "";
|
||||
if (state.seletType.value == "0") {
|
||||
if (state.selectType.value == "0") {
|
||||
fingerprintType = 1;
|
||||
startDate = "0";
|
||||
endDate = "0";
|
||||
} else if (state.seletType.value == "1") {
|
||||
} else if (state.selectType.value == "1") {
|
||||
fingerprintType = 2;
|
||||
if (state.beginTimeTimestamp.value.isEmpty) {
|
||||
showToast("请选择开始时间");
|
||||
@ -42,7 +42,7 @@ class AddCardTypeLogic extends BaseGetXController{
|
||||
|
||||
startDate = state.beginTimeTimestamp.value;
|
||||
endDate = state.endTimeTimestamp.value;
|
||||
} else if (state.seletType.value == "2") {
|
||||
} else if (state.selectType.value == "2") {
|
||||
if (state.effectiveDateTime.value <= 0) {
|
||||
showToast("请选择生效时间");
|
||||
return;
|
||||
@ -104,4 +104,4 @@ class AddCardTypeLogic extends BaseGetXController{
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -15,14 +15,14 @@ import '../../../../translations/trans_lib.dart';
|
||||
import 'addCardType_logic.dart';
|
||||
|
||||
class AddCardPage extends StatefulWidget {
|
||||
final String seletType; // 永久限时循环下标
|
||||
final String selectType; // 永久限时循环下标
|
||||
final int lockId;
|
||||
final int fromType; // // 1从添加钥匙列表进入 2从考勤添加员工入口进入
|
||||
final String fromTypeTwoStaffName; // 从添加员工进入 传入员工名字
|
||||
|
||||
const AddCardPage(
|
||||
{Key? key,
|
||||
required this.seletType,
|
||||
required this.selectType,
|
||||
required this.lockId,
|
||||
required this.fromType,
|
||||
required this.fromTypeTwoStaffName})
|
||||
@ -38,7 +38,7 @@ class _AddCardPageState extends State<AddCardPage> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
state.seletType.value = widget.seletType;
|
||||
state.selectType.value = widget.selectType;
|
||||
state.lockId.value = widget.lockId;
|
||||
// state.nameController.text = widget.fromTypeTwoStaffName;
|
||||
|
||||
@ -49,7 +49,7 @@ class _AddCardPageState extends State<AddCardPage> {
|
||||
}
|
||||
|
||||
Widget indexChangeWidget() {
|
||||
switch (int.parse(widget.seletType)) {
|
||||
switch (int.parse(widget.selectType)) {
|
||||
case 0:
|
||||
{
|
||||
// 永久
|
||||
@ -193,7 +193,7 @@ class _AddCardPageState extends State<AddCardPage> {
|
||||
onClick: () async {
|
||||
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||
if (isDemoMode == false) {
|
||||
// print("state.seletType:${state.seletType.value}");
|
||||
// print("state.selectType:${state.selectType.value}");
|
||||
if (state.nameController.text.isEmpty) {
|
||||
logic.showToast("请输入姓名");
|
||||
return;
|
||||
@ -201,7 +201,7 @@ class _AddCardPageState extends State<AddCardPage> {
|
||||
|
||||
logic.checkCardNameDuplicated(state.nameController.text);
|
||||
} else {
|
||||
// Get.toNamed(Routers.seletLockTypePage);
|
||||
// Get.toNamed(Routers.selectLockTypePage);
|
||||
logic.showToast("演示模式");
|
||||
}
|
||||
}),
|
||||
|
||||
@ -5,7 +5,7 @@ import 'package:get/get.dart';
|
||||
class AddCardTypeState{
|
||||
|
||||
final lockId = 0.obs;
|
||||
final seletType = "0".obs;// 0永久 1显示 2循环
|
||||
final selectType = "0".obs;// 0永久 1显示 2循环
|
||||
final fromType = 1.obs; // // 1从添加钥匙列表进入 2从考勤添加员工入口进入
|
||||
final isStressFingerprint = false.obs;
|
||||
|
||||
@ -24,4 +24,4 @@ class AddCardTypeState{
|
||||
// lockId.value = map["lockId"];
|
||||
// fromType.value = map["fromType"];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -50,7 +50,7 @@ class _CardListPageState extends State<CardListPage> with RouteAware {
|
||||
if (isDemoMode == false) {
|
||||
showDeletAlertDialog(context);
|
||||
} else {
|
||||
// Get.toNamed(Routers.seletLockTypePage);
|
||||
// Get.toNamed(Routers.selectLockTypePage);
|
||||
logic.showToast("演示模式");
|
||||
}
|
||||
},
|
||||
|
||||
@ -51,7 +51,7 @@ class _CheckingInAddHolidaysPageState extends State<CheckingInAddHolidaysPage> {
|
||||
builder: (context) {
|
||||
return ShowCalendar(
|
||||
datePickerMode: DatePickerMode.day,
|
||||
seletAction: (dateTime) {
|
||||
selectAction: (dateTime) {
|
||||
String beginDate = formatDate(dateTime, [yyyy,'-',mm,'-',dd]);
|
||||
state.beginDate.value = beginDate;
|
||||
Get.back();
|
||||
@ -70,7 +70,7 @@ class _CheckingInAddHolidaysPageState extends State<CheckingInAddHolidaysPage> {
|
||||
builder: (context) {
|
||||
return ShowCalendar(
|
||||
datePickerMode: DatePickerMode.day,
|
||||
seletAction: (dateTime) {
|
||||
selectAction: (dateTime) {
|
||||
String endDate = formatDate(dateTime, [yyyy,'-',mm,'-',dd]);
|
||||
state.endDate.value = endDate;
|
||||
Get.back();
|
||||
@ -88,7 +88,7 @@ class _CheckingInAddHolidaysPageState extends State<CheckingInAddHolidaysPage> {
|
||||
builder: (context) {
|
||||
return ShowCalendar(
|
||||
datePickerMode: DatePickerMode.day,
|
||||
seletAction: (dateTime) {
|
||||
selectAction: (dateTime) {
|
||||
String makeUpWorkDate = formatDate(dateTime, [yyyy,'-',mm,'-',dd]);
|
||||
state.makeUpWorkDate.value = makeUpWorkDate;
|
||||
Get.back();
|
||||
@ -147,7 +147,7 @@ class _CheckingInAddHolidaysPageState extends State<CheckingInAddHolidaysPage> {
|
||||
child: Row(
|
||||
children: [
|
||||
Image.asset(
|
||||
'images/icon_round_unSelet.png',
|
||||
'images/icon_round_unSelect.png',
|
||||
width: 40.w,
|
||||
height: 40.w,
|
||||
),
|
||||
|
||||
@ -12,7 +12,7 @@ class CheckingInSetHolidaysLogic extends BaseGetXController{
|
||||
void editStaffLoadData() async{
|
||||
var entity = await ApiRepository.to.holidaysListData(
|
||||
companyId: state.companyId.value,
|
||||
vacationYear: state.seletYear.value.toString(),
|
||||
vacationYear: state.selectYear.value.toString(),
|
||||
);
|
||||
if(entity.errorCode!.codeIsSuccessful){
|
||||
state.holidaysListData.value = entity.data!.holidayList!;
|
||||
@ -42,4 +42,4 @@ class CheckingInSetHolidaysLogic extends BaseGetXController{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -205,7 +205,7 @@ class _CheckingInSetHolidaysPageState extends State<CheckingInSetHolidaysPage> {
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
"${state.seletYear.value}${TranslationLoader.lanKeys!.year!.tr}",
|
||||
"${state.selectYear.value}${TranslationLoader.lanKeys!.year!.tr}",
|
||||
style: TextStyle(color: Colors.white, fontSize: 26.sp),
|
||||
),
|
||||
SizedBox(
|
||||
@ -259,7 +259,7 @@ class _CheckingInSetHolidaysPageState extends State<CheckingInSetHolidaysPage> {
|
||||
minDate: PDuration(year: 1900),
|
||||
maxDate: PDuration(year: 2100),
|
||||
onConfirm: (p) {
|
||||
state.seletYear.value = p.year!;
|
||||
state.selectYear.value = p.year!;
|
||||
logic.editStaffLoadData();
|
||||
print("longer >>> 返回数据:${p.year}");
|
||||
},
|
||||
|
||||
@ -7,7 +7,7 @@ import 'checkingInSetHolidays_entity.dart';
|
||||
class CheckingInSetHolidaysState{
|
||||
final companyId = "".obs;
|
||||
final mouth = "".obs;
|
||||
final seletYear = DateTime.now().year.obs;
|
||||
final selectYear = DateTime.now().year.obs;
|
||||
final holidaysListData = <HolidaysMonthListData>[].obs;
|
||||
|
||||
CheckingInSetHolidaysState() {
|
||||
@ -15,4 +15,4 @@ class CheckingInSetHolidaysState{
|
||||
companyId.value = map["companyId"];
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -44,7 +44,7 @@ class _CheckingInListPageState extends State<CheckingInListPage> {
|
||||
"getKeyInfosData": state.getKeyInfosData.value,
|
||||
});
|
||||
}else{
|
||||
// Get.toNamed(Routers.seletLockTypePage);
|
||||
// Get.toNamed(Routers.selectLockTypePage);
|
||||
logic.showToast("演示模式");
|
||||
}
|
||||
},
|
||||
@ -104,7 +104,7 @@ class _CheckingInListPageState extends State<CheckingInListPage> {
|
||||
logic.loadDataByType();
|
||||
});
|
||||
}else{
|
||||
// Get.toNamed(Routers.seletLockTypePage);
|
||||
// Get.toNamed(Routers.selectLockTypePage);
|
||||
logic.showToast("演示模式");
|
||||
}
|
||||
},
|
||||
@ -141,7 +141,7 @@ class _CheckingInListPageState extends State<CheckingInListPage> {
|
||||
logic.loadDataByType();
|
||||
});
|
||||
}else{
|
||||
// Get.toNamed(Routers.seletLockTypePage);
|
||||
// Get.toNamed(Routers.selectLockTypePage);
|
||||
logic.showToast("演示模式");
|
||||
}
|
||||
},
|
||||
@ -171,7 +171,7 @@ class _CheckingInListPageState extends State<CheckingInListPage> {
|
||||
builder: (context) {
|
||||
return ShowCalendar(
|
||||
datePickerMode: DatePickerMode.day,
|
||||
seletAction: (dateTime) {
|
||||
selectAction: (dateTime) {
|
||||
setState(() {
|
||||
state.checkListDateTimestamp.value = dateTime.millisecondsSinceEpoch;
|
||||
String beginDate = formatDate(dateTime, state.isDay.value ? [mm,'-',dd] : [mm]);
|
||||
@ -182,7 +182,7 @@ class _CheckingInListPageState extends State<CheckingInListPage> {
|
||||
});
|
||||
});
|
||||
}else{
|
||||
// Get.toNamed(Routers.seletLockTypePage);
|
||||
// Get.toNamed(Routers.selectLockTypePage);
|
||||
logic.showToast("演示模式");
|
||||
}
|
||||
},
|
||||
@ -343,7 +343,7 @@ class _CheckingInListPageState extends State<CheckingInListPage> {
|
||||
if(isDemoMode == false){
|
||||
showListType();
|
||||
}else{
|
||||
// Get.toNamed(Routers.seletLockTypePage);
|
||||
// Get.toNamed(Routers.selectLockTypePage);
|
||||
logic.showToast("演示模式");
|
||||
}
|
||||
},
|
||||
|
||||
@ -33,8 +33,8 @@ class _CheckingInSetWorkdaySetState extends State<CheckingInSetWorkdaySet> {
|
||||
body: ListView(
|
||||
children: [
|
||||
topBtnWidget(),
|
||||
Obx(() => Visibility(visible: state.isCustom.value, child: bottomCustomSeletBtn())),
|
||||
Obx(() => Visibility(visible: !state.isCustom.value, child: bottomOddOrEvenDaysOffSeletBtn())),
|
||||
Obx(() => Visibility(visible: state.isCustom.value, child: bottomCustomSelectBtn())),
|
||||
Obx(() => Visibility(visible: !state.isCustom.value, child: bottomOddOrEvenDaysOffSelectBtn())),
|
||||
SizedBox(height: 50.h,),
|
||||
Container(
|
||||
margin: EdgeInsets.only(left: 20.w, right: 20.w),
|
||||
@ -113,7 +113,7 @@ class _CheckingInSetWorkdaySetState extends State<CheckingInSetWorkdaySet> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget bottomOddOrEvenDaysOffSeletBtn() {
|
||||
Widget bottomOddOrEvenDaysOffSelectBtn() {
|
||||
return Container(
|
||||
padding: EdgeInsets.only(left: 10.w, right: 10.w),
|
||||
child: Column(
|
||||
@ -138,7 +138,7 @@ class _CheckingInSetWorkdaySetState extends State<CheckingInSetWorkdaySet> {
|
||||
},
|
||||
child: Row(
|
||||
children: [
|
||||
Image.asset(state.isSingledayWeekend.value == 0 ? 'images/icon_round_selet.png' : 'images/icon_round_unSelet.png', width: 30.w, height: 30.w,),
|
||||
Image.asset(state.isSingledayWeekend.value == 0 ? 'images/icon_round_select.png' : 'images/icon_round_unSelect.png', width: 30.w, height: 30.w,),
|
||||
],
|
||||
),
|
||||
)
|
||||
@ -158,7 +158,7 @@ class _CheckingInSetWorkdaySetState extends State<CheckingInSetWorkdaySet> {
|
||||
},
|
||||
child: Row(
|
||||
children: [
|
||||
Image.asset(state.isSingledayWeekend.value == 1 ? 'images/icon_round_selet.png' : 'images/icon_round_unSelet.png', width: 30.w, height: 30.w,),
|
||||
Image.asset(state.isSingledayWeekend.value == 1 ? 'images/icon_round_select.png' : 'images/icon_round_unSelect.png', width: 30.w, height: 30.w,),
|
||||
],
|
||||
),
|
||||
)
|
||||
@ -168,7 +168,7 @@ class _CheckingInSetWorkdaySetState extends State<CheckingInSetWorkdaySet> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget bottomCustomSeletBtn() {
|
||||
Widget bottomCustomSelectBtn() {
|
||||
return Container(
|
||||
padding: EdgeInsets.only(left: 10.w, right: 10.w),
|
||||
height: 420.h,
|
||||
@ -224,7 +224,7 @@ class _CheckingInSetWorkdaySetState extends State<CheckingInSetWorkdaySet> {
|
||||
},
|
||||
child: Obx(() => Row(
|
||||
children: [
|
||||
Image.asset(state.weekDays.value.contains(index) ? 'images/icon_round_selet.png' : 'images/icon_round_unSelet.png', width: 30.w, height: 30.w,),
|
||||
Image.asset(state.weekDays.value.contains(index) ? 'images/icon_round_select.png' : 'images/icon_round_unSelect.png', width: 30.w, height: 30.w,),
|
||||
],
|
||||
)))
|
||||
);
|
||||
|
||||
@ -1,14 +1,14 @@
|
||||
|
||||
class CheckingInAddStaffSeletKeyEntity {
|
||||
class CheckingInAddStaffSelectKeyEntity {
|
||||
int? errorCode;
|
||||
String? description;
|
||||
String? errorMsg;
|
||||
List<CheckingInAddStaffKeyEntity>? data;
|
||||
|
||||
CheckingInAddStaffSeletKeyEntity(
|
||||
CheckingInAddStaffSelectKeyEntity(
|
||||
{this.errorCode, this.description, this.errorMsg, this.data});
|
||||
|
||||
CheckingInAddStaffSeletKeyEntity.fromJson(Map<String, dynamic> json) {
|
||||
CheckingInAddStaffSelectKeyEntity.fromJson(Map<String, dynamic> json) {
|
||||
errorCode = json['errorCode'];
|
||||
description = json['description'];
|
||||
errorMsg = json['errorMsg'];
|
||||
@ -49,4 +49,4 @@ class CheckingInAddStaffKeyEntity {
|
||||
data['staffName'] = staffName;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -4,10 +4,10 @@ import 'package:get/get.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
import '../../../../../network/api_repository.dart';
|
||||
import '../../../../../tools/eventBusEventManage.dart';
|
||||
import 'checkingInAddStaffSeletKey_entity.dart';
|
||||
import 'checkingInAddStaffSelectKey_entity.dart';
|
||||
import 'checkingInAddStaff_state.dart';
|
||||
|
||||
typedef KeyClickCallback = void Function(List<CheckingInAddStaffKeyEntity> seletKeyList);
|
||||
typedef KeyClickCallback = void Function(List<CheckingInAddStaffKeyEntity> selectKeyList);
|
||||
class CheckingInAddStaffLogic extends BaseGetXController{
|
||||
CheckingInAddStaffState state = CheckingInAddStaffState();
|
||||
|
||||
@ -25,7 +25,7 @@ class CheckingInAddStaffLogic extends BaseGetXController{
|
||||
void addStaffLoadData() async{
|
||||
var attendanceWay = "";
|
||||
var usernameType = "1";
|
||||
switch(int.parse(state.seletPrintingMethodType.value)){
|
||||
switch(int.parse(state.selectPrintingMethodType.value)){
|
||||
case 1:
|
||||
// 打卡方式APP
|
||||
if(state.appUnHaveAccount.value){
|
||||
@ -41,7 +41,7 @@ class CheckingInAddStaffLogic extends BaseGetXController{
|
||||
return;
|
||||
}
|
||||
}else {
|
||||
attendanceWay = state.seletKey.value;
|
||||
attendanceWay = state.selectKey.value;
|
||||
|
||||
if(attendanceWay.isEmpty){
|
||||
showToast("请选择员工钥匙");
|
||||
@ -62,7 +62,7 @@ class CheckingInAddStaffLogic extends BaseGetXController{
|
||||
}
|
||||
|
||||
var entity = await ApiRepository.to.addStaffData(
|
||||
attendanceType: state.seletPrintingMethodType.value,
|
||||
attendanceType: state.selectPrintingMethodType.value,
|
||||
attendanceWay: attendanceWay,
|
||||
companyId: state.companyId.value,
|
||||
have: state.appUnHaveAccount.value ? "2" : "1",
|
||||
@ -78,10 +78,10 @@ class CheckingInAddStaffLogic extends BaseGetXController{
|
||||
}
|
||||
|
||||
// 考勤设置添加员工-选择钥匙 1为APP,2为密码,3为卡,4为指纹,返回数据中,attendanceWay分别为用户名、密码、卡号、指纹号
|
||||
void addStaffSeletKey(KeyClickCallback kyClickCallback) async{
|
||||
var entity = await ApiRepository.to.addStaffSeletKeyData(
|
||||
void addStaffSelectKey(KeyClickCallback kyClickCallback) async{
|
||||
var entity = await ApiRepository.to.addStaffSelectKeyData(
|
||||
companyId: state.companyId.value,
|
||||
type:state.seletPrintingMethodType.value,
|
||||
type:state.selectPrintingMethodType.value,
|
||||
);
|
||||
if(entity.errorCode!.codeIsSuccessful){
|
||||
state.keyEntity.value = entity.data!;
|
||||
@ -93,7 +93,7 @@ class CheckingInAddStaffLogic extends BaseGetXController{
|
||||
void editStaffLoadData() async{
|
||||
var attendanceWay = "";
|
||||
var usernameType = "1";
|
||||
switch(int.parse(state.seletPrintingMethodType.value)){
|
||||
switch(int.parse(state.selectPrintingMethodType.value)){
|
||||
case 1:
|
||||
// 打卡方式APP
|
||||
if(state.appUnHaveAccount.value){
|
||||
@ -109,7 +109,7 @@ class CheckingInAddStaffLogic extends BaseGetXController{
|
||||
return;
|
||||
}
|
||||
}else {
|
||||
attendanceWay = state.seletKey.value;
|
||||
attendanceWay = state.selectKey.value;
|
||||
|
||||
if(attendanceWay.isEmpty){
|
||||
showToast("请选择员工钥匙");
|
||||
@ -130,7 +130,7 @@ class CheckingInAddStaffLogic extends BaseGetXController{
|
||||
}
|
||||
|
||||
var entity = await ApiRepository.to.editStaffData(
|
||||
attendanceType: state.seletPrintingMethodType.value,
|
||||
attendanceType: state.selectPrintingMethodType.value,
|
||||
attendanceWay: attendanceWay,
|
||||
staffId: state.staffListItemData.value.staffId.toString(),
|
||||
have: state.appUnHaveAccount.value ? "2" : "1",
|
||||
@ -212,4 +212,4 @@ class CheckingInAddStaffLogic extends BaseGetXController{
|
||||
_getNumberEvent!.cancel();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -44,12 +44,12 @@ class _CheckingInAddStaffPageState extends State<CheckingInAddStaffPage> {
|
||||
state.staffNameController)),
|
||||
Obx(() => CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.punchingMode!.tr,
|
||||
rightTitle: state.seletPrintingMethodStr.value,
|
||||
rightTitle: state.selectPrintingMethodStr.value,
|
||||
isHaveLine: false,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
var list = ["APP", "密码", "卡", "指纹"];
|
||||
_showSeletClockInType(list, "1");
|
||||
_showSelectClockInType(list, "1");
|
||||
})),
|
||||
SizedBox(
|
||||
height: 10.h,
|
||||
@ -82,7 +82,7 @@ class _CheckingInAddStaffPageState extends State<CheckingInAddStaffPage> {
|
||||
// 当选择App时显示 其他隐藏
|
||||
Obx(() => Visibility(
|
||||
visible: (state.appUnHaveAccount.value &&
|
||||
state.seletPrintingMethodType.value == "1")
|
||||
state.selectPrintingMethodType.value == "1")
|
||||
? true
|
||||
: false,
|
||||
child: Column(
|
||||
@ -111,7 +111,7 @@ class _CheckingInAddStaffPageState extends State<CheckingInAddStaffPage> {
|
||||
),
|
||||
action: () async {
|
||||
var result = await Navigator.pushNamed(
|
||||
context, Routers.seletCountryRegionPage);
|
||||
context, Routers.selectCountryRegionPage);
|
||||
if (result != null) {
|
||||
result as Map<String, dynamic>;
|
||||
state.countryCode.value = result['code'];
|
||||
@ -125,7 +125,7 @@ class _CheckingInAddStaffPageState extends State<CheckingInAddStaffPage> {
|
||||
)),
|
||||
// 当选择密码、卡、指纹时显示
|
||||
Obx(() => Visibility(
|
||||
visible: (state.seletPrintingMethodType.value != "1" && state.appUnHaveAccount.value)
|
||||
visible: (state.selectPrintingMethodType.value != "1" && state.appUnHaveAccount.value)
|
||||
? true
|
||||
: false,
|
||||
child: CommonItem(
|
||||
@ -143,12 +143,12 @@ class _CheckingInAddStaffPageState extends State<CheckingInAddStaffPage> {
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: AppColors.mainColor,
|
||||
),
|
||||
child: Text(addStaffSeletKeyType(),
|
||||
child: Text(addStaffSelectKeyType(),
|
||||
style: TextStyle(
|
||||
color: Colors.white, fontSize: 22.sp)),
|
||||
onPressed: () async {
|
||||
switch (int.parse(
|
||||
state.seletPrintingMethodType.value)) {
|
||||
state.selectPrintingMethodType.value)) {
|
||||
case 2:
|
||||
// 获取密码
|
||||
logic.getKeyboardPwdRequest();
|
||||
@ -206,16 +206,16 @@ class _CheckingInAddStaffPageState extends State<CheckingInAddStaffPage> {
|
||||
visible: !state.appUnHaveAccount.value,
|
||||
child: CommonItem(
|
||||
leftTitel: addStaffGetKeyType(),
|
||||
rightTitle: state.seletKey.value,
|
||||
rightTitle: state.selectKey.value,
|
||||
isHaveLine: false,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
logic.addStaffSeletKey((v) {
|
||||
logic.addStaffSelectKey((v) {
|
||||
var list = [];
|
||||
for (var element in v) {
|
||||
list.add(element.attendanceWay);
|
||||
}
|
||||
_showSeletClockInType(list, "2");
|
||||
_showSelectClockInType(list, "2");
|
||||
});
|
||||
}),
|
||||
)),
|
||||
@ -280,7 +280,7 @@ class _CheckingInAddStaffPageState extends State<CheckingInAddStaffPage> {
|
||||
}
|
||||
|
||||
// type 1 打卡方式 2选择钥匙
|
||||
void _showSeletClockInType(List list, String type) {
|
||||
void _showSelectClockInType(List list, String type) {
|
||||
ShowBottomSheetTool().showSingleRowPicker(
|
||||
//上下文
|
||||
context,
|
||||
@ -297,14 +297,14 @@ class _CheckingInAddStaffPageState extends State<CheckingInAddStaffPage> {
|
||||
clickCallBack: (int index, var str) {
|
||||
setState(() {
|
||||
if (type == "1") {
|
||||
state.seletPrintingMethodType.value = (index + 1).toString();
|
||||
state.seletPrintingMethodStr.value = str.toString();
|
||||
state.selectPrintingMethodType.value = (index + 1).toString();
|
||||
state.selectPrintingMethodStr.value = str.toString();
|
||||
state.getDataPassword.value = "";
|
||||
} else {
|
||||
state.seletKey.value = str.toString();
|
||||
state.selectKey.value = str.toString();
|
||||
}
|
||||
print(
|
||||
"object:$index str:$str type:$type state.seletPrintingMethodType.value:${state.seletPrintingMethodType.value}");
|
||||
"object:$index str:$str type:$type state.selectPrintingMethodType.value:${state.selectPrintingMethodType.value}");
|
||||
});
|
||||
});
|
||||
}
|
||||
@ -317,8 +317,8 @@ class _CheckingInAddStaffPageState extends State<CheckingInAddStaffPage> {
|
||||
children: [
|
||||
Image.asset(
|
||||
appUnHaveAccount
|
||||
? 'images/icon_round_selet.png'
|
||||
: 'images/icon_round_unSelet.png',
|
||||
? 'images/icon_round_select.png'
|
||||
: 'images/icon_round_unSelect.png',
|
||||
width: 26.w,
|
||||
height: 26.w,
|
||||
),
|
||||
@ -338,7 +338,7 @@ class _CheckingInAddStaffPageState extends State<CheckingInAddStaffPage> {
|
||||
|
||||
String addStaffGetIfHaveKey() {
|
||||
String title = "";
|
||||
switch (int.parse(state.seletPrintingMethodType.value)) {
|
||||
switch (int.parse(state.selectPrintingMethodType.value)) {
|
||||
case 1:
|
||||
title = TranslationLoader.lanKeys!.whetherTheEmployeeHasAKey!.tr;
|
||||
break;
|
||||
@ -357,7 +357,7 @@ class _CheckingInAddStaffPageState extends State<CheckingInAddStaffPage> {
|
||||
|
||||
String addStaffGetKeyType() {
|
||||
String title = "";
|
||||
switch (int.parse(state.seletPrintingMethodType.value)) {
|
||||
switch (int.parse(state.selectPrintingMethodType.value)) {
|
||||
case 1:
|
||||
title = TranslationLoader.lanKeys!.accountNumber!.tr;
|
||||
break;
|
||||
@ -374,9 +374,9 @@ class _CheckingInAddStaffPageState extends State<CheckingInAddStaffPage> {
|
||||
return title;
|
||||
}
|
||||
|
||||
String addStaffSeletKeyType() {
|
||||
String addStaffSelectKeyType() {
|
||||
String title = "";
|
||||
switch (int.parse(state.seletPrintingMethodType.value)) {
|
||||
switch (int.parse(state.selectPrintingMethodType.value)) {
|
||||
case 1:
|
||||
title = TranslationLoader.lanKeys!.getKey!.tr;
|
||||
break;
|
||||
|
||||
@ -4,7 +4,7 @@ import 'package:get/get.dart';
|
||||
|
||||
import '../../../../lockMian/entity/lockListInfo_entity.dart';
|
||||
import '../checkingInSetStaffList/checkingInStaffList_entity.dart';
|
||||
import 'checkingInAddStaffSeletKey_entity.dart';
|
||||
import 'checkingInAddStaffSelectKey_entity.dart';
|
||||
|
||||
class CheckingInAddStaffState{
|
||||
final getKeyInfosData = LockListInfoItemEntity().obs;
|
||||
@ -14,15 +14,15 @@ class CheckingInAddStaffState{
|
||||
final TextEditingController staffNameController = TextEditingController();
|
||||
final TextEditingController staffAccountController = TextEditingController();
|
||||
|
||||
final seletPrintingMethodType = "1".obs;// 选择打卡类型
|
||||
final seletPrintingMethodStr = "APP".obs;// 选择打卡类型字符串
|
||||
final selectPrintingMethodType = "1".obs;// 选择打卡类型
|
||||
final selectPrintingMethodStr = "APP".obs;// 选择打卡类型字符串
|
||||
|
||||
final countryName = "中国".obs;
|
||||
final countryCode = "86".obs;
|
||||
|
||||
final appUnHaveAccount = true.obs;// 默认没有账号
|
||||
final keyEntity = <CheckingInAddStaffKeyEntity>[].obs;// 选择钥匙数据
|
||||
final seletKey = "".obs;
|
||||
final selectKey = "".obs;
|
||||
|
||||
final isAdd = "1".obs; // 1添加 2编辑
|
||||
final getDataPassword = "".obs;
|
||||
@ -37,29 +37,29 @@ class CheckingInAddStaffState{
|
||||
staffListItemData.value = map["staffListItem"];
|
||||
staffNameController.text = staffListItemData.value.staffName!;
|
||||
|
||||
seletPrintingMethodType.value = staffListItemData.value.attendanceType.toString();
|
||||
selectPrintingMethodType.value = staffListItemData.value.attendanceType.toString();
|
||||
switch(staffListItemData.value.attendanceType){
|
||||
case 1:
|
||||
seletPrintingMethodStr.value = "APP";
|
||||
selectPrintingMethodStr.value = "APP";
|
||||
break;
|
||||
case 2:
|
||||
seletPrintingMethodStr.value = "密码";
|
||||
selectPrintingMethodStr.value = "密码";
|
||||
break;
|
||||
case 3:
|
||||
seletPrintingMethodStr.value = "卡";
|
||||
selectPrintingMethodStr.value = "卡";
|
||||
break;
|
||||
case 4:
|
||||
seletPrintingMethodStr.value = "指纹";
|
||||
selectPrintingMethodStr.value = "指纹";
|
||||
break;
|
||||
}
|
||||
|
||||
if(staffListItemData.value.attendanceWay!.isNotEmpty){
|
||||
appUnHaveAccount.value = false;
|
||||
seletKey.value = staffListItemData.value.attendanceWay!;
|
||||
selectKey.value = staffListItemData.value.attendanceWay!;
|
||||
}else{
|
||||
appUnHaveAccount.value = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -47,7 +47,7 @@ class _DoorLockLogPageState extends State<DoorLockLogPage> {
|
||||
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||
if (isDemoMode == false) {
|
||||
} else {
|
||||
// Get.toNamed(Routers.seletLockTypePage);
|
||||
// Get.toNamed(Routers.selectLockTypePage);
|
||||
logic.showToast("演示模式");
|
||||
}
|
||||
},
|
||||
|
||||
@ -248,7 +248,7 @@ class _MassSendElectronicKeyPageState extends State<MassSendElectronicKeyPage> {
|
||||
),
|
||||
action: () async {
|
||||
var result = await Navigator.pushNamed(
|
||||
context, Routers.seletCountryRegionPage);
|
||||
context, Routers.selectCountryRegionPage);
|
||||
if (result != null) {
|
||||
result as Map<String, dynamic>;
|
||||
countryCode = result['code'];
|
||||
@ -260,7 +260,7 @@ class _MassSendElectronicKeyPageState extends State<MassSendElectronicKeyPage> {
|
||||
CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.lock!.tr,
|
||||
rightTitle: _lockIdList.isEmpty
|
||||
? TranslationLoader.lanKeys!.pleaseSelet!.tr
|
||||
? TranslationLoader.lanKeys!.pleaseSelect!.tr
|
||||
: _lockIdList.length.toString(),
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
|
||||
@ -201,8 +201,8 @@ class _LockUserListPageState extends State<LockUserListPage> {
|
||||
},
|
||||
child: Image.asset(
|
||||
itemData.isCheck!
|
||||
? 'images/icon_round_selet.png'
|
||||
: 'images/icon_round_unSelet.png',
|
||||
? 'images/icon_round_select.png'
|
||||
: 'images/icon_round_unSelect.png',
|
||||
width: 30.w,
|
||||
height: 30.w,
|
||||
)),
|
||||
|
||||
@ -66,8 +66,8 @@ class massSendLockGroupCell extends StatelessWidget {
|
||||
)),
|
||||
Image.asset(
|
||||
itemData.isChecked
|
||||
? "images/icon_round_selet.png"
|
||||
: "images/icon_round_unSelet.png",
|
||||
? "images/icon_round_select.png"
|
||||
: "images/icon_round_unSelect.png",
|
||||
width: 30.w,
|
||||
height: 30.w,
|
||||
),
|
||||
|
||||
@ -123,15 +123,15 @@ class _MassSendLockGroupListPageState extends State<MassSendLockGroupListPage> {
|
||||
// clickIndex = index;
|
||||
//是否选中组
|
||||
if (itemData.isChecked) {
|
||||
var seletList = itemData.lockList;
|
||||
for(LockListItem lockListItem in seletList!){
|
||||
var selectList = itemData.lockList;
|
||||
for(LockListItem lockListItem in selectList!){
|
||||
lockListItem.isChecked = true;
|
||||
selectLockIdList.add(lockListItem.lockId);
|
||||
}
|
||||
// lockItemList[selectIndex] =
|
||||
}else{
|
||||
var seletList = itemData.lockList;
|
||||
for(LockListItem lockListItem in seletList!){
|
||||
var selectList = itemData.lockList;
|
||||
for(LockListItem lockListItem in selectList!){
|
||||
lockListItem.isChecked = false;
|
||||
selectLockIdList.remove(lockListItem.lockId);
|
||||
}
|
||||
|
||||
@ -80,7 +80,7 @@ class _MassSendReceiverPageState extends State<MassSendReceiverPage> {
|
||||
),
|
||||
action: () async {
|
||||
var result = await Navigator.pushNamed(
|
||||
context, Routers.seletCountryRegionPage);
|
||||
context, Routers.selectCountryRegionPage);
|
||||
if (result != null) {
|
||||
result as Map<String, dynamic>;
|
||||
countryCode = result['code'];
|
||||
|
||||
@ -106,7 +106,7 @@ class SendElectronicKeyLogic extends BaseGetXController {
|
||||
),
|
||||
CupertinoDialogAction(
|
||||
child: Text(
|
||||
TranslationLoader.lanKeys!.selet!.tr,
|
||||
TranslationLoader.lanKeys!.select!.tr,
|
||||
style: TextStyle(color: AppColors.mainColor),
|
||||
),
|
||||
onPressed: () async {
|
||||
@ -114,7 +114,7 @@ class SendElectronicKeyLogic extends BaseGetXController {
|
||||
state.isCreateUser.value = true;
|
||||
Navigator.of(context).pop();
|
||||
|
||||
var result = await Get.toNamed(Routers.seletCountryRegionPage);
|
||||
var result = await Get.toNamed(Routers.selectCountryRegionPage);
|
||||
if (result != null) {
|
||||
result as Map<String, dynamic>;
|
||||
state.countryCode.value = result['code'];
|
||||
|
||||
@ -139,7 +139,7 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
|
||||
),
|
||||
action: () async {
|
||||
var result = await Navigator.pushNamed(
|
||||
context, Routers.seletCountryRegionPage);
|
||||
context, Routers.selectCountryRegionPage);
|
||||
if (result != null) {
|
||||
result as Map<String, dynamic>;
|
||||
state.countryCode.value = result['code'];
|
||||
|
||||
294
star_lock/lib/main/lockDetail/face/addFace/addFace_logic.dart
Normal file
@ -0,0 +1,294 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter_reactive_ble/flutter_reactive_ble.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/blue/io_protocol/io_addFace.dart';
|
||||
import 'package:star_lock/blue/io_type.dart';
|
||||
import 'package:star_lock/main/lockDetail/face/addFace/addFace_state.dart';
|
||||
import 'package:star_lock/tools/eventBusEventManage.dart';
|
||||
|
||||
import '../../../../../blue/blue_manage.dart';
|
||||
import '../../../../../blue/io_reply.dart';
|
||||
import '../../../../../blue/io_tool/io_tool.dart';
|
||||
import '../../../../../blue/io_tool/manager_event_bus.dart';
|
||||
import '../../../../../blue/sender_manage.dart';
|
||||
import '../../../../../network/api_repository.dart';
|
||||
import '../../../../../tools/baseGetXController.dart';
|
||||
import '../../../../../tools/storage.dart';
|
||||
|
||||
class AddFaceLogic extends BaseGetXController {
|
||||
final AddFaceState state = AddFaceState();
|
||||
|
||||
// 监听设备返回的数据
|
||||
late StreamSubscription<Reply> _replySubscription;
|
||||
void _initReplySubscription() {
|
||||
_replySubscription =
|
||||
EventBusManager().eventBus!.on<Reply>().listen((reply) async {
|
||||
// 添加指纹开始
|
||||
if (reply is SenderAddFaceReply) {
|
||||
_replyAddFaceBegin(reply);
|
||||
}
|
||||
|
||||
// 添加指纹过程
|
||||
if (reply is SenderAddFaceProcessReply) {
|
||||
_replyAddFaceProcess(reply);
|
||||
}
|
||||
|
||||
// 添加指纹确认
|
||||
if (reply is SenderAddFaceConfirmationReply) {
|
||||
_replyAddFaceConfirmation(reply);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Future<void> _replyAddFaceBegin(Reply reply) async {
|
||||
int status = reply.data[2];
|
||||
print("status:$status");
|
||||
|
||||
switch (status) {
|
||||
case 0x00:
|
||||
//成功
|
||||
print("${reply.commandType!.typeValue} 人脸开始数据解析成功");
|
||||
state.ifConnectScuess.value = true;
|
||||
|
||||
// 最大图片数
|
||||
state.maxRegCount.value = reply.data[10];
|
||||
print("人脸开始state.maxRegCount.value:${state.maxRegCount.value}");
|
||||
// state.fingerprintNumber.value = reply.data.last.toString();
|
||||
break;
|
||||
case 0x06:
|
||||
//无权限
|
||||
print("${reply.commandType!.typeValue} 需要鉴权");
|
||||
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
|
||||
var publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||
List<int> publicKeyDataList = changeStringListToIntList(publicKey!);
|
||||
|
||||
var token = reply.data.sublist(5, 9);
|
||||
var saveStrList = changeIntListToStringList(token);
|
||||
print("_replyAddFaceReplyToken:$token");
|
||||
Storage.setStringList(saveBlueToken, saveStrList);
|
||||
|
||||
IoSenderManage.senderAddFaceCommand(
|
||||
keyID: "1",
|
||||
userID: await Storage.getUid(),
|
||||
faceNo: 1,
|
||||
useCountLimit: 0xff,
|
||||
// startTime:0x11223344,
|
||||
// endTime:0x11223344,
|
||||
startTime: state.startDate.value ~/ 1000,
|
||||
endTime: state.endDate.value ~/ 1000,
|
||||
needAuthor: 1,
|
||||
publicKey: publicKeyDataList,
|
||||
privateKey: getPrivateKeyList,
|
||||
token: token,
|
||||
);
|
||||
break;
|
||||
case 0x07:
|
||||
//无权限
|
||||
print("${reply.commandType!.typeValue} 用户无权限");
|
||||
|
||||
break;
|
||||
case 0x09:
|
||||
// 权限校验错误
|
||||
print("${reply.commandType!.typeValue} 权限校验错误");
|
||||
|
||||
break;
|
||||
default:
|
||||
//失败
|
||||
print("${reply.commandType!.typeValue} 失败");
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _replyAddFaceProcess(Reply reply) async {
|
||||
int status = reply.data[2];
|
||||
print("33 status:$status");
|
||||
|
||||
switch (status) {
|
||||
case 0x00:
|
||||
//成功
|
||||
print("${reply.commandType!.typeValue} 注册人脸过程数据解析成功");
|
||||
if (reply.data[5] == 255) {
|
||||
// 注册指纹失败
|
||||
print("${reply.commandType!.typeValue} 注册人脸过程失败");
|
||||
showToast("添加失败");
|
||||
Get.close(2);
|
||||
} else {
|
||||
// state.addFaceProcessNumber.value++;
|
||||
|
||||
// 当前注册数
|
||||
state.regIndex.value = reply.data[6];
|
||||
print("state.regIndex.value:${state.regIndex.value}");
|
||||
}
|
||||
break;
|
||||
case 0x06:
|
||||
//需要权限
|
||||
|
||||
break;
|
||||
case 0x07:
|
||||
//无权限
|
||||
print("${reply.commandType!.typeValue} 用户无权限");
|
||||
|
||||
break;
|
||||
case 0x09:
|
||||
// 权限校验错误
|
||||
print("${reply.commandType!.typeValue} 权限校验错误");
|
||||
|
||||
break;
|
||||
default:
|
||||
//失败
|
||||
print("${reply.commandType!.typeValue} 注册人脸过程default失败");
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _replyAddFaceConfirmation(Reply reply) async {
|
||||
int status = reply.data[2];
|
||||
print("status:$status");
|
||||
|
||||
switch (status) {
|
||||
case 0x00:
|
||||
//成功
|
||||
print("${reply.commandType!.typeValue} 人脸确认数据解析成功");
|
||||
// print("添加人脸确认成功,调用添加指纹接口");
|
||||
if (state.faceNumber.value == (reply.data[6]).toString()) {
|
||||
return;
|
||||
} else {
|
||||
state.faceNumber.value = (reply.data[6]).toString();
|
||||
}
|
||||
addFaceData();
|
||||
break;
|
||||
case 0x06:
|
||||
//需要权限
|
||||
|
||||
break;
|
||||
case 0x07:
|
||||
//无权限
|
||||
print("${reply.commandType!.typeValue} 用户无权限");
|
||||
|
||||
break;
|
||||
case 0x09:
|
||||
// 权限校验错误
|
||||
print("${reply.commandType!.typeValue} 权限校验错误");
|
||||
|
||||
break;
|
||||
default:
|
||||
//失败
|
||||
print("${reply.commandType!.typeValue} 人脸确认default失败");
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// 添加人脸开始
|
||||
Future<void> senderAddFace() async {
|
||||
showBlueConnetctToastTimer(action: () {
|
||||
Get.close(1);
|
||||
});
|
||||
BlueManage().bludSendData(BlueManage().connectDeviceName,
|
||||
(DeviceConnectionState deviceConnectionState) async {
|
||||
if (deviceConnectionState == DeviceConnectionState.connected) {
|
||||
cancelBlueConnetctToastTimer();
|
||||
var publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||
List<int> publicKeyDataList = changeStringListToIntList(publicKey!);
|
||||
|
||||
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
|
||||
var token = await Storage.getStringList(saveBlueToken);
|
||||
List<int> getTokenList = changeStringListToIntList(token!);
|
||||
print(
|
||||
"openDoorTokenPubToken:$getTokenList state.startDate.value:${state.startDate.value}");
|
||||
|
||||
IoSenderManage.senderAddFaceCommand(
|
||||
keyID: "1",
|
||||
userID: await Storage.getUid(),
|
||||
faceNo: 1,
|
||||
useCountLimit: 0xff,
|
||||
// startTime:0x11223344,
|
||||
// endTime:0x11223344,
|
||||
startTime: state.startDate.value ~/ 1000,
|
||||
endTime: state.endDate.value ~/ 1000,
|
||||
needAuthor: 1,
|
||||
publicKey: publicKeyDataList,
|
||||
privateKey: getPrivateKeyList,
|
||||
token: getTokenList,
|
||||
);
|
||||
} else if (deviceConnectionState == DeviceConnectionState.disconnected) {
|
||||
if (state.ifCurrentScreen.value == true) {
|
||||
showBlueConnetctToast();
|
||||
}
|
||||
cancelBlueConnetctToastTimer();
|
||||
Get.close(1);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 添加人脸
|
||||
void addFaceData() async {
|
||||
var entity = await ApiRepository.to.addFaceData(
|
||||
lockId: state.lockId.value,
|
||||
faceName: state.faceName.value,
|
||||
faceNumber: state.faceNumber.value,
|
||||
faceType: state.faceType.value,
|
||||
startDate: state.startDate.value,
|
||||
endDate: state.endDate.value,
|
||||
featureData: state.featureData.value,
|
||||
addType: state.addType.value,
|
||||
cyclicConfig: state.cyclicConfig.value,
|
||||
);
|
||||
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
// Toast.show(msg: "添加成功");
|
||||
updateFaceUserNoLoadData(entity.data!.fingerprintId.toString());
|
||||
}
|
||||
}
|
||||
|
||||
// 更新人脸用户账号
|
||||
void updateFaceUserNoLoadData(String faceId) async {
|
||||
var entity = await ApiRepository.to.updateFaceUserNoLoadData(
|
||||
faceId: faceId,
|
||||
lockId: state.lockId.value.toString(),
|
||||
faceUserNo: state.faceNumber.value,
|
||||
);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
showToast("添加成功");
|
||||
if (state.fromType.value == 2) {
|
||||
// 回调人脸号
|
||||
eventBus
|
||||
.fire(ChickInAddStaffCardAndFingerprintBlockNumberEvent(faceId));
|
||||
} else if (state.fromType.value == 1) {
|
||||
eventBus.fire(OtherTypeRefreshListEvent());
|
||||
}
|
||||
Get.close(2);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
// TODO: implement onReady
|
||||
super.onReady();
|
||||
|
||||
_initReplySubscription();
|
||||
}
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
// TODO: implement onInit
|
||||
super.onInit();
|
||||
//开始添加后发送指令
|
||||
// senderAddFace();
|
||||
}
|
||||
|
||||
@override
|
||||
void onClose() {
|
||||
// TODO: implement onClose
|
||||
super.onClose();
|
||||
|
||||
_replySubscription.cancel();
|
||||
}
|
||||
}
|
||||
@ -1,39 +1,40 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/main/lockDetail/face/addFace/addFace_logic.dart';
|
||||
|
||||
import '../../../../../appRouters.dart';
|
||||
import '../../../../../app_settings/app_colors.dart';
|
||||
import '../../../../../tools/submitBtn.dart';
|
||||
import '../../../../../tools/titleAppBar.dart';
|
||||
import '../../../../../translations/trans_lib.dart';
|
||||
|
||||
class AddFaceTipPage extends StatefulWidget {
|
||||
const AddFaceTipPage({Key? key}) : super(key: key);
|
||||
class AddFacePage extends StatefulWidget {
|
||||
const AddFacePage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<AddFaceTipPage> createState() => _AddFaceTipPageState();
|
||||
State<AddFacePage> createState() => _AddFacePageState();
|
||||
}
|
||||
|
||||
class _AddFaceTipPageState extends State<AddFaceTipPage> {
|
||||
class _AddFacePageState extends State<AddFacePage> {
|
||||
final logic = Get.put(AddFaceLogic());
|
||||
final state = Get.find<AddFaceLogic>().state;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.white,
|
||||
appBar: TitleAppBar(
|
||||
barTitle: "${TranslationLoader.lanKeys!.addTip!.tr}${TranslationLoader.lanKeys!.face!.tr}",
|
||||
barTitle:
|
||||
"${TranslationLoader.lanKeys!.addTip!.tr}${TranslationLoader.lanKeys!.face!.tr}",
|
||||
haveBack: true,
|
||||
backgroundColor: AppColors.mainColor),
|
||||
body: ListView(
|
||||
// mainAxisAlignment: MainAxisAlignment.center,
|
||||
// crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 50.h,
|
||||
),
|
||||
Image.asset(
|
||||
'images/main/icon_main_addFace.png',
|
||||
'images/main/icon_addFace_step1.png',
|
||||
width: 100.w,
|
||||
height: 457.h,
|
||||
fit: BoxFit.fitHeight,
|
||||
@ -48,9 +49,8 @@ class _AddFaceTipPageState extends State<AddFaceTipPage> {
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
"请单人正对门锁,距离一个成年人手臂长度(约0.6米).\n保持脸部无遮挡,露出五官",
|
||||
// TranslationLoader.lanKeys!.lightTouchScreenTip!.tr,
|
||||
textAlign: TextAlign.center,
|
||||
"请单人正对门锁,距离一个成年人手臂长度\n(约0.6米)。\n保持脸部无遮挡,露出五官。",
|
||||
textAlign: TextAlign.left,
|
||||
maxLines: null,
|
||||
style:
|
||||
TextStyle(fontSize: 24.sp, fontWeight: FontWeight.w600),
|
||||
@ -62,15 +62,32 @@ class _AddFaceTipPageState extends State<AddFaceTipPage> {
|
||||
SizedBox(
|
||||
height: 120.h,
|
||||
),
|
||||
Container(
|
||||
padding: EdgeInsets.only(left: 20.w, right: 20.w),
|
||||
child: SubmitBtn(
|
||||
btnName: "开始添加", //TranslationLoader.lanKeys!.next!.tr,
|
||||
borderRadius: 20.w,
|
||||
onClick: () {
|
||||
EasyLoading.showToast("请确保在设备附近,设备未被连接,设备已打开", duration: 2000.milliseconds);
|
||||
}),
|
||||
),
|
||||
Obx(
|
||||
() => state.isClickAddFace.value == false
|
||||
? Container(
|
||||
padding: EdgeInsets.only(left: 20.w, right: 20.w),
|
||||
child: SubmitBtn(
|
||||
btnName:
|
||||
"准备好了,开始添加", //TranslationLoader.lanKeys!.next!.tr,
|
||||
borderRadius: 20.w,
|
||||
onClick: () {
|
||||
state.isClickAddFace.value = true;
|
||||
logic.senderAddFace();
|
||||
}),
|
||||
)
|
||||
: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
'正在录入中...',
|
||||
style: TextStyle(
|
||||
color: AppColors.darkGrayTextColor,
|
||||
fontSize: 22.sp),
|
||||
textAlign: TextAlign.center,
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
@ -0,0 +1,35 @@
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class AddFaceState {
|
||||
var ifCurrentScreen = true.obs; // 是否是当前界面,用于判断是否需要针对当前界面进行展示
|
||||
|
||||
var ifConnectScuess = false.obs;
|
||||
var maxRegCount = 0.obs; // 最大注册次数
|
||||
var regIndex = 0.obs; // 当前注册次数
|
||||
|
||||
var faceNumber = "".obs;
|
||||
|
||||
final lockId = 0.obs;
|
||||
final endDate = 0.obs;
|
||||
final addType = "".obs;
|
||||
final faceName = "".obs;
|
||||
final faceType = 0.obs;
|
||||
final startDate = 0.obs;
|
||||
final cyclicConfig = [].obs;
|
||||
final fromType = 1.obs;
|
||||
final featureData = ''.obs;
|
||||
final isClickAddFace = false.obs;
|
||||
|
||||
AddFaceState() {
|
||||
Map map = Get.arguments;
|
||||
lockId.value = map["lockId"];
|
||||
endDate.value = map["endDate"];
|
||||
addType.value = map["addType"];
|
||||
faceName.value = map["faceName"];
|
||||
faceType.value = map["faceType"];
|
||||
startDate.value = map["startDate"];
|
||||
lockId.value = map["lockId"];
|
||||
cyclicConfig.value = map["cyclicConfig"];
|
||||
fromType.value = map["fromType"];
|
||||
}
|
||||
}
|
||||
@ -21,9 +21,9 @@ class _AddFaceTypeManageTabbarState extends State<AddFaceTypeManageTabbar> with
|
||||
late TabController _tabController;
|
||||
|
||||
final List<ItemView> _itemTabs = <ItemView>[
|
||||
ItemView(title: TranslationLoader.lanKeys!.permanent!.tr, seletType: "0"),
|
||||
ItemView(title: TranslationLoader.lanKeys!.timeLimit!.tr, seletType: "1"),
|
||||
ItemView(title: TranslationLoader.lanKeys!.circulation!.tr, seletType: "2"),
|
||||
ItemView(title: TranslationLoader.lanKeys!.permanent!.tr, selectType: "0"),
|
||||
ItemView(title: TranslationLoader.lanKeys!.timeLimit!.tr, selectType: "1"),
|
||||
ItemView(title: TranslationLoader.lanKeys!.circulation!.tr, selectType: "2"),
|
||||
];
|
||||
|
||||
@override
|
||||
@ -83,7 +83,7 @@ class _AddFaceTypeManageTabbarState extends State<AddFaceTypeManageTabbar> with
|
||||
child: TabBarView(
|
||||
controller: _tabController,
|
||||
children: _itemTabs
|
||||
.map((ItemView item) => AddFaceTypePage(seletType: item.seletType,))
|
||||
.map((ItemView item) => AddFaceTypePage(selectType: item.selectType,))
|
||||
.toList(),
|
||||
),
|
||||
);
|
||||
@ -91,8 +91,8 @@ class _AddFaceTypeManageTabbarState extends State<AddFaceTypeManageTabbar> with
|
||||
}
|
||||
|
||||
class ItemView {
|
||||
const ItemView({required this.title, required this.seletType});
|
||||
const ItemView({required this.title, required this.selectType});
|
||||
|
||||
final String title;
|
||||
final String seletType;
|
||||
final String selectType;
|
||||
}
|
||||
|
||||
@ -1,8 +1,96 @@
|
||||
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/main/lockDetail/face/addFaceType/addFaceType_state.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
import 'addFaceType_state.dart';
|
||||
import '../../../../appRouters.dart';
|
||||
import '../../../../network/api_repository.dart';
|
||||
|
||||
class AddFaceTypeLogic extends BaseGetXController{
|
||||
class AddFaceTypeLogic extends BaseGetXController {
|
||||
AddFaceTypeState state = AddFaceTypeState();
|
||||
|
||||
}
|
||||
// 添加指纹
|
||||
void addFaceData() async {
|
||||
var faceType = 0; // 永久:1;限时2,单次3,循环:4
|
||||
var startDate = "";
|
||||
var endDate = "";
|
||||
if (state.seletType.value == "0") {
|
||||
faceType = 1;
|
||||
startDate = "0";
|
||||
endDate = "0";
|
||||
} else if (state.seletType.value == "1") {
|
||||
faceType = 2;
|
||||
if (state.beginTimeTimestamp.value.isEmpty) {
|
||||
showToast("请选择开始时间");
|
||||
return;
|
||||
}
|
||||
if (state.endTimeTimestamp.value.isEmpty) {
|
||||
showToast("请选择结束时间");
|
||||
return;
|
||||
}
|
||||
|
||||
// if(DateTime.now().millisecondsSinceEpoch > int.parse(state.beginTimeTimestamp.value)){
|
||||
// Toast.show(msg: "生效时间要大于当前时间");
|
||||
// return;
|
||||
// }
|
||||
|
||||
if (int.parse(state.beginTimeTimestamp.value) >=
|
||||
int.parse(state.endTimeTimestamp.value)) {
|
||||
showToast("失效时间要大于生效时间");
|
||||
return;
|
||||
}
|
||||
|
||||
startDate = state.beginTimeTimestamp.value;
|
||||
endDate = state.endTimeTimestamp.value;
|
||||
} else if (state.seletType.value == "2") {
|
||||
if (state.effectiveDateTime.value <= 0) {
|
||||
showToast("请选择生效时间");
|
||||
return;
|
||||
}
|
||||
if (state.failureDateTime.value <= 0) {
|
||||
showToast("请选择失效时间");
|
||||
return;
|
||||
}
|
||||
|
||||
if (state.weekdaysList.value.isEmpty) {
|
||||
showToast("请选择有效日");
|
||||
return;
|
||||
}
|
||||
|
||||
// if(DateTime.now().millisecondsSinceEpoch >= state.effectiveDateTime.value){
|
||||
// Toast.show(msg: "生效时间要大于当前时间");
|
||||
// return;
|
||||
// }
|
||||
|
||||
if (state.effectiveDateTime.value >= state.failureDateTime.value) {
|
||||
showToast("失效时间要大于生效时间");
|
||||
return;
|
||||
}
|
||||
startDate = state.effectiveDateTime.value.toString();
|
||||
endDate = state.failureDateTime.value.toString();
|
||||
faceType = 4;
|
||||
}
|
||||
|
||||
// 人脸
|
||||
Get.toNamed(Routers.addFacePage, arguments: {
|
||||
"lockId": state.lockId.value,
|
||||
"endDate": int.parse(endDate),
|
||||
"addType": "1",
|
||||
"faceName": state.nameController.text,
|
||||
"faceNumber": "123456",
|
||||
"faceType": faceType,
|
||||
"startDate": int.parse(startDate),
|
||||
"cyclicConfig": state.weekdaysList.value,
|
||||
"fromType": state.fromType.value,
|
||||
});
|
||||
}
|
||||
|
||||
// 校验指纹名字是否重复
|
||||
void checkFaceNameDuplicated(String faceName) async {
|
||||
var entity = await ApiRepository.to.checkFaceNameDuplicatedData(
|
||||
lockId: state.lockId.value.toString(),
|
||||
faceName: faceName,
|
||||
);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
addFaceData();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -14,9 +14,9 @@ import '../../../../translations/trans_lib.dart';
|
||||
import 'addFaceType_logic.dart';
|
||||
|
||||
class AddFaceTypePage extends StatefulWidget {
|
||||
final String seletType;
|
||||
final String selectType;
|
||||
|
||||
const AddFaceTypePage({Key? key, required this.seletType}) : super(key: key);
|
||||
const AddFaceTypePage({Key? key, required this.selectType}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<AddFaceTypePage> createState() => _AddFaceTypePageState();
|
||||
@ -32,7 +32,7 @@ class _AddFaceTypePageState extends State<AddFaceTypePage> {
|
||||
}
|
||||
|
||||
Widget indexChangeWidget() {
|
||||
switch (int.parse(widget.seletType)) {
|
||||
switch (int.parse(widget.selectType)) {
|
||||
case 0:
|
||||
{
|
||||
// 永久
|
||||
@ -176,15 +176,14 @@ class _AddFaceTypePageState extends State<AddFaceTypePage> {
|
||||
onClick: () async {
|
||||
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||
if (isDemoMode == false) {
|
||||
// print("state.seletType:${state.seletType.value}");
|
||||
// print("state.selectType:${state.selectType.value}");
|
||||
if (state.nameController.text.isEmpty) {
|
||||
logic.showToast("请输入姓名");
|
||||
return;
|
||||
}
|
||||
|
||||
Get.toNamed(Routers.addFaceTipPage);
|
||||
logic.checkFaceNameDuplicated(state.nameController.text);
|
||||
} else {
|
||||
// Get.toNamed(Routers.seletLockTypePage);
|
||||
// Get.toNamed(Routers.selectLockTypePage);
|
||||
logic.showToast("演示模式");
|
||||
}
|
||||
}),
|
||||
@ -293,19 +292,4 @@ class _AddFaceTypePageState extends State<AddFaceTypePage> {
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
//isStressFingerprint false:不是胁迫指纹 ture:胁迫指纹
|
||||
CupertinoSwitch _isStressFingerprint() {
|
||||
return CupertinoSwitch(
|
||||
activeColor: CupertinoColors.activeBlue,
|
||||
trackColor: CupertinoColors.systemGrey5,
|
||||
thumbColor: CupertinoColors.white,
|
||||
value: true,
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
// state.isStressFingerprint.value = value;
|
||||
});
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,16 +1,25 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class AddFaceTypeState{
|
||||
var beginTime = "".obs;// 开始时间
|
||||
var endTime = "".obs;// 结束时间
|
||||
var beginTimeTimestamp = "".obs;// 开始时间时间戳
|
||||
var endTimeTimestamp = "".obs;// 结束时间时间戳
|
||||
class AddFaceTypeState {
|
||||
final lockId = 0.obs;
|
||||
final seletType = "0".obs; // 0永久 1显示 2循环
|
||||
final fromType = 1.obs; // // 1从添加钥匙列表进入 2从考勤添加员工入口进入
|
||||
final isStressFingerprint = false.obs;
|
||||
|
||||
var effectiveDateTime = 0.obs;// 生效时间
|
||||
var failureDateTime = 0.obs;// 失效时间
|
||||
var beginTime = "".obs; // 开始时间
|
||||
var endTime = "".obs; // 结束时间
|
||||
var beginTimeTimestamp = "".obs; // 开始时间时间戳
|
||||
var endTimeTimestamp = "".obs; // 结束时间时间戳
|
||||
|
||||
var effectiveDateTime = 0.obs; // 生效时间
|
||||
var failureDateTime = 0.obs; // 失效时间
|
||||
var weekdaysList = [].obs;
|
||||
|
||||
final TextEditingController nameController = TextEditingController();
|
||||
}
|
||||
AddFaceTypeState() {
|
||||
Map map = Get.arguments;
|
||||
lockId.value = map["lockId"];
|
||||
fromType.value = map["fromType"];
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,193 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter_reactive_ble/flutter_reactive_ble.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/blue/io_type.dart';
|
||||
import 'package:star_lock/main/lockDetail/face/faceDetail/faceDetail_state.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
import '../../../../blue/blue_manage.dart';
|
||||
import '../../../../blue/io_protocol/io_addFingerprint.dart';
|
||||
import '../../../../blue/io_reply.dart';
|
||||
import '../../../../blue/io_tool/io_tool.dart';
|
||||
import '../../../../blue/io_tool/manager_event_bus.dart';
|
||||
import '../../../../blue/sender_manage.dart';
|
||||
import '../../../../network/api_repository.dart';
|
||||
import '../../../../tools/storage.dart';
|
||||
|
||||
class FaceDetailLogic extends BaseGetXController {
|
||||
FaceDetailState state = FaceDetailState();
|
||||
|
||||
// 获取解析后的数据
|
||||
late StreamSubscription<Reply> _replySubscription;
|
||||
void _initReplySubscription() {
|
||||
_replySubscription =
|
||||
EventBusManager().eventBus!.on<Reply>().listen((reply) {
|
||||
// 添加指纹开始(此处用作删除指纹)
|
||||
if ((reply is SenderAddFingerprintReply)) {
|
||||
_replyAddFingerprintBegin(reply);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 添加指纹开始
|
||||
Future<void> _replyAddFingerprintBegin(Reply reply) async {
|
||||
int status = reply.data[2];
|
||||
print("status:$status");
|
||||
|
||||
switch (status) {
|
||||
case 0x00:
|
||||
//成功
|
||||
print("${reply.commandType!.typeValue} 数据解析成功");
|
||||
state.sureBtnState.value = 0;
|
||||
cancelBlueConnetctToastTimer();
|
||||
dismissEasyLoading();
|
||||
deletFingerprintsData();
|
||||
break;
|
||||
case 0x06:
|
||||
//无权限
|
||||
print("${reply.commandType!.typeValue} 需要鉴权");
|
||||
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 = changeStringListToIntList(token!);
|
||||
|
||||
String? userID = await Storage.getUid();
|
||||
IoSenderManage.senderAddFingerprintCommand(
|
||||
keyID: state.keyId.value.toString(),
|
||||
userID: userID,
|
||||
fingerNo: int.parse(state.typeNumber.value),
|
||||
useCountLimit: 0,
|
||||
startTime: state.effectiveDateTime.value,
|
||||
endTime: state.failureDateTime.value,
|
||||
needAuthor: 1,
|
||||
publicKey: publicKeyDataList,
|
||||
privateKey: getPrivateKeyList,
|
||||
token: getTokenList,
|
||||
);
|
||||
break;
|
||||
case 0x07:
|
||||
//无权限
|
||||
print("${reply.commandType!.typeValue} 用户无权限");
|
||||
|
||||
break;
|
||||
case 0x09:
|
||||
// 权限校验错误
|
||||
print("${reply.commandType!.typeValue} 权限校验错误");
|
||||
|
||||
break;
|
||||
default:
|
||||
//失败
|
||||
print("${reply.commandType!.typeValue} 失败");
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// 删除指纹
|
||||
Future<void> senderAddFingerprint() async {
|
||||
if (state.sureBtnState.value == 1) {
|
||||
return;
|
||||
}
|
||||
state.sureBtnState.value = 1;
|
||||
|
||||
showEasyLoading();
|
||||
showBlueConnetctToastTimer(action: () {
|
||||
dismissEasyLoading();
|
||||
state.sureBtnState.value = 0;
|
||||
});
|
||||
BlueManage().bludSendData(BlueManage().connectDeviceName,
|
||||
(DeviceConnectionState deviceConnectionState) async {
|
||||
if (deviceConnectionState == DeviceConnectionState.connected) {
|
||||
var publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||
List<int> publicKeyDataList = changeStringListToIntList(publicKey!);
|
||||
|
||||
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
|
||||
var token = await Storage.getStringList(saveBlueToken);
|
||||
List<int> getTokenList = changeStringListToIntList(token!);
|
||||
|
||||
String? userID = await Storage.getUid();
|
||||
|
||||
IoSenderManage.senderAddFingerprintCommand(
|
||||
keyID: state.keyId.value.toString(),
|
||||
userID: userID,
|
||||
fingerNo: int.parse(state.typeNumber.value),
|
||||
useCountLimit: 0,
|
||||
startTime: state.effectiveDateTime.value,
|
||||
endTime: state.failureDateTime.value,
|
||||
needAuthor: 1,
|
||||
publicKey: publicKeyDataList,
|
||||
privateKey: getPrivateKeyList,
|
||||
token: getTokenList,
|
||||
);
|
||||
} else if (deviceConnectionState == DeviceConnectionState.disconnected) {
|
||||
dismissEasyLoading();
|
||||
cancelBlueConnetctToastTimer();
|
||||
state.sureBtnState.value = 0;
|
||||
if (state.ifCurrentScreen.value == true) {
|
||||
showBlueConnetctToast();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 删除指纹
|
||||
void deletFingerprintsData() async {
|
||||
var entity = await ApiRepository.to.deletFingerprintsData(
|
||||
fingerprintId: state.faceItemData.value.faceId.toString(),
|
||||
lockId: state.faceItemData.value.lockId.toString(),
|
||||
type: "0",
|
||||
deleteType: "1");
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
showToast("删除成功", something: () {
|
||||
Get.back(result: "addScuess");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// 编辑指纹
|
||||
void editFingerprintsData() async {
|
||||
var entity = await ApiRepository.to.editFingerprintsData(
|
||||
fingerprintId: state.keyId.value.toString(),
|
||||
lockId: state.faceItemData.value.lockId.toString(),
|
||||
weekDay: state.weekDay.value,
|
||||
startDate: state.effectiveDateTime.value.toString(),
|
||||
endDate: state.failureDateTime.value.toString(),
|
||||
isCoerced: state.isStressFingerprint.value ? "2" : "1",
|
||||
fingerprintName: state.changeNameController.text,
|
||||
changeType: "1",
|
||||
);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
showToast("修改成功", something: () {
|
||||
Get.back(result: "addScuess");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
// TODO: implement onReady
|
||||
super.onReady();
|
||||
|
||||
_initReplySubscription();
|
||||
}
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
// TODO: implement onInit
|
||||
super.onInit();
|
||||
}
|
||||
|
||||
@override
|
||||
void onClose() {
|
||||
// TODO: implement onClose
|
||||
super.onClose();
|
||||
|
||||
_replySubscription.cancel();
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,374 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/main/lockDetail/face/faceDetail/faceDetail_logic.dart';
|
||||
|
||||
import '../../../../appRouters.dart';
|
||||
import '../../../../app_settings/app_colors.dart';
|
||||
import '../../../../blue/blue_manage.dart';
|
||||
import '../../../../tools/appRouteObserver.dart';
|
||||
import '../../../../tools/commonItem.dart';
|
||||
import '../../../../tools/dateTool.dart';
|
||||
import '../../../../tools/showIosTipView.dart';
|
||||
import '../../../../tools/showTFView.dart';
|
||||
import '../../../../tools/submitBtn.dart';
|
||||
import '../../../../tools/titleAppBar.dart';
|
||||
import '../../../../translations/trans_lib.dart';
|
||||
|
||||
class FaceDetailPage extends StatefulWidget {
|
||||
const FaceDetailPage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<FaceDetailPage> createState() => _FingerprintDetailPageState();
|
||||
}
|
||||
|
||||
class _FingerprintDetailPageState extends State<FaceDetailPage>
|
||||
with RouteAware {
|
||||
final logic = Get.put(FaceDetailLogic());
|
||||
final state = Get.find<FaceDetailLogic>().state;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: AppColors.mainBackgroundColor,
|
||||
appBar: TitleAppBar(
|
||||
barTitle: "指纹详情",
|
||||
haveBack: true,
|
||||
backgroundColor: AppColors.mainColor,
|
||||
// actionsList: [
|
||||
// TextButton(
|
||||
// child: Text(TranslationLoader.lanKeys!.share!.tr, style: TextStyle(color: Colors.white, fontSize: 24.sp),),
|
||||
// onPressed: () {
|
||||
//
|
||||
// },
|
||||
// ),
|
||||
// ],
|
||||
),
|
||||
body: Column(
|
||||
children: [
|
||||
Obx(() => CommonItem(
|
||||
leftTitel:
|
||||
"${TranslationLoader.lanKeys!.fingerprint!.tr}${TranslationLoader.lanKeys!.number!.tr}",
|
||||
rightTitle: state.typeNumber.value,
|
||||
isHaveDirection: false,
|
||||
isHaveLine: true)),
|
||||
Obx(() => CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.name!.tr,
|
||||
rightTitle: state.typeName.value,
|
||||
isHaveDirection: true,
|
||||
isHaveLine: true,
|
||||
action: () {
|
||||
showCupertinoAlertDialog(context);
|
||||
})),
|
||||
Obx(() => Visibility(
|
||||
visible: (state.keyType.value == 4 || state.keyType.value == 2)
|
||||
? true
|
||||
: false,
|
||||
child: CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.periodValidity!.tr,
|
||||
allHeight: 70.h,
|
||||
// rightTitle:"2023.09.19 11:27\n2023.09.25 11:27",
|
||||
rightTitle: state.keyType.value == 1
|
||||
? "永久"
|
||||
: "${DateTool().dateToYMDHNString(state.effectiveDateTime.value.toString())}\n${DateTool().dateToYMDHNString(state.failureDateTime.value.toString())}",
|
||||
isHaveDirection: true,
|
||||
isHaveLine: true,
|
||||
action: () async {
|
||||
// switch(state.type.value){
|
||||
// case 0:
|
||||
// // 卡
|
||||
//
|
||||
// break;
|
||||
// case 1:
|
||||
// 当是指纹的时候
|
||||
if (state.keyType.value == 2) {
|
||||
// 限时
|
||||
var data = await Get.toNamed(
|
||||
Routers.otherTypeKeyChangeDatePage,
|
||||
arguments: {
|
||||
"fingerprintItemData": state.faceItemData.value,
|
||||
"pushType": 1,
|
||||
});
|
||||
if (data != null) {
|
||||
setState(() {
|
||||
state.effectiveDateTime.value =
|
||||
data["beginTimeTimestamp"];
|
||||
state.failureDateTime.value =
|
||||
data["endTimeTimestamp"];
|
||||
});
|
||||
}
|
||||
} else if (state.keyType.value == 4) {
|
||||
// 循环
|
||||
var data = await Get.toNamed(
|
||||
Routers.otherTypeKeyChangeValidityDatePage,
|
||||
arguments: {
|
||||
"fingerprintItemData": state.faceItemData.value,
|
||||
});
|
||||
if (data != null) {
|
||||
setState(() {
|
||||
state.effectiveDateTime.value =
|
||||
data["beginTimeTimestamp"];
|
||||
state.failureDateTime.value =
|
||||
data["endTimeTimestamp"];
|
||||
state.weekDay.value = data["weekDay"];
|
||||
});
|
||||
}
|
||||
}
|
||||
}))),
|
||||
Obx(() => Visibility(
|
||||
visible: state.keyType.value == 4 ? true : false,
|
||||
child: Obx(() => CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.effectiveDay!.tr,
|
||||
rightTitle: state.weekDay.value.join(','),
|
||||
isHaveDirection: true,
|
||||
action: () async {
|
||||
// 当是指纹的时候
|
||||
var data = await Get.toNamed(
|
||||
Routers.otherTypeKeyChangeValidityDatePage,
|
||||
arguments: {
|
||||
"fingerprintItemData": state.faceItemData.value,
|
||||
});
|
||||
if (data != null) {
|
||||
setState(() {
|
||||
state.effectiveDateTime.value =
|
||||
data["beginTimeTimestamp"];
|
||||
state.failureDateTime.value = data["endTimeTimestamp"];
|
||||
state.weekDay.value = data["weekDay"];
|
||||
});
|
||||
}
|
||||
})))),
|
||||
Container(height: 10.h),
|
||||
Obx(() => CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.additive!.tr,
|
||||
rightTitle: state.adder.value,
|
||||
isHaveLine: true,
|
||||
action: () {})),
|
||||
Obx(() => CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.addTime!.tr,
|
||||
rightTitle:
|
||||
DateTool().dateToYMDHNString(state.addTime.value.toString()),
|
||||
action: () {})),
|
||||
SizedBox(height: 10.h),
|
||||
|
||||
Container(height: 10.h),
|
||||
CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.operatingRecord!.tr,
|
||||
rightTitle: "",
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
// 人脸
|
||||
Get.toNamed(Routers.keyOperationRecordPage, arguments: {
|
||||
'lockId': state.faceItemData.value.lockId.toString(),
|
||||
'faceId': state.faceItemData.value.faceId.toString()
|
||||
});
|
||||
}),
|
||||
// SizedBox(height: 40.h),
|
||||
// addControlsBtn(type),
|
||||
SizedBox(height: 30.h),
|
||||
SubmitBtn(
|
||||
btnName: TranslationLoader.lanKeys!.delete!.tr,
|
||||
isDelete: true,
|
||||
borderRadius: 20.w,
|
||||
margin: EdgeInsets.only(
|
||||
left: 30.w, right: 30.w, top: 30.w, bottom: 30.w),
|
||||
padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
|
||||
onClick: () {
|
||||
showIosTipViewDialog(context);
|
||||
}),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// Widget addControlsBtn(int type) {
|
||||
// List<Widget> widgetList = [];
|
||||
// List<Map<String, dynamic>> routerList = [];
|
||||
// //卡详情
|
||||
// if (type == 0) {
|
||||
// routerList.add({
|
||||
// 'btnTitle': '设置密码',
|
||||
// 'routerName': Routers.passwordKeyDetailPage,
|
||||
// 'type': 9
|
||||
// });
|
||||
// routerList.add({
|
||||
// 'btnTitle': '设置指纹',
|
||||
// 'routerName': Routers.otherTypeKeyManagePage,
|
||||
// 'type': 1
|
||||
// });
|
||||
// routerList.add({
|
||||
// 'btnTitle': '设置遥控',
|
||||
// 'routerName': Routers.otherTypeKeyManagePage,
|
||||
// 'type': 2
|
||||
// });
|
||||
// } else if (type == 1) {
|
||||
// //指纹详情
|
||||
// routerList.add({
|
||||
// 'btnTitle': '设置密码',
|
||||
// 'routerName': Routers.passwordKeyDetailPage,
|
||||
// 'type': 9
|
||||
// });
|
||||
// routerList.add({
|
||||
// 'btnTitle': '设置卡',
|
||||
// 'routerName': Routers.otherTypeKeyManagePage,
|
||||
// 'type': 0
|
||||
// });
|
||||
// routerList.add({
|
||||
// 'btnTitle': '设置遥控',
|
||||
// 'routerName': Routers.otherTypeKeyManagePage,
|
||||
// 'type': 2
|
||||
// });
|
||||
// } else if (type == 2) {
|
||||
// //遥控详情
|
||||
// routerList.add({
|
||||
// 'btnTitle': '设置密码',
|
||||
// 'routerName': Routers.passwordKeyDetailPage,
|
||||
// 'type': 9
|
||||
// });
|
||||
// routerList.add({
|
||||
// 'btnTitle': '设置卡',
|
||||
// 'routerName': Routers.otherTypeKeyManagePage,
|
||||
// 'type': 0
|
||||
// });
|
||||
// routerList.add({
|
||||
// 'btnTitle': '设置指纹',
|
||||
// 'routerName': Routers.otherTypeKeyManagePage,
|
||||
// 'type': 1
|
||||
// });
|
||||
// }
|
||||
//
|
||||
// for (int i = 0; i < routerList.length; i++) {
|
||||
// widgetList.add(SizedBox(
|
||||
// width: ScreenUtil().screenWidth - 40.w,
|
||||
// height: 60.h,
|
||||
// child: OutlinedButton(
|
||||
// style: OutlinedButton.styleFrom(
|
||||
// // backgroundColor: Colors.white,
|
||||
// side: BorderSide(width: 1, color: AppColors.mainColor)),
|
||||
// onPressed: () {
|
||||
// if (routerList[i]['type'] == 9) {
|
||||
// Navigator.pushNamed(context, Routers.passwordKeyManagePage);
|
||||
// } else {
|
||||
// Navigator.pushNamed(context, Routers.otherTypeKeyManagePage,
|
||||
// arguments: routerList[i]['type']);
|
||||
// }
|
||||
// },
|
||||
// child: Text(
|
||||
// routerList[i]['btnTitle'],
|
||||
// style: TextStyle(color: AppColors.mainColor, fontSize: 24.sp),
|
||||
// )),
|
||||
// ));
|
||||
//
|
||||
// widgetList.add(
|
||||
// SizedBox(
|
||||
// height: 10.h,
|
||||
// ),
|
||||
// );
|
||||
// }
|
||||
//
|
||||
// return Column(
|
||||
// children: widgetList,
|
||||
// );
|
||||
// }
|
||||
|
||||
void showCupertinoAlertDialog(BuildContext context) {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return ShowTFView(
|
||||
title:
|
||||
"${TranslationLoader.lanKeys!.amend!.tr}${TranslationLoader.lanKeys!.name!.tr}",
|
||||
tipTitle: "",
|
||||
controller: state.changeNameController,
|
||||
sureClick: () {
|
||||
if (state.changeNameController.text.isEmpty) {
|
||||
logic.showToast("请输入姓名");
|
||||
return;
|
||||
}
|
||||
Get.back();
|
||||
// 指纹
|
||||
logic.editFingerprintsData();
|
||||
},
|
||||
cancelClick: () {
|
||||
Get.back();
|
||||
},
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
void showIosTipViewDialog(BuildContext context) {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return ShowIosTipView(
|
||||
title: "提示",
|
||||
tipTitle: "确定要删除吗?",
|
||||
sureClick: () {
|
||||
Get.back();
|
||||
// 指纹
|
||||
logic.senderAddFingerprint();
|
||||
},
|
||||
cancelClick: () {
|
||||
Get.back();
|
||||
},
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
void didChangeDependencies() {
|
||||
// TODO: implement didChangeDependencies
|
||||
super.didChangeDependencies();
|
||||
|
||||
/// 路由订阅
|
||||
AppRouteObserver().routeObserver.subscribe(this, ModalRoute.of(context)!);
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
// TODO: implement dispose
|
||||
/// 取消路由订阅
|
||||
AppRouteObserver().routeObserver.unsubscribe(this);
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
/// 从上级界面进入 当前界面即将出现
|
||||
@override
|
||||
void didPush() {
|
||||
super.didPush();
|
||||
print("lockSet===didPush");
|
||||
state.ifCurrentScreen.value = true;
|
||||
}
|
||||
|
||||
/// 返回上一个界面 当前界面即将消失
|
||||
@override
|
||||
void didPop() {
|
||||
super.didPop();
|
||||
print("lockSet===didPop");
|
||||
logic.cancelBlueConnetctToastTimer();
|
||||
if (EasyLoading.isShow) EasyLoading.dismiss(animation: true);
|
||||
BlueManage().stopScan();
|
||||
state.ifCurrentScreen.value = false;
|
||||
state.sureBtnState.value = 0;
|
||||
}
|
||||
|
||||
/// 从下级返回 当前界面即将出现
|
||||
@override
|
||||
void didPopNext() {
|
||||
super.didPopNext();
|
||||
print("lockSet===didPopNext");
|
||||
state.ifCurrentScreen.value = true;
|
||||
}
|
||||
|
||||
/// 进入下级界面 当前界面即将消失
|
||||
@override
|
||||
void didPushNext() {
|
||||
super.didPushNext();
|
||||
print("lockSet===didPushNext");
|
||||
logic.cancelBlueConnetctToastTimer();
|
||||
if (EasyLoading.isShow) EasyLoading.dismiss(animation: true);
|
||||
BlueManage().stopScan();
|
||||
state.ifCurrentScreen.value = false;
|
||||
state.sureBtnState.value = 0;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,38 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/main/lockDetail/face/faceList/faceListData_entity.dart';
|
||||
|
||||
class FaceDetailState {
|
||||
final faceItemData = FaceItemData().obs;
|
||||
|
||||
final TextEditingController changeNameController = TextEditingController();
|
||||
|
||||
final typeNumber = "".obs; // 指纹号
|
||||
final typeName = "".obs; // 指纹名字
|
||||
var effectiveDateTime = 0.obs; // 生效时间
|
||||
var failureDateTime = 0.obs; // 失效时间
|
||||
final keyType = 0.obs; // 永久:1;限时2,单次3,循环:4
|
||||
var weekDay = [].obs; // 有效日
|
||||
var adder = "".obs; // 添加者
|
||||
var addTime = 0.obs; // 添加时间
|
||||
var keyId = 0.obs;
|
||||
|
||||
var ifCurrentScreen = true.obs; // 是否是当前界面,用于判断是否需要针对当前界面进行展示
|
||||
var sureBtnState = 0.obs; // 0普通状态(可用) 1连接中(不可用)
|
||||
|
||||
final isStressFingerprint = false.obs;
|
||||
FaceDetailState() {
|
||||
Map map = Get.arguments;
|
||||
faceItemData.value = map["faceItemData"];
|
||||
keyId.value = faceItemData.value.faceId!;
|
||||
typeNumber.value = faceItemData.value.faceNumber!;
|
||||
typeName.value = faceItemData.value.faceName!;
|
||||
changeNameController.text = typeName.value;
|
||||
effectiveDateTime.value = faceItemData.value.startDate!;
|
||||
failureDateTime.value = faceItemData.value.endDate!;
|
||||
keyType.value = faceItemData.value.faceType!;
|
||||
adder.value = faceItemData.value.senderUsername!;
|
||||
addTime.value = faceItemData.value.createDate!;
|
||||
weekDay.value = faceItemData.value.cyclicConfig!;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,131 @@
|
||||
class FaceListDataEntity {
|
||||
int? errorCode;
|
||||
String? description;
|
||||
String? errorMsg;
|
||||
Data? data;
|
||||
|
||||
FaceListDataEntity(
|
||||
{this.errorCode, this.description, this.errorMsg, this.data});
|
||||
|
||||
FaceListDataEntity.fromJson(Map<String, dynamic> json) {
|
||||
errorCode = json['errorCode'];
|
||||
description = json['description'];
|
||||
errorMsg = json['errorMsg'];
|
||||
data = json['data'] != null ? Data.fromJson(json['data']) : null;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['errorCode'] = errorCode;
|
||||
data['description'] = description;
|
||||
data['errorMsg'] = errorMsg;
|
||||
if (this.data != null) {
|
||||
data['data'] = this.data!.toJson();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class Data {
|
||||
List<FaceItemData>? list;
|
||||
int? pageNo;
|
||||
int? pageSize;
|
||||
int? pages;
|
||||
int? total;
|
||||
|
||||
Data({this.list, this.pageNo, this.pageSize, this.pages, this.total});
|
||||
|
||||
Data.fromJson(Map<String, dynamic> json) {
|
||||
if (json['list'] != null) {
|
||||
list = <FaceItemData>[];
|
||||
json['list'].forEach((v) {
|
||||
list!.add(FaceItemData.fromJson(v));
|
||||
});
|
||||
}
|
||||
pageNo = json['pageNo'];
|
||||
pageSize = json['pageSize'];
|
||||
pages = json['pages'];
|
||||
total = json['total'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
if (list != null) {
|
||||
data['list'] = list!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
data['pageNo'] = pageNo;
|
||||
data['pageSize'] = pageSize;
|
||||
data['pages'] = pages;
|
||||
data['total'] = total;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class FaceItemData {
|
||||
int? lockId;
|
||||
int? faceId;
|
||||
String? faceName;
|
||||
String? faceNumber;
|
||||
int? startDate;
|
||||
int? endDate;
|
||||
int? status;
|
||||
int? addType;
|
||||
int? faceType;
|
||||
List? cyclicConfig;
|
||||
String? featureData;
|
||||
int? createDate;
|
||||
String? senderUsername;
|
||||
String? validTimeStr;
|
||||
|
||||
FaceItemData(
|
||||
{this.lockId,
|
||||
this.faceId,
|
||||
this.faceName,
|
||||
this.faceNumber,
|
||||
this.startDate,
|
||||
this.endDate,
|
||||
this.status,
|
||||
this.addType,
|
||||
this.faceType,
|
||||
this.cyclicConfig,
|
||||
this.featureData,
|
||||
this.createDate,
|
||||
this.senderUsername,
|
||||
this.validTimeStr});
|
||||
|
||||
FaceItemData.fromJson(Map<String, dynamic> json) {
|
||||
lockId = json['lockId'];
|
||||
faceId = json['faceId'];
|
||||
faceName = json['faceName'];
|
||||
faceNumber = json['faceNumber'];
|
||||
startDate = json['startDate'];
|
||||
endDate = json['endDate'];
|
||||
status = json['status'];
|
||||
addType = json['addType'];
|
||||
faceType = json['faceType'];
|
||||
cyclicConfig = json['cyclicConfig'];
|
||||
featureData = json['featureData'];
|
||||
createDate = json['createDate'];
|
||||
senderUsername = json['senderUsername'];
|
||||
validTimeStr = json['validTimeStr'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = <String, dynamic>{};
|
||||
data['lockId'] = lockId;
|
||||
data['faceId'] = faceId;
|
||||
data['faceName'] = faceName;
|
||||
data['faceNumber'] = faceNumber;
|
||||
data['startDate'] = startDate;
|
||||
data['endDate'] = endDate;
|
||||
data['status'] = status;
|
||||
data['addType'] = addType;
|
||||
data['faceType'] = faceType;
|
||||
data['cyclicConfig'] = cyclicConfig;
|
||||
data['featureData'] = featureData;
|
||||
data['createDate'] = createDate;
|
||||
data['senderUsername'] = senderUsername;
|
||||
data['validTimeStr'] = validTimeStr;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
@ -1,8 +1,427 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter_reactive_ble/flutter_reactive_ble.dart';
|
||||
import 'package:star_lock/blue/io_protocol/io_addFace.dart';
|
||||
import 'package:star_lock/blue/io_protocol/io_queryingFaceStatus.dart';
|
||||
import 'package:star_lock/blue/io_type.dart';
|
||||
import 'package:star_lock/main/lockDetail/face/faceList/faceList_state.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
import 'faceList_state.dart';
|
||||
import '../../../../blue/blue_manage.dart';
|
||||
import '../../../../blue/io_protocol/io_checkingUserInfoCount.dart';
|
||||
import '../../../../blue/io_reply.dart';
|
||||
import '../../../../blue/io_tool/io_tool.dart';
|
||||
import '../../../../blue/io_tool/manager_event_bus.dart';
|
||||
import '../../../../blue/sender_manage.dart';
|
||||
import '../../../../network/api_repository.dart';
|
||||
import '../../../../tools/eventBusEventManage.dart';
|
||||
import '../../../../tools/storage.dart';
|
||||
|
||||
class FaceListLogic extends BaseGetXController{
|
||||
class FaceListLogic extends BaseGetXController {
|
||||
FaceListState state = FaceListState();
|
||||
|
||||
}
|
||||
// 获取解析后的数据
|
||||
late StreamSubscription<Reply> _replySubscription;
|
||||
void _initReplySubscription() {
|
||||
_replySubscription =
|
||||
EventBusManager().eventBus!.on<Reply>().listen((reply) {
|
||||
// 添加人脸开始(此处用作删除人脸)
|
||||
if ((reply is SenderAddFaceReply) && (state.isDeletFaceData == true)) {
|
||||
_replyAddFaceBegin(reply);
|
||||
}
|
||||
|
||||
if (reply is SenderQueryingFaceStatusReply) {
|
||||
// 获取人脸状态
|
||||
_replyQueryingFaceStatus(reply);
|
||||
}
|
||||
|
||||
if (reply is SenderCheckingUserInfoCountReply) {
|
||||
_replyCheckingUserInfoCount(reply);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 添加人脸开始---这里用作删除人脸
|
||||
Future<void> _replyAddFaceBegin(Reply reply) async {
|
||||
int status = reply.data[2];
|
||||
print("status:$status");
|
||||
|
||||
switch (status) {
|
||||
case 0x00:
|
||||
//成功
|
||||
print("${reply.commandType!.typeValue} list人脸数据解析成功");
|
||||
state.isDeletFaceData = false;
|
||||
cancelBlueConnetctToastTimer();
|
||||
dismissEasyLoading();
|
||||
deletAllFacesData();
|
||||
break;
|
||||
case 0x06:
|
||||
//无权限
|
||||
print("${reply.commandType!.typeValue} 需要鉴权");
|
||||
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 = changeStringListToIntList(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;
|
||||
case 0x07:
|
||||
//无权限
|
||||
print("${reply.commandType!.typeValue} 用户无权限");
|
||||
|
||||
break;
|
||||
case 0x09:
|
||||
// 权限校验错误
|
||||
print("${reply.commandType!.typeValue} 权限校验错误");
|
||||
|
||||
break;
|
||||
default:
|
||||
//失败
|
||||
print("${reply.commandType!.typeValue} list人脸失败");
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// 获取人脸状态
|
||||
Future<void> _replyQueryingFaceStatus(Reply reply) async {
|
||||
int status = reply.data[2];
|
||||
|
||||
switch (status) {
|
||||
case 0x00:
|
||||
//成功
|
||||
print("${reply.commandType}数据解析成功");
|
||||
// _getLockStatus();
|
||||
break;
|
||||
case 0x06:
|
||||
//无权限
|
||||
print("${reply.commandType}需要鉴权");
|
||||
|
||||
break;
|
||||
case 0x07:
|
||||
//无权限
|
||||
print("${reply.commandType}用户无权限");
|
||||
|
||||
break;
|
||||
case 0x09:
|
||||
// 权限校验错误
|
||||
print("${reply.commandType}权限校验错误");
|
||||
|
||||
break;
|
||||
default:
|
||||
//失败
|
||||
print("${reply.commandType}失败");
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// 获取卡片状态
|
||||
Future<void> _replyReferEventRecordNumber(Reply reply) async {
|
||||
int status = reply.data[2];
|
||||
switch (status) {
|
||||
case 0x00:
|
||||
//成功
|
||||
print("${reply.commandType}数据解析成功");
|
||||
// _getLockStatus();
|
||||
break;
|
||||
case 0x06:
|
||||
//无权限
|
||||
print("${reply.commandType}需要鉴权");
|
||||
|
||||
break;
|
||||
case 0x07:
|
||||
//无权限
|
||||
print("${reply.commandType}用户无权限");
|
||||
|
||||
break;
|
||||
case 0x09:
|
||||
// 权限校验错误
|
||||
print("${reply.commandType}权限校验错误");
|
||||
|
||||
break;
|
||||
default:
|
||||
//失败
|
||||
print("${reply.commandType}失败");
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// 查询用户、指纹、密码、卡片数量(用于判断是否同步)
|
||||
Future<void> _replyCheckingUserInfoCount(Reply reply) async {
|
||||
int status = reply.data[2];
|
||||
|
||||
// 用户数量
|
||||
int userNum = reply.data[5];
|
||||
// print("userNum:$userNum");
|
||||
|
||||
// 指纹数量
|
||||
int fingerNum = reply.data[6];
|
||||
// print("fingerNum:$fingerNum");
|
||||
|
||||
// 密码数量
|
||||
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);
|
||||
print("serialNo:$serialNo");
|
||||
|
||||
switch (status) {
|
||||
case 0x00:
|
||||
//成功
|
||||
print("${reply.commandType}数据解析成功");
|
||||
// _getLockStatus();
|
||||
break;
|
||||
case 0x06:
|
||||
//无权限
|
||||
print("${reply.commandType}需要鉴权");
|
||||
|
||||
break;
|
||||
case 0x07:
|
||||
//无权限
|
||||
print("${reply.commandType}用户无权限");
|
||||
|
||||
break;
|
||||
case 0x09:
|
||||
// 权限校验错误
|
||||
print("${reply.commandType}权限校验错误");
|
||||
|
||||
break;
|
||||
default:
|
||||
//失败
|
||||
print("${reply.commandType}失败");
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// 获取人脸状态
|
||||
Future<void> senderQueryingFaceStatus() async {
|
||||
BlueManage().bludSendData(BlueManage().connectDeviceName,
|
||||
(DeviceConnectionState state) async {
|
||||
if (state == DeviceConnectionState.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,
|
||||
fingerCount: 20,
|
||||
fingerNo: 1,
|
||||
token: getTokenList,
|
||||
needAuthor: 1,
|
||||
publicKey: getPublicKeyList,
|
||||
privateKey: getPrivateKeyList,
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 查询用户、指纹、密码、卡片数量(用于判断是否同步)
|
||||
Future<void> senderCheckingUserInfoCount() async {
|
||||
BlueManage().bludSendData(BlueManage().connectDeviceName,
|
||||
(DeviceConnectionState state) async {
|
||||
if (state == DeviceConnectionState.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 {
|
||||
showEasyLoading();
|
||||
showBlueConnetctToastTimer(action: () {
|
||||
dismissEasyLoading();
|
||||
});
|
||||
BlueManage().bludSendData(BlueManage().connectDeviceName,
|
||||
(DeviceConnectionState deviceConnectionState) async {
|
||||
if (deviceConnectionState == DeviceConnectionState.connected) {
|
||||
var publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||
List<int> publicKeyDataList = changeStringListToIntList(publicKey!);
|
||||
|
||||
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
|
||||
var token = await Storage.getStringList(saveBlueToken);
|
||||
List<int> getTokenList = changeStringListToIntList(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,
|
||||
);
|
||||
} else if (deviceConnectionState == DeviceConnectionState.disconnected) {
|
||||
dismissEasyLoading();
|
||||
cancelBlueConnetctToastTimer();
|
||||
if (state.ifCurrentScreen.value == true) {
|
||||
showBlueConnetctToast();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 获取人脸列表
|
||||
void getFaceListData() async {
|
||||
var entity = await ApiRepository.to.getFaceListData(
|
||||
lockId: state.lockId.value.toString(),
|
||||
pageNo: '1',
|
||||
pageSize: '20',
|
||||
searchStr: state.searchController.text,
|
||||
);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
state.faceItemListData.value = entity.data!.list!;
|
||||
}
|
||||
}
|
||||
|
||||
// 重置所有的人脸
|
||||
void deletAllFacesData() async {
|
||||
var fingerprintId = "";
|
||||
var type = "1";
|
||||
if (state.isDeletAll == false) {
|
||||
fingerprintId = state.deletKeyID;
|
||||
type = "0";
|
||||
}
|
||||
print("delet fingerprintId $fingerprintId");
|
||||
var entity = await ApiRepository.to.deletFingerprintsData(
|
||||
fingerprintId: fingerprintId,
|
||||
lockId: state.lockId.value.toString(),
|
||||
type: type,
|
||||
deleteType: "1");
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
if (state.isDeletAll == false) {
|
||||
showToast("删除成功");
|
||||
} else {
|
||||
showToast("重置成功");
|
||||
}
|
||||
|
||||
state.isDeletFaceData = false;
|
||||
getFaceListData();
|
||||
}
|
||||
}
|
||||
|
||||
// 监听修改完详情之后刷新列表
|
||||
late StreamSubscription _teamEvent;
|
||||
void _initRefreshAction() {
|
||||
_teamEvent = eventBus.on<OtherTypeRefreshListEvent>().listen((event) {
|
||||
getFaceListData();
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> onReady() async {
|
||||
// TODO: implement onReady
|
||||
super.onReady();
|
||||
print("onReady()");
|
||||
|
||||
// 获取是否是演示模式 演示模式不获取接口
|
||||
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||
// print("aaaaaaa:$isDemoMode");
|
||||
if (isDemoMode == false) {
|
||||
_initReplySubscription();
|
||||
|
||||
_initRefreshAction();
|
||||
|
||||
getFaceListData();
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> onInit() async {
|
||||
// TODO: implement onInit
|
||||
super.onInit();
|
||||
print("onInit()");
|
||||
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||
if (isDemoMode == false) {
|
||||
// senderQueryingFingerprintStatus();
|
||||
// senderCheckingCardStatus();
|
||||
|
||||
// senderCheckingUserInfoCount();
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> onClose() async {
|
||||
// TODO: implement onClose
|
||||
super.onClose();
|
||||
|
||||
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||
if (isDemoMode == false) {
|
||||
_replySubscription.cancel();
|
||||
_teamEvent.cancel();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,8 +1,10 @@
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/main/lockDetail/face/faceList/faceListData_entity.dart';
|
||||
import 'package:star_lock/tools/keySearchWidget.dart';
|
||||
import 'package:star_lock/tools/left_slide_actions.dart';
|
||||
|
||||
import '../../../../appRouters.dart';
|
||||
import '../../../../app_settings/app_colors.dart';
|
||||
@ -44,7 +46,7 @@ class _FaceListState extends State<FaceList> {
|
||||
if (isDemoMode == false) {
|
||||
showDeletAlertDialog(context);
|
||||
} else {
|
||||
// Get.toNamed(Routers.seletLockTypePage);
|
||||
// Get.toNamed(Routers.selectLockTypePage);
|
||||
logic.showToast("演示模式");
|
||||
}
|
||||
},
|
||||
@ -53,86 +55,99 @@ class _FaceListState extends State<FaceList> {
|
||||
),
|
||||
body: Column(
|
||||
children: [
|
||||
_searchWidget(),
|
||||
KeySearchWidget(
|
||||
editingController: state.searchController,
|
||||
onSubmittedAction: () {
|
||||
logic.getFaceListData();
|
||||
},
|
||||
),
|
||||
SizedBox(
|
||||
height: 20.h,
|
||||
),
|
||||
Expanded(child: _buildMainUI()),
|
||||
AddBottomWhiteBtn(
|
||||
btnName:
|
||||
'${TranslationLoader.lanKeys!.add!.tr}${TranslationLoader.lanKeys!.face!.tr}',
|
||||
'${TranslationLoader.lanKeys!.add!.tr}${TranslationLoader.lanKeys!.face!.tr}',
|
||||
onClick: () async {
|
||||
var data =
|
||||
await Get.toNamed(Routers.addFaceTypeManagePage);
|
||||
await Get.toNamed(Routers.addFaceTypeManagePage, arguments: {
|
||||
"lockId": state.lockId.value,
|
||||
"fromType": 1 // 1从添加钥匙列表进入 2从考勤添加员工入口进入
|
||||
});
|
||||
if (data != null) {
|
||||
// 遥控添加
|
||||
|
||||
logic.getFaceListData();
|
||||
}
|
||||
},
|
||||
),
|
||||
SizedBox(
|
||||
height: 64.h,
|
||||
)
|
||||
SizedBox(height: 64.h)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _searchWidget() {
|
||||
return Container(
|
||||
height: 60.h,
|
||||
margin: EdgeInsets.only(top: 20.w, left: 20.w, right: 10.w),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white, borderRadius: BorderRadius.circular(5)),
|
||||
child: TextField(
|
||||
//输入框一行
|
||||
maxLines: 1,
|
||||
controller: state.searchController,
|
||||
autofocus: false,
|
||||
onChanged: (value) {
|
||||
print("onChanged:$value");
|
||||
},
|
||||
onEditingComplete: () {
|
||||
print("onEditingComplete:");
|
||||
},
|
||||
onSubmitted: (value) {
|
||||
// 调用遥控列表
|
||||
|
||||
},
|
||||
decoration: InputDecoration(
|
||||
//输入里面输入文字内边距设置
|
||||
contentPadding: const EdgeInsets.only(
|
||||
top: 12.0, left: -19.0, right: -15.0, bottom: 8.0),
|
||||
hintText: TranslationLoader.lanKeys!.pleaseEnter!.tr,
|
||||
hintStyle: TextStyle(fontSize: 22.sp, height: 3.0),
|
||||
//不需要输入框下划线
|
||||
border: InputBorder.none,
|
||||
//左边图标设置
|
||||
icon: Padding(
|
||||
padding: EdgeInsets.only(
|
||||
top: 20.h, bottom: 20.h, right: 20.w, left: 10.w),
|
||||
child: Image.asset(
|
||||
'images/main/icon_main_search.png',
|
||||
width: 40.w,
|
||||
height: 40.w,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildMainUI() {
|
||||
String typeImgName = 'images/icon_card.png';
|
||||
|
||||
return const NoData();
|
||||
{
|
||||
return Obx(() => state.faceItemListData.value.isNotEmpty
|
||||
? ListView.separated(
|
||||
itemCount: state.faceItemListData.value.length,
|
||||
itemBuilder: (c, index) {
|
||||
FaceItemData getFaceItemData =
|
||||
state.faceItemListData.value[index];
|
||||
// 人脸
|
||||
if (index < state.faceItemListData.value.length) {
|
||||
return LeftSlideActions(
|
||||
key: Key(getFaceItemData.faceName!),
|
||||
actionsWidth: 60,
|
||||
actions: [
|
||||
_buildDeleteBtn(getFaceItemData),
|
||||
],
|
||||
decoration: const BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(1)),
|
||||
),
|
||||
child: _keyItem(
|
||||
'images/icon_fingerprint.png',
|
||||
getFaceItemData.faceName!,
|
||||
(getFaceItemData.faceType! != 1)
|
||||
? (getFaceItemData.endDate! <
|
||||
DateTime.now().millisecondsSinceEpoch
|
||||
? "已失效"
|
||||
: "")
|
||||
: "",
|
||||
getFaceItemData.validTimeStr!,
|
||||
// fingerprintItemData.fingerprintType! == 1
|
||||
// ? "永久"
|
||||
// : "${DateTool().dateToYMDHNString(fingerprintItemData.startDate.toString())} - ${DateTool().dateToYMDHNString(fingerprintItemData.endDate.toString())}",
|
||||
() async {
|
||||
var data =
|
||||
await Get.toNamed(Routers.faceDetailPage, arguments: {
|
||||
"faceItemData": getFaceItemData,
|
||||
});
|
||||
if (data != null) {
|
||||
logic.getFaceListData();
|
||||
}
|
||||
}),
|
||||
);
|
||||
}
|
||||
return const SizedBox.shrink();
|
||||
},
|
||||
separatorBuilder: (BuildContext context, int index) {
|
||||
return const Divider(
|
||||
height: 1,
|
||||
color: AppColors.greyLineColor,
|
||||
);
|
||||
},
|
||||
)
|
||||
: const NoData());
|
||||
}
|
||||
}
|
||||
|
||||
Widget _buildDeleteBtn(String idStr) {
|
||||
Widget _buildDeleteBtn(FaceItemData faceItemData) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
// 省略: 弹出是否删除的确认对话框。
|
||||
showIosTipViewDialog(context, idStr);
|
||||
state.deletKeyID = faceItemData.faceId.toString();
|
||||
state.deletFaceNo = int.parse(faceItemData.faceNumber!);
|
||||
showIosTipViewDialog(context);
|
||||
},
|
||||
child: Container(
|
||||
width: 60,
|
||||
@ -151,7 +166,7 @@ class _FaceListState extends State<FaceList> {
|
||||
);
|
||||
}
|
||||
|
||||
void showIosTipViewDialog(BuildContext context, String keyId) {
|
||||
void showIosTipViewDialog(BuildContext context) {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
@ -159,8 +174,11 @@ class _FaceListState extends State<FaceList> {
|
||||
title: "提示",
|
||||
tipTitle: "确定要删除吗?",
|
||||
sureClick: () async {
|
||||
// 遥控删除
|
||||
|
||||
Get.back();
|
||||
state.isDeletFaceData = true;
|
||||
state.isDeletAll = false;
|
||||
state.deletUserID = (await Storage.getUid())!;
|
||||
logic.senderAddFace();
|
||||
},
|
||||
cancelClick: () {
|
||||
Get.back();
|
||||
@ -170,8 +188,8 @@ class _FaceListState extends State<FaceList> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _keyItem(String lockTypeIcon, String lockTypeTitle, String showTime,
|
||||
Function() action) {
|
||||
Widget _keyItem(String lockTypeIcon, String lockTypeTitle,
|
||||
String ifInvalidation, String showTime, Function() action) {
|
||||
return GestureDetector(
|
||||
onTap: action,
|
||||
child: Container(
|
||||
@ -192,24 +210,26 @@ class _FaceListState extends State<FaceList> {
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(lockTypeTitle,
|
||||
style: TextStyle(
|
||||
fontSize: 24.sp, color: AppColors.blackColor)),
|
||||
Expanded(child: Container()),
|
||||
Text(ifInvalidation,
|
||||
style: TextStyle(fontSize: 22.sp, color: Colors.red)),
|
||||
SizedBox(width: 10.w),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 5.h),
|
||||
Container(
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Text(showTime,
|
||||
style: TextStyle(
|
||||
fontSize: 18.sp,
|
||||
color: AppColors.placeholderTextColor)),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Text(showTime,
|
||||
style: TextStyle(
|
||||
fontSize: 18.sp,
|
||||
color: AppColors.placeholderTextColor)),
|
||||
],
|
||||
),
|
||||
SizedBox(width: 20.h),
|
||||
],
|
||||
@ -222,13 +242,13 @@ class _FaceListState extends State<FaceList> {
|
||||
);
|
||||
}
|
||||
|
||||
void showDeletAlertDialog(BuildContext context,) {
|
||||
void showDeletAlertDialog(BuildContext context) {
|
||||
showCupertinoDialog(
|
||||
context: context,
|
||||
builder: (context) {
|
||||
return CupertinoAlertDialog(
|
||||
title: const Text("提示"),
|
||||
content: const Text('重置后信息都会清除哦,确认要重置吗?'),
|
||||
content: const Text('重置后,该锁的人脸都将被删除哦,确认要重置吗?'),
|
||||
actions: [
|
||||
CupertinoDialogAction(
|
||||
child: Text(TranslationLoader.lanKeys!.cancel!.tr),
|
||||
@ -239,8 +259,13 @@ class _FaceListState extends State<FaceList> {
|
||||
CupertinoDialogAction(
|
||||
child: Text(TranslationLoader.lanKeys!.sure!.tr),
|
||||
onPressed: () {
|
||||
// 遥控重置
|
||||
|
||||
Navigator.pop(context);
|
||||
state.isDeletFaceData = true;
|
||||
state.isDeletAll = true;
|
||||
state.deletKeyID = "1";
|
||||
state.deletUserID = "DeleteAll!@#";
|
||||
state.deletFaceNo = 255;
|
||||
logic.senderAddFace();
|
||||
},
|
||||
),
|
||||
],
|
||||
|
||||
@ -1,6 +1,24 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/main/lockDetail/face/faceList/faceListData_entity.dart';
|
||||
|
||||
class FaceListState{
|
||||
class FaceListState {
|
||||
final TextEditingController searchController = TextEditingController();
|
||||
}
|
||||
final lockId = 0.obs;
|
||||
|
||||
// 因为删除跟添加人脸用的同一个协议 所以这里用做判断
|
||||
var isDeletFaceData = false;
|
||||
var isDeletAll = false;
|
||||
var deletKeyID = "";
|
||||
var deletUserID = "DeleteAll!@#";
|
||||
var deletFaceNo = 0;
|
||||
|
||||
final faceItemListData = <FaceItemData>[].obs;
|
||||
|
||||
var ifCurrentScreen = true.obs; // 是否是当前界面,用于判断是否需要针对当前界面进行展示
|
||||
|
||||
FaceListState() {
|
||||
Map map = Get.arguments;
|
||||
lockId.value = map["lockId"];
|
||||
}
|
||||
}
|
||||
|
||||
@ -25,9 +25,9 @@ class _AddFingerprintTypeManageTabbarState extends State<AddFingerprintTypeManag
|
||||
late TabController _tabController;
|
||||
|
||||
final List<ItemView> _itemTabs = <ItemView>[
|
||||
ItemView(title: TranslationLoader.lanKeys!.permanent!.tr, seletType: "0"),
|
||||
ItemView(title: TranslationLoader.lanKeys!.timeLimit!.tr, seletType: "1"),
|
||||
ItemView(title: TranslationLoader.lanKeys!.circulation!.tr, seletType: "2"),
|
||||
ItemView(title: TranslationLoader.lanKeys!.permanent!.tr, selectType: "0"),
|
||||
ItemView(title: TranslationLoader.lanKeys!.timeLimit!.tr, selectType: "1"),
|
||||
ItemView(title: TranslationLoader.lanKeys!.circulation!.tr, selectType: "2"),
|
||||
];
|
||||
|
||||
@override
|
||||
@ -97,7 +97,7 @@ class _AddFingerprintTypeManageTabbarState extends State<AddFingerprintTypeManag
|
||||
controller: _tabController,
|
||||
children: _itemTabs
|
||||
.map((ItemView item) => AddFingerprintTypePage(
|
||||
seletType: item.seletType,
|
||||
selectType: item.selectType,
|
||||
lockId: widget.lockId,
|
||||
fromType: widget.fromType,
|
||||
fromTypeTwoStaffName:widget.fromTypeTwoStaffName
|
||||
@ -109,8 +109,8 @@ class _AddFingerprintTypeManageTabbarState extends State<AddFingerprintTypeManag
|
||||
}
|
||||
|
||||
class ItemView {
|
||||
const ItemView({required this.title, required this.seletType});
|
||||
const ItemView({required this.title, required this.selectType});
|
||||
|
||||
final String title;
|
||||
final String seletType;
|
||||
}
|
||||
final String selectType;
|
||||
}
|
||||
@ -13,11 +13,11 @@ class AddFingerprintTypeLogic extends BaseGetXController{
|
||||
var fingerprintType = 0; // 永久:1;限时2,单次3,循环:4
|
||||
var startDate = "";
|
||||
var endDate = "";
|
||||
if (state.seletType.value == "0") {
|
||||
if (state.selectType.value == "0") {
|
||||
fingerprintType = 1;
|
||||
startDate = "0";
|
||||
endDate = "0";
|
||||
} else if (state.seletType.value == "1") {
|
||||
} else if (state.selectType.value == "1") {
|
||||
fingerprintType = 2;
|
||||
if (state.beginTimeTimestamp.value.isEmpty) {
|
||||
showToast("请选择开始时间");
|
||||
@ -41,7 +41,7 @@ class AddFingerprintTypeLogic extends BaseGetXController{
|
||||
|
||||
startDate = state.beginTimeTimestamp.value;
|
||||
endDate = state.endTimeTimestamp.value;
|
||||
} else if (state.seletType.value == "2") {
|
||||
} else if (state.selectType.value == "2") {
|
||||
if (state.effectiveDateTime.value <= 0) {
|
||||
showToast("请选择生效时间");
|
||||
return;
|
||||
@ -98,4 +98,4 @@ class AddFingerprintTypeLogic extends BaseGetXController{
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@ -15,14 +15,14 @@ import '../../../../translations/trans_lib.dart';
|
||||
import 'addFingerprintType_logic.dart';
|
||||
|
||||
class AddFingerprintTypePage extends StatefulWidget {
|
||||
final String seletType; // 永久限时循环下标
|
||||
final String selectType; // 永久限时循环下标
|
||||
final int lockId;
|
||||
final int fromType; // // 1从添加钥匙列表进入 2从考勤添加员工入口进入
|
||||
final String fromTypeTwoStaffName; // 从添加员工进入 传入员工名字
|
||||
|
||||
const AddFingerprintTypePage(
|
||||
{Key? key,
|
||||
required this.seletType,
|
||||
required this.selectType,
|
||||
required this.lockId,
|
||||
required this.fromType,
|
||||
required this.fromTypeTwoStaffName})
|
||||
@ -38,7 +38,7 @@ class _AddFingerprintTypePageState extends State<AddFingerprintTypePage> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
state.seletType.value = widget.seletType;
|
||||
state.selectType.value = widget.selectType;
|
||||
state.lockId.value = widget.lockId;
|
||||
// state.nameController.text = widget.fromTypeTwoStaffName;
|
||||
|
||||
@ -49,7 +49,7 @@ class _AddFingerprintTypePageState extends State<AddFingerprintTypePage> {
|
||||
}
|
||||
|
||||
Widget indexChangeWidget() {
|
||||
switch (int.parse(widget.seletType)) {
|
||||
switch (int.parse(widget.selectType)) {
|
||||
case 0:
|
||||
{
|
||||
// 永久
|
||||
@ -193,14 +193,14 @@ class _AddFingerprintTypePageState extends State<AddFingerprintTypePage> {
|
||||
onClick: () async {
|
||||
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||
if (isDemoMode == false) {
|
||||
// print("state.seletType:${state.seletType.value}");
|
||||
// print("state.selectType:${state.selectType.value}");
|
||||
if (state.nameController.text.isEmpty) {
|
||||
logic.showToast("请输入姓名");
|
||||
return;
|
||||
}
|
||||
logic.checkFingerprintNameDuplicated(state.nameController.text);
|
||||
} else {
|
||||
// Get.toNamed(Routers.seletLockTypePage);
|
||||
// Get.toNamed(Routers.selectLockTypePage);
|
||||
logic.showToast("演示模式");
|
||||
}
|
||||
}),
|
||||
@ -4,7 +4,7 @@ import 'package:get/get.dart';
|
||||
|
||||
class AddFingerprintState{
|
||||
final lockId = 0.obs;
|
||||
final seletType = "0".obs;// 0永久 1显示 2循环
|
||||
final selectType = "0".obs;// 0永久 1显示 2循环
|
||||
final fromType = 1.obs; // // 1从添加钥匙列表进入 2从考勤添加员工入口进入
|
||||
final isStressFingerprint = false.obs;
|
||||
|
||||
@ -23,4 +23,4 @@ class AddFingerprintState{
|
||||
// lockId.value = map["lockId"];
|
||||
// fromType.value = map["fromType"];
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -50,7 +50,7 @@ class _FingerprintListPageState extends State<FingerprintListPage> with RouteAwa
|
||||
if (isDemoMode == false) {
|
||||
showDeletAlertDialog(context);
|
||||
} else {
|
||||
// Get.toNamed(Routers.seletLockTypePage);
|
||||
// Get.toNamed(Routers.selectLockTypePage);
|
||||
logic.showToast("演示模式");
|
||||
}
|
||||
},
|
||||
|
||||
@ -1,6 +0,0 @@
|
||||
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class LockEscalationState{
|
||||
|
||||
}
|
||||
@ -59,7 +59,7 @@ class _LockOperatingRecordPageState extends State<LockOperatingRecordPage> {
|
||||
|
||||
_openModalBottomSheet();
|
||||
}else{
|
||||
// Get.toNamed(Routers.seletLockTypePage);
|
||||
// Get.toNamed(Routers.selectLockTypePage);
|
||||
logic.showToast("演示模式");
|
||||
}
|
||||
},
|
||||
|
||||
@ -6,7 +6,6 @@ import 'package:get/get.dart';
|
||||
import 'package:star_lock/blue/io_protocol/io_setSupportFunctionsWithParameters.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
import '../../../../blue/blue_manage.dart';
|
||||
import '../../../../blue/io_protocol/io_readSupportFunctionsWithParameters.dart';
|
||||
import '../../../../blue/io_reply.dart';
|
||||
import '../../../../blue/io_tool/io_tool.dart';
|
||||
import '../../../../blue/io_tool/manager_event_bus.dart';
|
||||
@ -182,7 +181,7 @@ class AutomaticBlockingLogic extends BaseGetXController{
|
||||
|
||||
var publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||
List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
|
||||
|
||||
|
||||
String autoTime;
|
||||
if(state.isOpen.value == false){
|
||||
autoTime = "0";
|
||||
@ -2,7 +2,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../../../lockMian/entity/lockListInfo_entity.dart';
|
||||
import '../lockSet/lockSetInfo_entity.dart';
|
||||
|
||||
class AutomaticBlockingState {
|
||||
@ -46,4 +45,4 @@ class AutomaticBlockingState {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@ -1,14 +1,12 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
|
||||
|
||||
import '../../../../../appRouters.dart';
|
||||
import '../../../../../app_settings/app_colors.dart';
|
||||
import '../../../../../tools/commonItem.dart';
|
||||
import '../../../../../tools/titleAppBar.dart';
|
||||
import '../../../../../translations/trans_lib.dart';
|
||||
import '../../lockSet/lockSetInfo_entity.dart';
|
||||
import 'basicInformation_logic.dart';
|
||||
|
||||
class BasicInformationPage extends StatefulWidget {
|
||||
@ -102,7 +100,7 @@ class _BasicInformationPageState extends State<BasicInformationPage> {
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
action: () async {
|
||||
Get.toNamed(Routers.lockSeletGroupingPage, arguments: {
|
||||
Get.toNamed(Routers.lockSelectGroupingPage, arguments: {
|
||||
'lockSetInfoData': state.lockSetInfoData.value
|
||||
})!
|
||||
.then((val) {
|
||||
@ -1,7 +1,6 @@
|
||||
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../../../../lockMian/entity/lockListInfo_entity.dart';
|
||||
import '../../lockSet/lockSetInfo_entity.dart';
|
||||
|
||||
class BasicInformationState {
|
||||
@ -15,4 +14,4 @@ class BasicInformationState {
|
||||
lockSetInfoData.value = map["lockSetInfoData"];
|
||||
lockBasicInfo.value = lockSetInfoData.value.lockBasicInfo!;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3,10 +3,10 @@ import '../../../../../network/api_repository.dart';
|
||||
import '../../../../../tools/baseGetXController.dart';
|
||||
import '../../../../../tools/eventBusEventManage.dart';
|
||||
import '../../../electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupListEntity.dart';
|
||||
import 'lockSeletGrouping_state.dart';
|
||||
import 'lockSelectGrouping_state.dart';
|
||||
|
||||
class LockSeletGroupingLogic extends BaseGetXController {
|
||||
final LockSeletGroupingState state = LockSeletGroupingState();
|
||||
class LockSelectGroupingLogic extends BaseGetXController {
|
||||
final LockSelectGroupingState state = LockSelectGroupingState();
|
||||
|
||||
//创建锁分组请求
|
||||
Future<void> addLockGroupRequest() async {
|
||||
@ -64,4 +64,4 @@ class LockSeletGroupingLogic extends BaseGetXController {
|
||||
// TODO: implement onClose
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -10,18 +10,18 @@ import '../../../../../tools/noData.dart';
|
||||
import '../../../../../tools/submitBtn.dart';
|
||||
import '../../../../../tools/titleAppBar.dart';
|
||||
import '../../../../../translations/trans_lib.dart';
|
||||
import 'lockSeletGrouping_logic.dart';
|
||||
import 'lockSelectGrouping_logic.dart';
|
||||
|
||||
class LockSeletGroupingPage extends StatefulWidget {
|
||||
const LockSeletGroupingPage({Key? key}) : super(key: key);
|
||||
class LockSelectGroupingPage extends StatefulWidget {
|
||||
const LockSelectGroupingPage({Key? key}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<LockSeletGroupingPage> createState() => _LockSeletGroupingPageState();
|
||||
State<LockSelectGroupingPage> createState() => _LockSelectGroupingPageState();
|
||||
}
|
||||
|
||||
class _LockSeletGroupingPageState extends State<LockSeletGroupingPage> {
|
||||
final logic = Get.put(LockSeletGroupingLogic());
|
||||
final state = Get.find<LockSeletGroupingLogic>().state;
|
||||
class _LockSelectGroupingPageState extends State<LockSelectGroupingPage> {
|
||||
final logic = Get.put(LockSelectGroupingLogic());
|
||||
final state = Get.find<LockSelectGroupingLogic>().state;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@ -6,16 +6,16 @@ import 'package:get/get.dart';
|
||||
import '../../../electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupListEntity.dart';
|
||||
import '../../lockSet/lockSetInfo_entity.dart';
|
||||
|
||||
class LockSeletGroupingState {
|
||||
class LockSelectGroupingState {
|
||||
var lockSetInfoData = LockSetInfoData().obs;
|
||||
var lockBasicInfo = LockBasicInfo().obs;
|
||||
|
||||
var groupList = <GroupListItem>[].obs;
|
||||
final TextEditingController changeNameController = TextEditingController();
|
||||
|
||||
LockSeletGroupingState() {
|
||||
LockSelectGroupingState() {
|
||||
var map = Get.arguments;
|
||||
lockSetInfoData.value = map["lockSetInfoData"];
|
||||
lockBasicInfo.value = lockSetInfoData.value.lockBasicInfo!;
|
||||
}
|
||||
}
|
||||
}
|
||||