调试锁设置模块接口
This commit is contained in:
parent
88f4c5f9ab
commit
2271a45c19
@ -122,6 +122,8 @@
|
|||||||
"remoteUnlocking":"Remote Unlocking",
|
"remoteUnlocking":"Remote Unlocking",
|
||||||
"automaticBlocking":"Automatic Blocking",
|
"automaticBlocking":"Automatic Blocking",
|
||||||
"normallyOpenMode":"Normally Open Mode",
|
"normallyOpenMode":"Normally Open Mode",
|
||||||
|
"automaticUnLock":"Automatic UnLock",
|
||||||
|
"automaticUnLockTip":"After opening, the lock will open automatically at the beginning of the normally open mode",
|
||||||
"lockSound":"Lock Sound",
|
"lockSound":"Lock Sound",
|
||||||
"burglarAlarm":"Burglar Alarm",
|
"burglarAlarm":"Burglar Alarm",
|
||||||
"resetButton":"Reset Button",
|
"resetButton":"Reset Button",
|
||||||
@ -226,6 +228,8 @@
|
|||||||
"lockScreen":"Lock Screen",
|
"lockScreen":"Lock Screen",
|
||||||
"closed":"Closed",
|
"closed":"Closed",
|
||||||
"opened":"Opened",
|
"opened":"Opened",
|
||||||
|
"close":"Close",
|
||||||
|
"open":"Open",
|
||||||
"hideInvalidUnlockPermissions":"Hide Invalid Unlock Permissions",
|
"hideInvalidUnlockPermissions":"Hide Invalid Unlock Permissions",
|
||||||
"appUnlockRequiresMobilePhoneAccessToTheLock":"APP Unlock Requires Mobile Phone Access To The Lock",
|
"appUnlockRequiresMobilePhoneAccessToTheLock":"APP Unlock Requires Mobile Phone Access To The Lock",
|
||||||
"valueAddedServices":"Value Added Services",
|
"valueAddedServices":"Value Added Services",
|
||||||
@ -390,5 +394,11 @@
|
|||||||
"lockScreenTip":"After the function is enabled, you need to use your fingerprint, face or account password to open the APP. There is no need to verify again for 3 minutes",
|
"lockScreenTip":"After the function is enabled, you need to use your fingerprint, face or account password to open the APP. There is no need to verify again for 3 minutes",
|
||||||
"hideInvalidUnlockPermissionsTip":"After the function is enabled, the password, electronic key, card, fingerprint and other unlocking permissions that have been invalid for a long time will be hidden and not displayed in the list.",
|
"hideInvalidUnlockPermissionsTip":"After the function is enabled, the password, electronic key, card, fingerprint and other unlocking permissions that have been invalid for a long time will be hidden and not displayed in the list.",
|
||||||
"appUnlockRequiresMobilePhoneAccessToTheLockTip":"For the selected locks, when the user uses the APP to unlock the lock, his phone needs to be connected to the Internet, otherwise the lock cannot be unlocked",
|
"appUnlockRequiresMobilePhoneAccessToTheLockTip":"For the selected locks, when the user uses the APP to unlock the lock, his phone needs to be connected to the Internet, otherwise the lock cannot be unlocked",
|
||||||
"checkAll":"Check All"
|
"checkAll":"Check All",
|
||||||
|
|
||||||
|
"wifiDistributionNetwork":"WiFi Distribution Network",
|
||||||
|
"configuringWiFi":"Configuring WiFi",
|
||||||
|
"pleaseEnterWifiName":"Please Enter Wifi Name",
|
||||||
|
"wifiPwd":"WiFi password",
|
||||||
|
"pleaseEnterWifiPwd":"Please Enter WiFi Password"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -122,6 +122,8 @@
|
|||||||
"remoteUnlocking":"remoteUnlocking",
|
"remoteUnlocking":"remoteUnlocking",
|
||||||
"automaticBlocking":"automaticBlocking",
|
"automaticBlocking":"automaticBlocking",
|
||||||
"normallyOpenMode":"normallyOpenMode",
|
"normallyOpenMode":"normallyOpenMode",
|
||||||
|
"automaticUnLock":"automaticUnLock",
|
||||||
|
"automaticUnLockTip":"automaticUnLockTip",
|
||||||
"lockSound":"lockSound",
|
"lockSound":"lockSound",
|
||||||
"burglarAlarm":"burglarAlarm",
|
"burglarAlarm":"burglarAlarm",
|
||||||
"resetButton":"resetButton",
|
"resetButton":"resetButton",
|
||||||
@ -223,6 +225,8 @@
|
|||||||
"lockScreen":"lockScreen",
|
"lockScreen":"lockScreen",
|
||||||
"closed":"closed",
|
"closed":"closed",
|
||||||
"opened":"opened",
|
"opened":"opened",
|
||||||
|
"close":"close",
|
||||||
|
"open":"open",
|
||||||
"hideInvalidUnlockPermissions":"hideInvalidUnlockPermissions",
|
"hideInvalidUnlockPermissions":"hideInvalidUnlockPermissions",
|
||||||
"appUnlockRequiresMobilePhoneAccessToTheLock":"appUnlockRequiresMobilePhoneAccessToTheLock",
|
"appUnlockRequiresMobilePhoneAccessToTheLock":"appUnlockRequiresMobilePhoneAccessToTheLock",
|
||||||
"valueAddedServices":"valueAddedServices",
|
"valueAddedServices":"valueAddedServices",
|
||||||
@ -390,5 +394,11 @@
|
|||||||
"lockScreenTip":"lockScreenTip",
|
"lockScreenTip":"lockScreenTip",
|
||||||
"hideInvalidUnlockPermissionsTip":"hideInvalidUnlockPermissionsTip",
|
"hideInvalidUnlockPermissionsTip":"hideInvalidUnlockPermissionsTip",
|
||||||
"appUnlockRequiresMobilePhoneAccessToTheLockTip":"appUnlockRequiresMobilePhoneAccessToTheLockTip",
|
"appUnlockRequiresMobilePhoneAccessToTheLockTip":"appUnlockRequiresMobilePhoneAccessToTheLockTip",
|
||||||
"checkAll":"checkAll"
|
"checkAll":"checkAll",
|
||||||
|
|
||||||
|
"wifiDistributionNetwork":"wifiDistributionNetwork",
|
||||||
|
"configuringWiFi":"configuringWiFi",
|
||||||
|
"pleaseEnterWifiName":"pleaseEnterWifiName",
|
||||||
|
"wifiPwd":"wifiPwd",
|
||||||
|
"pleaseEnterWifiPwd":"pleaseEnterWifiPwd"
|
||||||
}
|
}
|
||||||
@ -122,6 +122,8 @@
|
|||||||
"remoteUnlocking":"远程开锁",
|
"remoteUnlocking":"远程开锁",
|
||||||
"automaticBlocking":"自动闭锁",
|
"automaticBlocking":"自动闭锁",
|
||||||
"normallyOpenMode":"常开模式",
|
"normallyOpenMode":"常开模式",
|
||||||
|
"automaticUnLock":"自动开锁",
|
||||||
|
"automaticUnLockTip":"开启后锁将在常开模式开始时自动打开",
|
||||||
"lockSound":"锁声音",
|
"lockSound":"锁声音",
|
||||||
"burglarAlarm":"防撬报警",
|
"burglarAlarm":"防撬报警",
|
||||||
"resetButton":"重置键",
|
"resetButton":"重置键",
|
||||||
@ -223,6 +225,8 @@
|
|||||||
"lockScreen":"锁屏",
|
"lockScreen":"锁屏",
|
||||||
"closed":"已关闭",
|
"closed":"已关闭",
|
||||||
"opened":"已开启",
|
"opened":"已开启",
|
||||||
|
"close":"关闭",
|
||||||
|
"open":"开启",
|
||||||
"hideInvalidUnlockPermissions":"隐藏无效开锁权限",
|
"hideInvalidUnlockPermissions":"隐藏无效开锁权限",
|
||||||
"appUnlockRequiresMobilePhoneAccessToTheLock":"APP开锁时需手机连网的锁",
|
"appUnlockRequiresMobilePhoneAccessToTheLock":"APP开锁时需手机连网的锁",
|
||||||
"valueAddedServices":"增值服务",
|
"valueAddedServices":"增值服务",
|
||||||
@ -393,5 +397,11 @@
|
|||||||
"lockScreenTip":"功能开启后,需使用指纹、人脸或账号密码来打开 APP。3分钟内不需要再次验证",
|
"lockScreenTip":"功能开启后,需使用指纹、人脸或账号密码来打开 APP。3分钟内不需要再次验证",
|
||||||
"hideInvalidUnlockPermissionsTip":"功能开启后,已失效较长时间的密码、电子钥匙、卡、指纹等开锁权限将被隐藏,不在列表里显示。",
|
"hideInvalidUnlockPermissionsTip":"功能开启后,已失效较长时间的密码、电子钥匙、卡、指纹等开锁权限将被隐藏,不在列表里显示。",
|
||||||
"appUnlockRequiresMobilePhoneAccessToTheLockTip":"对于选中的这些锁,当用户用APP开锁时,他的手机需要是连网的,否则无法开锁",
|
"appUnlockRequiresMobilePhoneAccessToTheLockTip":"对于选中的这些锁,当用户用APP开锁时,他的手机需要是连网的,否则无法开锁",
|
||||||
"checkAll":"全选"
|
"checkAll":"全选",
|
||||||
|
|
||||||
|
"wifiDistributionNetwork":"WiFi配网",
|
||||||
|
"configuringWiFi":"配置WiFi",
|
||||||
|
"pleaseEnterWifiName":"请输入WiFi名字",
|
||||||
|
"wifiPwd":"WiFi名字",
|
||||||
|
"pleaseEnterWifiPwd":"请输入WiFi密码"
|
||||||
}
|
}
|
||||||
@ -32,6 +32,8 @@ PODS:
|
|||||||
- GoogleMaps/Base
|
- GoogleMaps/Base
|
||||||
- image_picker_ios (0.0.1):
|
- image_picker_ios (0.0.1):
|
||||||
- Flutter
|
- Flutter
|
||||||
|
- network_info_plus (0.0.1):
|
||||||
|
- Flutter
|
||||||
- package_info_plus (0.4.5):
|
- package_info_plus (0.4.5):
|
||||||
- Flutter
|
- Flutter
|
||||||
- path_provider_foundation (0.0.1):
|
- path_provider_foundation (0.0.1):
|
||||||
@ -63,6 +65,7 @@ DEPENDENCIES:
|
|||||||
- geocoding_ios (from `.symlinks/plugins/geocoding_ios/ios`)
|
- geocoding_ios (from `.symlinks/plugins/geocoding_ios/ios`)
|
||||||
- google_maps_flutter_ios (from `.symlinks/plugins/google_maps_flutter_ios/ios`)
|
- google_maps_flutter_ios (from `.symlinks/plugins/google_maps_flutter_ios/ios`)
|
||||||
- image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`)
|
- image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`)
|
||||||
|
- network_info_plus (from `.symlinks/plugins/network_info_plus/ios`)
|
||||||
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
|
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
|
||||||
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
|
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
|
||||||
- permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
|
- permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
|
||||||
@ -101,6 +104,8 @@ EXTERNAL SOURCES:
|
|||||||
:path: ".symlinks/plugins/google_maps_flutter_ios/ios"
|
:path: ".symlinks/plugins/google_maps_flutter_ios/ios"
|
||||||
image_picker_ios:
|
image_picker_ios:
|
||||||
:path: ".symlinks/plugins/image_picker_ios/ios"
|
:path: ".symlinks/plugins/image_picker_ios/ios"
|
||||||
|
network_info_plus:
|
||||||
|
:path: ".symlinks/plugins/network_info_plus/ios"
|
||||||
package_info_plus:
|
package_info_plus:
|
||||||
:path: ".symlinks/plugins/package_info_plus/ios"
|
:path: ".symlinks/plugins/package_info_plus/ios"
|
||||||
path_provider_foundation:
|
path_provider_foundation:
|
||||||
@ -129,6 +134,7 @@ SPEC CHECKSUMS:
|
|||||||
google_maps_flutter_ios: abdac20d6ce8931f6ebc5f46616df241bfaa2cfd
|
google_maps_flutter_ios: abdac20d6ce8931f6ebc5f46616df241bfaa2cfd
|
||||||
GoogleMaps: 025272d5876d3b32604e5c080dc25eaf68764693
|
GoogleMaps: 025272d5876d3b32604e5c080dc25eaf68764693
|
||||||
image_picker_ios: 4a8aadfbb6dc30ad5141a2ce3832af9214a705b5
|
image_picker_ios: 4a8aadfbb6dc30ad5141a2ce3832af9214a705b5
|
||||||
|
network_info_plus: 122280582fe2fa2bbb8681a4269745cd5c3a9b32
|
||||||
package_info_plus: 6c92f08e1f853dc01228d6f553146438dafcd14e
|
package_info_plus: 6c92f08e1f853dc01228d6f553146438dafcd14e
|
||||||
path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943
|
path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943
|
||||||
permission_handler_apple: e76247795d700c14ea09e3a2d8855d41ee80a2e6
|
permission_handler_apple: e76247795d700c14ea09e3a2d8855d41ee80a2e6
|
||||||
|
|||||||
@ -372,6 +372,8 @@
|
|||||||
ALWAYS_SEARCH_USER_PATHS = YES;
|
ALWAYS_SEARCH_USER_PATHS = YES;
|
||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
||||||
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
|
CODE_SIGN_STYLE = Automatic;
|
||||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||||
DEVELOPMENT_TEAM = ZJ29NYHTV5;
|
DEVELOPMENT_TEAM = ZJ29NYHTV5;
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
@ -382,6 +384,7 @@
|
|||||||
);
|
);
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = "cn.star-lock.lock";
|
PRODUCT_BUNDLE_IDENTIFIER = "cn.star-lock.lock";
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
VERSIONING_SYSTEM = "apple-generic";
|
VERSIONING_SYSTEM = "apple-generic";
|
||||||
};
|
};
|
||||||
name = Profile;
|
name = Profile;
|
||||||
@ -500,6 +503,8 @@
|
|||||||
ALWAYS_SEARCH_USER_PATHS = YES;
|
ALWAYS_SEARCH_USER_PATHS = YES;
|
||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
||||||
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
|
CODE_SIGN_STYLE = Automatic;
|
||||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||||
DEVELOPMENT_TEAM = ZJ29NYHTV5;
|
DEVELOPMENT_TEAM = ZJ29NYHTV5;
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
@ -510,6 +515,7 @@
|
|||||||
);
|
);
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = "cn.star-lock.lock";
|
PRODUCT_BUNDLE_IDENTIFIER = "cn.star-lock.lock";
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
VERSIONING_SYSTEM = "apple-generic";
|
VERSIONING_SYSTEM = "apple-generic";
|
||||||
};
|
};
|
||||||
name = Debug;
|
name = Debug;
|
||||||
@ -521,6 +527,8 @@
|
|||||||
ALWAYS_SEARCH_USER_PATHS = YES;
|
ALWAYS_SEARCH_USER_PATHS = YES;
|
||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
||||||
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
|
CODE_SIGN_STYLE = Automatic;
|
||||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||||
DEVELOPMENT_TEAM = ZJ29NYHTV5;
|
DEVELOPMENT_TEAM = ZJ29NYHTV5;
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
@ -531,6 +539,7 @@
|
|||||||
);
|
);
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = "cn.star-lock.lock";
|
PRODUCT_BUNDLE_IDENTIFIER = "cn.star-lock.lock";
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
VERSIONING_SYSTEM = "apple-generic";
|
VERSIONING_SYSTEM = "apple-generic";
|
||||||
};
|
};
|
||||||
name = Release;
|
name = Release;
|
||||||
|
|||||||
@ -40,7 +40,7 @@
|
|||||||
</Testables>
|
</Testables>
|
||||||
</TestAction>
|
</TestAction>
|
||||||
<LaunchAction
|
<LaunchAction
|
||||||
buildConfiguration = "Release"
|
buildConfiguration = "Debug"
|
||||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||||
launchStyle = "0"
|
launchStyle = "0"
|
||||||
|
|||||||
@ -1,5 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict/>
|
<dict>
|
||||||
|
<key>com.apple.external-accessory.wireless-configuration</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|||||||
@ -36,6 +36,7 @@ import 'main/lockDetail/lcokSet/basicInformation/editLockName/editLockName_page.
|
|||||||
import 'main/lockDetail/lcokSet/basicInformation/lockSeletGrouping/lockSeletGrouping_page.dart';
|
import 'main/lockDetail/lcokSet/basicInformation/lockSeletGrouping/lockSeletGrouping_page.dart';
|
||||||
import 'main/lockDetail/lcokSet/basicInformation/uploadElectricQuantity/uploadElectricQuantity_page.dart';
|
import 'main/lockDetail/lcokSet/basicInformation/uploadElectricQuantity/uploadElectricQuantity_page.dart';
|
||||||
import 'main/lockDetail/lcokSet/burglarAlarm/burglarAlarm_page.dart';
|
import 'main/lockDetail/lcokSet/burglarAlarm/burglarAlarm_page.dart';
|
||||||
|
import 'main/lockDetail/lcokSet/configuringWifi/configuringWifi_page.dart';
|
||||||
import 'main/lockDetail/lcokSet/diagnose/diagnose_page.dart';
|
import 'main/lockDetail/lcokSet/diagnose/diagnose_page.dart';
|
||||||
import 'main/lockDetail/lcokSet/doorMagnetic/addDoorMagnetic/addDoorMagnetic_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/doorMagneticList/doorMagnetic_page.dart';
|
||||||
@ -189,6 +190,7 @@ abstract class Routers {
|
|||||||
static const burglarAlarmPage = '/BurglarAlarmPage'; // 防撬警报
|
static const burglarAlarmPage = '/BurglarAlarmPage'; // 防撬警报
|
||||||
static const resetButtonPage = '/ResetButtonPage'; // 锁重置键
|
static const resetButtonPage = '/ResetButtonPage'; // 锁重置键
|
||||||
static const unlockQRCodePage = '/UnlockQRCodePage'; // 开锁二维码
|
static const unlockQRCodePage = '/UnlockQRCodePage'; // 开锁二维码
|
||||||
|
static const configuringWifiPage = '/ConfiguringWifiPage'; // 配置WiFi
|
||||||
static const lockTimePage = '/LockTimePage'; // 锁时间
|
static const lockTimePage = '/LockTimePage'; // 锁时间
|
||||||
static const diagnosePage = '/DiagnosePage'; // 诊断
|
static const diagnosePage = '/DiagnosePage'; // 诊断
|
||||||
static const uploadDataPage = '/UploadDataPage'; // 上传数据
|
static const uploadDataPage = '/UploadDataPage'; // 上传数据
|
||||||
@ -734,5 +736,8 @@ abstract class AppRouters {
|
|||||||
GetPage(
|
GetPage(
|
||||||
name: Routers.addFingerprintPage,
|
name: Routers.addFingerprintPage,
|
||||||
page: () => const AddFingerprintPage()),
|
page: () => const AddFingerprintPage()),
|
||||||
|
GetPage(
|
||||||
|
name: Routers.configuringWifiPage,
|
||||||
|
page: () => const ConfiguringWifiPage()),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
120
star_lock/lib/blue/io_protocol/io_checkingUserInfoCount.dart
Normal file
120
star_lock/lib/blue/io_protocol/io_checkingUserInfoCount.dart
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
|
||||||
|
//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 SenderCheckingUserInfoCountCommand extends SenderProtocol {
|
||||||
|
|
||||||
|
String? keyID;
|
||||||
|
String? userID;
|
||||||
|
int? role;
|
||||||
|
int? nowTime;
|
||||||
|
List<int>? token;
|
||||||
|
int? needAuthor;
|
||||||
|
List<int>? publicKey;
|
||||||
|
List<int>? privateKey;
|
||||||
|
|
||||||
|
SenderCheckingUserInfoCountCommand({
|
||||||
|
this.keyID,
|
||||||
|
this.userID,
|
||||||
|
this.role,
|
||||||
|
this.nowTime,
|
||||||
|
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(15);
|
||||||
|
|
||||||
|
// 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!);
|
||||||
|
|
||||||
|
// time
|
||||||
|
subData.add((nowTime! & 0xff000000) >> 24);
|
||||||
|
subData.add((nowTime! & 0xff0000) >> 16);
|
||||||
|
subData.add((nowTime! & 0xff00) >> 8);
|
||||||
|
subData.add((nowTime! & 0xff));
|
||||||
|
|
||||||
|
// token
|
||||||
|
// subData.addAll(token!);
|
||||||
|
|
||||||
|
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 SenderCheckingUserInfoCountReply extends Reply {
|
||||||
|
SenderCheckingUserInfoCountReply.parseData(CommandType commandType, List<int> dataDetail)
|
||||||
|
: super.parseData(commandType, dataDetail) {
|
||||||
|
data = dataDetail;
|
||||||
|
}
|
||||||
|
}
|
||||||
131
star_lock/lib/blue/io_protocol/io_configuringWifi.dart
Normal file
131
star_lock/lib/blue/io_protocol/io_configuringWifi.dart
Normal file
@ -0,0 +1,131 @@
|
|||||||
|
|
||||||
|
//TODO:WIFI配网
|
||||||
|
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 SenderConfiguringWifiCommand extends SenderProtocol {
|
||||||
|
|
||||||
|
String? keyID;
|
||||||
|
String? userID;
|
||||||
|
String? ssid;
|
||||||
|
String? password;
|
||||||
|
int? numberOfServers;
|
||||||
|
int? listOfServers;
|
||||||
|
List<int>? token;
|
||||||
|
int? needAuthor;
|
||||||
|
List<int>? publicKey;
|
||||||
|
List<int>? privateKey;
|
||||||
|
|
||||||
|
SenderConfiguringWifiCommand({
|
||||||
|
this.keyID,
|
||||||
|
this.userID,
|
||||||
|
this.ssid,
|
||||||
|
this.password,
|
||||||
|
this.numberOfServers,
|
||||||
|
this.listOfServers,
|
||||||
|
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(50);
|
||||||
|
|
||||||
|
// 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);
|
||||||
|
|
||||||
|
//SSID 30
|
||||||
|
int ssidLength = utf8.encode(ssid!).length;
|
||||||
|
subData.addAll(utf8.encode(ssid!));
|
||||||
|
subData = getFixedLengthList(subData, 30 - ssidLength);
|
||||||
|
|
||||||
|
//Password 20
|
||||||
|
int passwordLength = utf8.encode(password!).length;
|
||||||
|
subData.addAll(utf8.encode(password!));
|
||||||
|
subData = getFixedLengthList(subData, 20 - passwordLength);
|
||||||
|
|
||||||
|
// NumberOfServers
|
||||||
|
subData.add(numberOfServers!);
|
||||||
|
|
||||||
|
// listOfServers
|
||||||
|
subData.add(listOfServers!);
|
||||||
|
|
||||||
|
// token
|
||||||
|
// subData.addAll(token!);
|
||||||
|
|
||||||
|
if(needAuthor == 0){
|
||||||
|
//AuthCodeLen 1
|
||||||
|
subData.add(0);
|
||||||
|
} else {
|
||||||
|
List<int> authCodeData = [];
|
||||||
|
|
||||||
|
//userID
|
||||||
|
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 SenderConfiguringWifiReply extends Reply {
|
||||||
|
SenderConfiguringWifiReply.parseData(CommandType commandType, List<int> dataDetail)
|
||||||
|
: super.parseData(commandType, dataDetail) {
|
||||||
|
data = dataDetail;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -22,9 +22,3 @@ class EventBusManager {
|
|||||||
eventBus?.fire(event);
|
eventBus?.fire(event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
///刷新锁列表数据
|
|
||||||
class RefreshLockListInfoDataEvent{
|
|
||||||
RefreshLockListInfoDataEvent();
|
|
||||||
}
|
|
||||||
@ -16,6 +16,8 @@ import 'io_protocol/io_addFingerprint.dart';
|
|||||||
import 'io_protocol/io_addUser.dart';
|
import 'io_protocol/io_addUser.dart';
|
||||||
import 'io_protocol/io_automaticPadlock.dart';
|
import 'io_protocol/io_automaticPadlock.dart';
|
||||||
import 'io_protocol/io_checkingCardStatus.dart';
|
import 'io_protocol/io_checkingCardStatus.dart';
|
||||||
|
import 'io_protocol/io_checkingUserInfoCount.dart';
|
||||||
|
import 'io_protocol/io_configuringWifi.dart';
|
||||||
import 'io_protocol/io_getPrivateKey.dart';
|
import 'io_protocol/io_getPrivateKey.dart';
|
||||||
import 'io_protocol/io_getPublicKey.dart';
|
import 'io_protocol/io_getPublicKey.dart';
|
||||||
import 'io_protocol/io_openLock.dart';
|
import 'io_protocol/io_openLock.dart';
|
||||||
@ -174,6 +176,12 @@ class CommandReciverManager {
|
|||||||
reply = AutomaticPadlockReply.parseData(commandType, data);
|
reply = AutomaticPadlockReply.parseData(commandType, data);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case 15:
|
||||||
|
{
|
||||||
|
// 查询用户、指纹、密码、卡片数量(用于判断是否同步)
|
||||||
|
reply = SenderCheckingUserInfoCountReply.parseData(commandType, data);
|
||||||
|
}
|
||||||
|
break;
|
||||||
case 20:
|
case 20:
|
||||||
{
|
{
|
||||||
// 查询卡片状态
|
// 查询卡片状态
|
||||||
@ -210,6 +218,12 @@ class CommandReciverManager {
|
|||||||
reply = SenderReferEventRecordNumberReply.parseData(commandType, data);
|
reply = SenderReferEventRecordNumberReply.parseData(commandType, data);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case 51:
|
||||||
|
{
|
||||||
|
// wifi配网结果
|
||||||
|
reply = SenderConfiguringWifiReply.parseData(commandType, data);
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|||||||
@ -6,6 +6,8 @@ import 'io_protocol/io_addFingerprint.dart';
|
|||||||
import 'io_protocol/io_addUser.dart';
|
import 'io_protocol/io_addUser.dart';
|
||||||
import 'io_protocol/io_automaticPadlock.dart';
|
import 'io_protocol/io_automaticPadlock.dart';
|
||||||
import 'io_protocol/io_checkingCardStatus.dart';
|
import 'io_protocol/io_checkingCardStatus.dart';
|
||||||
|
import 'io_protocol/io_checkingUserInfoCount.dart';
|
||||||
|
import 'io_protocol/io_configuringWifi.dart';
|
||||||
import 'io_protocol/io_editUser.dart';
|
import 'io_protocol/io_editUser.dart';
|
||||||
import 'io_protocol/io_factoryDataReset.dart';
|
import 'io_protocol/io_factoryDataReset.dart';
|
||||||
import 'io_protocol/io_getPrivateKey.dart';
|
import 'io_protocol/io_getPrivateKey.dart';
|
||||||
@ -430,4 +432,56 @@ class IoSenderManage {
|
|||||||
privateKey: privateKey,
|
privateKey: privateKey,
|
||||||
), callBack:callBack);
|
), callBack:callBack);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//todo:查询用户、指纹、密码、卡片数量(用于判断是否同步)
|
||||||
|
static void senderCheckingUserInfoCountCommand({
|
||||||
|
required String? keyID,
|
||||||
|
required String? userID,
|
||||||
|
required int? role,
|
||||||
|
required int? nowTime,
|
||||||
|
required List<int>? token,
|
||||||
|
required int? needAuthor,
|
||||||
|
required List<int>? publicKey,
|
||||||
|
required List<int>? privateKey,
|
||||||
|
CommandSendCallBack? callBack}) {
|
||||||
|
CommandSenderManager().managerSendData(
|
||||||
|
command: SenderCheckingUserInfoCountCommand(
|
||||||
|
keyID: keyID,
|
||||||
|
userID: userID,
|
||||||
|
role: role,
|
||||||
|
nowTime: nowTime,
|
||||||
|
token: token,
|
||||||
|
needAuthor: needAuthor,
|
||||||
|
publicKey: publicKey,
|
||||||
|
privateKey: privateKey,
|
||||||
|
), callBack:callBack);
|
||||||
|
}
|
||||||
|
|
||||||
|
//todo:配置wifi
|
||||||
|
static void senderConfiguringWifiCommand({
|
||||||
|
required String? keyID,
|
||||||
|
required String? userID,
|
||||||
|
required String? ssid,
|
||||||
|
required String? password,
|
||||||
|
required int? numberOfServers,
|
||||||
|
required int? listOfServers,
|
||||||
|
required List<int>? token,
|
||||||
|
required int? needAuthor,
|
||||||
|
required List<int>? publicKey,
|
||||||
|
required List<int>? privateKey,
|
||||||
|
CommandSendCallBack? callBack}) {
|
||||||
|
CommandSenderManager().managerSendData(
|
||||||
|
command: SenderConfiguringWifiCommand(
|
||||||
|
keyID: keyID,
|
||||||
|
userID: userID,
|
||||||
|
ssid: ssid,
|
||||||
|
password: password,
|
||||||
|
numberOfServers: numberOfServers,
|
||||||
|
listOfServers: listOfServers,
|
||||||
|
token: token,
|
||||||
|
needAuthor: needAuthor,
|
||||||
|
publicKey: publicKey,
|
||||||
|
privateKey: privateKey,
|
||||||
|
), callBack:callBack);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -11,11 +11,35 @@ import '../../../../blue/io_tool/io_manager.dart';
|
|||||||
import '../../../../blue/io_tool/io_tool.dart';
|
import '../../../../blue/io_tool/io_tool.dart';
|
||||||
import '../../../../blue/io_tool/manager_event_bus.dart';
|
import '../../../../blue/io_tool/manager_event_bus.dart';
|
||||||
import '../../../../blue/sender_manage.dart';
|
import '../../../../blue/sender_manage.dart';
|
||||||
|
import '../../../../network/api_repository.dart';
|
||||||
|
import '../../../../tools/eventBusEventManage.dart';
|
||||||
import '../../../../tools/storage.dart';
|
import '../../../../tools/storage.dart';
|
||||||
|
import '../../../../tools/toast.dart';
|
||||||
import 'automaticBlocking_state.dart';
|
import 'automaticBlocking_state.dart';
|
||||||
|
|
||||||
class AutomaticBlockingLogic extends BaseGetXController{
|
class AutomaticBlockingLogic extends BaseGetXController{
|
||||||
final AutomaticBlockingState automaticBlockingState = AutomaticBlockingState();
|
final AutomaticBlockingState state = AutomaticBlockingState();
|
||||||
|
|
||||||
|
void setAutoUnLock() async{
|
||||||
|
String autoTime;
|
||||||
|
if(state.isOpen.value == false){
|
||||||
|
autoTime = "-1";
|
||||||
|
}else{
|
||||||
|
autoTime = state.autoLockTime.value;
|
||||||
|
}
|
||||||
|
|
||||||
|
var entity = await ApiRepository.to.setAutoUnlock(
|
||||||
|
lockId: state.getKeyInfosData.value.lockId.toString(),
|
||||||
|
autoLockTime:autoTime,
|
||||||
|
type: "1",
|
||||||
|
);
|
||||||
|
if(entity.errorCode!.codeIsSuccessful){
|
||||||
|
state.getKeyInfosData.value.autoLockTime = int.parse(autoTime);
|
||||||
|
eventBus.fire(RefreshLockListInfoDataEvent());
|
||||||
|
eventBus.fire(PassCurrentLockInformationEvent(state.getKeyInfosData.value));
|
||||||
|
Toast.show(msg: "操作成功");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 获取解析后的数据
|
// 获取解析后的数据
|
||||||
late StreamSubscription<Reply> _replySubscription;
|
late StreamSubscription<Reply> _replySubscription;
|
||||||
@ -40,8 +64,6 @@ class AutomaticBlockingLogic extends BaseGetXController{
|
|||||||
//成功
|
//成功
|
||||||
print("${reply.commandType}数据解析成功");
|
print("${reply.commandType}数据解析成功");
|
||||||
|
|
||||||
// 锁当前时间
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case 0x06:
|
case 0x06:
|
||||||
//无权限
|
//无权限
|
||||||
@ -66,7 +88,7 @@ class AutomaticBlockingLogic extends BaseGetXController{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 校时数据解析
|
// 设置自动落锁数据解析
|
||||||
Future<void> _replyAutomaticPadlock(Reply reply) async {
|
Future<void> _replyAutomaticPadlock(Reply reply) async {
|
||||||
int status = reply.data[2];
|
int status = reply.data[2];
|
||||||
switch(status){
|
switch(status){
|
||||||
@ -101,8 +123,8 @@ class AutomaticBlockingLogic extends BaseGetXController{
|
|||||||
// 获取锁状态
|
// 获取锁状态
|
||||||
Future<void> _getLockStatus() async {
|
Future<void> _getLockStatus() async {
|
||||||
// 进来之后首先连接
|
// 进来之后首先连接
|
||||||
BlueManage().judgeReconnect(BlueManage().connectDeviceMacAddress, BlueManage().connectDeviceName, (DeviceConnectionState state) async {
|
BlueManage().judgeReconnect(BlueManage().connectDeviceMacAddress, BlueManage().connectDeviceName, (DeviceConnectionState connectionState) async {
|
||||||
if (state == DeviceConnectionState.connected) {
|
if (connectionState == DeviceConnectionState.connected) {
|
||||||
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||||
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||||
IoSenderManage.senderGetLockStatu(
|
IoSenderManage.senderGetLockStatu(
|
||||||
@ -114,10 +136,10 @@ class AutomaticBlockingLogic extends BaseGetXController{
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 校验时间
|
// 自动落锁
|
||||||
Future<void> sendTiming() async {
|
Future<void> sendAutoLock() async {
|
||||||
BlueManage().judgeReconnect(BlueManage().connectDeviceMacAddress, BlueManage().connectDeviceName, (DeviceConnectionState state) async {
|
BlueManage().judgeReconnect(BlueManage().connectDeviceMacAddress, BlueManage().connectDeviceName, (DeviceConnectionState connectionState) async {
|
||||||
if (state == DeviceConnectionState.connected) {
|
if (connectionState == DeviceConnectionState.connected) {
|
||||||
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||||
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||||
|
|
||||||
@ -127,11 +149,11 @@ class AutomaticBlockingLogic extends BaseGetXController{
|
|||||||
var signKey = await Storage.getStringList(saveBlueSignKey);
|
var signKey = await Storage.getStringList(saveBlueSignKey);
|
||||||
List<int> getSignKeyList = changeStringListToIntList(signKey!);
|
List<int> getSignKeyList = changeStringListToIntList(signKey!);
|
||||||
|
|
||||||
print("automaticBlockingState.isOpen.value:${automaticBlockingState.isOpen.value}");
|
print("automaticBlockingState.isOpen.value:${state.isOpen.value}");
|
||||||
IoSenderManage.senderAutomaticPadlockCommand(
|
IoSenderManage.senderAutomaticPadlockCommand(
|
||||||
lockID:BlueManage().connectDeviceName,
|
lockID:BlueManage().connectDeviceName,
|
||||||
userID:await Storage.getUid(),
|
userID:await Storage.getUid(),
|
||||||
autoLockFlag:automaticBlockingState.isOpen.value ? 1 : 0,
|
autoLockFlag:state.isOpen.value ? 1 : 0,
|
||||||
token:getTokenList,
|
token:getTokenList,
|
||||||
needAuthor:1,
|
needAuthor:1,
|
||||||
signKey:getSignKeyList,
|
signKey:getSignKeyList,
|
||||||
|
|||||||
@ -22,7 +22,7 @@ class AutomaticBlockingPage extends StatefulWidget {
|
|||||||
class _AutomaticBlockingPageState extends State<AutomaticBlockingPage> {
|
class _AutomaticBlockingPageState extends State<AutomaticBlockingPage> {
|
||||||
final TextEditingController _timeController = TextEditingController();
|
final TextEditingController _timeController = TextEditingController();
|
||||||
final logic = Get.put(AutomaticBlockingLogic());
|
final logic = Get.put(AutomaticBlockingLogic());
|
||||||
final state = Get.find<AutomaticBlockingLogic>().automaticBlockingState;
|
final state = Get.find<AutomaticBlockingLogic>().state;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@ -38,8 +38,9 @@ class _AutomaticBlockingPageState extends State<AutomaticBlockingPage> {
|
|||||||
style: TextStyle(color: Colors.white, fontSize: 24.sp),
|
style: TextStyle(color: Colors.white, fontSize: 24.sp),
|
||||||
),
|
),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
logic.sendTiming();
|
// logic.sendAutoLock();
|
||||||
},
|
logic.setAutoUnLock();
|
||||||
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
backgroundColor: AppColors.mainColor),
|
backgroundColor: AppColors.mainColor),
|
||||||
@ -47,7 +48,7 @@ class _AutomaticBlockingPageState extends State<AutomaticBlockingPage> {
|
|||||||
children: [
|
children: [
|
||||||
Obx(() => CommonItem(
|
Obx(() => CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.automaticBlocking!.tr,
|
leftTitel: TranslationLoader.lanKeys!.automaticBlocking!.tr,
|
||||||
rightTitle: "${state.automaticBlockingTime}s",
|
rightTitle: "${state.autoLockTime}s",
|
||||||
isHaveLine: false,
|
isHaveLine: false,
|
||||||
isHaveRightWidget: true,
|
isHaveRightWidget: true,
|
||||||
rightWidget:
|
rightWidget:
|
||||||
@ -56,9 +57,9 @@ class _AutomaticBlockingPageState extends State<AutomaticBlockingPage> {
|
|||||||
height: 10.h,
|
height: 10.h,
|
||||||
),
|
),
|
||||||
Builder(builder: (context) {
|
Builder(builder: (context) {
|
||||||
return CommonItem(
|
return Obx(() => CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.delayTime!.tr,
|
leftTitel: TranslationLoader.lanKeys!.delayTime!.tr,
|
||||||
rightTitle: "5s",
|
rightTitle: "${state.autoLockTime.value}s",
|
||||||
isHaveLine: false,
|
isHaveLine: false,
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () {
|
action: () {
|
||||||
@ -71,10 +72,10 @@ class _AutomaticBlockingPageState extends State<AutomaticBlockingPage> {
|
|||||||
TranslationLoader.lanKeys!.custom!.tr
|
TranslationLoader.lanKeys!.custom!.tr
|
||||||
];
|
];
|
||||||
ShowBottomSheetTool().showSingleRowPicker(
|
ShowBottomSheetTool().showSingleRowPicker(
|
||||||
//上下文
|
//上下文
|
||||||
context,
|
context,
|
||||||
//默认的索引
|
//默认的索引
|
||||||
normalIndex: 2,
|
normalIndex: 0,
|
||||||
title: TranslationLoader.lanKeys!.time!.tr,
|
title: TranslationLoader.lanKeys!.time!.tr,
|
||||||
cancelTitle: TranslationLoader.lanKeys!.cancel!.tr,
|
cancelTitle: TranslationLoader.lanKeys!.cancel!.tr,
|
||||||
sureTitle: TranslationLoader.lanKeys!.sure!.tr,
|
sureTitle: TranslationLoader.lanKeys!.sure!.tr,
|
||||||
@ -85,12 +86,12 @@ class _AutomaticBlockingPageState extends State<AutomaticBlockingPage> {
|
|||||||
//选择事件的回调
|
//选择事件的回调
|
||||||
clickCallBack: (int index, var str) {
|
clickCallBack: (int index, var str) {
|
||||||
if(index != 5){
|
if(index != 5){
|
||||||
state.automaticBlockingTime.value = str.toString();
|
state.autoLockTime.value = str.toString();
|
||||||
}else{
|
}else{
|
||||||
state.isCustomLockTime.value = true;
|
state.isCustomLockTime.value = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
}));
|
||||||
}),
|
}),
|
||||||
Container(
|
Container(
|
||||||
height: 10.h,
|
height: 10.h,
|
||||||
|
|||||||
@ -1,8 +1,26 @@
|
|||||||
|
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
import '../../../lockMian/entity/lockInfoEntity.dart';
|
||||||
|
|
||||||
class AutomaticBlockingState {
|
class AutomaticBlockingState {
|
||||||
var isOpen = false.obs;
|
var getKeyInfosData = KeyInfos().obs;
|
||||||
var automaticBlockingTime = "5".obs;
|
|
||||||
var isCustomLockTime = false.obs;
|
var isOpen = false.obs;// 是否开启自动落锁
|
||||||
|
var autoLockTime = "5".obs;
|
||||||
|
var isCustomLockTime = false.obs;// 自定义
|
||||||
|
|
||||||
|
AutomaticBlockingState() {
|
||||||
|
getKeyInfosData.value = Get.arguments as KeyInfos;
|
||||||
|
isOpen.value = getKeyInfosData.value.autoLockTime! > -1 ? true : false;
|
||||||
|
autoLockTime.value = getKeyInfosData.value.autoLockTime!.toString();
|
||||||
|
if((getKeyInfosData.value.autoLockTime! > 0)
|
||||||
|
&& (getKeyInfosData.value.autoLockTime! != 5)
|
||||||
|
&& (getKeyInfosData.value.autoLockTime! != 10)
|
||||||
|
&& (getKeyInfosData.value.autoLockTime! != 15)
|
||||||
|
&& (getKeyInfosData.value.autoLockTime! != 30)
|
||||||
|
&& (getKeyInfosData.value.autoLockTime! != 60)){
|
||||||
|
isCustomLockTime.value = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -0,0 +1,29 @@
|
|||||||
|
|
||||||
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
|
import '../../../../network/api_repository.dart';
|
||||||
|
import '../../../../tools/eventBusEventManage.dart';
|
||||||
|
import '../../../../tools/toast.dart';
|
||||||
|
import 'burglarAlarm_state.dart';
|
||||||
|
|
||||||
|
class BurglarAlarmLogic extends BaseGetXController{
|
||||||
|
BurglarAlarmState state = BurglarAlarmState();
|
||||||
|
|
||||||
|
// 配置锁的常开模式设置 -> 防撬报警
|
||||||
|
Future<void> setLockSetGeneralSetting() async{
|
||||||
|
var entity = await ApiRepository.to.setLockSetGeneralSettingData(
|
||||||
|
lockId: state.getKeyInfosData.value.lockId.toString(),
|
||||||
|
changeType:"1",
|
||||||
|
isOn:state.burglarAlarmEnable.value == 1 ? "2" : "1", // 1-开启、2-关闭;
|
||||||
|
type:"3", // 3 防撬报警
|
||||||
|
);
|
||||||
|
if(entity.errorCode!.codeIsSuccessful){
|
||||||
|
eventBus.fire(RefreshLockListInfoDataEvent());
|
||||||
|
|
||||||
|
state.burglarAlarmEnable.value = state.burglarAlarmEnable.value == 1 ? 2 : 1;
|
||||||
|
state.getKeyInfosData.value.tamperAlert = state.burglarAlarmEnable.value;
|
||||||
|
eventBus.fire(PassCurrentLockInformationEvent(state.getKeyInfosData.value));
|
||||||
|
Toast.show(msg: "操作成功");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -6,6 +6,7 @@ import '../../../../app_settings/app_colors.dart';
|
|||||||
import '../../../../tools/submitBtn.dart';
|
import '../../../../tools/submitBtn.dart';
|
||||||
import '../../../../tools/titleAppBar.dart';
|
import '../../../../tools/titleAppBar.dart';
|
||||||
import '../../../../translations/trans_lib.dart';
|
import '../../../../translations/trans_lib.dart';
|
||||||
|
import 'burglarAlarm_logic.dart';
|
||||||
|
|
||||||
class BurglarAlarmPage extends StatefulWidget {
|
class BurglarAlarmPage extends StatefulWidget {
|
||||||
const BurglarAlarmPage({Key? key}) : super(key: key);
|
const BurglarAlarmPage({Key? key}) : super(key: key);
|
||||||
@ -15,6 +16,9 @@ class BurglarAlarmPage extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _BurglarAlarmPageState extends State<BurglarAlarmPage> {
|
class _BurglarAlarmPageState extends State<BurglarAlarmPage> {
|
||||||
|
final logic = Get.put(BurglarAlarmLogic());
|
||||||
|
final state = Get.find<BurglarAlarmLogic>().state;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
@ -40,27 +44,29 @@ class _BurglarAlarmPageState extends State<BurglarAlarmPage> {
|
|||||||
SizedBox(
|
SizedBox(
|
||||||
height: 20.h,
|
height: 20.h,
|
||||||
),
|
),
|
||||||
Row(
|
Obx(() => Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
"${TranslationLoader.lanKeys!.currentMode!.tr} : ${TranslationLoader.lanKeys!.opened!.tr}",
|
"${TranslationLoader.lanKeys!.currentMode!.tr} : ${state.burglarAlarmEnable.value == 1 ? TranslationLoader.lanKeys!.opened!.tr : TranslationLoader.lanKeys!.closed!.tr}",
|
||||||
style:
|
style:
|
||||||
TextStyle(fontSize: 22.sp, fontWeight: FontWeight.w600),
|
TextStyle(fontSize: 22.sp, fontWeight: FontWeight.w600),
|
||||||
)),
|
)),
|
||||||
],
|
],
|
||||||
),
|
)),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 40.h,
|
height: 40.h,
|
||||||
),
|
),
|
||||||
SubmitBtn(
|
Obx(() => SubmitBtn(
|
||||||
btnName: TranslationLoader.lanKeys!.closed!.tr,
|
btnName: state.burglarAlarmEnable.value == 1 ? TranslationLoader.lanKeys!.close!.tr : TranslationLoader.lanKeys!.open!.tr,
|
||||||
borderRadius: 20.w,
|
borderRadius: 20.w,
|
||||||
fontSize: 32.sp,
|
fontSize: 32.sp,
|
||||||
// margin: EdgeInsets.only(left: 03.w, right: 30.w, top: 20.w),
|
// margin: EdgeInsets.only(left: 03.w, right: 30.w, top: 20.w),
|
||||||
padding: EdgeInsets.only(top: 20.w, bottom: 20.w),
|
padding: EdgeInsets.only(top: 20.w, bottom: 20.w),
|
||||||
onClick: () {}),
|
onClick: () {
|
||||||
|
logic.setLockSetGeneralSetting();
|
||||||
|
})),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
));
|
));
|
||||||
|
|||||||
@ -0,0 +1,16 @@
|
|||||||
|
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
import '../../../lockMian/entity/lockInfoEntity.dart';
|
||||||
|
|
||||||
|
class BurglarAlarmState{
|
||||||
|
var getKeyInfosData = KeyInfos().obs;
|
||||||
|
|
||||||
|
var burglarAlarmEnable = 1.obs;
|
||||||
|
|
||||||
|
BurglarAlarmState() {
|
||||||
|
getKeyInfosData.value = Get.arguments as KeyInfos;
|
||||||
|
burglarAlarmEnable.value = getKeyInfosData.value.tamperAlert!;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,72 @@
|
|||||||
|
class ConfiguringWifiEntity {
|
||||||
|
int? errorCode;
|
||||||
|
String? description;
|
||||||
|
String? errorMsg;
|
||||||
|
Data? data;
|
||||||
|
|
||||||
|
ConfiguringWifiEntity(
|
||||||
|
{this.errorCode, this.description, this.errorMsg, this.data});
|
||||||
|
|
||||||
|
ConfiguringWifiEntity.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 {
|
||||||
|
int? serviceNum;
|
||||||
|
List<ServiceList>? serviceList;
|
||||||
|
|
||||||
|
Data({this.serviceNum, this.serviceList});
|
||||||
|
|
||||||
|
Data.fromJson(Map<String, dynamic> json) {
|
||||||
|
serviceNum = json['serviceNum'];
|
||||||
|
if (json['serviceList'] != null) {
|
||||||
|
serviceList = <ServiceList>[];
|
||||||
|
json['serviceList'].forEach((v) {
|
||||||
|
serviceList!.add(ServiceList.fromJson(v));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
data['serviceNum'] = serviceNum;
|
||||||
|
if (serviceList != null) {
|
||||||
|
data['serviceList'] = serviceList!.map((v) => v.toJson()).toList();
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class ServiceList {
|
||||||
|
String? serviceIp;
|
||||||
|
String? port;
|
||||||
|
|
||||||
|
ServiceList({this.serviceIp, this.port});
|
||||||
|
|
||||||
|
ServiceList.fromJson(Map<String, dynamic> json) {
|
||||||
|
serviceIp = json['serviceIp'];
|
||||||
|
port = json['port'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
data['serviceIp'] = serviceIp;
|
||||||
|
data['port'] = port;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,175 @@
|
|||||||
|
|
||||||
|
import 'dart:async';
|
||||||
|
|
||||||
|
import 'package:flutter_reactive_ble/flutter_reactive_ble.dart';
|
||||||
|
import 'package:network_info_plus/network_info_plus.dart';
|
||||||
|
import 'package:permission_handler/permission_handler.dart';
|
||||||
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
|
|
||||||
|
import '../../../../blue/blue_manage.dart';
|
||||||
|
import '../../../../blue/io_protocol/io_configuringWifi.dart';
|
||||||
|
import '../../../../blue/io_reply.dart';
|
||||||
|
import '../../../../blue/io_tool/io_manager.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';
|
||||||
|
import 'configuringWifi_state.dart';
|
||||||
|
|
||||||
|
class ConfiguringWifiLogic extends BaseGetXController{
|
||||||
|
final ConfiguringWifiState state = ConfiguringWifiState();
|
||||||
|
|
||||||
|
Future<void> getWifiLockServiceIpAndPort() async {
|
||||||
|
var entity = await ApiRepository.to.getWifiLockServiceIpAndPort();
|
||||||
|
if(entity.errorCode! == 0){
|
||||||
|
state.configuringWifiEntity.value = entity;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 监听设备返回的数据
|
||||||
|
late StreamSubscription<Reply> _replySubscription;
|
||||||
|
void _initReplySubscription() {
|
||||||
|
_replySubscription = EventBusManager().eventBus!.on<Reply>().listen((reply) async {
|
||||||
|
// 配置wifi
|
||||||
|
if(reply is SenderConfiguringWifiReply) {
|
||||||
|
_replySenderConfiguringWifi(reply);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 开门数据解析
|
||||||
|
Future<void> _replySenderConfiguringWifi(Reply reply) async {
|
||||||
|
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||||
|
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||||
|
|
||||||
|
var signKey = await Storage.getStringList(saveBlueSignKey);
|
||||||
|
List<int> signKeyDataList = changeStringListToIntList(signKey!);
|
||||||
|
|
||||||
|
var tokenData = reply.data.sublist(2, 6);
|
||||||
|
var saveStrList = changeIntListToStringList(tokenData);
|
||||||
|
print("openDoorToken:$tokenData");
|
||||||
|
Storage.setStringList(saveBlueToken, saveStrList);
|
||||||
|
|
||||||
|
int status = reply.data[6];
|
||||||
|
print("status:$status");
|
||||||
|
|
||||||
|
switch(status){
|
||||||
|
case 0x00:
|
||||||
|
//成功
|
||||||
|
print("${reply.commandType}数据解析成功");
|
||||||
|
|
||||||
|
break;
|
||||||
|
case 0x06:
|
||||||
|
//无权限
|
||||||
|
print("${reply.commandType}需要鉴权");
|
||||||
|
|
||||||
|
IoSenderManage.senderOpenLock(
|
||||||
|
keyID: "1",
|
||||||
|
userID: await Storage.getUid(),
|
||||||
|
openMode: 1,
|
||||||
|
openTime: DateTime.now().millisecondsSinceEpoch,
|
||||||
|
token: tokenData,
|
||||||
|
needAuthor: 1,
|
||||||
|
signKey: signKeyDataList,
|
||||||
|
privateKey: getPrivateKeyList,
|
||||||
|
);
|
||||||
|
|
||||||
|
break;
|
||||||
|
case 0x07:
|
||||||
|
//无权限
|
||||||
|
print("${reply.commandType}用户无权限");
|
||||||
|
|
||||||
|
break;
|
||||||
|
case 0x09:
|
||||||
|
// 权限校验错误
|
||||||
|
print("${reply.commandType}校验错误");
|
||||||
|
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
//失败
|
||||||
|
print("${reply.commandType}失败");
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 点击配置wifi
|
||||||
|
Future<void> senderConfiguringWifiAction() async {
|
||||||
|
BlueManage().judgeReconnect(BlueManage().connectDeviceMacAddress, BlueManage().connectDeviceName, (DeviceConnectionState connectionState) async {
|
||||||
|
if (connectionState == DeviceConnectionState.connected){
|
||||||
|
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||||
|
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||||
|
|
||||||
|
var publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||||
|
List<int> publicKeyDataList = changeStringListToIntList(publicKey!);
|
||||||
|
|
||||||
|
var token = await Storage.getStringList(saveBlueToken);
|
||||||
|
List<int> getTokenList = changeStringListToIntList(token!);
|
||||||
|
print("openDoorTokenPubToken:$getTokenList");
|
||||||
|
|
||||||
|
print("millisecondsSinceEpoch/1000:${DateTime.now().millisecondsSinceEpoch~/1000}");
|
||||||
|
IoSenderManage.senderConfiguringWifiCommand(
|
||||||
|
keyID: "1",
|
||||||
|
userID: await Storage.getUid(),
|
||||||
|
ssid: state.wifiNameController.text,
|
||||||
|
password: state.wifiPWDController.text,
|
||||||
|
numberOfServers: state.configuringWifiEntity.value.data!.serviceNum,
|
||||||
|
listOfServers: 0,
|
||||||
|
token: getTokenList,
|
||||||
|
needAuthor: 1,
|
||||||
|
publicKey: publicKeyDataList,
|
||||||
|
privateKey: getPrivateKeyList,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
final _networkInfo = NetworkInfo();
|
||||||
|
Future<String> getWifiName() async {
|
||||||
|
// if(!(await checkLocationPermission())) {
|
||||||
|
// print("未获取定位权限");
|
||||||
|
// return '';
|
||||||
|
// }
|
||||||
|
var ssid = '';
|
||||||
|
ssid = (await _networkInfo.getWifiName())!;
|
||||||
|
ssid = ssid ?? '';
|
||||||
|
ssid = ssid.replaceAll(r'"', '');
|
||||||
|
print("ssid:$ssid");
|
||||||
|
return ssid ?? '';
|
||||||
|
}
|
||||||
|
|
||||||
|
///定位权限
|
||||||
|
Future<bool> checkLocationPermission() async {
|
||||||
|
PermissionStatus value = await locationPermission();
|
||||||
|
bool allow = value != PermissionStatus.permanentlyDenied && value != PermissionStatus.denied;
|
||||||
|
return allow;
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<PermissionStatus> locationPermission() async => Permission.location.request();
|
||||||
|
|
||||||
|
@override
|
||||||
|
void onReady() {
|
||||||
|
// TODO: implement onReady
|
||||||
|
super.onReady();
|
||||||
|
|
||||||
|
getWifiName().then((value) {
|
||||||
|
print("wifiName:$value");
|
||||||
|
state.wifiNameController.text = value;
|
||||||
|
});
|
||||||
|
|
||||||
|
getWifiLockServiceIpAndPort();
|
||||||
|
_initReplySubscription();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void onInit() {
|
||||||
|
// TODO: implement onInit
|
||||||
|
super.onInit();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void onClose() {
|
||||||
|
// TODO: implement onClose
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,92 @@
|
|||||||
|
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
import '../../../../app_settings/app_colors.dart';
|
||||||
|
import '../../../../tools/commonItem.dart';
|
||||||
|
import '../../../../tools/submitBtn.dart';
|
||||||
|
import '../../../../tools/titleAppBar.dart';
|
||||||
|
import '../../../../translations/trans_lib.dart';
|
||||||
|
import 'configuringWifi_logic.dart';
|
||||||
|
|
||||||
|
class ConfiguringWifiPage extends StatefulWidget {
|
||||||
|
const ConfiguringWifiPage({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<ConfiguringWifiPage> createState() => _ConfiguringWifiPageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _ConfiguringWifiPageState extends State<ConfiguringWifiPage> {
|
||||||
|
final logic = Get.put(ConfiguringWifiLogic());
|
||||||
|
final state = Get.find<ConfiguringWifiLogic>().state;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
backgroundColor: Colors.white,
|
||||||
|
appBar: TitleAppBar(
|
||||||
|
barTitle: TranslationLoader.lanKeys!.configuringWiFi!.tr,
|
||||||
|
haveBack: true,
|
||||||
|
backgroundColor: AppColors.mainColor),
|
||||||
|
body: Column(
|
||||||
|
children: [
|
||||||
|
configuringWifiTFWidget(TranslationLoader.lanKeys!.wifiName!.tr, TranslationLoader.lanKeys!.pleaseEnterWifiName!.tr, state.wifiNameController),
|
||||||
|
Container(width: 1.sw, height: 1.h,color: AppColors.mainBackgroundColor),
|
||||||
|
configuringWifiTFWidget(TranslationLoader.lanKeys!.wifiPassward!.tr, TranslationLoader.lanKeys!.pleaseEnterWifiPwd!.tr, state.wifiPWDController),
|
||||||
|
SizedBox(height: 50.h,),
|
||||||
|
SubmitBtn(btnName: TranslationLoader.lanKeys!.sure!.tr, onClick: () {
|
||||||
|
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget configuringWifiTFWidget(
|
||||||
|
String titleStr, String rightTitle,TextEditingController controller) {
|
||||||
|
return Column(
|
||||||
|
children: [
|
||||||
|
Container(height: 10.h),
|
||||||
|
CommonItem(
|
||||||
|
leftTitel: titleStr,
|
||||||
|
rightTitle: "",
|
||||||
|
isHaveRightWidget: true,
|
||||||
|
rightWidget: getTFWidget(rightTitle)),
|
||||||
|
Container(height: 10.h),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 接受者信息输入框
|
||||||
|
Widget getTFWidget(String tfStr) {
|
||||||
|
return Container(
|
||||||
|
height: 50.h,
|
||||||
|
width: 300.w,
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: TextField(
|
||||||
|
//输入框一行
|
||||||
|
maxLines: 1,
|
||||||
|
// controller: _controller,
|
||||||
|
autofocus: false,
|
||||||
|
textAlign: TextAlign.end,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
//输入里面输入文字内边距设置
|
||||||
|
contentPadding: const EdgeInsets.only(top: 12.0, bottom: 8.0),
|
||||||
|
hintText: tfStr,
|
||||||
|
hintStyle: TextStyle(fontSize: 24.sp),
|
||||||
|
//不需要输入框下划线
|
||||||
|
border: InputBorder.none,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: 10.w,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,17 @@
|
|||||||
|
|
||||||
|
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
import 'configuringWifiEntity.dart';
|
||||||
|
|
||||||
|
class ConfiguringWifiState{
|
||||||
|
var configuringWifiEntity = ConfiguringWifiEntity().obs;
|
||||||
|
|
||||||
|
TextEditingController wifiNameController = TextEditingController();
|
||||||
|
TextEditingController wifiPWDController = TextEditingController();
|
||||||
|
ConfiguringWifiState() {
|
||||||
|
// wifiNameController.text = emailOrPhone.value;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,9 @@
|
|||||||
|
|
||||||
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
|
|
||||||
|
import 'diagnose_state.dart';
|
||||||
|
|
||||||
|
class DiagnoseLogic extends BaseGetXController{
|
||||||
|
DiagnoseState state = DiagnoseState();
|
||||||
|
|
||||||
|
}
|
||||||
@ -34,7 +34,7 @@ class _DiagnosePageState extends State<DiagnosePage> {
|
|||||||
child: Text(
|
child: Text(
|
||||||
TranslationLoader.lanKeys!.diagnoseTip!.tr,
|
TranslationLoader.lanKeys!.diagnoseTip!.tr,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 20.sp, color: AppColors.darkGrayTextColor),
|
fontSize: 22.sp, color: AppColors.darkGrayTextColor),
|
||||||
)),
|
)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@ -0,0 +1,4 @@
|
|||||||
|
|
||||||
|
class DiagnoseState{
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,41 @@
|
|||||||
|
|
||||||
|
|
||||||
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
|
|
||||||
|
import '../../../../network/api_repository.dart';
|
||||||
|
import 'lockEscalation_state.dart';
|
||||||
|
|
||||||
|
class LockEscalationLogic extends BaseGetXController{
|
||||||
|
LockEscalationState state = LockEscalationState();
|
||||||
|
|
||||||
|
// 配置锁的常开模式设置
|
||||||
|
Future<void> setLockSetGeneralSetting() async{
|
||||||
|
var entity = await ApiRepository.to.getLockVersionInfoData(
|
||||||
|
lockId: state.getKeyInfosData.value.lockId.toString(),
|
||||||
|
);
|
||||||
|
if(entity.errorCode!.codeIsSuccessful){
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void onReady() {
|
||||||
|
// TODO: implement onReady
|
||||||
|
super.onReady();
|
||||||
|
print("onReady()");
|
||||||
|
setLockSetGeneralSetting();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void onInit() {
|
||||||
|
// TODO: implement onInit
|
||||||
|
super.onInit();
|
||||||
|
print("onInit()");
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void onClose() {
|
||||||
|
// TODO: implement onClose
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -6,6 +6,7 @@ import '../../../../app_settings/app_colors.dart';
|
|||||||
import '../../../../tools/submitBtn.dart';
|
import '../../../../tools/submitBtn.dart';
|
||||||
import '../../../../tools/titleAppBar.dart';
|
import '../../../../tools/titleAppBar.dart';
|
||||||
import '../../../../translations/trans_lib.dart';
|
import '../../../../translations/trans_lib.dart';
|
||||||
|
import 'lockEscalation_logic.dart';
|
||||||
|
|
||||||
class LockEscalationPage extends StatefulWidget {
|
class LockEscalationPage extends StatefulWidget {
|
||||||
const LockEscalationPage({Key? key}) : super(key: key);
|
const LockEscalationPage({Key? key}) : super(key: key);
|
||||||
@ -15,6 +16,9 @@ class LockEscalationPage extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _LockEscalationPageState extends State<LockEscalationPage> {
|
class _LockEscalationPageState extends State<LockEscalationPage> {
|
||||||
|
final logic = Get.put(LockEscalationLogic());
|
||||||
|
final state = Get.find<LockEscalationLogic>().state;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
|
|||||||
@ -0,0 +1,8 @@
|
|||||||
|
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import '../../../lockMian/entity/lockInfoEntity.dart';
|
||||||
|
|
||||||
|
class LockEscalationState{
|
||||||
|
var getKeyInfosData = KeyInfos().obs;
|
||||||
|
|
||||||
|
}
|
||||||
@ -14,12 +14,15 @@ import '../../../../blue/io_tool/manager_event_bus.dart';
|
|||||||
import '../../../../blue/sender_manage.dart';
|
import '../../../../blue/sender_manage.dart';
|
||||||
import '../../../../network/api_repository.dart';
|
import '../../../../network/api_repository.dart';
|
||||||
import '../../../../tools/baseGetXController.dart';
|
import '../../../../tools/baseGetXController.dart';
|
||||||
|
import '../../../../tools/eventBusEventManage.dart';
|
||||||
import '../../../../tools/storage.dart';
|
import '../../../../tools/storage.dart';
|
||||||
import 'lockSet_state.dart';
|
import 'lockSet_state.dart';
|
||||||
|
|
||||||
|
typedef BlockSetStateCallback = void Function();
|
||||||
class LockSetLogic extends BaseGetXController{
|
class LockSetLogic extends BaseGetXController{
|
||||||
final LockSetState state = LockSetState();
|
final LockSetState state = LockSetState();
|
||||||
|
|
||||||
|
// 删除锁调用后台接口
|
||||||
void deletLockInfoData() async{
|
void deletLockInfoData() async{
|
||||||
var entity = await ApiRepository.to.deletLockData(
|
var entity = await ApiRepository.to.deletLockData(
|
||||||
lockId:state.getKeyInfosData.value.lockId.toString(),
|
lockId:state.getKeyInfosData.value.lockId.toString(),
|
||||||
@ -29,6 +32,17 @@ class LockSetLogic extends BaseGetXController{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 下级界面修改成功后传递数据
|
||||||
|
StreamSubscription? _passCurrentLockInformationEvent;
|
||||||
|
void initLoadDataAction(BlockSetStateCallback blockSetStateCallback) {
|
||||||
|
// 蓝牙协议通知传输跟蓝牙之外的数据传输类不一样 eventBus
|
||||||
|
_passCurrentLockInformationEvent = eventBus.on<PassCurrentLockInformationEvent>().listen((event) {
|
||||||
|
state.getKeyInfosData.value = event.keyInfo;
|
||||||
|
blockSetStateCallback();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 监听蓝牙协议返回结果
|
||||||
late StreamSubscription<Reply> _replySubscription;
|
late StreamSubscription<Reply> _replySubscription;
|
||||||
void _initReplySubscription() {
|
void _initReplySubscription() {
|
||||||
_replySubscription = EventBusManager().eventBus!.on<Reply>().listen((reply) async {
|
_replySubscription = EventBusManager().eventBus!.on<Reply>().listen((reply) async {
|
||||||
@ -87,6 +101,7 @@ class LockSetLogic extends BaseGetXController{
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 删除用户蓝牙协议
|
||||||
Future<void> deletUserAction() async {
|
Future<void> deletUserAction() async {
|
||||||
BlueManage().judgeReconnect(BlueManage().connectDeviceMacAddress, BlueManage().connectDeviceName, (DeviceConnectionState connectionState) async {
|
BlueManage().judgeReconnect(BlueManage().connectDeviceMacAddress, BlueManage().connectDeviceName, (DeviceConnectionState connectionState) async {
|
||||||
if (connectionState == DeviceConnectionState.connected){
|
if (connectionState == DeviceConnectionState.connected){
|
||||||
@ -119,6 +134,7 @@ class LockSetLogic extends BaseGetXController{
|
|||||||
// TODO: implement onReady
|
// TODO: implement onReady
|
||||||
super.onReady();
|
super.onReady();
|
||||||
print("onReady()");
|
print("onReady()");
|
||||||
|
|
||||||
_initReplySubscription();
|
_initReplySubscription();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -135,6 +151,7 @@ class LockSetLogic extends BaseGetXController{
|
|||||||
void onClose() {
|
void onClose() {
|
||||||
// TODO: implement onClose
|
// TODO: implement onClose
|
||||||
_replySubscription.cancel();
|
_replySubscription.cancel();
|
||||||
|
_passCurrentLockInformationEvent!.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1,3 +1,5 @@
|
|||||||
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
@ -6,8 +8,10 @@ import 'package:get/get.dart';
|
|||||||
import '../../../../appRouters.dart';
|
import '../../../../appRouters.dart';
|
||||||
import '../../../../app_settings/app_colors.dart';
|
import '../../../../app_settings/app_colors.dart';
|
||||||
import '../../../../tools/commonItem.dart';
|
import '../../../../tools/commonItem.dart';
|
||||||
|
import '../../../../tools/eventBusEventManage.dart';
|
||||||
import '../../../../tools/submitBtn.dart';
|
import '../../../../tools/submitBtn.dart';
|
||||||
import '../../../../tools/titleAppBar.dart';
|
import '../../../../tools/titleAppBar.dart';
|
||||||
|
import '../../../../tools/toast.dart';
|
||||||
import '../../../../translations/trans_lib.dart';
|
import '../../../../translations/trans_lib.dart';
|
||||||
import 'lockSet_logic.dart';
|
import 'lockSet_logic.dart';
|
||||||
|
|
||||||
@ -21,6 +25,17 @@ class LockSetPage extends StatefulWidget {
|
|||||||
class _LockSetPageState extends State<LockSetPage> {
|
class _LockSetPageState extends State<LockSetPage> {
|
||||||
final logic = Get.put(LockSetLogic());
|
final logic = Get.put(LockSetLogic());
|
||||||
final state = Get.find<LockSetLogic>().state;
|
final state = Get.find<LockSetLogic>().state;
|
||||||
|
StreamSubscription? _passCurrentLockInformationEvent;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
// TODO: implement initState
|
||||||
|
super.initState();
|
||||||
|
|
||||||
|
logic.initLoadDataAction(() {
|
||||||
|
setState(() {});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@ -42,8 +57,7 @@ class _LockSetPageState extends State<LockSetPage> {
|
|||||||
isHaveLine: false,
|
isHaveLine: false,
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () {
|
action: () {
|
||||||
Navigator.pushNamed(
|
Get.toNamed(Routers.basicInformationPage);
|
||||||
context, Routers.basicInformationPage);
|
|
||||||
}),
|
}),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 10.h,
|
height: 10.h,
|
||||||
@ -55,8 +69,8 @@ class _LockSetPageState extends State<LockSetPage> {
|
|||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () {
|
action: () {
|
||||||
Navigator.pushNamed(
|
// Get.toNamed(Routers.wirelessKeyboardPage);
|
||||||
context, Routers.wirelessKeyboardPage);
|
Toast.show(msg: "功能暂未开放");
|
||||||
}),
|
}),
|
||||||
CommonItem(
|
CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.doorMagnetic!.tr,
|
leftTitel: TranslationLoader.lanKeys!.doorMagnetic!.tr,
|
||||||
@ -64,78 +78,102 @@ class _LockSetPageState extends State<LockSetPage> {
|
|||||||
isHaveLine: false,
|
isHaveLine: false,
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () {
|
action: () {
|
||||||
Navigator.pushNamed(context, Routers.doorMagneticPage);
|
// Get.toNamed(Routers.doorMagneticPage);
|
||||||
|
Toast.show(msg: "功能暂未开放");
|
||||||
}),
|
}),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 10.h,
|
height: 10.h,
|
||||||
),
|
),
|
||||||
CommonItem(
|
Obx(()=> CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.remoteUnlocking!.tr,
|
leftTitel: TranslationLoader.lanKeys!.remoteUnlocking!.tr,
|
||||||
rightTitle: TranslationLoader.lanKeys!.closed!.tr,
|
rightTitle: state.getKeyInfosData.value.remoteEnable == 1 ? TranslationLoader.lanKeys!.opened!.tr : TranslationLoader.lanKeys!.closed!.tr,
|
||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () {
|
action: () {
|
||||||
Navigator.pushNamed(
|
Get.toNamed(Routers.remoteUnlockingPage, arguments: state.getKeyInfosData.value);
|
||||||
context, Routers.remoteUnlockingPage);
|
})),
|
||||||
}),
|
Obx(() => CommonItem(
|
||||||
CommonItem(
|
|
||||||
leftTitel:
|
leftTitel:
|
||||||
TranslationLoader.lanKeys!.automaticBlocking!.tr,
|
TranslationLoader.lanKeys!.automaticBlocking!.tr,
|
||||||
rightTitle: "5s",
|
rightTitle: state.getKeyInfosData.value.autoLockTime! > -1 ? "${state.getKeyInfosData.value.autoLockTime!.toString()}s" : TranslationLoader.lanKeys!.closed!.tr,
|
||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () {
|
action: () {
|
||||||
Navigator.pushNamed(
|
Get.toNamed(Routers.automaticBlockingPage, arguments: state.getKeyInfosData.value);
|
||||||
context, Routers.automaticBlockingPage);
|
})),
|
||||||
}),
|
Obx(() => CommonItem(
|
||||||
CommonItem(
|
|
||||||
leftTitel:
|
leftTitel:
|
||||||
TranslationLoader.lanKeys!.normallyOpenMode!.tr,
|
TranslationLoader.lanKeys!.normallyOpenMode!.tr,
|
||||||
rightTitle: TranslationLoader.lanKeys!.closed!.tr,
|
rightTitle: state.getKeyInfosData.value.passageMode == 1 ? TranslationLoader.lanKeys!.opened!.tr : TranslationLoader.lanKeys!.closed!.tr,
|
||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () {
|
action: () {
|
||||||
Navigator.pushNamed(
|
Get.toNamed(Routers.normallyOpenModePage, arguments: state.getKeyInfosData.value);
|
||||||
context, Routers.normallyOpenModePage);
|
}),),
|
||||||
}),
|
Obx(() {
|
||||||
CommonItem(
|
var titleStr = "";
|
||||||
leftTitel: TranslationLoader.lanKeys!.lockSound!.tr,
|
if(state.getKeyInfosData.value.lockSound == 1){
|
||||||
rightTitle: "高",
|
switch(state.getKeyInfosData.value.volume){
|
||||||
isHaveLine: true,
|
case 1:
|
||||||
isHaveDirection: true,
|
titleStr = TranslationLoader.lanKeys!.low!.tr;
|
||||||
action: () {
|
break;
|
||||||
Navigator.pushNamed(context, Routers.lockSoundSetPage);
|
case 2:
|
||||||
}),
|
titleStr = TranslationLoader.lanKeys!.lower!.tr;
|
||||||
CommonItem(
|
break;
|
||||||
|
case 3:
|
||||||
|
titleStr = TranslationLoader.lanKeys!.medium!.tr;
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
titleStr = TranslationLoader.lanKeys!.high!.tr;
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
titleStr = TranslationLoader.lanKeys!.higher!.tr;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
titleStr = TranslationLoader.lanKeys!.closed!.tr;
|
||||||
|
}
|
||||||
|
return CommonItem(
|
||||||
|
leftTitel: TranslationLoader.lanKeys!.lockSound!.tr,
|
||||||
|
rightTitle: titleStr,
|
||||||
|
isHaveLine: true,
|
||||||
|
isHaveDirection: true,
|
||||||
|
action: () {
|
||||||
|
Get.toNamed(Routers.lockSoundSetPage, arguments: state.getKeyInfosData.value);
|
||||||
|
});
|
||||||
|
}),
|
||||||
|
Obx(() => CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.burglarAlarm!.tr,
|
leftTitel: TranslationLoader.lanKeys!.burglarAlarm!.tr,
|
||||||
rightTitle: TranslationLoader.lanKeys!.opened!.tr,
|
rightTitle: state.getKeyInfosData.value.tamperAlert == 1 ? TranslationLoader.lanKeys!.opened!.tr : TranslationLoader.lanKeys!.closed!.tr,
|
||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () {
|
action: () {
|
||||||
Navigator.pushNamed(context, Routers.burglarAlarmPage);
|
Get.toNamed(Routers.burglarAlarmPage, arguments: state.getKeyInfosData.value);
|
||||||
}),
|
})),
|
||||||
CommonItem(
|
Obx(() => CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.resetButton!.tr,
|
leftTitel: TranslationLoader.lanKeys!.resetButton!.tr,
|
||||||
rightTitle: TranslationLoader.lanKeys!.opened!.tr,
|
rightTitle: state.getKeyInfosData.value.resetButton == 1 ? TranslationLoader.lanKeys!.opened!.tr : TranslationLoader.lanKeys!.closed!.tr,
|
||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () {
|
action: () {
|
||||||
Navigator.pushNamed(context, Routers.resetButtonPage);
|
Get.toNamed(Routers.resetButtonPage, arguments: state.getKeyInfosData.value);
|
||||||
}),
|
})),
|
||||||
CommonItem(
|
CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.unlockQRCode!.tr,
|
leftTitel: TranslationLoader.lanKeys!.unlockQRCode!.tr,
|
||||||
rightTitle: "",
|
rightTitle: "",
|
||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () {
|
action: () {
|
||||||
Navigator.pushNamed(context, Routers.unlockQRCodePage);
|
Get.toNamed(Routers.unlockQRCodePage);
|
||||||
}),
|
}),
|
||||||
CommonItem(
|
CommonItem(
|
||||||
leftTitel: 'WiFi配网',
|
leftTitel: TranslationLoader.lanKeys!.wifiDistributionNetwork!.tr,
|
||||||
rightTitle: "",
|
rightTitle: "",
|
||||||
isHaveLine: false,
|
isHaveLine: false,
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () {}),
|
action: () {
|
||||||
|
Get.toNamed(Routers.configuringWifiPage);
|
||||||
|
}),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 10.h,
|
height: 10.h,
|
||||||
),
|
),
|
||||||
@ -145,7 +183,7 @@ class _LockSetPageState extends State<LockSetPage> {
|
|||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () {
|
action: () {
|
||||||
Navigator.pushNamed(context, Routers.lockTimePage);
|
Get.toNamed(Routers.lockTimePage, arguments: state.getKeyInfosData.value);
|
||||||
}),
|
}),
|
||||||
CommonItem(
|
CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.diagnose!.tr,
|
leftTitel: TranslationLoader.lanKeys!.diagnose!.tr,
|
||||||
@ -153,7 +191,7 @@ class _LockSetPageState extends State<LockSetPage> {
|
|||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () {
|
action: () {
|
||||||
Navigator.pushNamed(context, Routers.diagnosePage);
|
Get.toNamed(Routers.diagnosePage);
|
||||||
}),
|
}),
|
||||||
CommonItem(
|
CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.uploadData!.tr,
|
leftTitel: TranslationLoader.lanKeys!.uploadData!.tr,
|
||||||
@ -161,7 +199,7 @@ class _LockSetPageState extends State<LockSetPage> {
|
|||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () {
|
action: () {
|
||||||
Navigator.pushNamed(context, Routers.uploadDataPage);
|
Get.toNamed(Routers.uploadDataPage);
|
||||||
}),
|
}),
|
||||||
CommonItem(
|
CommonItem(
|
||||||
leftTitel:
|
leftTitel:
|
||||||
@ -170,8 +208,7 @@ class _LockSetPageState extends State<LockSetPage> {
|
|||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () {
|
action: () {
|
||||||
Navigator.pushNamed(
|
Get.toNamed(Routers.importOtherLockDataPage);
|
||||||
context, Routers.importOtherLockDataPage);
|
|
||||||
}),
|
}),
|
||||||
CommonItem(
|
CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.lockEscalation!.tr,
|
leftTitel: TranslationLoader.lanKeys!.lockEscalation!.tr,
|
||||||
@ -179,8 +216,7 @@ class _LockSetPageState extends State<LockSetPage> {
|
|||||||
isHaveLine: false,
|
isHaveLine: false,
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () {
|
action: () {
|
||||||
Navigator.pushNamed(
|
Get.toNamed(Routers.lockEscalationPage);
|
||||||
context, Routers.lockEscalationPage);
|
|
||||||
}),
|
}),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 10.h,
|
height: 10.h,
|
||||||
@ -200,16 +236,23 @@ class _LockSetPageState extends State<LockSetPage> {
|
|||||||
SizedBox(
|
SizedBox(
|
||||||
height: 10.h,
|
height: 10.h,
|
||||||
),
|
),
|
||||||
CommonItem(
|
Obx((){
|
||||||
leftTitel:
|
var title = "";
|
||||||
TranslationLoader.lanKeys!.markedHouseState!.tr,
|
if(state.getKeyInfosData.value.roomStatus == 1){
|
||||||
rightTitle: "空闲",
|
title = TranslationLoader.lanKeys!.checkedIn!.tr;
|
||||||
isHaveLine: true,
|
}else if(state.getKeyInfosData.value.roomStatus == 2){
|
||||||
isHaveDirection: true,
|
title = TranslationLoader.lanKeys!.leisure!.tr;
|
||||||
action: () {
|
}
|
||||||
Navigator.pushNamed(
|
return CommonItem(
|
||||||
context, Routers.markedHouseStatePage);
|
leftTitel:
|
||||||
}),
|
TranslationLoader.lanKeys!.markedHouseState!.tr,
|
||||||
|
rightTitle: title,
|
||||||
|
isHaveLine: true,
|
||||||
|
isHaveDirection: true,
|
||||||
|
action: () {
|
||||||
|
Get.toNamed(Routers.markedHouseStatePage, arguments: state.getKeyInfosData.value);
|
||||||
|
});
|
||||||
|
}),
|
||||||
CommonItem(
|
CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.checkingIn!.tr,
|
leftTitel: TranslationLoader.lanKeys!.checkingIn!.tr,
|
||||||
rightTitle: "",
|
rightTitle: "",
|
||||||
@ -232,6 +275,7 @@ class _LockSetPageState extends State<LockSetPage> {
|
|||||||
isDelete: true,
|
isDelete: true,
|
||||||
onClick: () {
|
onClick: () {
|
||||||
logic.deletUserAction();
|
logic.deletUserAction();
|
||||||
|
// logic.deletLockInfoData();
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import 'package:get/get.dart';
|
|||||||
import 'package:star_lock/main/lockMian/entity/lockInfoEntity.dart';
|
import 'package:star_lock/main/lockMian/entity/lockInfoEntity.dart';
|
||||||
|
|
||||||
class LockSetState {
|
class LockSetState {
|
||||||
var getKeyInfosData = KeyInfos().obs;
|
final getKeyInfosData = KeyInfos().obs;
|
||||||
|
|
||||||
LockSetState() {
|
LockSetState() {
|
||||||
getKeyInfosData.value = Get.arguments as KeyInfos;
|
getKeyInfosData.value = Get.arguments as KeyInfos;
|
||||||
|
|||||||
@ -0,0 +1,37 @@
|
|||||||
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
|
|
||||||
|
import '../../../../network/api_repository.dart';
|
||||||
|
import '../../../../tools/eventBusEventManage.dart';
|
||||||
|
import '../../../../tools/toast.dart';
|
||||||
|
import 'lockSoundSet_state.dart';
|
||||||
|
|
||||||
|
class LockSoundSetLogic extends BaseGetXController {
|
||||||
|
LockSoundSetState state = LockSoundSetState();
|
||||||
|
|
||||||
|
// 配置锁的常开模式设置 -> 锁声音设置
|
||||||
|
void setLockSetGeneralSetting() async{
|
||||||
|
int isOn;
|
||||||
|
int type;
|
||||||
|
if(state.isOpenLockSound.value == false){
|
||||||
|
// 音量关了的时候
|
||||||
|
isOn = 2; type = 6;
|
||||||
|
}else{
|
||||||
|
// 音量开了的时候
|
||||||
|
isOn = state.lockSoundLevel.value; type = 8;
|
||||||
|
}
|
||||||
|
var entity = await ApiRepository.to.setLockSetGeneralSettingData(
|
||||||
|
lockId: state.getKeyInfosData.value.lockId.toString(),
|
||||||
|
changeType:"1",
|
||||||
|
isOn:isOn.toString(), // 1-开启、2-关闭; 设置音量:1到5;
|
||||||
|
type:type.toString(), // 6-锁声音开关 8-音量、
|
||||||
|
);
|
||||||
|
if(entity.errorCode!.codeIsSuccessful){
|
||||||
|
eventBus.fire(RefreshLockListInfoDataEvent());
|
||||||
|
//
|
||||||
|
state.getKeyInfosData.value.lockSound = state.isOpenLockSound.value == true ? 1 :2;
|
||||||
|
state.getKeyInfosData.value.volume = state.lockSoundLevel.value;
|
||||||
|
eventBus.fire(PassCurrentLockInformationEvent(state.getKeyInfosData.value));
|
||||||
|
Toast.show(msg: "操作成功");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -8,6 +8,7 @@ import '../../../../tools/commonItem.dart';
|
|||||||
import '../../../../tools/submitBtn.dart';
|
import '../../../../tools/submitBtn.dart';
|
||||||
import '../../../../tools/titleAppBar.dart';
|
import '../../../../tools/titleAppBar.dart';
|
||||||
import '../../../../translations/trans_lib.dart';
|
import '../../../../translations/trans_lib.dart';
|
||||||
|
import 'lockSoundSet_logic.dart';
|
||||||
|
|
||||||
class LockSoundSetPage extends StatefulWidget {
|
class LockSoundSetPage extends StatefulWidget {
|
||||||
const LockSoundSetPage({Key? key}) : super(key: key);
|
const LockSoundSetPage({Key? key}) : super(key: key);
|
||||||
@ -17,6 +18,9 @@ class LockSoundSetPage extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _LockSoundSetPageState extends State<LockSoundSetPage> {
|
class _LockSoundSetPageState extends State<LockSoundSetPage> {
|
||||||
|
final logic = Get.put(LockSoundSetLogic());
|
||||||
|
final state = Get.find<LockSoundSetLogic>().state;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
@ -25,7 +29,7 @@ class _LockSoundSetPageState extends State<LockSoundSetPage> {
|
|||||||
barTitle: TranslationLoader.lanKeys!.lockSound!.tr,
|
barTitle: TranslationLoader.lanKeys!.lockSound!.tr,
|
||||||
haveBack: true,
|
haveBack: true,
|
||||||
backgroundColor: AppColors.mainColor),
|
backgroundColor: AppColors.mainColor),
|
||||||
body: ListView(
|
body: Obx(() => ListView(
|
||||||
children: [
|
children: [
|
||||||
CommonItem(
|
CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.lockSound!.tr,
|
leftTitel: TranslationLoader.lanKeys!.lockSound!.tr,
|
||||||
@ -33,7 +37,7 @@ class _LockSoundSetPageState extends State<LockSoundSetPage> {
|
|||||||
isHaveLine: false,
|
isHaveLine: false,
|
||||||
isHaveRightWidget: true,
|
isHaveRightWidget: true,
|
||||||
rightWidget:
|
rightWidget:
|
||||||
SizedBox(width: 60.w, height: 50.h, child: _switch())),
|
SizedBox(width: 60.w, height: 50.h, child: _switch())),
|
||||||
Container(
|
Container(
|
||||||
height: 10.h,
|
height: 10.h,
|
||||||
),
|
),
|
||||||
@ -46,9 +50,9 @@ class _LockSoundSetPageState extends State<LockSoundSetPage> {
|
|||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
TranslationLoader.lanKeys!.lockSoundTip!.tr,
|
TranslationLoader.lanKeys!.lockSoundTip!.tr,
|
||||||
style: TextStyle(fontSize: 20.sp),
|
style: TextStyle(fontSize: 20.sp),
|
||||||
)),
|
)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -56,7 +60,7 @@ class _LockSoundSetPageState extends State<LockSoundSetPage> {
|
|||||||
height: 10.h,
|
height: 10.h,
|
||||||
),
|
),
|
||||||
Visibility(
|
Visibility(
|
||||||
visible: true,
|
visible: state.isOpenLockSound.value,
|
||||||
child: Container(
|
child: Container(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
child: Column(
|
child: Column(
|
||||||
@ -72,11 +76,15 @@ class _LockSoundSetPageState extends State<LockSoundSetPage> {
|
|||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
isHaveRightWidget: true,
|
isHaveRightWidget: true,
|
||||||
rightWidget: GestureDetector(
|
rightWidget: GestureDetector(
|
||||||
onTap: () {},
|
onTap: () {
|
||||||
|
setState(() {
|
||||||
|
state.lockSoundLevel.value = 1;
|
||||||
|
});
|
||||||
|
},
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Image.asset(
|
Image.asset(
|
||||||
'images/icon_round_unSelet.png',
|
state.lockSoundLevel.value == 1 ? 'images/icon_round_selet.png' : 'images/icon_round_unSelet.png',
|
||||||
width: 30.w,
|
width: 30.w,
|
||||||
height: 30.w,
|
height: 30.w,
|
||||||
),
|
),
|
||||||
@ -89,11 +97,15 @@ class _LockSoundSetPageState extends State<LockSoundSetPage> {
|
|||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
isHaveRightWidget: true,
|
isHaveRightWidget: true,
|
||||||
rightWidget: GestureDetector(
|
rightWidget: GestureDetector(
|
||||||
onTap: () {},
|
onTap: () {
|
||||||
|
setState(() {
|
||||||
|
state.lockSoundLevel.value = 2;
|
||||||
|
});
|
||||||
|
},
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Image.asset(
|
Image.asset(
|
||||||
'images/icon_round_unSelet.png',
|
state.lockSoundLevel.value == 2 ? 'images/icon_round_selet.png' : 'images/icon_round_unSelet.png',
|
||||||
width: 30.w,
|
width: 30.w,
|
||||||
height: 30.w,
|
height: 30.w,
|
||||||
),
|
),
|
||||||
@ -106,11 +118,15 @@ class _LockSoundSetPageState extends State<LockSoundSetPage> {
|
|||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
isHaveRightWidget: true,
|
isHaveRightWidget: true,
|
||||||
rightWidget: GestureDetector(
|
rightWidget: GestureDetector(
|
||||||
onTap: () {},
|
onTap: () {
|
||||||
|
setState(() {
|
||||||
|
state.lockSoundLevel.value = 3;
|
||||||
|
});
|
||||||
|
},
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Image.asset(
|
Image.asset(
|
||||||
'images/icon_round_unSelet.png',
|
state.lockSoundLevel.value == 3 ? 'images/icon_round_selet.png' : 'images/icon_round_unSelet.png',
|
||||||
width: 30.w,
|
width: 30.w,
|
||||||
height: 30.w,
|
height: 30.w,
|
||||||
),
|
),
|
||||||
@ -123,11 +139,15 @@ class _LockSoundSetPageState extends State<LockSoundSetPage> {
|
|||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
isHaveRightWidget: true,
|
isHaveRightWidget: true,
|
||||||
rightWidget: GestureDetector(
|
rightWidget: GestureDetector(
|
||||||
onTap: () {},
|
onTap: () {
|
||||||
|
setState(() {
|
||||||
|
state.lockSoundLevel.value = 4;
|
||||||
|
});
|
||||||
|
},
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Image.asset(
|
Image.asset(
|
||||||
'images/icon_round_unSelet.png',
|
state.lockSoundLevel.value == 4 ? 'images/icon_round_selet.png' : 'images/icon_round_unSelet.png',
|
||||||
width: 30.w,
|
width: 30.w,
|
||||||
height: 30.w,
|
height: 30.w,
|
||||||
),
|
),
|
||||||
@ -140,11 +160,15 @@ class _LockSoundSetPageState extends State<LockSoundSetPage> {
|
|||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
isHaveRightWidget: true,
|
isHaveRightWidget: true,
|
||||||
rightWidget: GestureDetector(
|
rightWidget: GestureDetector(
|
||||||
onTap: () {},
|
onTap: () {
|
||||||
|
setState(() {
|
||||||
|
state.lockSoundLevel.value = 5;
|
||||||
|
});
|
||||||
|
},
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Image.asset(
|
Image.asset(
|
||||||
'images/icon_round_unSelet.png',
|
state.lockSoundLevel.value == 5 ? 'images/icon_round_selet.png' : 'images/icon_round_unSelet.png',
|
||||||
width: 30.w,
|
width: 30.w,
|
||||||
height: 30.w,
|
height: 30.w,
|
||||||
),
|
),
|
||||||
@ -159,23 +183,22 @@ class _LockSoundSetPageState extends State<LockSoundSetPage> {
|
|||||||
child: SubmitBtn(
|
child: SubmitBtn(
|
||||||
btnName: TranslationLoader.lanKeys!.save!.tr,
|
btnName: TranslationLoader.lanKeys!.save!.tr,
|
||||||
onClick: () {
|
onClick: () {
|
||||||
// Navigator.pushNamed(context, Routers.nearbyLockPage);
|
logic.setLockSetGeneralSetting();
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
));
|
)));
|
||||||
}
|
}
|
||||||
|
|
||||||
CupertinoSwitch _switch() {
|
CupertinoSwitch _switch() {
|
||||||
bool _isOn = false;
|
|
||||||
return CupertinoSwitch(
|
return CupertinoSwitch(
|
||||||
activeColor: CupertinoColors.activeBlue,
|
activeColor: CupertinoColors.activeBlue,
|
||||||
trackColor: CupertinoColors.systemGrey5,
|
trackColor: CupertinoColors.systemGrey5,
|
||||||
thumbColor: CupertinoColors.white,
|
thumbColor: CupertinoColors.white,
|
||||||
value: _isOn,
|
value: state.isOpenLockSound.value,
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
setState(() {
|
setState(() {
|
||||||
_isOn = value;
|
state.isOpenLockSound.value = value;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|||||||
@ -0,0 +1,16 @@
|
|||||||
|
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import '../../../lockMian/entity/lockInfoEntity.dart';
|
||||||
|
|
||||||
|
class LockSoundSetState {
|
||||||
|
var getKeyInfosData = KeyInfos().obs;
|
||||||
|
|
||||||
|
var isOpenLockSound = false.obs;// 是否开启声音
|
||||||
|
var lockSoundLevel = 0.obs;// 音量等级
|
||||||
|
|
||||||
|
LockSoundSetState() {
|
||||||
|
getKeyInfosData.value = Get.arguments as KeyInfos;
|
||||||
|
isOpenLockSound.value = getKeyInfosData.value.lockSound == 1 ? true : false;
|
||||||
|
lockSoundLevel.value = getKeyInfosData.value.volume!;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,45 @@
|
|||||||
|
|
||||||
|
class GetServerDatetimeEntity {
|
||||||
|
int? errorCode;
|
||||||
|
String? description;
|
||||||
|
String? errorMsg;
|
||||||
|
Data? data;
|
||||||
|
|
||||||
|
GetServerDatetimeEntity(
|
||||||
|
{this.errorCode, this.description, this.errorMsg, this.data});
|
||||||
|
|
||||||
|
GetServerDatetimeEntity.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 {
|
||||||
|
String? date;
|
||||||
|
|
||||||
|
Data(
|
||||||
|
{this.date});
|
||||||
|
|
||||||
|
Data.fromJson(Map<String, dynamic> json) {
|
||||||
|
date = json['date'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
data['date'] = date;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -13,6 +13,7 @@ import '../../../../blue/io_tool/io_manager.dart';
|
|||||||
import '../../../../blue/io_tool/io_tool.dart';
|
import '../../../../blue/io_tool/io_tool.dart';
|
||||||
import '../../../../blue/io_tool/manager_event_bus.dart';
|
import '../../../../blue/io_tool/manager_event_bus.dart';
|
||||||
import '../../../../blue/sender_manage.dart';
|
import '../../../../blue/sender_manage.dart';
|
||||||
|
import '../../../../network/api_repository.dart';
|
||||||
import '../../../../tools/baseGetXController.dart';
|
import '../../../../tools/baseGetXController.dart';
|
||||||
import '../../../../tools/dateTool.dart';
|
import '../../../../tools/dateTool.dart';
|
||||||
import '../../../../tools/storage.dart';
|
import '../../../../tools/storage.dart';
|
||||||
@ -54,7 +55,7 @@ class LockTimeLogic extends BaseGetXController{
|
|||||||
(0xff & lockTime[2]) << 8 |
|
(0xff & lockTime[2]) << 8 |
|
||||||
(0xFF & lockTime[3]));
|
(0xFF & lockTime[3]));
|
||||||
|
|
||||||
String dataEime = DateTool().dateToString("${value}000");
|
String dataEime = DateTool().dateToString("${value}");
|
||||||
state.dateTime.value = dataEime;
|
state.dateTime.value = dataEime;
|
||||||
print("lockTime:$lockTime value:$value dataEime:$dataEime");
|
print("lockTime:$lockTime value:$value dataEime:$dataEime");
|
||||||
break;
|
break;
|
||||||
@ -156,6 +157,28 @@ class LockTimeLogic extends BaseGetXController{
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取锁的常开模式设置
|
||||||
|
void getLockTimeFromGateway() async{
|
||||||
|
var entity = await ApiRepository.to.getLockTimeFromGateway(
|
||||||
|
lockId: state.getKeyInfosData.value.lockId.toString(),
|
||||||
|
);
|
||||||
|
if(entity.errorCode!.codeIsSuccessful){
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取锁的常开模式设置
|
||||||
|
void getServerDatetime() async{
|
||||||
|
var entity = await ApiRepository.to.getServerDatetimeData(
|
||||||
|
lockId: state.getKeyInfosData.value.lockId.toString(),
|
||||||
|
);
|
||||||
|
if(entity.errorCode!.codeIsSuccessful){
|
||||||
|
String dataEime = DateTool().dateToString("${int.parse(entity.data!.date.toString())~/1000}");
|
||||||
|
state.dateTime.value = dataEime;
|
||||||
|
sendTiming();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void onReady() {
|
void onReady() {
|
||||||
// TODO: implement onReady
|
// TODO: implement onReady
|
||||||
@ -163,6 +186,7 @@ class LockTimeLogic extends BaseGetXController{
|
|||||||
print("onReady()");
|
print("onReady()");
|
||||||
|
|
||||||
_initReplySubscription();
|
_initReplySubscription();
|
||||||
|
getLockTimeFromGateway();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
@ -52,8 +52,9 @@ class _LockTimePageState extends State<LockTimePage> {
|
|||||||
// margin: EdgeInsets.only(left: 03.w, right: 30.w, top: 20.w),
|
// margin: EdgeInsets.only(left: 03.w, right: 30.w, top: 20.w),
|
||||||
padding: EdgeInsets.only(top: 20.w, bottom: 20.w),
|
padding: EdgeInsets.only(top: 20.w, bottom: 20.w),
|
||||||
onClick: () {
|
onClick: () {
|
||||||
print("1111111");
|
// print("1111111");
|
||||||
logic.sendTiming();
|
// logic.sendTiming();
|
||||||
|
logic.getServerDatetime();
|
||||||
}),
|
}),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 40.h,
|
height: 40.h,
|
||||||
|
|||||||
@ -2,6 +2,14 @@
|
|||||||
|
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
import '../../../lockMian/entity/lockInfoEntity.dart';
|
||||||
|
|
||||||
class LockTimeState{
|
class LockTimeState{
|
||||||
var dateTime = "".obs;
|
var dateTime = "".obs;
|
||||||
|
|
||||||
|
var getKeyInfosData = KeyInfos().obs;
|
||||||
|
|
||||||
|
LockTimeState() {
|
||||||
|
getKeyInfosData.value = Get.arguments as KeyInfos;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -0,0 +1,35 @@
|
|||||||
|
|
||||||
|
|
||||||
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
|
|
||||||
|
import '../../../../network/api_repository.dart';
|
||||||
|
import '../../../../tools/eventBusEventManage.dart';
|
||||||
|
import '../../../../tools/toast.dart';
|
||||||
|
import 'markedHouseState_state.dart';
|
||||||
|
|
||||||
|
class MarkedHouseStateLogic extends BaseGetXController{
|
||||||
|
MarkedHouseStateState state = MarkedHouseStateState();
|
||||||
|
|
||||||
|
// 配置锁的常开模式设置
|
||||||
|
Future<void> setLockSetGeneralSetting() async{
|
||||||
|
var entity = await ApiRepository.to.setLockSetGeneralSettingData(
|
||||||
|
lockId: state.getKeyInfosData.value.lockId.toString(),
|
||||||
|
changeType:"1",
|
||||||
|
isOn:state.roomStatus.value.toString(), // 已入住: 1 空闲:2
|
||||||
|
type:"13", // 标记房态
|
||||||
|
);
|
||||||
|
if(entity.errorCode!.codeIsSuccessful){
|
||||||
|
eventBus.fire(RefreshLockListInfoDataEvent());
|
||||||
|
|
||||||
|
state.roomStatus.value = state.roomStatus.value;
|
||||||
|
state.getKeyInfosData.value.roomStatus = state.roomStatus.value;
|
||||||
|
eventBus.fire(PassCurrentLockInformationEvent(state.getKeyInfosData.value));
|
||||||
|
Toast.show(msg: "操作成功");
|
||||||
|
}else if(entity.errorCode! == 1){
|
||||||
|
// 跳转到高级功能界面 需要开通高级功能
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -7,6 +7,7 @@ import '../../../../tools/commonItem.dart';
|
|||||||
import '../../../../tools/submitBtn.dart';
|
import '../../../../tools/submitBtn.dart';
|
||||||
import '../../../../tools/titleAppBar.dart';
|
import '../../../../tools/titleAppBar.dart';
|
||||||
import '../../../../translations/trans_lib.dart';
|
import '../../../../translations/trans_lib.dart';
|
||||||
|
import 'markedHouseState_logic.dart';
|
||||||
|
|
||||||
class MarkedHouseStatePage extends StatefulWidget {
|
class MarkedHouseStatePage extends StatefulWidget {
|
||||||
const MarkedHouseStatePage({Key? key}) : super(key: key);
|
const MarkedHouseStatePage({Key? key}) : super(key: key);
|
||||||
@ -16,6 +17,9 @@ class MarkedHouseStatePage extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _MarkedHouseStatePageState extends State<MarkedHouseStatePage> {
|
class _MarkedHouseStatePageState extends State<MarkedHouseStatePage> {
|
||||||
|
final logic = Get.put(MarkedHouseStateLogic());
|
||||||
|
final state = Get.find<MarkedHouseStateLogic>().state;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
@ -24,55 +28,63 @@ class _MarkedHouseStatePageState extends State<MarkedHouseStatePage> {
|
|||||||
barTitle: TranslationLoader.lanKeys!.markedHouseState!.tr,
|
barTitle: TranslationLoader.lanKeys!.markedHouseState!.tr,
|
||||||
haveBack: true,
|
haveBack: true,
|
||||||
backgroundColor: AppColors.mainColor),
|
backgroundColor: AppColors.mainColor),
|
||||||
body: Container(
|
body: Column(
|
||||||
child: Column(
|
children: [
|
||||||
children: [
|
Obx(() => CommonItem(
|
||||||
CommonItem(
|
leftTitel: TranslationLoader.lanKeys!.leisure!.tr,
|
||||||
leftTitel: TranslationLoader.lanKeys!.leisure!.tr,
|
rightTitle: "",
|
||||||
rightTitle: "",
|
isHaveLine: true,
|
||||||
isHaveLine: true,
|
isHaveRightWidget: true,
|
||||||
isHaveRightWidget: true,
|
rightWidget: GestureDetector(
|
||||||
rightWidget: GestureDetector(
|
onTap: () {
|
||||||
onTap: () {},
|
setState(() {
|
||||||
child: Row(
|
state.roomStatus.value = 2;
|
||||||
children: [
|
});
|
||||||
Image.asset(
|
},
|
||||||
'images/icon_round_unSelet.png',
|
child: Row(
|
||||||
width: 30.w,
|
children: [
|
||||||
height: 30.w,
|
Image.asset(
|
||||||
),
|
state.roomStatus.value == 2 ? 'images/icon_round_selet.png' : 'images/icon_round_unSelet.png',
|
||||||
],
|
width: 30.w,
|
||||||
),
|
height: 30.w,
|
||||||
)),
|
),
|
||||||
CommonItem(
|
],
|
||||||
leftTitel: TranslationLoader.lanKeys!.checkedIn!.tr,
|
),
|
||||||
rightTitle: "",
|
))),
|
||||||
isHaveLine: false,
|
Obx(() => CommonItem(
|
||||||
isHaveRightWidget: true,
|
leftTitel: TranslationLoader.lanKeys!.checkedIn!.tr,
|
||||||
rightWidget: GestureDetector(
|
rightTitle: "",
|
||||||
onTap: () {},
|
isHaveLine: false,
|
||||||
child: Row(
|
isHaveRightWidget: true,
|
||||||
children: [
|
rightWidget: GestureDetector(
|
||||||
Image.asset(
|
onTap: () {
|
||||||
'images/icon_round_unSelet.png',
|
setState(() {
|
||||||
width: 30.w,
|
state.roomStatus.value = 1;
|
||||||
height: 30.w,
|
});
|
||||||
),
|
},
|
||||||
],
|
child: Row(
|
||||||
),
|
children: [
|
||||||
)),
|
Image.asset(
|
||||||
SizedBox(
|
state.roomStatus.value == 1 ? 'images/icon_round_selet.png' : 'images/icon_round_unSelet.png',
|
||||||
height: 60.h,
|
width: 30.w,
|
||||||
),
|
height: 30.w,
|
||||||
SubmitBtn(
|
),
|
||||||
btnName: TranslationLoader.lanKeys!.sure!.tr,
|
],
|
||||||
borderRadius: 20.w,
|
),
|
||||||
fontSize: 32.sp,
|
))),
|
||||||
// margin: EdgeInsets.only(left: 03.w, right: 30.w, top: 20.w),
|
SizedBox(
|
||||||
padding: EdgeInsets.only(top: 20.w, bottom: 20.w),
|
height: 60.h,
|
||||||
onClick: () {}),
|
),
|
||||||
],
|
SubmitBtn(
|
||||||
),
|
btnName: TranslationLoader.lanKeys!.sure!.tr,
|
||||||
|
borderRadius: 20.w,
|
||||||
|
fontSize: 32.sp,
|
||||||
|
// margin: EdgeInsets.only(left: 03.w, right: 30.w, top: 20.w),
|
||||||
|
padding: EdgeInsets.only(top: 20.w, bottom: 20.w),
|
||||||
|
onClick: () {
|
||||||
|
logic.setLockSetGeneralSetting();
|
||||||
|
}),
|
||||||
|
],
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,16 @@
|
|||||||
|
|
||||||
|
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
import '../../../lockMian/entity/lockInfoEntity.dart';
|
||||||
|
|
||||||
|
class MarkedHouseStateState{
|
||||||
|
var getKeyInfosData = KeyInfos().obs;
|
||||||
|
|
||||||
|
var roomStatus = 0.obs;
|
||||||
|
|
||||||
|
MarkedHouseStateState() {
|
||||||
|
getKeyInfosData.value = Get.arguments as KeyInfos;
|
||||||
|
roomStatus.value = getKeyInfosData.value.roomStatus!;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,65 @@
|
|||||||
|
|
||||||
|
class GetPassageModeConfigEntity {
|
||||||
|
int? errorCode;
|
||||||
|
String? description;
|
||||||
|
String? errorMsg;
|
||||||
|
Data? data;
|
||||||
|
|
||||||
|
GetPassageModeConfigEntity(
|
||||||
|
{this.errorCode, this.description, this.errorMsg, this.data});
|
||||||
|
|
||||||
|
GetPassageModeConfigEntity.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 {
|
||||||
|
int? passageMode;
|
||||||
|
int? startDate;
|
||||||
|
int? endDate;
|
||||||
|
int? isAllDay;
|
||||||
|
List<dynamic>? weekDays;
|
||||||
|
int? autoUnlock;
|
||||||
|
|
||||||
|
Data(
|
||||||
|
{this.passageMode,
|
||||||
|
this.startDate,
|
||||||
|
this.endDate,
|
||||||
|
this.isAllDay,
|
||||||
|
this.weekDays,
|
||||||
|
this.autoUnlock});
|
||||||
|
|
||||||
|
Data.fromJson(Map<String, dynamic> json) {
|
||||||
|
passageMode = json['passageMode'];
|
||||||
|
startDate = json['startDate'];
|
||||||
|
endDate = json['endDate'];
|
||||||
|
isAllDay = json['isAllDay'];
|
||||||
|
weekDays = json['weekDays'];
|
||||||
|
autoUnlock = json['autoUnlock'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
data['passageMode'] = passageMode;
|
||||||
|
data['startDate'] = startDate;
|
||||||
|
data['endDate'] = endDate;
|
||||||
|
data['isAllDay'] = isAllDay;
|
||||||
|
data['weekDays'] = weekDays;
|
||||||
|
data['autoUnlock'] = autoUnlock;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,82 @@
|
|||||||
|
|
||||||
|
|
||||||
|
import 'package:date_format/date_format.dart';
|
||||||
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
|
|
||||||
|
import '../../../../network/api_repository.dart';
|
||||||
|
import '../../../../tools/eventBusEventManage.dart';
|
||||||
|
import '../../../../tools/toast.dart';
|
||||||
|
import 'normallyOpenMode_state.dart';
|
||||||
|
|
||||||
|
class NormallyOpenModeLogic extends BaseGetXController{
|
||||||
|
NormallyOpenModeState state = NormallyOpenModeState();
|
||||||
|
|
||||||
|
// 获取锁的常开模式设置
|
||||||
|
void getNormallyOpenModeConfig() async{
|
||||||
|
var entity = await ApiRepository.to.getPassageModeConfig(
|
||||||
|
lockId: state.getKeyInfosData.value.lockId.toString(),
|
||||||
|
);
|
||||||
|
if(entity.errorCode!.codeIsSuccessful){
|
||||||
|
state.getPassageModeConfigData.value = entity;
|
||||||
|
state.isOpenNormallyOpenMode.value = state.getPassageModeConfigData.value.data!.passageMode == 1 ? true : false;
|
||||||
|
state.isOpenAutomaticUnLock.value = state.getPassageModeConfigData.value.data!.autoUnlock == 1 ? true : false;
|
||||||
|
state.isAllDay.value = state.getPassageModeConfigData.value.data!.isAllDay == 1 ? 1 : 2;
|
||||||
|
state.weekDays.value = state.getPassageModeConfigData.value.data!.weekDays!;
|
||||||
|
|
||||||
|
state.beginTimeMinute.value = state.getPassageModeConfigData.value.data!.startDate!;
|
||||||
|
state.beginTime.value = "${state.getPassageModeConfigData.value.data!.startDate!~/60}:${state.getPassageModeConfigData.value.data!.startDate! % 60}";
|
||||||
|
state.endTimeMinute.value = state.getPassageModeConfigData.value.data!.endDate!;
|
||||||
|
state.endTime.value = "${state.getPassageModeConfigData.value.data!.endDate!~/60}:${state.getPassageModeConfigData.value.data!.endDate! % 60}";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 配置锁的常开模式设置
|
||||||
|
void configPassageMode() async{
|
||||||
|
if(state.endTimeMinute.value < state.beginTimeMinute.value){
|
||||||
|
Toast.show(msg:"结束时间不能小于开始时间哦");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
print("state.isOpenNormallyOpenMode.value:${state.isOpenNormallyOpenMode.value}");
|
||||||
|
var entity = await ApiRepository.to.configPassageModeLoadData(
|
||||||
|
lockId: state.getKeyInfosData.value.lockId.toString(),
|
||||||
|
passageMode:state.isOpenNormallyOpenMode.value == true ? "1":"2",
|
||||||
|
autoUnlock:state.isOpenAutomaticUnLock.value == true ? "1":"2",
|
||||||
|
type: "1",
|
||||||
|
startDate: state.beginTimeMinute.toString(),
|
||||||
|
endDate: state.endTimeMinute.toString(),
|
||||||
|
isAllDay: state.isAllDay.value == 1 ? "1":"2",
|
||||||
|
weekDays: state.weekDays,
|
||||||
|
);
|
||||||
|
if(entity.errorCode!.codeIsSuccessful){
|
||||||
|
eventBus.fire(RefreshLockListInfoDataEvent());
|
||||||
|
|
||||||
|
state.getKeyInfosData.value.passageMode = state.isOpenNormallyOpenMode.value == true ? 1:2;
|
||||||
|
eventBus.fire(PassCurrentLockInformationEvent(state.getKeyInfosData.value));
|
||||||
|
Toast.show(msg: "操作成功");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void onReady() {
|
||||||
|
// TODO: implement onReady
|
||||||
|
super.onReady();
|
||||||
|
print("onReady()");
|
||||||
|
|
||||||
|
if(state.getKeyInfosData.value.passageMode == 1){
|
||||||
|
getNormallyOpenModeConfig();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void onInit() {
|
||||||
|
// TODO: implement onInit
|
||||||
|
super.onInit();
|
||||||
|
print("onInit()");
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void onClose() {
|
||||||
|
// TODO: implement onClose
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,5 +1,7 @@
|
|||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_pickers/pickers.dart';
|
||||||
|
import 'package:flutter_pickers/time_picker/model/date_mode.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
@ -8,6 +10,7 @@ import '../../../../tools/commonItem.dart';
|
|||||||
import '../../../../tools/submitBtn.dart';
|
import '../../../../tools/submitBtn.dart';
|
||||||
import '../../../../tools/titleAppBar.dart';
|
import '../../../../tools/titleAppBar.dart';
|
||||||
import '../../../../translations/trans_lib.dart';
|
import '../../../../translations/trans_lib.dart';
|
||||||
|
import 'normallyOpenMode_logic.dart';
|
||||||
|
|
||||||
class NormallyOpenModePage extends StatefulWidget {
|
class NormallyOpenModePage extends StatefulWidget {
|
||||||
const NormallyOpenModePage({Key? key}) : super(key: key);
|
const NormallyOpenModePage({Key? key}) : super(key: key);
|
||||||
@ -17,6 +20,9 @@ class NormallyOpenModePage extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _NormallyOpenModePageState extends State<NormallyOpenModePage> {
|
class _NormallyOpenModePageState extends State<NormallyOpenModePage> {
|
||||||
|
final logic = Get.put(NormallyOpenModeLogic());
|
||||||
|
final state = Get.find<NormallyOpenModeLogic>().state;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
@ -25,7 +31,7 @@ class _NormallyOpenModePageState extends State<NormallyOpenModePage> {
|
|||||||
barTitle: TranslationLoader.lanKeys!.normallyOpenMode!.tr,
|
barTitle: TranslationLoader.lanKeys!.normallyOpenMode!.tr,
|
||||||
haveBack: true,
|
haveBack: true,
|
||||||
backgroundColor: AppColors.mainColor),
|
backgroundColor: AppColors.mainColor),
|
||||||
body: ListView(
|
body: Obx(() => ListView(
|
||||||
children: [
|
children: [
|
||||||
CommonItem(
|
CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.normallyOpenMode!.tr,
|
leftTitel: TranslationLoader.lanKeys!.normallyOpenMode!.tr,
|
||||||
@ -33,9 +39,9 @@ class _NormallyOpenModePageState extends State<NormallyOpenModePage> {
|
|||||||
isHaveLine: false,
|
isHaveLine: false,
|
||||||
isHaveRightWidget: true,
|
isHaveRightWidget: true,
|
||||||
rightWidget:
|
rightWidget:
|
||||||
SizedBox(width: 60.w, height: 50.h, child: _switch())),
|
SizedBox(width: 60.w, height: 50.h, child: _normallyOpenModeSwitch())),
|
||||||
Container(
|
SizedBox(
|
||||||
height: 10.h,
|
height: 1.h,
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
padding: EdgeInsets.only(
|
padding: EdgeInsets.only(
|
||||||
@ -46,9 +52,9 @@ class _NormallyOpenModePageState extends State<NormallyOpenModePage> {
|
|||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
TranslationLoader.lanKeys!.normallyOpenModeTip!.tr,
|
TranslationLoader.lanKeys!.normallyOpenModeTip!.tr,
|
||||||
style: TextStyle(fontSize: 20.sp),
|
style: TextStyle(fontSize: 20.sp),
|
||||||
)),
|
)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -56,11 +62,41 @@ class _NormallyOpenModePageState extends State<NormallyOpenModePage> {
|
|||||||
height: 10.h,
|
height: 10.h,
|
||||||
),
|
),
|
||||||
Visibility(
|
Visibility(
|
||||||
visible: true,
|
visible: state.isOpenNormallyOpenMode.value,
|
||||||
child: Container(
|
child: Container(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
|
CommonItem(
|
||||||
|
leftTitel: TranslationLoader.lanKeys!.automaticUnLock!.tr,
|
||||||
|
rightTitle: "",
|
||||||
|
isHaveLine: false,
|
||||||
|
isHaveRightWidget: true,
|
||||||
|
rightWidget:
|
||||||
|
SizedBox(width: 60.w, height: 50.h, child: _autoUnlockSwitch())),
|
||||||
|
Container(
|
||||||
|
height: 1.h,
|
||||||
|
color: AppColors.mainBackgroundColor,
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
padding: EdgeInsets.only(
|
||||||
|
left: 30.w, right: 30.w, top: 20.w, bottom: 20.w),
|
||||||
|
color: Colors.white,
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: Text(
|
||||||
|
TranslationLoader.lanKeys!.automaticUnLockTip!.tr,
|
||||||
|
style: TextStyle(fontSize: 20.sp),
|
||||||
|
)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
height: 10.h,
|
||||||
|
color: AppColors.mainBackgroundColor,
|
||||||
|
),
|
||||||
topWidget(),
|
topWidget(),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 10.h,
|
height: 10.h,
|
||||||
@ -74,11 +110,11 @@ class _NormallyOpenModePageState extends State<NormallyOpenModePage> {
|
|||||||
child: SubmitBtn(
|
child: SubmitBtn(
|
||||||
btnName: TranslationLoader.lanKeys!.save!.tr,
|
btnName: TranslationLoader.lanKeys!.save!.tr,
|
||||||
onClick: () {
|
onClick: () {
|
||||||
// Navigator.pushNamed(context, Routers.nearbyLockPage);
|
logic.configPassageMode();
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
));
|
)));
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget topWidget() {
|
Widget topWidget() {
|
||||||
@ -106,6 +142,7 @@ class _NormallyOpenModePageState extends State<NormallyOpenModePage> {
|
|||||||
itemCount: 7,
|
itemCount: 7,
|
||||||
physics: const NeverScrollableScrollPhysics(),
|
physics: const NeverScrollableScrollPhysics(),
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
|
index += 1;
|
||||||
return btnItem(index);
|
return btnItem(index);
|
||||||
})),
|
})),
|
||||||
],
|
],
|
||||||
@ -116,9 +153,6 @@ class _NormallyOpenModePageState extends State<NormallyOpenModePage> {
|
|||||||
Widget btnItem(int index) {
|
Widget btnItem(int index) {
|
||||||
String dateStr;
|
String dateStr;
|
||||||
switch (index) {
|
switch (index) {
|
||||||
case 0:
|
|
||||||
dateStr = TranslationLoader.lanKeys!.sundayShort!.tr;
|
|
||||||
break;
|
|
||||||
case 1:
|
case 1:
|
||||||
dateStr = TranslationLoader.lanKeys!.mondayShort!.tr;
|
dateStr = TranslationLoader.lanKeys!.mondayShort!.tr;
|
||||||
break;
|
break;
|
||||||
@ -137,27 +171,39 @@ class _NormallyOpenModePageState extends State<NormallyOpenModePage> {
|
|||||||
case 6:
|
case 6:
|
||||||
dateStr = TranslationLoader.lanKeys!.saturdayShort!.tr;
|
dateStr = TranslationLoader.lanKeys!.saturdayShort!.tr;
|
||||||
break;
|
break;
|
||||||
|
case 7:
|
||||||
|
dateStr = TranslationLoader.lanKeys!.sundayShort!.tr;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
dateStr = "";
|
dateStr = "";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: () {},
|
onTap: () {
|
||||||
child: Container(
|
if(state.weekDays.value.contains(index)){
|
||||||
|
state.weekDays.value.remove(index);
|
||||||
|
}else{
|
||||||
|
state.weekDays.value.add(index);
|
||||||
|
}
|
||||||
|
state.weekDays.value.sort();
|
||||||
|
setState(() {});
|
||||||
|
// print("index:$index data:${state.normallyOpenPeriod.value}");
|
||||||
|
},
|
||||||
|
child: Obx(() => Container(
|
||||||
width: 40.w,
|
width: 40.w,
|
||||||
height: 40.w,
|
height: 40.w,
|
||||||
margin: EdgeInsets.all(10.w),
|
margin: EdgeInsets.all(10.w),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
// color: Colors.blue,
|
color: state.weekDays.value.contains(index) ? AppColors.mainColor :Colors.white,
|
||||||
border: Border.all(width: 1, color: AppColors.btnDisableColor),
|
border: Border.all(width: 1, color: AppColors.btnDisableColor),
|
||||||
borderRadius: BorderRadius.circular(30.w),
|
borderRadius: BorderRadius.circular(30.w),
|
||||||
),
|
),
|
||||||
child: Center(
|
child: Center(
|
||||||
child: Text(
|
child: Text(
|
||||||
dateStr,
|
dateStr,
|
||||||
style: TextStyle(fontSize: 20.sp, color: AppColors.darkGrayTextColor),
|
style: TextStyle(fontSize: 20.sp, color: state.weekDays.value.contains(index) ? Colors.white : AppColors.darkGrayTextColor),
|
||||||
)),
|
)),
|
||||||
),
|
)),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -168,14 +214,22 @@ class _NormallyOpenModePageState extends State<NormallyOpenModePage> {
|
|||||||
color: AppColors.mainBackgroundColor,
|
color: AppColors.mainBackgroundColor,
|
||||||
height: 10.h,
|
height: 10.h,
|
||||||
),
|
),
|
||||||
CommonItem(
|
Obx(() => CommonItem(
|
||||||
leftTitel:
|
leftTitel:
|
||||||
"${TranslationLoader.lanKeys!.normallyOpen!.tr}${TranslationLoader.lanKeys!.time!.tr}",
|
"${TranslationLoader.lanKeys!.normallyOpen!.tr}${TranslationLoader.lanKeys!.time!.tr}",
|
||||||
rightTitle: "",
|
rightTitle: "",
|
||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
isHaveRightWidget: true,
|
isHaveRightWidget: true,
|
||||||
rightWidget: GestureDetector(
|
rightWidget: GestureDetector(
|
||||||
onTap: () {},
|
onTap: () {
|
||||||
|
// 选择全天模式
|
||||||
|
if(state.isAllDay.value == 1){
|
||||||
|
state.isAllDay.value = 2;
|
||||||
|
}else{
|
||||||
|
state.isAllDay.value = 1;
|
||||||
|
}
|
||||||
|
setState(() {});
|
||||||
|
},
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
@ -186,32 +240,46 @@ class _NormallyOpenModePageState extends State<NormallyOpenModePage> {
|
|||||||
width: 5.w,
|
width: 5.w,
|
||||||
),
|
),
|
||||||
Image.asset(
|
Image.asset(
|
||||||
'images/icon_round_unSelet.png',
|
state.isAllDay.value == 1 ? 'images/icon_round_selet.png': 'images/icon_round_unSelet.png',
|
||||||
width: 30.w,
|
width: 30.w,
|
||||||
height: 30.w,
|
height: 30.w,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
)),
|
))),
|
||||||
Visibility(
|
Visibility(
|
||||||
visible: true,
|
visible: true,
|
||||||
child: Container(
|
child: Container(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
CommonItem(
|
Obx(() => CommonItem(
|
||||||
leftTitel:
|
leftTitel:
|
||||||
"${TranslationLoader.lanKeys!.begin!.tr}${TranslationLoader.lanKeys!.time!.tr}",
|
"${TranslationLoader.lanKeys!.begin!.tr}${TranslationLoader.lanKeys!.time!.tr}",
|
||||||
rightTitle: "",
|
rightTitle: state.beginTime.value,
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
action: () {}),
|
action: () {
|
||||||
CommonItem(
|
Pickers.showDatePicker(context, mode: DateMode.HM,
|
||||||
|
onConfirm: (p) {
|
||||||
|
state.beginTimeMinute.value = p.hour!*60 + p.minute!;
|
||||||
|
state.beginTime.value = "${p.hour}:${p.minute!}";
|
||||||
|
setState(() {});
|
||||||
|
});
|
||||||
|
})),
|
||||||
|
Obx(() => CommonItem(
|
||||||
leftTitel:
|
leftTitel:
|
||||||
"${TranslationLoader.lanKeys!.end!.tr}${TranslationLoader.lanKeys!.time!.tr}",
|
"${TranslationLoader.lanKeys!.end!.tr}${TranslationLoader.lanKeys!.time!.tr}",
|
||||||
rightTitle: "",
|
rightTitle: state.endTime.value,
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () {}),
|
action: () {
|
||||||
|
Pickers.showDatePicker(context, mode: DateMode.HM,
|
||||||
|
onConfirm: (p) {
|
||||||
|
state.endTimeMinute.value = p.hour!*60 + p.minute!;
|
||||||
|
state.endTime.value = "${p.hour}:${p.minute!}";
|
||||||
|
setState(() {});
|
||||||
|
});
|
||||||
|
})),
|
||||||
Container(height: 10.h),
|
Container(height: 10.h),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@ -220,16 +288,29 @@ class _NormallyOpenModePageState extends State<NormallyOpenModePage> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
CupertinoSwitch _switch() {
|
CupertinoSwitch _normallyOpenModeSwitch() {
|
||||||
bool _isOn = false;
|
|
||||||
return CupertinoSwitch(
|
return CupertinoSwitch(
|
||||||
activeColor: CupertinoColors.activeBlue,
|
activeColor: CupertinoColors.activeBlue,
|
||||||
trackColor: CupertinoColors.systemGrey5,
|
trackColor: CupertinoColors.systemGrey5,
|
||||||
thumbColor: CupertinoColors.white,
|
thumbColor: CupertinoColors.white,
|
||||||
value: _isOn,
|
value: state.isOpenNormallyOpenMode.value,
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
setState(() {
|
setState(() {
|
||||||
_isOn = value;
|
state.isOpenNormallyOpenMode.value = value;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
CupertinoSwitch _autoUnlockSwitch() {
|
||||||
|
return CupertinoSwitch(
|
||||||
|
activeColor: CupertinoColors.activeBlue,
|
||||||
|
trackColor: CupertinoColors.systemGrey5,
|
||||||
|
thumbColor: CupertinoColors.white,
|
||||||
|
value: state.isOpenAutomaticUnLock.value,
|
||||||
|
onChanged: (value) {
|
||||||
|
setState(() {
|
||||||
|
state.isOpenAutomaticUnLock.value = value;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|||||||
@ -0,0 +1,24 @@
|
|||||||
|
|
||||||
|
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:star_lock/main/lockDetail/lcokSet/normallyOpenMode/GetPassageModeConfigEntity.dart';
|
||||||
|
|
||||||
|
import '../../../lockMian/entity/lockInfoEntity.dart';
|
||||||
|
|
||||||
|
class NormallyOpenModeState{
|
||||||
|
var getKeyInfosData = KeyInfos().obs;
|
||||||
|
|
||||||
|
var getPassageModeConfigData = GetPassageModeConfigEntity().obs;
|
||||||
|
var isOpenNormallyOpenMode = false.obs;// 是否开启常开模式 常开模式:1-开启、2-关闭
|
||||||
|
var isOpenAutomaticUnLock = false.obs;// 是否开启自动开锁模式 自动开锁:1-开启、2-关闭,开启后锁将在常开模式开始时自动打开
|
||||||
|
var isAllDay = 0.obs;// 是否开启全天模式 是否全天常开:1-是、2-否, 如果全天常开,startDate和endDate参数将被忽略.
|
||||||
|
var weekDays = [].obs;// 常开时期
|
||||||
|
var beginTime = "".obs;// 开始时间
|
||||||
|
var endTime = "".obs;// 结束时间
|
||||||
|
var beginTimeMinute = 0.obs;// 开始时间分钟
|
||||||
|
var endTimeMinute = 0.obs;// 结束时间分钟
|
||||||
|
|
||||||
|
NormallyOpenModeState() {
|
||||||
|
getKeyInfosData.value = Get.arguments as KeyInfos;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,51 @@
|
|||||||
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
|
import 'package:star_lock/tools/toast.dart';
|
||||||
|
|
||||||
|
import '../../../../blue/io_tool/manager_event_bus.dart';
|
||||||
|
import '../../../../network/api_repository.dart';
|
||||||
|
import '../../../../tools/eventBusEventManage.dart';
|
||||||
|
import 'remoteUnlocking_state.dart';
|
||||||
|
|
||||||
|
class RemoteUnlockingLogic extends BaseGetXController{
|
||||||
|
RemoteUnlockingState state = RemoteUnlockingState();
|
||||||
|
|
||||||
|
void remoteUnlockingOpenOrClose() async{
|
||||||
|
var entity = await ApiRepository.to.remoteUnlockingOpenOrClose(
|
||||||
|
lockId: state.getKeyInfosData.value.lockId.toString(),
|
||||||
|
// featureValue:state.getKeyInfosData.value.featureValue.toString()
|
||||||
|
featureValue:"1234"
|
||||||
|
);
|
||||||
|
if(entity.errorCode!.codeIsSuccessful){
|
||||||
|
eventBus.fire(RefreshLockListInfoDataEvent());
|
||||||
|
if(state.remoteEnable.value == 1){
|
||||||
|
state.remoteEnable.value = 2;
|
||||||
|
}else if(state.remoteEnable.value == 2){
|
||||||
|
state.remoteEnable.value = 1;
|
||||||
|
}
|
||||||
|
state.getKeyInfosData.value.remoteEnable = state.remoteEnable.value;
|
||||||
|
print("state.remoteEnable.value:${state.remoteEnable.value} state.getKeyInfosData.value.remoteEnable:${state.getKeyInfosData.value.remoteEnable}");
|
||||||
|
eventBus.fire(PassCurrentLockInformationEvent(state.getKeyInfosData.value));
|
||||||
|
Toast.show(msg: "操作成功");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void onReady() {
|
||||||
|
// TODO: implement onReady
|
||||||
|
super.onReady();
|
||||||
|
print("onReady()");
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void onInit() {
|
||||||
|
// TODO: implement onInit
|
||||||
|
super.onInit();
|
||||||
|
print("onInit()");
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void onClose() {
|
||||||
|
// TODO: implement onClose
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -1,6 +1,7 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:star_lock/main/lockDetail/lcokSet/remoteUnlocking/remoteUnlocking_logic.dart';
|
||||||
|
|
||||||
import '../../../../app_settings/app_colors.dart';
|
import '../../../../app_settings/app_colors.dart';
|
||||||
import '../../../../tools/submitBtn.dart';
|
import '../../../../tools/submitBtn.dart';
|
||||||
@ -15,6 +16,9 @@ class RemoteUnlockingPage extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _RemoteUnlockingPageState extends State<RemoteUnlockingPage> {
|
class _RemoteUnlockingPageState extends State<RemoteUnlockingPage> {
|
||||||
|
final logic = Get.put(RemoteUnlockingLogic());
|
||||||
|
final state = Get.find<RemoteUnlockingLogic>().state;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
@ -41,23 +45,28 @@ class _RemoteUnlockingPageState extends State<RemoteUnlockingPage> {
|
|||||||
SizedBox(
|
SizedBox(
|
||||||
height: 20.h,
|
height: 20.h,
|
||||||
),
|
),
|
||||||
Row(
|
Obx((){
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
// print("state.remoteEnable:${state.remoteEnable}");
|
||||||
children: [
|
return Row(
|
||||||
Expanded(
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
child: Text(
|
children: [
|
||||||
"${TranslationLoader.lanKeys!.currentMode!.tr} : ${TranslationLoader.lanKeys!.opened!.tr}",
|
Expanded(
|
||||||
style:
|
child: Text(
|
||||||
TextStyle(fontWeight: FontWeight.w600, fontSize: 22.sp),
|
"${TranslationLoader.lanKeys!.currentMode!.tr} : ${state.remoteEnable.value == 1 ?TranslationLoader.lanKeys!.opened!.tr: TranslationLoader.lanKeys!.closed!.tr}",
|
||||||
)),
|
style:
|
||||||
],
|
TextStyle(fontWeight: FontWeight.w600, fontSize: 22.sp),
|
||||||
),
|
)),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 40.h,
|
height: 40.h,
|
||||||
),
|
),
|
||||||
SubmitBtn(
|
Obx(() => SubmitBtn(
|
||||||
btnName: TranslationLoader.lanKeys!.closed!.tr,
|
btnName: state.remoteEnable.value == 1 ?TranslationLoader.lanKeys!.close!.tr: TranslationLoader.lanKeys!.open!.tr,
|
||||||
onClick: () {}),
|
onClick: () {
|
||||||
|
logic.remoteUnlockingOpenOrClose();
|
||||||
|
})),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
));
|
));
|
||||||
|
|||||||
@ -0,0 +1,13 @@
|
|||||||
|
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
import '../../../lockMian/entity/lockInfoEntity.dart';
|
||||||
|
|
||||||
|
class RemoteUnlockingState{
|
||||||
|
var getKeyInfosData = KeyInfos().obs;
|
||||||
|
var remoteEnable = 1.obs;
|
||||||
|
RemoteUnlockingState() {
|
||||||
|
getKeyInfosData.value = Get.arguments as KeyInfos;
|
||||||
|
remoteEnable.value = getKeyInfosData.value.remoteEnable!;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,30 @@
|
|||||||
|
|
||||||
|
import 'package:star_lock/main/lockDetail/lcokSet/resetButton/resetButton_state.dart';
|
||||||
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
|
|
||||||
|
import '../../../../network/api_repository.dart';
|
||||||
|
import '../../../../tools/eventBusEventManage.dart';
|
||||||
|
import '../../../../tools/toast.dart';
|
||||||
|
|
||||||
|
class ResetButtonLogic extends BaseGetXController{
|
||||||
|
ResetButtonState state = ResetButtonState();
|
||||||
|
|
||||||
|
|
||||||
|
// 配置锁的常开模式设置 -> 重置开关
|
||||||
|
Future<void> setLockSetGeneralSetting() async{
|
||||||
|
var entity = await ApiRepository.to.setLockSetGeneralSettingData(
|
||||||
|
lockId: state.getKeyInfosData.value.lockId.toString(),
|
||||||
|
changeType:"1",
|
||||||
|
isOn:state.resetButtonEnable.value == 1 ? "2" : "1", // 1-开启、2-关闭;
|
||||||
|
type:"4", // 4 重置键开关
|
||||||
|
);
|
||||||
|
if(entity.errorCode!.codeIsSuccessful){
|
||||||
|
eventBus.fire(RefreshLockListInfoDataEvent());
|
||||||
|
|
||||||
|
state.resetButtonEnable.value = state.resetButtonEnable.value == 1 ? 2 : 1;
|
||||||
|
state.getKeyInfosData.value.resetButton = state.resetButtonEnable.value;
|
||||||
|
eventBus.fire(PassCurrentLockInformationEvent(state.getKeyInfosData.value));
|
||||||
|
Toast.show(msg: "操作成功");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -6,6 +6,7 @@ import '../../../../app_settings/app_colors.dart';
|
|||||||
import '../../../../tools/submitBtn.dart';
|
import '../../../../tools/submitBtn.dart';
|
||||||
import '../../../../tools/titleAppBar.dart';
|
import '../../../../tools/titleAppBar.dart';
|
||||||
import '../../../../translations/trans_lib.dart';
|
import '../../../../translations/trans_lib.dart';
|
||||||
|
import 'resetButton_logic.dart';
|
||||||
|
|
||||||
class ResetButtonPage extends StatefulWidget {
|
class ResetButtonPage extends StatefulWidget {
|
||||||
const ResetButtonPage({Key? key}) : super(key: key);
|
const ResetButtonPage({Key? key}) : super(key: key);
|
||||||
@ -15,6 +16,9 @@ class ResetButtonPage extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _ResetButtonPageState extends State<ResetButtonPage> {
|
class _ResetButtonPageState extends State<ResetButtonPage> {
|
||||||
|
final logic = Get.put(ResetButtonLogic());
|
||||||
|
final state = Get.find<ResetButtonLogic>().state;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
@ -53,27 +57,29 @@ class _ResetButtonPageState extends State<ResetButtonPage> {
|
|||||||
SizedBox(
|
SizedBox(
|
||||||
height: 30.h,
|
height: 30.h,
|
||||||
),
|
),
|
||||||
Row(
|
Obx(() => Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
"${TranslationLoader.lanKeys!.currentMode!.tr} : ${TranslationLoader.lanKeys!.opened!.tr}",
|
"${TranslationLoader.lanKeys!.currentMode!.tr} : ${state.resetButtonEnable.value == 1 ? TranslationLoader.lanKeys!.opened!.tr : TranslationLoader.lanKeys!.closed!.tr}",
|
||||||
style:
|
style:
|
||||||
TextStyle(fontWeight: FontWeight.w600, fontSize: 20.sp),
|
TextStyle(fontWeight: FontWeight.w600, fontSize: 20.sp),
|
||||||
)),
|
)),
|
||||||
],
|
],
|
||||||
),
|
)),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 30.h,
|
height: 30.h,
|
||||||
),
|
),
|
||||||
SubmitBtn(
|
Obx(() => SubmitBtn(
|
||||||
btnName: TranslationLoader.lanKeys!.closed!.tr,
|
btnName: state.resetButtonEnable.value == 1 ? TranslationLoader.lanKeys!.close!.tr : TranslationLoader.lanKeys!.open!.tr,
|
||||||
borderRadius: 20.w,
|
borderRadius: 20.w,
|
||||||
fontSize: 32.sp,
|
fontSize: 32.sp,
|
||||||
// margin: EdgeInsets.only(left: 03.w, right: 30.w, top: 20.w),
|
// margin: EdgeInsets.only(left: 03.w, right: 30.w, top: 20.w),
|
||||||
padding: EdgeInsets.only(top: 20.w, bottom: 20.w),
|
padding: EdgeInsets.only(top: 20.w, bottom: 20.w),
|
||||||
onClick: () {}),
|
onClick: () {
|
||||||
|
logic.setLockSetGeneralSetting();
|
||||||
|
})),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
));
|
));
|
||||||
|
|||||||
@ -0,0 +1,16 @@
|
|||||||
|
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
import '../../../lockMian/entity/lockInfoEntity.dart';
|
||||||
|
|
||||||
|
class ResetButtonState{
|
||||||
|
|
||||||
|
var getKeyInfosData = KeyInfos().obs;
|
||||||
|
var resetButtonEnable = 1.obs;
|
||||||
|
|
||||||
|
ResetButtonState() {
|
||||||
|
getKeyInfosData.value = Get.arguments as KeyInfos;
|
||||||
|
resetButtonEnable.value = getKeyInfosData.value.tamperAlert!;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -27,13 +27,13 @@ class _UploadDataPageState extends State<UploadDataPage> {
|
|||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Expanded(child: Text(TranslationLoader.lanKeys!.uploadDataTip!.tr)),
|
Expanded(child: Text(TranslationLoader.lanKeys!.uploadDataTip!.tr, style: TextStyle(fontSize: 24.sp,),)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
SizedBox(height: 30.h,),
|
SizedBox(height: 30.h,),
|
||||||
SubmitBtn(btnName: TranslationLoader.lanKeys!.begin!.tr,
|
SubmitBtn(btnName: TranslationLoader.lanKeys!.begin!.tr,
|
||||||
borderRadius: 20.w,
|
borderRadius: 20.w,
|
||||||
fontSize: 32.sp,
|
fontSize: 24.sp,
|
||||||
// margin: EdgeInsets.only(left: 03.w, right: 30.w, top: 20.w),
|
// margin: EdgeInsets.only(left: 03.w, right: 30.w, top: 20.w),
|
||||||
padding: EdgeInsets.only(top: 20.w, bottom: 20.w),
|
padding: EdgeInsets.only(top: 20.w, bottom: 20.w),
|
||||||
onClick: () {
|
onClick: () {
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
import '../../../appRouters.dart';
|
import '../../../appRouters.dart';
|
||||||
import '../../../app_settings/app_colors.dart';
|
import '../../../app_settings/app_colors.dart';
|
||||||
@ -127,13 +128,15 @@ class _LockDetailPageState extends State<LockDetailPage> {
|
|||||||
child: Image.asset('images/main/icon_main_openLockBtn.png',
|
child: Image.asset('images/main/icon_main_openLockBtn.png',
|
||||||
width: 268.w, height: 268.w),
|
width: 268.w, height: 268.w),
|
||||||
)),
|
)),
|
||||||
Align(
|
Visibility(
|
||||||
alignment: const Alignment(0.6, 1),
|
visible: state.keyInfos.value.remoteEnable == 1 ? true: false,
|
||||||
child: Image.asset(
|
child: Align(
|
||||||
'images/main/icon_main_remoteUnlocking.png',
|
alignment: const Alignment(0.6, 1),
|
||||||
width: 50.w,
|
child: Image.asset(
|
||||||
height: 52.w,
|
'images/main/icon_main_remoteUnlocking.png',
|
||||||
)),
|
width: 50.w,
|
||||||
|
height: 52.w,
|
||||||
|
))),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -176,78 +179,92 @@ class _LockDetailPageState extends State<LockDetailPage> {
|
|||||||
crossAxisSpacing: 20.w,
|
crossAxisSpacing: 20.w,
|
||||||
mainAxisSpacing: 0.h,
|
mainAxisSpacing: 0.h,
|
||||||
physics: const NeverScrollableScrollPhysics(),
|
physics: const NeverScrollableScrollPhysics(),
|
||||||
children: [
|
children: getShowWidget()
|
||||||
bottomItem('images/main/icon_main_clockingIn.png',
|
|
||||||
TranslationLoader.lanKeys!.checkingIn!.tr, () {
|
|
||||||
Navigator.pushNamed(context, Routers.checkingInListPage);
|
|
||||||
}),
|
|
||||||
bottomItem('images/main/icon_main_electronicKey.png',
|
|
||||||
TranslationLoader.lanKeys!.electronicKey!.tr, () {
|
|
||||||
Navigator.pushNamed(context, Routers.electronicKeyListPage,
|
|
||||||
arguments: {
|
|
||||||
"lockMainEntity": widget.lockMainEntity,
|
|
||||||
"keyInfo": widget.keyInfo
|
|
||||||
});
|
|
||||||
}),
|
|
||||||
bottomItem('images/main/icon_main_password.png',
|
|
||||||
TranslationLoader.lanKeys!.password!.tr, () {
|
|
||||||
Navigator.pushNamed(context, Routers.passwordKeyListPage,
|
|
||||||
arguments: {
|
|
||||||
"lockMainEntity": widget.lockMainEntity,
|
|
||||||
"keyInfo": widget.keyInfo
|
|
||||||
});
|
|
||||||
}),
|
|
||||||
bottomItem('images/main/icon_main_icCard.png',
|
|
||||||
TranslationLoader.lanKeys!.card!.tr, () {
|
|
||||||
Navigator.pushNamed(context, Routers.otherTypeKeyListPage,
|
|
||||||
arguments: 0);
|
|
||||||
}),
|
|
||||||
bottomItem('images/main/icon_main_fingerprint.png',
|
|
||||||
TranslationLoader.lanKeys!.fingerprint!.tr, () {
|
|
||||||
Navigator.pushNamed(context, Routers.otherTypeKeyListPage,
|
|
||||||
arguments: 1);
|
|
||||||
}),
|
|
||||||
bottomItem('images/main/icon_main_remoteControl.png',
|
|
||||||
TranslationLoader.lanKeys!.remoteControl!.tr, () {
|
|
||||||
Navigator.pushNamed(context, Routers.otherTypeKeyListPage,
|
|
||||||
arguments: 2);
|
|
||||||
}),
|
|
||||||
//可视对讲门锁新增->人脸、监控
|
|
||||||
bottomItem('images/main/icon_main_fingerprint.png', '人脸', () {
|
|
||||||
// Navigator.pushNamed(context, Routers.otherTypeKeyListPage,
|
|
||||||
// arguments: 1);
|
|
||||||
}),
|
|
||||||
bottomItem('images/main/icon_main_fingerprint.png', '监控', () {
|
|
||||||
// Navigator.pushNamed(context, Routers.otherTypeKeyListPage,
|
|
||||||
// arguments: 1);
|
|
||||||
}),
|
|
||||||
bottomItem('images/main/icon_main_authorizedAdmin.png',
|
|
||||||
TranslationLoader.lanKeys!.authorizedAdmin!.tr, () {
|
|
||||||
Navigator.pushNamed(context, Routers.authorizedAdminListPage,
|
|
||||||
arguments: {
|
|
||||||
"lockMainEntity": widget.lockMainEntity,
|
|
||||||
"keyInfo": widget.keyInfo
|
|
||||||
});
|
|
||||||
}),
|
|
||||||
bottomItem('images/main/icon_main_operatingRecord.png',
|
|
||||||
TranslationLoader.lanKeys!.operatingRecord!.tr, () {
|
|
||||||
Navigator.pushNamed(context, Routers.lockOperatingRecordPage,
|
|
||||||
arguments: {
|
|
||||||
"lockMainEntity": widget.lockMainEntity,
|
|
||||||
"keyInfo": widget.keyInfo
|
|
||||||
});
|
|
||||||
}),
|
|
||||||
bottomItem('images/main/icon_main_set.png',
|
|
||||||
TranslationLoader.lanKeys!.set!.tr, () {
|
|
||||||
Navigator.pushNamed(context, Routers.lockSetPage,
|
|
||||||
arguments: widget.keyInfo);
|
|
||||||
}),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
List<Widget> getShowWidget(){
|
||||||
|
var showWidgetArr = <Widget>[];
|
||||||
|
|
||||||
|
// 考勤
|
||||||
|
showWidgetArr.add(bottomItem('images/main/icon_main_clockingIn.png',
|
||||||
|
TranslationLoader.lanKeys!.checkingIn!.tr, () {
|
||||||
|
Get.toNamed( Routers.checkingInListPage);
|
||||||
|
}));
|
||||||
|
|
||||||
|
var defaultWidgetArr = [
|
||||||
|
// 电子钥匙
|
||||||
|
bottomItem('images/main/icon_main_electronicKey.png', TranslationLoader.lanKeys!.electronicKey!.tr, () {
|
||||||
|
Get.toNamed(Routers.electronicKeyListPage, arguments: {
|
||||||
|
"lockMainEntity": widget.lockMainEntity,
|
||||||
|
"keyInfo": widget.keyInfo
|
||||||
|
});
|
||||||
|
}),
|
||||||
|
// 密码
|
||||||
|
bottomItem('images/main/icon_main_password.png', TranslationLoader.lanKeys!.password!.tr, () {
|
||||||
|
Get.toNamed(Routers.passwordKeyListPage,
|
||||||
|
arguments: {
|
||||||
|
"lockMainEntity": widget.lockMainEntity,
|
||||||
|
"keyInfo": widget.keyInfo
|
||||||
|
});
|
||||||
|
}),
|
||||||
|
// ic卡
|
||||||
|
bottomItem('images/main/icon_main_icCard.png', TranslationLoader.lanKeys!.card!.tr, () {
|
||||||
|
Get.toNamed(Routers.otherTypeKeyListPage,
|
||||||
|
arguments: 0);
|
||||||
|
}),
|
||||||
|
// 指纹
|
||||||
|
bottomItem('images/main/icon_main_fingerprint.png', TranslationLoader.lanKeys!.fingerprint!.tr, () {
|
||||||
|
Get.toNamed(Routers.otherTypeKeyListPage,
|
||||||
|
arguments: 1);
|
||||||
|
}),
|
||||||
|
// 遥控
|
||||||
|
bottomItem('images/main/icon_main_remoteControl.png', TranslationLoader.lanKeys!.remoteControl!.tr, () {
|
||||||
|
Get.toNamed(Routers.otherTypeKeyListPage,
|
||||||
|
arguments: 2);
|
||||||
|
}),
|
||||||
|
];
|
||||||
|
showWidgetArr.addAll(defaultWidgetArr);
|
||||||
|
|
||||||
|
//可视对讲门锁新增->人脸
|
||||||
|
showWidgetArr.add(bottomItem('images/main/icon_main_fingerprint.png', '人脸', () {
|
||||||
|
// Navigator.pushNamed(context, Routers.otherTypeKeyListPage,
|
||||||
|
// arguments: 1);
|
||||||
|
}),);
|
||||||
|
|
||||||
|
//可视对讲门锁新增->监控
|
||||||
|
showWidgetArr.add(bottomItem('images/main/icon_main_fingerprint.png', '监控', () {
|
||||||
|
// Navigator.pushNamed(context, Routers.otherTypeKeyListPage,
|
||||||
|
// arguments: 1);
|
||||||
|
}),);
|
||||||
|
|
||||||
|
var endWiddget = [
|
||||||
|
// 授权管理员
|
||||||
|
bottomItem('images/main/icon_main_authorizedAdmin.png', TranslationLoader.lanKeys!.authorizedAdmin!.tr, () {
|
||||||
|
Get.toNamed(Routers.authorizedAdminListPage, arguments: {
|
||||||
|
"lockMainEntity": widget.lockMainEntity,
|
||||||
|
"keyInfo": widget.keyInfo
|
||||||
|
});
|
||||||
|
}),
|
||||||
|
// 操作记录
|
||||||
|
bottomItem('images/main/icon_main_operatingRecord.png', TranslationLoader.lanKeys!.operatingRecord!.tr, () {
|
||||||
|
Get.toNamed(Routers.lockOperatingRecordPage,
|
||||||
|
arguments: {
|
||||||
|
"lockMainEntity": widget.lockMainEntity,
|
||||||
|
"keyInfo": widget.keyInfo
|
||||||
|
});
|
||||||
|
}),
|
||||||
|
// 设置
|
||||||
|
bottomItem('images/main/icon_main_set.png', TranslationLoader.lanKeys!.set!.tr, () {
|
||||||
|
Get.toNamed(Routers.lockSetPage, arguments: widget.keyInfo);
|
||||||
|
}),
|
||||||
|
];
|
||||||
|
showWidgetArr.addAll(endWiddget);
|
||||||
|
return showWidgetArr;
|
||||||
|
}
|
||||||
|
|
||||||
Widget bottomItem(String iconUrl, String name, Function() onClick) {
|
Widget bottomItem(String iconUrl, String name, Function() onClick) {
|
||||||
var width = 42.w;
|
var width = 42.w;
|
||||||
var height = 42.h;
|
var height = 42.h;
|
||||||
|
|||||||
@ -128,7 +128,8 @@ class LockOperatingRecordLogic extends BaseGetXController{
|
|||||||
super.onInit();
|
super.onInit();
|
||||||
print("onInit()");
|
print("onInit()");
|
||||||
|
|
||||||
senderReferEventRecordNumberTime();
|
// senderReferEventRecordNumberTime();
|
||||||
|
senderReferEventRecordNumber();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import 'package:flutter_reactive_ble/flutter_reactive_ble.dart';
|
|||||||
|
|
||||||
import '../../../../blue/blue_manage.dart';
|
import '../../../../blue/blue_manage.dart';
|
||||||
import '../../../../blue/io_protocol/io_checkingCardStatus.dart';
|
import '../../../../blue/io_protocol/io_checkingCardStatus.dart';
|
||||||
|
import '../../../../blue/io_protocol/io_checkingUserInfoCount.dart';
|
||||||
import '../../../../blue/io_protocol/io_queryingFingerprintStatus.dart';
|
import '../../../../blue/io_protocol/io_queryingFingerprintStatus.dart';
|
||||||
import '../../../../blue/io_reply.dart';
|
import '../../../../blue/io_reply.dart';
|
||||||
import '../../../../blue/io_tool/io_manager.dart';
|
import '../../../../blue/io_tool/io_manager.dart';
|
||||||
@ -30,12 +31,17 @@ class OtherTypeKeyListLogic extends BaseGetXController{
|
|||||||
if(reply is SenderCheckingCardStatusReply) {
|
if(reply is SenderCheckingCardStatusReply) {
|
||||||
_replyReferEventRecordNumber(reply);
|
_replyReferEventRecordNumber(reply);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(reply is SenderCheckingUserInfoCountReply){
|
||||||
|
_replyCheckingUserInfoCount(reply);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取指纹状态
|
// 获取指纹状态
|
||||||
Future<void> _replyQueryingFingerprintStatus(Reply reply) async {
|
Future<void> _replyQueryingFingerprintStatus(Reply reply) async {
|
||||||
int status = reply.data[2];
|
int status = reply.data[2];
|
||||||
|
|
||||||
switch(status){
|
switch(status){
|
||||||
case 0x00:
|
case 0x00:
|
||||||
//成功
|
//成功
|
||||||
@ -97,6 +103,80 @@ class OtherTypeKeyListLogic extends BaseGetXController{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 查询用户、指纹、密码、卡片数量(用于判断是否同步)
|
||||||
|
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> senderQueryingFingerprintStatus() async {
|
Future<void> senderQueryingFingerprintStatus() async {
|
||||||
BlueManage().judgeReconnect(BlueManage().connectDeviceMacAddress, BlueManage().connectDeviceName, (DeviceConnectionState state) async {
|
BlueManage().judgeReconnect(BlueManage().connectDeviceMacAddress, BlueManage().connectDeviceName, (DeviceConnectionState state) async {
|
||||||
@ -153,6 +233,33 @@ class OtherTypeKeyListLogic extends BaseGetXController{
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 查询用户、指纹、密码、卡片数量(用于判断是否同步)
|
||||||
|
Future<void> senderCheckingUserInfoCount() async {
|
||||||
|
BlueManage().judgeReconnect(BlueManage().connectDeviceMacAddress, 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,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void onReady() {
|
void onReady() {
|
||||||
// TODO: implement onReady
|
// TODO: implement onReady
|
||||||
@ -169,7 +276,8 @@ class OtherTypeKeyListLogic extends BaseGetXController{
|
|||||||
print("onInit()");
|
print("onInit()");
|
||||||
|
|
||||||
// senderQueryingFingerprintStatus();
|
// senderQueryingFingerprintStatus();
|
||||||
senderCheckingCardStatus();
|
// senderCheckingCardStatus();
|
||||||
|
senderCheckingUserInfoCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
@ -22,12 +22,12 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
|
|||||||
EventBusManager().eventBus!.on<Reply>().listen((reply) async {
|
EventBusManager().eventBus!.on<Reply>().listen((reply) async {
|
||||||
// 设置自定义密码
|
// 设置自定义密码
|
||||||
if (reply is SenderCustomPasswordsReply) {
|
if (reply is SenderCustomPasswordsReply) {
|
||||||
var token = reply.data.sublist(2, 6);
|
var token = reply.data.sublist(5, 9);
|
||||||
var saveStrList = changeIntListToStringList(token);
|
var saveStrList = changeIntListToStringList(token);
|
||||||
print("_replyFactoryDataResetKeyToken:$token");
|
print("_replyFactoryDataResetKeyToken:$token");
|
||||||
Storage.setStringList(saveBlueToken, saveStrList);
|
Storage.setStringList(saveBlueToken, saveStrList);
|
||||||
|
|
||||||
int status = reply.data[6];
|
int status = reply.data[2];
|
||||||
print("status:$status");
|
print("status:$status");
|
||||||
|
|
||||||
switch (status) {
|
switch (status) {
|
||||||
|
|||||||
@ -352,6 +352,7 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> {
|
|||||||
SubmitBtn(
|
SubmitBtn(
|
||||||
btnName: TranslationLoader.lanKeys!.getPassword!.tr,
|
btnName: TranslationLoader.lanKeys!.getPassword!.tr,
|
||||||
onClick: () {
|
onClick: () {
|
||||||
|
// logic.senderCustomPasswords();
|
||||||
logic.getStartDate(_effectiveDateTime);
|
logic.getStartDate(_effectiveDateTime);
|
||||||
getKeyboardPwdRequest();
|
getKeyboardPwdRequest();
|
||||||
}),
|
}),
|
||||||
|
|||||||
@ -226,6 +226,7 @@ class KeyInfos {
|
|||||||
int? keyRight;
|
int? keyRight;
|
||||||
int? electricQuantity;
|
int? electricQuantity;
|
||||||
int? lockSound;
|
int? lockSound;
|
||||||
|
int? volume;
|
||||||
int? specialValue;
|
int? specialValue;
|
||||||
int? displayPasscode;
|
int? displayPasscode;
|
||||||
int? lockId;
|
int? lockId;
|
||||||
@ -235,13 +236,12 @@ class KeyInfos {
|
|||||||
Bluetooth? bluetooth;
|
Bluetooth? bluetooth;
|
||||||
String? lockName;
|
String? lockName;
|
||||||
int? monitorFlag;
|
int? monitorFlag;
|
||||||
Null? bondPassword;
|
String? bondPassword;
|
||||||
int? soundVolume;
|
|
||||||
String? lockAlias;
|
String? lockAlias;
|
||||||
int? isFrozen;
|
int? isFrozen;
|
||||||
int? isRemoteUnlock;
|
int? remoteEnable;
|
||||||
int? lockFlagPos;
|
int? lockFlagPos;
|
||||||
int? autoUnlockRssi;
|
int? autoLockTime;
|
||||||
int? unlockDirection;
|
int? unlockDirection;
|
||||||
int? isCameraEnable;
|
int? isCameraEnable;
|
||||||
int? startDate;
|
int? startDate;
|
||||||
@ -260,9 +260,8 @@ class KeyInfos {
|
|||||||
int? adminUid;
|
int? adminUid;
|
||||||
String? lockMac;
|
String? lockMac;
|
||||||
String? wirelessKeypadFeatureValue;
|
String? wirelessKeypadFeatureValue;
|
||||||
int? autoLockTime;
|
|
||||||
int? tamperAlert;
|
int? tamperAlert;
|
||||||
|
int? roomStatus;
|
||||||
KeyInfos(
|
KeyInfos(
|
||||||
{this.lightingTime,
|
{this.lightingTime,
|
||||||
this.privacyLock,
|
this.privacyLock,
|
||||||
@ -282,6 +281,7 @@ class KeyInfos {
|
|||||||
this.keyRight,
|
this.keyRight,
|
||||||
this.electricQuantity,
|
this.electricQuantity,
|
||||||
this.lockSound,
|
this.lockSound,
|
||||||
|
this.volume,
|
||||||
this.specialValue,
|
this.specialValue,
|
||||||
this.displayPasscode,
|
this.displayPasscode,
|
||||||
this.lockId,
|
this.lockId,
|
||||||
@ -291,12 +291,11 @@ class KeyInfos {
|
|||||||
this.lockName,
|
this.lockName,
|
||||||
this.monitorFlag,
|
this.monitorFlag,
|
||||||
this.bondPassword,
|
this.bondPassword,
|
||||||
this.soundVolume,
|
|
||||||
this.lockAlias,
|
this.lockAlias,
|
||||||
this.isFrozen,
|
this.isFrozen,
|
||||||
this.isRemoteUnlock,
|
this.remoteEnable,
|
||||||
this.lockFlagPos,
|
this.lockFlagPos,
|
||||||
this.autoUnlockRssi,
|
this.autoLockTime,
|
||||||
this.unlockDirection,
|
this.unlockDirection,
|
||||||
this.isCameraEnable,
|
this.isCameraEnable,
|
||||||
this.startDate,
|
this.startDate,
|
||||||
@ -315,8 +314,8 @@ class KeyInfos {
|
|||||||
this.adminUid,
|
this.adminUid,
|
||||||
this.lockMac,
|
this.lockMac,
|
||||||
this.wirelessKeypadFeatureValue,
|
this.wirelessKeypadFeatureValue,
|
||||||
this.autoLockTime,
|
|
||||||
this.tamperAlert,
|
this.tamperAlert,
|
||||||
|
this.roomStatus,
|
||||||
this.bluetooth});
|
this.bluetooth});
|
||||||
|
|
||||||
KeyInfos.fromJson(Map<String, dynamic> json) {
|
KeyInfos.fromJson(Map<String, dynamic> json) {
|
||||||
@ -338,6 +337,7 @@ class KeyInfos {
|
|||||||
keyRight = json['keyRight'];
|
keyRight = json['keyRight'];
|
||||||
electricQuantity = json['electricQuantity'];
|
electricQuantity = json['electricQuantity'];
|
||||||
lockSound = json['lockSound'];
|
lockSound = json['lockSound'];
|
||||||
|
volume = json['volume'];
|
||||||
specialValue = json['specialValue'];
|
specialValue = json['specialValue'];
|
||||||
displayPasscode = json['displayPasscode'];
|
displayPasscode = json['displayPasscode'];
|
||||||
lockId = json['lockId'];
|
lockId = json['lockId'];
|
||||||
@ -349,12 +349,11 @@ class KeyInfos {
|
|||||||
lockName = json['lockName'];
|
lockName = json['lockName'];
|
||||||
monitorFlag = json['monitorFlag'];
|
monitorFlag = json['monitorFlag'];
|
||||||
bondPassword = json['bondPassword'];
|
bondPassword = json['bondPassword'];
|
||||||
soundVolume = json['soundVolume'];
|
|
||||||
lockAlias = json['lockAlias'];
|
lockAlias = json['lockAlias'];
|
||||||
isFrozen = json['isFrozen'];
|
isFrozen = json['isFrozen'];
|
||||||
isRemoteUnlock = json['isRemoteUnlock'];
|
remoteEnable = json['remoteEnable'];
|
||||||
lockFlagPos = json['lockFlagPos'];
|
lockFlagPos = json['lockFlagPos'];
|
||||||
autoUnlockRssi = json['autoUnlockRssi'];
|
autoLockTime = json['autoLockTime'];
|
||||||
unlockDirection = json['unlockDirection'];
|
unlockDirection = json['unlockDirection'];
|
||||||
isCameraEnable = json['isCameraEnable'];
|
isCameraEnable = json['isCameraEnable'];
|
||||||
startDate = json['startDate'];
|
startDate = json['startDate'];
|
||||||
@ -373,8 +372,8 @@ class KeyInfos {
|
|||||||
adminUid = json['adminUid'];
|
adminUid = json['adminUid'];
|
||||||
lockMac = json['lockMac'];
|
lockMac = json['lockMac'];
|
||||||
wirelessKeypadFeatureValue = json['wirelessKeypadFeatureValue'];
|
wirelessKeypadFeatureValue = json['wirelessKeypadFeatureValue'];
|
||||||
autoLockTime = json['autoLockTime'];
|
|
||||||
tamperAlert = json['tamperAlert'];
|
tamperAlert = json['tamperAlert'];
|
||||||
|
roomStatus = json['roomStatus'];
|
||||||
bluetooth = json['bluetooth'] != null
|
bluetooth = json['bluetooth'] != null
|
||||||
? Bluetooth.fromJson(json['bluetooth'])
|
? Bluetooth.fromJson(json['bluetooth'])
|
||||||
: null;
|
: null;
|
||||||
@ -400,6 +399,7 @@ class KeyInfos {
|
|||||||
data['keyRight'] = keyRight;
|
data['keyRight'] = keyRight;
|
||||||
data['electricQuantity'] = electricQuantity;
|
data['electricQuantity'] = electricQuantity;
|
||||||
data['lockSound'] = lockSound;
|
data['lockSound'] = lockSound;
|
||||||
|
data['volume'] = volume;
|
||||||
data['specialValue'] = specialValue;
|
data['specialValue'] = specialValue;
|
||||||
data['displayPasscode'] = displayPasscode;
|
data['displayPasscode'] = displayPasscode;
|
||||||
data['lockId'] = lockId;
|
data['lockId'] = lockId;
|
||||||
@ -411,12 +411,10 @@ class KeyInfos {
|
|||||||
data['lockName'] = lockName;
|
data['lockName'] = lockName;
|
||||||
data['monitorFlag'] = monitorFlag;
|
data['monitorFlag'] = monitorFlag;
|
||||||
data['bondPassword'] = bondPassword;
|
data['bondPassword'] = bondPassword;
|
||||||
data['soundVolume'] = soundVolume;
|
|
||||||
data['lockAlias'] = lockAlias;
|
data['lockAlias'] = lockAlias;
|
||||||
data['isFrozen'] = isFrozen;
|
data['isFrozen'] = isFrozen;
|
||||||
data['isRemoteUnlock'] = isRemoteUnlock;
|
data['remoteEnable'] = remoteEnable;
|
||||||
data['lockFlagPos'] = lockFlagPos;
|
data['lockFlagPos'] = lockFlagPos;
|
||||||
data['autoUnlockRssi'] = autoUnlockRssi;
|
|
||||||
data['unlockDirection'] = unlockDirection;
|
data['unlockDirection'] = unlockDirection;
|
||||||
data['isCameraEnable'] = isCameraEnable;
|
data['isCameraEnable'] = isCameraEnable;
|
||||||
data['startDate'] = startDate;
|
data['startDate'] = startDate;
|
||||||
@ -437,6 +435,7 @@ class KeyInfos {
|
|||||||
data['wirelessKeypadFeatureValue'] = wirelessKeypadFeatureValue;
|
data['wirelessKeypadFeatureValue'] = wirelessKeypadFeatureValue;
|
||||||
data['autoLockTime'] = autoLockTime;
|
data['autoLockTime'] = autoLockTime;
|
||||||
data['tamperAlert'] = tamperAlert;
|
data['tamperAlert'] = tamperAlert;
|
||||||
|
data['roomStatus'] = roomStatus;
|
||||||
if (bluetooth != null) {
|
if (bluetooth != null) {
|
||||||
data['bluetooth'] = bluetooth!.toJson();
|
data['bluetooth'] = bluetooth!.toJson();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import 'package:pull_to_refresh/pull_to_refresh.dart';
|
|||||||
import '../../../blue/io_tool/manager_event_bus.dart';
|
import '../../../blue/io_tool/manager_event_bus.dart';
|
||||||
import '../../../network/api_repository.dart';
|
import '../../../network/api_repository.dart';
|
||||||
import '../../../tools/baseGetXController.dart';
|
import '../../../tools/baseGetXController.dart';
|
||||||
|
import '../../../tools/eventBusEventManage.dart';
|
||||||
import 'lockMain_state.dart';
|
import 'lockMain_state.dart';
|
||||||
|
|
||||||
class LockMainLogic extends BaseGetXController {
|
class LockMainLogic extends BaseGetXController {
|
||||||
@ -57,21 +58,22 @@ class LockMainLogic extends BaseGetXController {
|
|||||||
// refreshController.refreshCompleted();
|
// refreshController.refreshCompleted();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 监听设备返回的数据
|
late StreamSubscription _teamEvent;
|
||||||
late StreamSubscription<RefreshLockListInfoDataEvent> _addLockSubscription;
|
void _initLoadDataAction() {
|
||||||
void _initAddLockSubscription() {
|
_teamEvent = eventBus.on<RefreshLockListInfoDataEvent>().listen((event) {
|
||||||
_addLockSubscription = EventBusManager().eventBus!.on<RefreshLockListInfoDataEvent>().listen((event) async {
|
|
||||||
getLockInfo();
|
getLockInfo();
|
||||||
|
print("收到消息");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void onReady() {
|
void onReady() {
|
||||||
// TODO: implement onReady
|
// TODO: implement onReady
|
||||||
super.onReady();
|
super.onReady();
|
||||||
print("onReady()");
|
print("onReady()");
|
||||||
|
|
||||||
_initAddLockSubscription();
|
_initLoadDataAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -89,7 +91,7 @@ class LockMainLogic extends BaseGetXController {
|
|||||||
super.onClose();
|
super.onClose();
|
||||||
|
|
||||||
// refreshController.dispose();
|
// refreshController.dispose();
|
||||||
_addLockSubscription.cancel();
|
_teamEvent.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1,4 +1,6 @@
|
|||||||
|
|
||||||
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
|||||||
@ -17,6 +17,7 @@ import '../../../blue/io_tool/manager_event_bus.dart';
|
|||||||
import '../../../blue/sender_manage.dart';
|
import '../../../blue/sender_manage.dart';
|
||||||
import '../../../network/api_repository.dart';
|
import '../../../network/api_repository.dart';
|
||||||
import '../../../tools/baseGetXController.dart';
|
import '../../../tools/baseGetXController.dart';
|
||||||
|
import '../../../tools/eventBusEventManage.dart';
|
||||||
import '../../../tools/storage.dart';
|
import '../../../tools/storage.dart';
|
||||||
import 'saveLock_state.dart';
|
import 'saveLock_state.dart';
|
||||||
|
|
||||||
@ -52,7 +53,7 @@ class SaveLockLogic extends BaseGetXController {
|
|||||||
int status = reply.data[46];
|
int status = reply.data[46];
|
||||||
print("status:$status");
|
print("status:$status");
|
||||||
|
|
||||||
userNo = reply.data[47];
|
userNo = reply.data[46];
|
||||||
print("status:$status");
|
print("status:$status");
|
||||||
switch(status){
|
switch(status){
|
||||||
case 0x00:
|
case 0x00:
|
||||||
@ -262,10 +263,12 @@ class SaveLockLogic extends BaseGetXController {
|
|||||||
position:positionMap,
|
position:positionMap,
|
||||||
bluetooth:bluetooth,
|
bluetooth:bluetooth,
|
||||||
deviceNo:"123456",
|
deviceNo:"123456",
|
||||||
lockUserNo:userNo.toString()
|
// lockUserNo:userNo.toString(),
|
||||||
|
lockUserNo:"1234",
|
||||||
|
pwdTimestamp:"11223344"
|
||||||
);
|
);
|
||||||
if(entity.errorCode!.codeIsSuccessful){
|
if(entity.errorCode!.codeIsSuccessful){
|
||||||
EventBusManager().eventBusFir(RefreshLockListInfoDataEvent);
|
eventBus.fire(RefreshLockListInfoDataEvent());
|
||||||
Get.offAllNamed(Routers.starLockMain);
|
Get.offAllNamed(Routers.starLockMain);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -38,4 +38,14 @@ abstract class Api {
|
|||||||
final String updateSettingURL = '/room/updateSetting'; //标记房态
|
final String updateSettingURL = '/room/updateSetting'; //标记房态
|
||||||
final String keyGroupListURL = '/keyGroup/list'; //分组列表
|
final String keyGroupListURL = '/keyGroup/list'; //分组列表
|
||||||
final String lockListByGroupURL = '/room/listByGroup'; //分组下的锁
|
final String lockListByGroupURL = '/room/listByGroup'; //分组下的锁
|
||||||
|
|
||||||
|
final String getWifiServiceIpURL = '/wifiLock/getWifiServiceIp'; // 获取Wifi锁服务器
|
||||||
|
final String updateSpecialValueUrl = '/room/updateSpecialValue'; // 开启/关闭 远程开锁
|
||||||
|
final String setAutoLockTimeUrl = '/room/setAutoLockTime'; // 自动闭锁
|
||||||
|
final String getPassageModeConfigUrl = '/room/getPassageModeConfig'; // 获取锁的常开模式设置
|
||||||
|
final String configPassageModeUrl = '/room/configPassageMode'; // 配置锁的常开模式
|
||||||
|
final String updateSettingUrl = '/room/updateSetting'; // 锁声音/防撬报警/重置键/考勤
|
||||||
|
final String roomQueryDateUrl = '/room/queryDate'; // 获取网关时间
|
||||||
|
final String getServerDatetimeUrl = '/check/getServerDatetime'; // 获取服务器当前时间
|
||||||
|
final String getLockVersionInfoUrl = '/room/update'; // 获取锁当前版本信息
|
||||||
}
|
}
|
||||||
|
|||||||
@ -264,7 +264,8 @@ class ApiProvider extends BaseProvider {
|
|||||||
Map position,
|
Map position,
|
||||||
Map bluetooth,
|
Map bluetooth,
|
||||||
String deviceNo,
|
String deviceNo,
|
||||||
String lockUserNo) =>
|
String lockUserNo,
|
||||||
|
String pwdTimestamp) =>
|
||||||
post(
|
post(
|
||||||
bindingBlueAdminURL.toUrl,
|
bindingBlueAdminURL.toUrl,
|
||||||
jsonEncode({
|
jsonEncode({
|
||||||
@ -277,6 +278,7 @@ class ApiProvider extends BaseProvider {
|
|||||||
'bluetooth': bluetooth,
|
'bluetooth': bluetooth,
|
||||||
'deviceNo': deviceNo,
|
'deviceNo': deviceNo,
|
||||||
'lockUserNo': lockUserNo,
|
'lockUserNo': lockUserNo,
|
||||||
|
'pwdTimestamp': pwdTimestamp,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// 获取锁信息
|
// 获取锁信息
|
||||||
@ -294,6 +296,12 @@ class ApiProvider extends BaseProvider {
|
|||||||
'lockId': lockId,
|
'lockId': lockId,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
// 获取Wifi锁服务器
|
||||||
|
Future<Response> getWifiLockServiceIpAndPort() => post(
|
||||||
|
getWifiServiceIpURL.toUrl,
|
||||||
|
jsonEncode({
|
||||||
|
}));
|
||||||
|
|
||||||
Future<Response> passwordKeyList(
|
Future<Response> passwordKeyList(
|
||||||
String keyStatus,
|
String keyStatus,
|
||||||
String lockId,
|
String lockId,
|
||||||
@ -373,6 +381,84 @@ class ApiProvider extends BaseProvider {
|
|||||||
Future<Response> lockListByGroup(String type, String keyGroupId) => post(
|
Future<Response> lockListByGroup(String type, String keyGroupId) => post(
|
||||||
lockListByGroupURL.toUrl,
|
lockListByGroupURL.toUrl,
|
||||||
jsonEncode({'type': type, 'keyGroupId': keyGroupId}));
|
jsonEncode({'type': type, 'keyGroupId': keyGroupId}));
|
||||||
|
|
||||||
|
/// 锁设置模块
|
||||||
|
// 远程开锁
|
||||||
|
Future<Response> remoteUnlockingOpenOrCloseLoadData(String lockId, String featureValue) =>
|
||||||
|
post(
|
||||||
|
updateSpecialValueUrl.toUrl,
|
||||||
|
jsonEncode({
|
||||||
|
'lockId': lockId,
|
||||||
|
'featureValue': featureValue,
|
||||||
|
}));
|
||||||
|
|
||||||
|
// 自动闭锁
|
||||||
|
Future<Response> setAutoUnlockLoadData(String lockId, String autoLockTime, String type) =>
|
||||||
|
post(
|
||||||
|
setAutoLockTimeUrl.toUrl,
|
||||||
|
jsonEncode({
|
||||||
|
'lockId': lockId,
|
||||||
|
'autoLockTime': autoLockTime,
|
||||||
|
'type': type,
|
||||||
|
}));
|
||||||
|
|
||||||
|
// 获取锁的常开模式设置
|
||||||
|
Future<Response> getPassageModeConfigLoadData(String lockId) =>
|
||||||
|
post(
|
||||||
|
getPassageModeConfigUrl.toUrl,
|
||||||
|
jsonEncode({
|
||||||
|
'lockId': lockId,
|
||||||
|
}));
|
||||||
|
|
||||||
|
// 获取锁的常开模式设置
|
||||||
|
Future<Response> configPassageMode(String lockId, String passageMode, String autoUnlock, String type, String startDate, String endDate, String isAllDay, List weekDays) =>
|
||||||
|
post(
|
||||||
|
configPassageModeUrl.toUrl,
|
||||||
|
jsonEncode({
|
||||||
|
'lockId': lockId,
|
||||||
|
'passageMode': passageMode,
|
||||||
|
'autoUnlock': autoUnlock,
|
||||||
|
'type': type,
|
||||||
|
'startDate': startDate,
|
||||||
|
'endDate': endDate,
|
||||||
|
'isAllDay': isAllDay,
|
||||||
|
'weekDays': weekDays,
|
||||||
|
}));
|
||||||
|
|
||||||
|
// 获取锁的常开模式设置
|
||||||
|
Future<Response> setLockSetGeneralSetting(String lockId, String changeType, String isOn, String type) =>
|
||||||
|
post(
|
||||||
|
updateSettingUrl.toUrl,
|
||||||
|
jsonEncode({
|
||||||
|
'lockId': lockId,
|
||||||
|
'changeType': changeType,
|
||||||
|
'isOn': isOn,
|
||||||
|
'type': type,
|
||||||
|
}));
|
||||||
|
|
||||||
|
// 通过网关获取锁的时间
|
||||||
|
Future<Response> getLockTimeFromGatewayLoadData(String lockId) =>
|
||||||
|
post(
|
||||||
|
roomQueryDateUrl.toUrl,
|
||||||
|
jsonEncode({
|
||||||
|
'lockId': lockId,
|
||||||
|
}));
|
||||||
|
|
||||||
|
// 获取服务器当前时间
|
||||||
|
Future<Response> getServerDatetimeLoadData(String lockId) =>
|
||||||
|
post(
|
||||||
|
getServerDatetimeUrl.toUrl,
|
||||||
|
jsonEncode({
|
||||||
|
'lockId': lockId,
|
||||||
|
}));
|
||||||
|
|
||||||
|
// 获取锁版本信息
|
||||||
|
Future<Response> getLockVersionInfoLoadData(String lockId) =>
|
||||||
|
post(
|
||||||
|
getLockVersionInfoUrl.toUrl,
|
||||||
|
jsonEncode({
|
||||||
|
'lockId': lockId,
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
extension ExtensionString on String {
|
extension ExtensionString on String {
|
||||||
|
|||||||
@ -9,6 +9,9 @@ import '../common/safetyVerification/entity/CheckSafetyVerificationEntity.dart';
|
|||||||
import '../common/safetyVerification/entity/SafetyVerificationEntity.dart';
|
import '../common/safetyVerification/entity/SafetyVerificationEntity.dart';
|
||||||
import '../login/login/entity/LoginEntity.dart';
|
import '../login/login/entity/LoginEntity.dart';
|
||||||
import '../login/register/entity/SendValidationCodeEntity.dart';
|
import '../login/register/entity/SendValidationCodeEntity.dart';
|
||||||
|
import '../main/lockDetail/lcokSet/configuringWifi/configuringWifiEntity.dart';
|
||||||
|
import '../main/lockDetail/lcokSet/lockTime/GetServerDatetimeEntity.dart';
|
||||||
|
import '../main/lockDetail/lcokSet/normallyOpenMode/GetPassageModeConfigEntity.dart';
|
||||||
import '../main/lockMian/entity/lockInfoEntity.dart';
|
import '../main/lockMian/entity/lockInfoEntity.dart';
|
||||||
import '../mine/addLock/saveLock/entity/SaveLockEntity.dart';
|
import '../mine/addLock/saveLock/entity/SaveLockEntity.dart';
|
||||||
import 'api_provider.dart';
|
import 'api_provider.dart';
|
||||||
@ -192,7 +195,8 @@ class ApiRepository {
|
|||||||
required Map position,
|
required Map position,
|
||||||
required Map bluetooth,
|
required Map bluetooth,
|
||||||
required String deviceNo,
|
required String deviceNo,
|
||||||
required String lockUserNo}) async {
|
required String lockUserNo,
|
||||||
|
required String pwdTimestamp}) async {
|
||||||
final res = await apiProvider.bindingBlueAdmin(
|
final res = await apiProvider.bindingBlueAdmin(
|
||||||
bindingDate,
|
bindingDate,
|
||||||
hotelMode,
|
hotelMode,
|
||||||
@ -202,7 +206,8 @@ class ApiRepository {
|
|||||||
position,
|
position,
|
||||||
bluetooth,
|
bluetooth,
|
||||||
deviceNo,
|
deviceNo,
|
||||||
lockUserNo);
|
lockUserNo,
|
||||||
|
pwdTimestamp);
|
||||||
return SaveLockEntity.fromJson(res.body);
|
return SaveLockEntity.fromJson(res.body);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -362,4 +367,104 @@ class ApiRepository {
|
|||||||
final res = await apiProvider.lockListByGroup(type, keyGroupId);
|
final res = await apiProvider.lockListByGroup(type, keyGroupId);
|
||||||
return PasswordKeyEntity.fromJson(res.body);
|
return PasswordKeyEntity.fromJson(res.body);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取Wifi锁服务器
|
||||||
|
Future<ConfiguringWifiEntity> getWifiLockServiceIpAndPort() async {
|
||||||
|
final res = await apiProvider.getWifiLockServiceIpAndPort();
|
||||||
|
return ConfiguringWifiEntity.fromJson(res.body);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 锁设置模块
|
||||||
|
// 远程开锁开/关
|
||||||
|
Future<LoginEntity> remoteUnlockingOpenOrClose(
|
||||||
|
{
|
||||||
|
required String lockId,
|
||||||
|
required String featureValue,
|
||||||
|
}) async {
|
||||||
|
final res =
|
||||||
|
await apiProvider.remoteUnlockingOpenOrCloseLoadData(lockId, featureValue);
|
||||||
|
return LoginEntity.fromJson(res.body);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 自动闭锁
|
||||||
|
Future<LoginEntity> setAutoUnlock(
|
||||||
|
{
|
||||||
|
required String lockId,
|
||||||
|
required String autoLockTime,
|
||||||
|
required String type,
|
||||||
|
}) async {
|
||||||
|
final res =
|
||||||
|
await apiProvider.setAutoUnlockLoadData(lockId, autoLockTime, type);
|
||||||
|
return LoginEntity.fromJson(res.body);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取锁的常开模式设置 configPassageMode
|
||||||
|
Future<GetPassageModeConfigEntity> getPassageModeConfig(
|
||||||
|
{
|
||||||
|
required String lockId,
|
||||||
|
}) async {
|
||||||
|
final res =
|
||||||
|
await apiProvider.getPassageModeConfigLoadData(lockId);
|
||||||
|
return GetPassageModeConfigEntity.fromJson(res.body);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 配置锁的常开模式
|
||||||
|
Future<GetPassageModeConfigEntity> configPassageModeLoadData(
|
||||||
|
{
|
||||||
|
required String lockId,
|
||||||
|
required String passageMode,
|
||||||
|
required String autoUnlock,
|
||||||
|
required String type,
|
||||||
|
required String startDate,
|
||||||
|
required String endDate,
|
||||||
|
required String isAllDay,
|
||||||
|
required List weekDays,
|
||||||
|
}) async {
|
||||||
|
final res =
|
||||||
|
await apiProvider.configPassageMode(lockId, passageMode, autoUnlock, type, startDate, endDate, isAllDay, weekDays);
|
||||||
|
return GetPassageModeConfigEntity.fromJson(res.body);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 配置锁的常规设置
|
||||||
|
Future<LoginEntity> setLockSetGeneralSettingData(
|
||||||
|
{
|
||||||
|
required String lockId,
|
||||||
|
required String changeType,
|
||||||
|
required String isOn,
|
||||||
|
required String type,
|
||||||
|
}) async {
|
||||||
|
final res =
|
||||||
|
await apiProvider.setLockSetGeneralSetting(lockId, changeType, isOn, type);
|
||||||
|
return LoginEntity.fromJson(res.body);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取锁时间 通过网关
|
||||||
|
Future<GetPassageModeConfigEntity> getLockTimeFromGateway(
|
||||||
|
{
|
||||||
|
required String lockId,
|
||||||
|
}) async {
|
||||||
|
final res =
|
||||||
|
await apiProvider.getLockTimeFromGatewayLoadData(lockId);
|
||||||
|
return GetPassageModeConfigEntity.fromJson(res.body);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取服务器当前时间
|
||||||
|
Future<GetServerDatetimeEntity> getServerDatetimeData(
|
||||||
|
{
|
||||||
|
required String lockId,
|
||||||
|
}) async {
|
||||||
|
final res =
|
||||||
|
await apiProvider.getServerDatetimeLoadData(lockId);
|
||||||
|
return GetServerDatetimeEntity.fromJson(res.body);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取锁版本信息
|
||||||
|
Future<GetServerDatetimeEntity> getLockVersionInfoData(
|
||||||
|
{
|
||||||
|
required String lockId,
|
||||||
|
}) async {
|
||||||
|
final res =
|
||||||
|
await apiProvider.getLockVersionInfoLoadData(lockId);
|
||||||
|
return GetServerDatetimeEntity.fromJson(res.body);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -28,7 +28,7 @@ class DateTool {
|
|||||||
int time = int.parse(timeDate);
|
int time = int.parse(timeDate);
|
||||||
DateTime nowDate = DateTime.fromMillisecondsSinceEpoch(time);
|
DateTime nowDate = DateTime.fromMillisecondsSinceEpoch(time);
|
||||||
|
|
||||||
String appointmentDate = formatDate(nowDate, [yyyy,'.',mm,'.',dd,' ',HH,':',nn]);
|
String appointmentDate = formatDate(nowDate, [yyyy,'.',mm,'.',dd,' ',HH,':',nn ,':',ss]);
|
||||||
|
|
||||||
return appointmentDate;
|
return appointmentDate;
|
||||||
}
|
}
|
||||||
|
|||||||
16
star_lock/lib/tools/eventBusEventManage.dart
Normal file
16
star_lock/lib/tools/eventBusEventManage.dart
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
import 'package:event_bus/event_bus.dart';
|
||||||
|
import 'package:star_lock/main/lockMian/entity/lockInfoEntity.dart';
|
||||||
|
|
||||||
|
/// 创建EventBus
|
||||||
|
EventBus eventBus = EventBus();
|
||||||
|
|
||||||
|
/// 刷新锁列表数据
|
||||||
|
class RefreshLockListInfoDataEvent{
|
||||||
|
RefreshLockListInfoDataEvent();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 传递当前锁信息
|
||||||
|
class PassCurrentLockInformationEvent{
|
||||||
|
KeyInfos keyInfo;
|
||||||
|
PassCurrentLockInformationEvent(this.keyInfo);
|
||||||
|
}
|
||||||
@ -10,6 +10,7 @@ class TitleAppBar extends AppBar {
|
|||||||
final bool? haveTitleWidget;
|
final bool? haveTitleWidget;
|
||||||
final Widget? titleWidget;
|
final Widget? titleWidget;
|
||||||
final bool? haveBack;
|
final bool? haveBack;
|
||||||
|
final Function? backAction;
|
||||||
final bool? haveOtherLeftWidget;
|
final bool? haveOtherLeftWidget;
|
||||||
final Widget? leftWidget;
|
final Widget? leftWidget;
|
||||||
List<Widget>? actionsList;
|
List<Widget>? actionsList;
|
||||||
@ -24,6 +25,7 @@ class TitleAppBar extends AppBar {
|
|||||||
this.backgroundColor,
|
this.backgroundColor,
|
||||||
this.actionsList,
|
this.actionsList,
|
||||||
this.haveBack,
|
this.haveBack,
|
||||||
|
this.backAction,
|
||||||
this.haveOtherLeftWidget = false,
|
this.haveOtherLeftWidget = false,
|
||||||
this.leftWidget})
|
this.leftWidget})
|
||||||
: super(key: key);
|
: super(key: key);
|
||||||
@ -43,7 +45,7 @@ class _TitleAppBarState extends State<TitleAppBar> {
|
|||||||
? IconButton(
|
? IconButton(
|
||||||
icon: Icon(Icons.arrow_back_ios,
|
icon: Icon(Icons.arrow_back_ios,
|
||||||
color: widget.iconColor ?? Colors.white),
|
color: widget.iconColor ?? Colors.white),
|
||||||
onPressed: () => Navigator.of(context).pop(),
|
onPressed: () => widget.backAction ?? Navigator.of(context).pop(),
|
||||||
)
|
)
|
||||||
: Container()),
|
: Container()),
|
||||||
backgroundColor: widget.backgroundColor ?? Colors.white,
|
backgroundColor: widget.backgroundColor ?? Colors.white,
|
||||||
|
|||||||
@ -89,6 +89,8 @@ class LanKeyEntity {
|
|||||||
this.remoteUnlocking,
|
this.remoteUnlocking,
|
||||||
this.automaticBlocking,
|
this.automaticBlocking,
|
||||||
this.normallyOpenMode,
|
this.normallyOpenMode,
|
||||||
|
this.automaticUnLock,
|
||||||
|
this.automaticUnLockTip,
|
||||||
this.lockSound,
|
this.lockSound,
|
||||||
this.burglarAlarm,
|
this.burglarAlarm,
|
||||||
this.resetButton,
|
this.resetButton,
|
||||||
@ -219,6 +221,8 @@ class LanKeyEntity {
|
|||||||
this.lockScreen,
|
this.lockScreen,
|
||||||
this.closed,
|
this.closed,
|
||||||
this.opened,
|
this.opened,
|
||||||
|
this.close,
|
||||||
|
this.open,
|
||||||
this.hideInvalidUnlockPermissions,
|
this.hideInvalidUnlockPermissions,
|
||||||
this.appUnlockRequiresMobilePhoneAccessToTheLock,
|
this.appUnlockRequiresMobilePhoneAccessToTheLock,
|
||||||
this.valueAddedServices,
|
this.valueAddedServices,
|
||||||
@ -377,7 +381,13 @@ class LanKeyEntity {
|
|||||||
this.hideInvalidUnlockPermissionsTip,
|
this.hideInvalidUnlockPermissionsTip,
|
||||||
this.appUnlockRequiresMobilePhoneAccessToTheLockTip,
|
this.appUnlockRequiresMobilePhoneAccessToTheLockTip,
|
||||||
this.checkAll,
|
this.checkAll,
|
||||||
this.getVerificationCode});
|
this.getVerificationCode,
|
||||||
|
this.configuringWiFi,
|
||||||
|
this.pleaseEnterWifiName,
|
||||||
|
this.wifiPwd,
|
||||||
|
this.pleaseEnterWifiPwd,
|
||||||
|
this.wifiDistributionNetwork,
|
||||||
|
});
|
||||||
|
|
||||||
LanKeyEntity.fromJson(dynamic json) {
|
LanKeyEntity.fromJson(dynamic json) {
|
||||||
starLock = json['starLock'];
|
starLock = json['starLock'];
|
||||||
@ -502,6 +512,8 @@ class LanKeyEntity {
|
|||||||
remoteUnlocking = json['remoteUnlocking'];
|
remoteUnlocking = json['remoteUnlocking'];
|
||||||
automaticBlocking = json['automaticBlocking'];
|
automaticBlocking = json['automaticBlocking'];
|
||||||
normallyOpenMode = json['normallyOpenMode'];
|
normallyOpenMode = json['normallyOpenMode'];
|
||||||
|
automaticUnLock = json['automaticUnLock'];
|
||||||
|
automaticUnLockTip = json['automaticUnLockTip'];
|
||||||
lockSound = json['lockSound'];
|
lockSound = json['lockSound'];
|
||||||
burglarAlarm = json['burglarAlarm'];
|
burglarAlarm = json['burglarAlarm'];
|
||||||
resetButton = json['resetButton'];
|
resetButton = json['resetButton'];
|
||||||
@ -608,6 +620,8 @@ class LanKeyEntity {
|
|||||||
lockScreen = json['lockScreen'];
|
lockScreen = json['lockScreen'];
|
||||||
closed = json['closed'];
|
closed = json['closed'];
|
||||||
opened = json['opened'];
|
opened = json['opened'];
|
||||||
|
close = json['close'];
|
||||||
|
open = json['open'];
|
||||||
hideInvalidUnlockPermissions = json['hideInvalidUnlockPermissions'];
|
hideInvalidUnlockPermissions = json['hideInvalidUnlockPermissions'];
|
||||||
appUnlockRequiresMobilePhoneAccessToTheLock =
|
appUnlockRequiresMobilePhoneAccessToTheLock =
|
||||||
json['appUnlockRequiresMobilePhoneAccessToTheLock'];
|
json['appUnlockRequiresMobilePhoneAccessToTheLock'];
|
||||||
@ -786,6 +800,12 @@ class LanKeyEntity {
|
|||||||
json['appUnlockRequiresMobilePhoneAccessToTheLockTip'];
|
json['appUnlockRequiresMobilePhoneAccessToTheLockTip'];
|
||||||
checkAll = json['checkAll'];
|
checkAll = json['checkAll'];
|
||||||
getVerificationCode = json['getVerificationCode'];
|
getVerificationCode = json['getVerificationCode'];
|
||||||
|
|
||||||
|
configuringWiFi = json['configuringWiFi'];
|
||||||
|
pleaseEnterWifiName = json['pleaseEnterWifiName'];
|
||||||
|
wifiPwd = json['wifiPwd'];
|
||||||
|
pleaseEnterWifiPwd = json['pleaseEnterWifiPwd'];
|
||||||
|
wifiDistributionNetwork = json['wifiDistributionNetwork'];
|
||||||
}
|
}
|
||||||
String? starLock;
|
String? starLock;
|
||||||
String? clickUnlockAndHoldDownClose;
|
String? clickUnlockAndHoldDownClose;
|
||||||
@ -944,6 +964,8 @@ class LanKeyEntity {
|
|||||||
String? remoteUnlocking;
|
String? remoteUnlocking;
|
||||||
String? automaticBlocking;
|
String? automaticBlocking;
|
||||||
String? normallyOpenMode;
|
String? normallyOpenMode;
|
||||||
|
String? automaticUnLock;
|
||||||
|
String? automaticUnLockTip;
|
||||||
String? lockSound;
|
String? lockSound;
|
||||||
String? burglarAlarm;
|
String? burglarAlarm;
|
||||||
String? resetButton;
|
String? resetButton;
|
||||||
@ -1012,6 +1034,8 @@ class LanKeyEntity {
|
|||||||
String? lockScreen;
|
String? lockScreen;
|
||||||
String? closed;
|
String? closed;
|
||||||
String? opened;
|
String? opened;
|
||||||
|
String? close;
|
||||||
|
String? open;
|
||||||
String? hideInvalidUnlockPermissions;
|
String? hideInvalidUnlockPermissions;
|
||||||
String? appUnlockRequiresMobilePhoneAccessToTheLock;
|
String? appUnlockRequiresMobilePhoneAccessToTheLock;
|
||||||
String? valueAddedServices;
|
String? valueAddedServices;
|
||||||
@ -1182,6 +1206,12 @@ class LanKeyEntity {
|
|||||||
String? checkAll;
|
String? checkAll;
|
||||||
String? getVerificationCode;
|
String? getVerificationCode;
|
||||||
|
|
||||||
|
String? configuringWiFi;
|
||||||
|
String? pleaseEnterWifiName;
|
||||||
|
String? wifiPwd;
|
||||||
|
String? pleaseEnterWifiPwd;
|
||||||
|
String? wifiDistributionNetwork;
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
final map = <String, dynamic>{};
|
final map = <String, dynamic>{};
|
||||||
map['starLock'] = starLock;
|
map['starLock'] = starLock;
|
||||||
@ -1311,6 +1341,8 @@ class LanKeyEntity {
|
|||||||
map['remoteUnlocking'] = remoteUnlocking;
|
map['remoteUnlocking'] = remoteUnlocking;
|
||||||
map['automaticBlocking'] = automaticBlocking;
|
map['automaticBlocking'] = automaticBlocking;
|
||||||
map['normallyOpenMode'] = normallyOpenMode;
|
map['normallyOpenMode'] = normallyOpenMode;
|
||||||
|
map['automaticUnLock'] = automaticUnLock;
|
||||||
|
map['automaticUnLockTip'] = automaticUnLockTip;
|
||||||
map['lockSound'] = lockSound;
|
map['lockSound'] = lockSound;
|
||||||
map['burglarAlarm'] = burglarAlarm;
|
map['burglarAlarm'] = burglarAlarm;
|
||||||
map['resetButton'] = resetButton;
|
map['resetButton'] = resetButton;
|
||||||
@ -1410,6 +1442,8 @@ class LanKeyEntity {
|
|||||||
map['lockScreen'] = lockScreen;
|
map['lockScreen'] = lockScreen;
|
||||||
map['closed'] = closed;
|
map['closed'] = closed;
|
||||||
map['opened'] = opened;
|
map['opened'] = opened;
|
||||||
|
map['close'] = close;
|
||||||
|
map['open'] = open;
|
||||||
map['hideInvalidUnlockPermissions'] = hideInvalidUnlockPermissions;
|
map['hideInvalidUnlockPermissions'] = hideInvalidUnlockPermissions;
|
||||||
map['appUnlockRequiresMobilePhoneAccessToTheLock'] =
|
map['appUnlockRequiresMobilePhoneAccessToTheLock'] =
|
||||||
appUnlockRequiresMobilePhoneAccessToTheLock;
|
appUnlockRequiresMobilePhoneAccessToTheLock;
|
||||||
@ -1587,6 +1621,12 @@ class LanKeyEntity {
|
|||||||
appUnlockRequiresMobilePhoneAccessToTheLockTip;
|
appUnlockRequiresMobilePhoneAccessToTheLockTip;
|
||||||
map['checkAll'] = checkAll;
|
map['checkAll'] = checkAll;
|
||||||
map['getVerificationCode'] = getVerificationCode;
|
map['getVerificationCode'] = getVerificationCode;
|
||||||
|
|
||||||
|
map['configuringWiFi'] = configuringWiFi;
|
||||||
|
map['pleaseEnterWifiName'] = pleaseEnterWifiName;
|
||||||
|
map['wifiPwd'] = wifiPwd;
|
||||||
|
map['pleaseEnterWifiPwd'] = pleaseEnterWifiPwd;
|
||||||
|
map['wifiDistributionNetwork'] = wifiDistributionNetwork;
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,6 +8,7 @@ import Foundation
|
|||||||
import aj_captcha_flutter
|
import aj_captcha_flutter
|
||||||
import device_info_plus
|
import device_info_plus
|
||||||
import file_selector_macos
|
import file_selector_macos
|
||||||
|
import network_info_plus
|
||||||
import package_info_plus
|
import package_info_plus
|
||||||
import path_provider_foundation
|
import path_provider_foundation
|
||||||
import shared_preferences_foundation
|
import shared_preferences_foundation
|
||||||
@ -17,6 +18,7 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
|||||||
AjCaptchaFlutterPlugin.register(with: registry.registrar(forPlugin: "AjCaptchaFlutterPlugin"))
|
AjCaptchaFlutterPlugin.register(with: registry.registrar(forPlugin: "AjCaptchaFlutterPlugin"))
|
||||||
DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin"))
|
DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin"))
|
||||||
FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin"))
|
FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin"))
|
||||||
|
NetworkInfoPlusPlugin.register(with: registry.registrar(forPlugin: "NetworkInfoPlusPlugin"))
|
||||||
FLTPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlusPlugin"))
|
FLTPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlusPlugin"))
|
||||||
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
|
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
|
||||||
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
|
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
|
||||||
|
|||||||
@ -102,6 +102,8 @@ dependencies:
|
|||||||
google_maps_flutter: ^2.2.5
|
google_maps_flutter: ^2.2.5
|
||||||
geocoding: ^2.1.0
|
geocoding: ^2.1.0
|
||||||
|
|
||||||
|
# 允许App发现网络的相关信息并且进行相应的配置
|
||||||
|
network_info_plus: ^4.0.2
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user