Merge branch 'master' of https://gitee.com/weishaoyang/star_lock
BIN
star_lock/images/icon_about.png
Normal file
|
After Width: | Height: | Size: 213 KiB |
BIN
star_lock/images/icon_email.png
Normal file
|
After Width: | Height: | Size: 6.0 KiB |
|
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 64 KiB |
BIN
star_lock/images/icon_message.png
Normal file
|
After Width: | Height: | Size: 4.5 KiB |
BIN
star_lock/images/icon_more.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
star_lock/images/icon_noData.png
Normal file
|
After Width: | Height: | Size: 8.7 KiB |
BIN
star_lock/images/icon_wechat.png
Normal file
|
After Width: | Height: | Size: 7.7 KiB |
@ -212,7 +212,7 @@
|
||||
"pushNotification":"消息推送",
|
||||
"lockUserManagement":"锁用户管理",
|
||||
"ownedKey":"拥有的钥匙",
|
||||
"authorityManagement":"权限管理",
|
||||
"authorityManagement":"批量授权",
|
||||
"associatedDevice":"关联设备",
|
||||
"associatedName":"关联姓名",
|
||||
"device":"设备",
|
||||
|
||||
BIN
star_lock/images/lockType/addLock_entranceGuardBg.png
Normal file
|
After Width: | Height: | Size: 37 KiB |
BIN
star_lock/images/lockType/addLock_parkingBg.png
Normal file
|
After Width: | Height: | Size: 66 KiB |
BIN
star_lock/images/lockType/addLock_safeBg.png
Normal file
|
After Width: | Height: | Size: 73 KiB |
@ -10,6 +10,7 @@
|
||||
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
|
||||
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
|
||||
3EF1E85D6F1EE0C0DCF8449F /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 09D8B2FA2B26BA5BFF31AB2A /* Pods_Runner.framework */; };
|
||||
82BD91202ADA6FBB0018E523 /* XSFlutterManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 82BD911F2ADA6FBB0018E523 /* XSFlutterManager.m */; };
|
||||
978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; };
|
||||
97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; };
|
||||
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
|
||||
@ -39,6 +40,9 @@
|
||||
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
|
||||
7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
|
||||
7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
|
||||
82BD911E2ADA6FBB0018E523 /* XSFlutterManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XSFlutterManager.h; sourceTree = "<group>"; };
|
||||
82BD911F2ADA6FBB0018E523 /* XSFlutterManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XSFlutterManager.m; sourceTree = "<group>"; };
|
||||
82BD91212ADA72360018E523 /* CommonDefine.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CommonDefine.h; sourceTree = "<group>"; };
|
||||
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
|
||||
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
|
||||
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
@ -74,6 +78,15 @@
|
||||
path = Pods;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
826570C02ADCDD0200A92776 /* XSController */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
82BD911E2ADA6FBB0018E523 /* XSFlutterManager.h */,
|
||||
82BD911F2ADA6FBB0018E523 /* XSFlutterManager.m */,
|
||||
);
|
||||
name = XSController;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
9304F75C378DB3447BB2408C /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@ -115,6 +128,7 @@
|
||||
97C146F01CF9000F007C117D /* Runner */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
826570C02ADCDD0200A92776 /* XSController */,
|
||||
33BF41252A96174D009D92E2 /* Runner.entitlements */,
|
||||
7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */,
|
||||
7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */,
|
||||
@ -125,6 +139,7 @@
|
||||
97C146F11CF9000F007C117D /* Supporting Files */,
|
||||
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
|
||||
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
|
||||
82BD91212ADA72360018E523 /* CommonDefine.h */,
|
||||
);
|
||||
path = Runner;
|
||||
sourceTree = "<group>";
|
||||
@ -173,6 +188,7 @@
|
||||
TargetAttributes = {
|
||||
97C146ED1CF9000F007C117D = {
|
||||
CreatedOnToolsVersion = 7.3.1;
|
||||
LastSwiftMigration = 1430;
|
||||
};
|
||||
};
|
||||
};
|
||||
@ -287,6 +303,7 @@
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */,
|
||||
82BD91202ADA6FBB0018E523 /* XSFlutterManager.m in Sources */,
|
||||
97C146F31CF9000F007C117D /* main.m in Sources */,
|
||||
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
|
||||
);
|
||||
@ -371,6 +388,7 @@
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = YES;
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
||||
CODE_SIGN_IDENTITY = "Apple Development";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
@ -385,6 +403,8 @@
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "cn.star-lock.lock";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||
SWIFT_VERSION = 5.0;
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
};
|
||||
name = Profile;
|
||||
@ -502,6 +522,7 @@
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = YES;
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
||||
CODE_SIGN_IDENTITY = "Apple Development";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
@ -516,6 +537,9 @@
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "cn.star-lock.lock";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
SWIFT_VERSION = 5.0;
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
};
|
||||
name = Debug;
|
||||
@ -526,6 +550,7 @@
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = YES;
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
||||
CODE_SIGN_IDENTITY = "Apple Development";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
@ -540,6 +565,8 @@
|
||||
PRODUCT_BUNDLE_IDENTIFIER = "cn.star-lock.lock";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||
SWIFT_VERSION = 5.0;
|
||||
VERSIONING_SYSTEM = "apple-generic";
|
||||
};
|
||||
name = Release;
|
||||
|
||||
@ -1,13 +1,16 @@
|
||||
#import "AppDelegate.h"
|
||||
#import "GeneratedPluginRegistrant.h"
|
||||
#import "XSFlutterManager.h"
|
||||
#import "CommonDefine.h"
|
||||
|
||||
@implementation AppDelegate
|
||||
|
||||
- (BOOL)application:(UIApplication *)application
|
||||
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
|
||||
[GeneratedPluginRegistrant registerWithRegistry:self];
|
||||
// Override point for customization after application launch.
|
||||
return [super application:application didFinishLaunchingWithOptions:launchOptions];
|
||||
XSFlutterManager * VC = [[XSFlutterManager alloc]init];
|
||||
self.window.rootViewController = VC;
|
||||
[self.window makeKeyAndVisible];
|
||||
return YES;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@ -1,122 +1,121 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"size" : "20x20",
|
||||
"filename" : "icon-20@2x.png",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-20x20@2x.png",
|
||||
"scale" : "2x"
|
||||
"scale" : "2x",
|
||||
"size" : "20x20"
|
||||
},
|
||||
{
|
||||
"size" : "20x20",
|
||||
"filename" : "icon-20@3x.png",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-20x20@3x.png",
|
||||
"scale" : "3x"
|
||||
"scale" : "3x",
|
||||
"size" : "20x20"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-29x29@1x.png",
|
||||
"scale" : "1x"
|
||||
"scale" : "1x",
|
||||
"size" : "29x29"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"filename" : "icon-29@2x.png",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-29x29@2x.png",
|
||||
"scale" : "2x"
|
||||
"scale" : "2x",
|
||||
"size" : "29x29"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"filename" : "icon-29@3x.png",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-29x29@3x.png",
|
||||
"scale" : "3x"
|
||||
"scale" : "3x",
|
||||
"size" : "29x29"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"filename" : "icon-40@2x.png",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-40x40@2x.png",
|
||||
"scale" : "2x"
|
||||
"scale" : "2x",
|
||||
"size" : "40x40"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"filename" : "icon-40@3x.png",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-40x40@3x.png",
|
||||
"scale" : "3x"
|
||||
"scale" : "3x",
|
||||
"size" : "40x40"
|
||||
},
|
||||
{
|
||||
"size" : "60x60",
|
||||
"filename" : "icon-60@2x.png",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-60x60@2x.png",
|
||||
"scale" : "2x"
|
||||
"scale" : "2x",
|
||||
"size" : "60x60"
|
||||
},
|
||||
{
|
||||
"size" : "60x60",
|
||||
"filename" : "icon-60@3x.png",
|
||||
"idiom" : "iphone",
|
||||
"filename" : "Icon-App-60x60@3x.png",
|
||||
"scale" : "3x"
|
||||
"scale" : "3x",
|
||||
"size" : "60x60"
|
||||
},
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-20x20@1x.png",
|
||||
"scale" : "1x"
|
||||
"idiom" : "ipad",
|
||||
"scale" : "1x",
|
||||
"size" : "20x20"
|
||||
},
|
||||
{
|
||||
"size" : "20x20",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-20x20@2x.png",
|
||||
"scale" : "2x"
|
||||
"idiom" : "ipad",
|
||||
"scale" : "2x",
|
||||
"size" : "20x20"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-29x29@1x.png",
|
||||
"scale" : "1x"
|
||||
"idiom" : "ipad",
|
||||
"scale" : "1x",
|
||||
"size" : "29x29"
|
||||
},
|
||||
{
|
||||
"size" : "29x29",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-29x29@2x.png",
|
||||
"scale" : "2x"
|
||||
"idiom" : "ipad",
|
||||
"scale" : "2x",
|
||||
"size" : "29x29"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-40x40@1x.png",
|
||||
"scale" : "1x"
|
||||
"idiom" : "ipad",
|
||||
"scale" : "1x",
|
||||
"size" : "40x40"
|
||||
},
|
||||
{
|
||||
"size" : "40x40",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-40x40@2x.png",
|
||||
"scale" : "2x"
|
||||
"idiom" : "ipad",
|
||||
"scale" : "2x",
|
||||
"size" : "40x40"
|
||||
},
|
||||
{
|
||||
"size" : "76x76",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-76x76@1x.png",
|
||||
"scale" : "1x"
|
||||
"idiom" : "ipad",
|
||||
"scale" : "1x",
|
||||
"size" : "76x76"
|
||||
},
|
||||
{
|
||||
"size" : "76x76",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-76x76@2x.png",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"size" : "83.5x83.5",
|
||||
"idiom" : "ipad",
|
||||
"filename" : "Icon-App-83.5x83.5@2x.png",
|
||||
"scale" : "2x"
|
||||
"scale" : "2x",
|
||||
"size" : "76x76"
|
||||
},
|
||||
{
|
||||
"filename" : "Icon-App-83.5x83.5@2x.png",
|
||||
"idiom" : "ipad",
|
||||
"scale" : "2x",
|
||||
"size" : "83.5x83.5"
|
||||
},
|
||||
{
|
||||
"size" : "1024x1024",
|
||||
"idiom" : "ios-marketing",
|
||||
"filename" : "Icon-App-1024x1024@1x.png",
|
||||
"scale" : "1x"
|
||||
"idiom" : "ios-marketing",
|
||||
"scale" : "1x",
|
||||
"size" : "1024x1024"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 3.7 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 4.1 KiB |
|
After Width: | Height: | Size: 3.8 KiB |
|
After Width: | Height: | Size: 6.0 KiB |
|
After Width: | Height: | Size: 6.0 KiB |
|
After Width: | Height: | Size: 9.7 KiB |
@ -1,8 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="21701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
|
||||
<device id="retina6_12" orientation="portrait" appearance="light"/>
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21679"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--Flutter View Controller-->
|
||||
@ -14,13 +16,14 @@
|
||||
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
|
||||
</layoutGuides>
|
||||
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
|
||||
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
|
||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
</view>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="-26" y="-77"/>
|
||||
</scene>
|
||||
</scenes>
|
||||
</document>
|
||||
|
||||
20
star_lock/ios/Runner/CommonDefine.h
Normal file
@ -0,0 +1,20 @@
|
||||
//
|
||||
// CommonDefine.h
|
||||
// Runner
|
||||
//
|
||||
// Created by DaisyWu on 2023/10/14.
|
||||
//
|
||||
|
||||
#ifndef CommonDefine_h
|
||||
#define CommonDefine_h
|
||||
|
||||
|
||||
/** 信号通道,须与flutter里一致*/
|
||||
#define flutterMethodChannel @"flutter_native_ios"
|
||||
/** 交互方法字段名,须与flutter里一致*/
|
||||
#define flutterMethodSharePassword @"flutter_sharePassword_to_ios"
|
||||
#define flutterMethodPresent @"flutter_present_to_ios"
|
||||
|
||||
|
||||
#endif /* CommonDefine_h */
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>Star Lock</string>
|
||||
<string>星锁</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
@ -15,7 +15,7 @@
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>star_lock</string>
|
||||
<string>星锁</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
@ -57,6 +57,11 @@
|
||||
</array>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
<string>LaunchScreen</string>
|
||||
<key>UIApplicationSceneManifest</key>
|
||||
<dict>
|
||||
<key>UISceneConfigurations</key>
|
||||
<dict/>
|
||||
</dict>
|
||||
<key>UIMainStoryboardFile</key>
|
||||
<string>Main</string>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
|
||||
16
star_lock/ios/Runner/XSFlutterManager.h
Normal file
@ -0,0 +1,16 @@
|
||||
//
|
||||
// SharePasswordViewController.h
|
||||
// Runner
|
||||
//
|
||||
// Created by DaisyWu on 2023/10/14.
|
||||
//
|
||||
|
||||
#import <Flutter/Flutter.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface XSFlutterManager : FlutterViewController
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
104
star_lock/ios/Runner/XSFlutterManager.m
Normal file
@ -0,0 +1,104 @@
|
||||
//
|
||||
// XSFlutterManager.m
|
||||
// Runner
|
||||
//
|
||||
// Created by DaisyWu on 2023/10/14.
|
||||
//
|
||||
|
||||
#import "XSFlutterManager.h"
|
||||
#include "GeneratedPluginRegistrant.h"
|
||||
#import "CommonDefine.h"
|
||||
|
||||
|
||||
@interface XSFlutterManager ()
|
||||
|
||||
@property(nonatomic,strong) FlutterMethodChannel* methodChannel;
|
||||
@property (nonatomic, copy) NSString *textToShare;
|
||||
|
||||
@end
|
||||
|
||||
@implementation XSFlutterManager
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
self.textToShare = [[NSString alloc] init];
|
||||
|
||||
[self methodChannelFunction];
|
||||
}
|
||||
- (void)methodChannelFunction {
|
||||
|
||||
//创建 FlutterMethodChannel
|
||||
self.methodChannel = [FlutterMethodChannel
|
||||
methodChannelWithName:flutterMethodChannel binaryMessenger:self];
|
||||
//设置监听
|
||||
[self.methodChannel setMethodCallHandler:^(FlutterMethodCall* call, FlutterResult result) {
|
||||
// TODO
|
||||
NSString *method=call.method;
|
||||
//调用系统分享
|
||||
if ([method isEqualToString:flutterMethodSharePassword]) {
|
||||
id params = call.arguments;
|
||||
self.textToShare = @"您好,您的密码是:";
|
||||
if ([params isKindOfClass:[NSDictionary class]]) {
|
||||
NSDictionary *paramDic = (NSDictionary *)params;
|
||||
//分享的标题
|
||||
self.textToShare = paramDic[@"pwdShareStr"];
|
||||
}
|
||||
//分享的url
|
||||
NSURL *urlToShare = [NSURL URLWithString:@"https://pre.lock.star-lock.cn:8093/login"];
|
||||
|
||||
//在这里呢 如果想分享图片 就把图片添加进去 文字什么的通上
|
||||
NSArray *activityItems = @[self.textToShare,urlToShare];
|
||||
|
||||
UIActivityViewController *activityVC = [[UIActivityViewController alloc]initWithActivityItems:activityItems applicationActivities:nil];
|
||||
|
||||
//不出现在活动项目
|
||||
activityVC.excludedActivityTypes = @[UIActivityTypePrint];
|
||||
[self presentViewController:activityVC animated:YES completion:nil];
|
||||
|
||||
// 分享之后的回调
|
||||
activityVC.completionWithItemsHandler = ^(UIActivityType _Nullable activityType, BOOL completed, NSArray * _Nullable returnedItems, NSError * _Nullable activityError) {
|
||||
if (completed) {
|
||||
|
||||
NSLog(@"completed");
|
||||
|
||||
//分享 成功
|
||||
|
||||
} else {
|
||||
|
||||
NSLog(@"cancled");
|
||||
|
||||
//分享 取消
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
result(@"push返回到flutter");
|
||||
}
|
||||
|
||||
}];
|
||||
[GeneratedPluginRegistrant registerWithRegistry:self];
|
||||
}
|
||||
|
||||
-(void)viewWillAppear:(BOOL)animated{
|
||||
[super viewWillAppear:animated];
|
||||
[self.navigationController setNavigationBarHidden:YES];
|
||||
}
|
||||
|
||||
-(void)viewWillDisappear:(BOOL)animated{
|
||||
[super viewWillDisappear:animated];
|
||||
[self.navigationController setNavigationBarHidden:NO];
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
#pragma mark - Navigation
|
||||
|
||||
// In a storyboard-based application, you will often want to do a little preparation before navigation
|
||||
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
|
||||
// Get the new view controller using [segue destinationViewController].
|
||||
// Pass the selected object to the new view controller.
|
||||
}
|
||||
*/
|
||||
|
||||
@end
|
||||
@ -12,7 +12,7 @@ import 'package:star_lock/mine/about/webviewShow_page.dart';
|
||||
import 'package:star_lock/mine/mine/safeVerify/safeVerify_page.dart';
|
||||
import 'package:star_lock/mine/minePersonInfo/minePersonInfoEmail/mineBindPhoneOrEmail_page.dart';
|
||||
import 'package:star_lock/mine/minePersonInfo/minePersonInfoViewSafetyProblem/minePersonInfoViewSafetyProblem_page.dart';
|
||||
import 'package:star_lock/mine/mineSet/authorizedAdministrator/addAuthorizedAdministrator_page.dart';
|
||||
import 'package:star_lock/mine/mineSet/addAuthorizedAdministrator/addAuthorizedAdministrator_page.dart';
|
||||
import 'package:star_lock/mine/mineSet/authorizedAdministrator/administratorDetails/adminDetailChangeDate_page.dart';
|
||||
import 'package:star_lock/mine/mineSet/authorizedAdministrator/administratorDetails/administratorDetails_page.dart';
|
||||
import 'package:star_lock/mine/mineSet/lockGroup/lockGroupList_page.dart';
|
||||
@ -320,7 +320,7 @@ abstract class Routers {
|
||||
|
||||
static const getDeviceListPage = '/getDeviceListPage'; //设备列表
|
||||
static const getNameListPage = '/getNameListPage'; //姓名列表
|
||||
static const authorityManagementPage = '/authorityManagementPage'; //权限管理
|
||||
static const authorityManagementPage = '/authorityManagementPage'; //批量授权
|
||||
static const massSendLockGroupPage = '/massSendLockGroupPage'; //群发锁分组列表
|
||||
static const massSendReceiverPage = '/massSendReceiverPage'; //群发接收人
|
||||
static const lockUserListPage = '/lockUserListPage'; //锁用户列表
|
||||
|
||||
@ -27,7 +27,7 @@ class AuthorizedAdminSendEntity {
|
||||
}
|
||||
|
||||
class Data {
|
||||
String? receiverUid;
|
||||
int? receiverUid;
|
||||
ReceiverUser? receiverUser;
|
||||
int? keyId;
|
||||
|
||||
@ -105,7 +105,7 @@ class Phone {
|
||||
int? userId;
|
||||
String? phoneNumberHash;
|
||||
String? phoneNumberEncrypt;
|
||||
String? countryCode;
|
||||
int? countryCode;
|
||||
String? phoneNumberVerifiedAt;
|
||||
String? updatedAt;
|
||||
String? createdAt;
|
||||
@ -149,7 +149,7 @@ class Phone {
|
||||
class Cloud {
|
||||
String? username;
|
||||
String? password;
|
||||
String? cloudUid;
|
||||
int? cloudUid;
|
||||
int? userId;
|
||||
String? updatedAt;
|
||||
String? createdAt;
|
||||
|
||||
@ -1,7 +1,11 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter_reactive_ble/flutter_reactive_ble.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/appRouters.dart';
|
||||
import 'package:star_lock/blue/io_type.dart';
|
||||
import 'package:star_lock/translations/trans_lib.dart';
|
||||
|
||||
import '../../../../blue/blue_manage.dart';
|
||||
import '../../../../blue/io_protocol/io_addUser.dart';
|
||||
@ -23,7 +27,8 @@ class AuthorizedAdminLogic extends BaseGetXController {
|
||||
// 监听设备返回的数据
|
||||
late StreamSubscription<Reply> _replySubscription;
|
||||
void _initReplySubscription() {
|
||||
_replySubscription = EventBusManager().eventBus!.on<Reply>().listen((reply) async {
|
||||
_replySubscription =
|
||||
EventBusManager().eventBus!.on<Reply>().listen((reply) async {
|
||||
// 转移权限
|
||||
if (reply is TransferPermissionsReply) {
|
||||
var token = reply.data.sublist(2, 6);
|
||||
@ -73,7 +78,7 @@ class AuthorizedAdminLogic extends BaseGetXController {
|
||||
|
||||
break;
|
||||
case 0x14:
|
||||
// 权限校验错误
|
||||
// 权限校验错误
|
||||
print("${reply.commandType!.typeValue} 用户已存在");
|
||||
|
||||
break;
|
||||
@ -85,7 +90,7 @@ class AuthorizedAdminLogic extends BaseGetXController {
|
||||
}
|
||||
}
|
||||
|
||||
if(reply is AddUserReply) {
|
||||
if (reply is AddUserReply) {
|
||||
_replyAddUserKey(reply);
|
||||
}
|
||||
});
|
||||
@ -105,16 +110,16 @@ class AuthorizedAdminLogic extends BaseGetXController {
|
||||
|
||||
// userNo = reply.data[46];
|
||||
// print("status:$status");
|
||||
switch(status){
|
||||
switch (status) {
|
||||
case 0x00:
|
||||
//成功
|
||||
//成功
|
||||
print("添加用户数据解析成功");
|
||||
state.isSendSuccess.value = true;
|
||||
Toast.show(msg: "添加成功");
|
||||
// bindBlueAdmin();
|
||||
break;
|
||||
case 0x06:
|
||||
//无权限
|
||||
//无权限
|
||||
print("需要鉴权");
|
||||
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
@ -124,33 +129,32 @@ class AuthorizedAdminLogic extends BaseGetXController {
|
||||
|
||||
IoSenderManage.senderAddUser(
|
||||
lockID: BlueManage().connectDeviceName,
|
||||
authUserID:await Storage.getUid(),
|
||||
keyID:"1",
|
||||
userID:state.addUserId.value,
|
||||
openMode:1,
|
||||
keyType:(state.type.value == "1") ? 0 : 1,
|
||||
startDate:state.effectiveDateTime.value.millisecondsSinceEpoch,
|
||||
expireDate:state.failureDateTime.value.millisecondsSinceEpoch,
|
||||
role:0,
|
||||
password:"123456",
|
||||
needAuthor:1,
|
||||
publicKey:publicKeyDataList,
|
||||
privateKey:getPrivateKeyList,
|
||||
token: token
|
||||
);
|
||||
authUserID: await Storage.getUid(),
|
||||
keyID: "1",
|
||||
userID: state.addUserId.value,
|
||||
openMode: 1,
|
||||
keyType: (state.type.value == "1") ? 0 : 1,
|
||||
startDate: state.effectiveDateTime.value.millisecondsSinceEpoch,
|
||||
expireDate: state.failureDateTime.value.millisecondsSinceEpoch,
|
||||
role: 0,
|
||||
password: "123456",
|
||||
needAuthor: 1,
|
||||
publicKey: publicKeyDataList,
|
||||
privateKey: getPrivateKeyList,
|
||||
token: token);
|
||||
break;
|
||||
case 0x07:
|
||||
//无权限
|
||||
//无权限
|
||||
print("用户无权限");
|
||||
|
||||
break;
|
||||
case 0x09:
|
||||
// 权限校验错误
|
||||
// 权限校验错误
|
||||
print("添加用户权限校验错误");
|
||||
|
||||
break;
|
||||
default:
|
||||
//失败
|
||||
//失败
|
||||
print("领锁失败");
|
||||
|
||||
break;
|
||||
@ -190,8 +194,10 @@ class AuthorizedAdminLogic extends BaseGetXController {
|
||||
// 添加用户
|
||||
Future<void> addUserConnectBlue(String receiveId) async {
|
||||
// 进来之后首先连接
|
||||
BlueManage().judgeReconnect(BlueManage().connectDeviceMacAddress, BlueManage().connectDeviceName, (DeviceConnectionState connecteState) async {
|
||||
if (connecteState == DeviceConnectionState.connected){
|
||||
BlueManage().judgeReconnect(
|
||||
BlueManage().connectDeviceMacAddress, BlueManage().connectDeviceName,
|
||||
(DeviceConnectionState connecteState) async {
|
||||
if (connecteState == DeviceConnectionState.connected) {
|
||||
// 私钥
|
||||
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
@ -200,59 +206,60 @@ class AuthorizedAdminLogic extends BaseGetXController {
|
||||
List<int> publicKeyDataList = changeStringListToIntList(publicKey!);
|
||||
|
||||
var token = await Storage.getStringList(saveBlueToken);
|
||||
List<int> getTokenList = [0,0,0,0];
|
||||
if(token != null){
|
||||
List<int> getTokenList = [0, 0, 0, 0];
|
||||
if (token != null) {
|
||||
getTokenList = changeStringListToIntList(token);
|
||||
}
|
||||
|
||||
IoSenderManage.senderAddUser(
|
||||
lockID: BlueManage().connectDeviceName,
|
||||
authUserID:await Storage.getUid(),
|
||||
keyID:"1",
|
||||
userID:receiveId,
|
||||
openMode:1,
|
||||
keyType:(state.type.value == "1") ? 0 : 1,
|
||||
startDate:state.effectiveDateTime.value.millisecondsSinceEpoch,
|
||||
expireDate:state.failureDateTime.value.millisecondsSinceEpoch,
|
||||
role:0,
|
||||
password:"123456",
|
||||
needAuthor:1,
|
||||
publicKey:publicKeyDataList,
|
||||
privateKey:getPrivateKeyList,
|
||||
token: getTokenList
|
||||
);
|
||||
authUserID: await Storage.getUid(),
|
||||
keyID: "1",
|
||||
userID: receiveId,
|
||||
openMode: 1,
|
||||
keyType: (state.type.value == "1") ? 0 : 1,
|
||||
startDate: state.effectiveDateTime.value.millisecondsSinceEpoch,
|
||||
expireDate: state.failureDateTime.value.millisecondsSinceEpoch,
|
||||
role: 0,
|
||||
password: "123456",
|
||||
needAuthor: 1,
|
||||
publicKey: publicKeyDataList,
|
||||
privateKey: getPrivateKeyList,
|
||||
token: getTokenList);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//发送授权管理员列表请求
|
||||
Future<void> sendElectronicKeyRequest() async {
|
||||
Future<void> sendElectronicKeyRequest(BuildContext widgetContext) async {
|
||||
String getFailureDateTime = '0';
|
||||
String getEffectiveDateTime = '0';
|
||||
String lockID = state.keyInfo.value.lockId.toString();
|
||||
String getKeyType = (int.parse(state.type.value) + 1).toString();
|
||||
if (state.type.value == '0') {
|
||||
getFailureDateTime = state.failureDateTime.value.millisecondsSinceEpoch.toString();
|
||||
getFailureDateTime =
|
||||
state.failureDateTime.value.millisecondsSinceEpoch.toString();
|
||||
getEffectiveDateTime =
|
||||
state.effectiveDateTime.value.millisecondsSinceEpoch.toString();
|
||||
}
|
||||
|
||||
var entity = await ApiRepository.to.sendElectronicKey(
|
||||
state.isCreateUser.value ? "1" : "0",
|
||||
state.countryCode.value,
|
||||
'1',
|
||||
getFailureDateTime,
|
||||
state.isAuthentication.value == true ? '1' : '2',
|
||||
'2',
|
||||
'2',
|
||||
state.keyNameController.text,
|
||||
'1',
|
||||
getKeyType,
|
||||
lockID,
|
||||
'',
|
||||
state.emailOrPhoneController.text,
|
||||
'',
|
||||
getEffectiveDateTime,
|
||||
state.weekdaysList);
|
||||
createUser: state.isCreateUser.value ? "1" : "0",
|
||||
countryCode: state.countryCode.value,
|
||||
usernameType: '1',
|
||||
endDate: getFailureDateTime,
|
||||
faceAuthentication: state.isAuthentication.value == true ? '1' : '2',
|
||||
isCameraEnable: '2',
|
||||
isRemoteUnlock: '2',
|
||||
keyNameForAdmin: state.keyNameController.text,
|
||||
keyRight: '1',
|
||||
keyType: getKeyType,
|
||||
lockId: lockID,
|
||||
operatorUid: '',
|
||||
receiverUsername: state.emailOrPhoneController.text,
|
||||
remarks: '',
|
||||
startDate: getEffectiveDateTime,
|
||||
weekDays: state.weekdaysList);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
print('发送电子钥匙成功');
|
||||
state.isSendSuccess.value = true;
|
||||
@ -260,15 +267,48 @@ class AuthorizedAdminLogic extends BaseGetXController {
|
||||
state.addUserId.value = entity.data!.receiverUser!.id.toString();
|
||||
addUserConnectBlue(state.addUserId.value);
|
||||
} else {
|
||||
// Toast.show(msg: '${entity.errorMsg}');
|
||||
if (entity.errorCode == 425) {
|
||||
//用户未注册
|
||||
state.isCreateUser.value = true;
|
||||
sendElectronicKeyRequest();
|
||||
_showDialog(widgetContext, '${entity.errorMsg}');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//用户未注册确认弹窗
|
||||
void _showDialog(widgetContext, String errMsg) {
|
||||
showCupertinoDialog(
|
||||
context: widgetContext,
|
||||
builder: (context) {
|
||||
return CupertinoAlertDialog(
|
||||
title: const Text('接收者号码未注册,请选择号码所在的国家并重新发送'),
|
||||
actions: [
|
||||
CupertinoDialogAction(
|
||||
child: Text(TranslationLoader.lanKeys!.cancel!.tr),
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
CupertinoDialogAction(
|
||||
child: Text(TranslationLoader.lanKeys!.selet!.tr),
|
||||
onPressed: () async {
|
||||
//选择国家代码
|
||||
state.isCreateUser.value = true;
|
||||
Navigator.of(context).pop();
|
||||
|
||||
var result = await Get.toNamed(Routers.seletCountryRegionPage);
|
||||
if (result != null) {
|
||||
result as Map<String, dynamic>;
|
||||
state.countryCode.value = result['code'];
|
||||
state.countryName.value = result['countryName'];
|
||||
}
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
// TODO: implement onReady
|
||||
|
||||
@ -202,7 +202,7 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage> {
|
||||
if (state.emailOrPhoneController.text.isNotEmpty &&
|
||||
state.keyNameController.value.text.isNotEmpty) {
|
||||
// logic.addUserConnectBlue();
|
||||
logic.sendElectronicKeyRequest();
|
||||
logic.sendElectronicKeyRequest(context);
|
||||
}
|
||||
}),
|
||||
Container(
|
||||
@ -358,11 +358,15 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage> {
|
||||
alignment: Alignment.center,
|
||||
child: InkWell(
|
||||
onTap: () async {
|
||||
Contact? contact =
|
||||
Contact? currentContact =
|
||||
await state.contactPicker.selectContact();
|
||||
setState(() {
|
||||
state.contact = contact!;
|
||||
// print("object111111111111 ${_contact.fullName} ${_contact.phoneNumbers}");
|
||||
state.contact = currentContact!;
|
||||
if (currentContact.phoneNumbers!.isNotEmpty) {
|
||||
state.emailOrPhoneController.text = currentContact
|
||||
.phoneNumbers![0]
|
||||
.replaceAll(RegExp(r"\s+\b|\b\s"), "");
|
||||
}
|
||||
});
|
||||
},
|
||||
),
|
||||
|
||||
@ -5,6 +5,7 @@ import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/entity
|
||||
import 'package:star_lock/main/lockMian/entity/lockInfoEntity.dart';
|
||||
import 'package:star_lock/network/api_repository.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
import 'package:star_lock/tools/noData.dart';
|
||||
|
||||
import '../../../../appRouters.dart';
|
||||
import '../../../../app_settings/app_colors.dart';
|
||||
@ -116,32 +117,34 @@ class _AuthorizedAdminListPageState extends State<AuthorizedAdminListPage> {
|
||||
|
||||
Widget _buildMainUI(itemData) {
|
||||
List<ElectronicKeyListItem> getItemData = itemData;
|
||||
return ListView.builder(
|
||||
itemCount: getItemData.length,
|
||||
itemBuilder: (c, index) {
|
||||
ElectronicKeyListItem indexEntity = getItemData[index];
|
||||
String useDateStr = ''; //使用期限
|
||||
String keyStatus = ''; //钥匙状态
|
||||
return getItemData.isEmpty
|
||||
? const NoData()
|
||||
: ListView.builder(
|
||||
itemCount: getItemData.length,
|
||||
itemBuilder: (c, index) {
|
||||
ElectronicKeyListItem indexEntity = getItemData[index];
|
||||
String useDateStr = ''; //使用期限
|
||||
String keyStatus = ''; //钥匙状态
|
||||
|
||||
//使用期限
|
||||
useDateStr = getUseDateStr(indexEntity);
|
||||
//使用期限
|
||||
useDateStr = getUseDateStr(indexEntity);
|
||||
|
||||
//钥匙状态
|
||||
keyStatus = getKeyStatus(indexEntity.keyStatus);
|
||||
//钥匙状态
|
||||
keyStatus = getKeyStatus(indexEntity.keyStatus);
|
||||
|
||||
//是否为管理钥匙
|
||||
bool isAdminKey = false;
|
||||
if (indexEntity.keyRight == 1) {
|
||||
isAdminKey = true;
|
||||
} else {
|
||||
isAdminKey = false;
|
||||
}
|
||||
return _electronicKeyItem('images/controls_user.png',
|
||||
indexEntity.keyName!, useDateStr, keyStatus, isAdminKey, () {
|
||||
Navigator.pushNamed(context, Routers.electronicKeyDetailPage,
|
||||
arguments: {'itemData': indexEntity});
|
||||
});
|
||||
});
|
||||
//是否为管理钥匙
|
||||
bool isAdminKey = false;
|
||||
if (indexEntity.keyRight == 1) {
|
||||
isAdminKey = true;
|
||||
} else {
|
||||
isAdminKey = false;
|
||||
}
|
||||
return _electronicKeyItem('images/controls_user.png',
|
||||
indexEntity.keyName!, useDateStr, keyStatus, isAdminKey, () {
|
||||
Navigator.pushNamed(context, Routers.electronicKeyDetailPage,
|
||||
arguments: {'itemData': indexEntity});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
//使用期限
|
||||
|
||||
@ -26,6 +26,7 @@ class VolumeAuthorizationLockPage extends StatefulWidget {
|
||||
_VolumeAuthorizationLockPageState();
|
||||
}
|
||||
|
||||
//批量授权锁页面
|
||||
class _VolumeAuthorizationLockPageState
|
||||
extends State<VolumeAuthorizationLockPage> {
|
||||
final FlutterContactPicker _contactPicker = FlutterContactPicker();
|
||||
|
||||
@ -5,6 +5,7 @@ import 'package:star_lock/app_settings/app_colors.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserListEntity.dart';
|
||||
import 'package:star_lock/network/api_repository.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
import 'package:star_lock/tools/noData.dart';
|
||||
import 'package:star_lock/tools/submitBtn.dart';
|
||||
import 'package:star_lock/translations/trans_lib.dart';
|
||||
|
||||
@ -56,16 +57,19 @@ class _LockUserListPageState extends State<LockUserListPage> {
|
||||
height: 20.h,
|
||||
),
|
||||
Expanded(
|
||||
child: ListView.separated(
|
||||
itemBuilder: (context, index) {
|
||||
LockUserData indexEntity = dataList[index];
|
||||
return _electronicKeyItem(indexEntity);
|
||||
},
|
||||
itemCount: dataList.length,
|
||||
separatorBuilder: (context, index) {
|
||||
return const Divider(height: 1, color: AppColors.greyLineColor);
|
||||
},
|
||||
)),
|
||||
child: dataList.isEmpty
|
||||
? const NoData()
|
||||
: ListView.separated(
|
||||
itemBuilder: (context, index) {
|
||||
LockUserData indexEntity = dataList[index];
|
||||
return _electronicKeyItem(indexEntity);
|
||||
},
|
||||
itemCount: dataList.length,
|
||||
separatorBuilder: (context, index) {
|
||||
return const Divider(
|
||||
height: 1, color: AppColors.greyLineColor);
|
||||
},
|
||||
)),
|
||||
Container(
|
||||
height: 120.h,
|
||||
padding: EdgeInsets.only(left: 20.w, right: 20.w, top: 0.h),
|
||||
|
||||
@ -122,6 +122,11 @@ class _MassSendLockGroupListPageState extends State<MassSendLockGroupListPage> {
|
||||
onTap: () {
|
||||
selectGroupIdList.add(index);
|
||||
clickIndex = index;
|
||||
//是否选中组
|
||||
if (itemData.isChecked) {
|
||||
// lockItemList[selectIndex] =
|
||||
}
|
||||
print('选中了么0');
|
||||
},
|
||||
typeImgList: const [],
|
||||
groupItem: itemData,
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_native_contact_picker/flutter_native_contact_picker.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get_utils/get_utils.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserListEntity.dart';
|
||||
@ -9,6 +10,8 @@ class MassSendReceiverCell extends StatelessWidget {
|
||||
final int currentIndex;
|
||||
LockUserData userData;
|
||||
final VoidCallback clickDeleteUser;
|
||||
final FlutterContactPicker contactPicker = FlutterContactPicker();
|
||||
late Contact contact;
|
||||
|
||||
MassSendReceiverCell(int index,
|
||||
{Key? key,
|
||||
@ -138,10 +141,14 @@ class MassSendReceiverCell extends StatelessWidget {
|
||||
child: InkWell(
|
||||
onTap: () async {
|
||||
// Contact? currentContact =
|
||||
// await _contactPicker.selectContact();
|
||||
// await contactPicker.selectContact();
|
||||
// setState(() {
|
||||
// _contact = currentContact!;
|
||||
// // print("object111111111111 ${_contact.fullName} ${_contact.phoneNumbers}");
|
||||
// state.contact = currentContact!;
|
||||
// if (currentContact.phoneNumbers!.isNotEmpty) {
|
||||
// state.emailOrPhoneController.text = currentContact
|
||||
// .phoneNumbers![0]
|
||||
// .replaceAll(RegExp(r"\s+\b|\b\s"), "");
|
||||
// }
|
||||
// });
|
||||
},
|
||||
),
|
||||
|
||||
@ -1,13 +1,18 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get/get_utils/get_utils.dart';
|
||||
import 'package:star_lock/appRouters.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/sendElectronicKey/sendElectronicKey/sendElectronicKey_state.dart';
|
||||
import 'package:star_lock/network/api_repository.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
import 'package:star_lock/tools/toast.dart';
|
||||
import 'package:star_lock/translations/trans_lib.dart';
|
||||
|
||||
class SendElectronicKeyLogic extends BaseGetXController {
|
||||
final SendElectronicKeyState state = SendElectronicKeyState();
|
||||
|
||||
//发送钥匙请求
|
||||
Future<void> sendElectronicKeyRequest() async {
|
||||
Future<void> sendElectronicKeyRequest(BuildContext widgetContext) async {
|
||||
String getFailureDateTime = '0';
|
||||
String getEffectiveDateTime = '0';
|
||||
String lockID = state.keyInfo.value.lockId.toString();
|
||||
@ -18,33 +23,67 @@ class SendElectronicKeyLogic extends BaseGetXController {
|
||||
getEffectiveDateTime =
|
||||
state.effectiveDateTime.value.millisecondsSinceEpoch.toString();
|
||||
}
|
||||
|
||||
var entity = await ApiRepository.to.sendElectronicKey(
|
||||
state.isCreateUser.value ? "1" : "0",
|
||||
state.countryCode.value,
|
||||
'1',
|
||||
getFailureDateTime,
|
||||
state.isAuthentication.value == true ? '1' : '2',
|
||||
'2',
|
||||
state.isRemoteUnlock.value == true ? '1' : '2',
|
||||
state.keyNameController.text,
|
||||
'0',
|
||||
getKeyType,
|
||||
lockID,
|
||||
'',
|
||||
state.emailOrPhoneController.text,
|
||||
'',
|
||||
getEffectiveDateTime,
|
||||
state.weekdaysList);
|
||||
createUser: state.isCreateUser.value ? "1" : "0",
|
||||
countryCode: state.countryCode.value,
|
||||
usernameType: '1',
|
||||
endDate: getFailureDateTime,
|
||||
faceAuthentication: state.isAuthentication.value == true ? '1' : '2',
|
||||
isCameraEnable: '2',
|
||||
isRemoteUnlock: state.isRemoteUnlock.value == true ? '1' : '2',
|
||||
keyNameForAdmin: state.keyNameController.text,
|
||||
keyRight: '0',
|
||||
keyType: getKeyType,
|
||||
lockId: lockID,
|
||||
operatorUid: '',
|
||||
receiverUsername: state.emailOrPhoneController.text,
|
||||
remarks: '',
|
||||
startDate: getEffectiveDateTime,
|
||||
weekDays: state.weekdaysList);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
print('发送电子钥匙成功');
|
||||
state.isSendSuccess.value = true;
|
||||
} else {
|
||||
Toast.show(msg: '${entity.errorMsg}');
|
||||
if (entity.errorCode == 425) {
|
||||
//用户未注册
|
||||
state.isCreateUser.value = true;
|
||||
sendElectronicKeyRequest();
|
||||
_showDialog(widgetContext, '${entity.errorMsg}');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//用户未注册确认弹窗
|
||||
void _showDialog(widgetContext, String errMsg) {
|
||||
showCupertinoDialog(
|
||||
context: widgetContext,
|
||||
builder: (context) {
|
||||
return CupertinoAlertDialog(
|
||||
title: const Text('接收者号码未注册,请选择号码所在的国家并重新发送'),
|
||||
actions: [
|
||||
CupertinoDialogAction(
|
||||
child: Text(TranslationLoader.lanKeys!.cancel!.tr),
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
CupertinoDialogAction(
|
||||
child: Text(TranslationLoader.lanKeys!.selet!.tr),
|
||||
onPressed: () async {
|
||||
//选择国家代码
|
||||
state.isCreateUser.value = true;
|
||||
Navigator.of(context).pop();
|
||||
|
||||
var result = await Get.toNamed(Routers.seletCountryRegionPage);
|
||||
if (result != null) {
|
||||
result as Map<String, dynamic>;
|
||||
state.countryCode.value = result['code'];
|
||||
state.countryName.value = result['countryName'];
|
||||
}
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -201,7 +201,9 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
|
||||
isHaveRightWidget: true,
|
||||
rightWidget: SizedBox(
|
||||
width: 60.w, height: 50.h, child: _remoteSwitch(false)),
|
||||
action: () {}),
|
||||
action: () {
|
||||
// Toast.show(msg: '此功能暂未开放');
|
||||
}),
|
||||
],
|
||||
);
|
||||
}
|
||||
@ -260,12 +262,12 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
|
||||
if (state.failureDateTime.value
|
||||
.compareTo(state.effectiveDateTime.value) ==
|
||||
1) {
|
||||
logic.sendElectronicKeyRequest();
|
||||
logic.sendElectronicKeyRequest(context);
|
||||
} else {
|
||||
Toast.show(msg: '失效时间需大于生效时间');
|
||||
}
|
||||
} else {
|
||||
logic.sendElectronicKeyRequest();
|
||||
logic.sendElectronicKeyRequest(context);
|
||||
}
|
||||
} else {
|
||||
Toast.show(msg: '请完善信息');
|
||||
@ -428,7 +430,11 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
|
||||
await state.contactPicker.selectContact();
|
||||
setState(() {
|
||||
state.contact = currentContact!;
|
||||
// print("object111111111111 ${_contact.fullName} ${_contact.phoneNumbers}");
|
||||
if (currentContact.phoneNumbers!.isNotEmpty) {
|
||||
state.emailOrPhoneController.text = currentContact
|
||||
.phoneNumbers![0]
|
||||
.replaceAll(RegExp(r"\s+\b|\b\s"), "");
|
||||
}
|
||||
});
|
||||
},
|
||||
),
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/tools/noData.dart';
|
||||
|
||||
import '../../../../../app_settings/app_colors.dart';
|
||||
import '../../../../../tools/titleAppBar.dart';
|
||||
@ -14,6 +15,7 @@ class NearbyDoorMagneticPage extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _NearbyDoorMagneticPageState extends State<NearbyDoorMagneticPage> {
|
||||
List dataList = [];
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
@ -22,13 +24,16 @@ class _NearbyDoorMagneticPageState extends State<NearbyDoorMagneticPage> {
|
||||
barTitle: TranslationLoader.lanKeys!.nearbyEquipment!.tr,
|
||||
haveBack: true,
|
||||
backgroundColor: AppColors.mainColor),
|
||||
body: ListView.builder(
|
||||
itemCount: 20,
|
||||
itemBuilder: (c, index) {
|
||||
return nearbyLockItem('images/icon_lock.png', "MCBN01-ea9240", () {
|
||||
// Navigator.pushNamed(context, Routers.saveLockPage);
|
||||
});
|
||||
}),
|
||||
body: dataList.isEmpty
|
||||
? const NoData()
|
||||
: ListView.builder(
|
||||
itemCount: dataList.length,
|
||||
itemBuilder: (c, index) {
|
||||
return nearbyLockItem('images/icon_lock.png', "MCBN01-ea9240",
|
||||
() {
|
||||
// Navigator.pushNamed(context, Routers.saveLockPage);
|
||||
});
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -66,42 +66,65 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
|
||||
'keyInfo': state.getKeyInfosData.value
|
||||
});
|
||||
}),
|
||||
SizedBox(height: 10.h,),
|
||||
SizedBox(
|
||||
height: 10.h,
|
||||
),
|
||||
// 门磁
|
||||
Visibility(
|
||||
visible: true,
|
||||
child:CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.doorMagnetic!.tr,
|
||||
child: CommonItem(
|
||||
leftTitel:
|
||||
TranslationLoader.lanKeys!.doorMagnetic!.tr,
|
||||
rightTitle: "",
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
// Get.toNamed(Routers.doorMagneticPage);
|
||||
Toast.show(msg: "功能暂未开放");
|
||||
})
|
||||
),
|
||||
Get.toNamed(Routers.doorMagneticPage);
|
||||
// Toast.show(msg: "功能暂未开放");
|
||||
})),
|
||||
// 无线键盘
|
||||
Visibility(
|
||||
visible: true,
|
||||
child: CommonItem(
|
||||
leftTitel:
|
||||
TranslationLoader.lanKeys!.wirelessKeyboard!.tr,
|
||||
TranslationLoader.lanKeys!.wirelessKeyboard!.tr,
|
||||
rightTitle: "",
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
Get.toNamed(Routers.wirelessKeyboardPage);
|
||||
// Toast.show(msg: "功能暂未开放");
|
||||
})),
|
||||
Visibility(
|
||||
visible: true,
|
||||
child: CommonItem(
|
||||
leftTitel: '照明',
|
||||
rightTitle: "",
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
Toast.show(msg: "功能暂未开放");
|
||||
})),
|
||||
Visibility(
|
||||
visible: true,
|
||||
child: CommonItem(
|
||||
leftTitel: '开门器',
|
||||
rightTitle: "",
|
||||
isHaveLine: false,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
// Get.toNamed(Routers.wirelessKeyboardPage);
|
||||
Toast.show(msg: "功能暂未开放");
|
||||
})
|
||||
),
|
||||
})),
|
||||
SizedBox(height: 10.h),
|
||||
// 自动闭锁
|
||||
Obx(() => Visibility(
|
||||
visible: true,
|
||||
child: CommonItem(
|
||||
leftTitel:
|
||||
TranslationLoader.lanKeys!.automaticBlocking!.tr,
|
||||
rightTitle: state.getKeyInfosData.value.autoLockTime! > -1
|
||||
TranslationLoader.lanKeys!.automaticBlocking!.tr,
|
||||
rightTitle: state
|
||||
.getKeyInfosData.value.autoLockTime! >
|
||||
-1
|
||||
? "${state.getKeyInfosData.value.autoLockTime!.toString()}s"
|
||||
: TranslationLoader.lanKeys!.closed!.tr,
|
||||
isHaveLine: true,
|
||||
@ -109,8 +132,7 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
|
||||
action: () {
|
||||
Get.toNamed(Routers.automaticBlockingPage,
|
||||
arguments: state.getKeyInfosData.value);
|
||||
}))
|
||||
),
|
||||
}))),
|
||||
// 锁声音
|
||||
Obx(() {
|
||||
var titleStr = "";
|
||||
@ -145,144 +167,144 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
|
||||
action: () {
|
||||
Get.toNamed(Routers.lockSoundSetPage,
|
||||
arguments: state.getKeyInfosData.value);
|
||||
})
|
||||
);
|
||||
}));
|
||||
}),
|
||||
// 防撬报警
|
||||
Obx(() => Visibility(
|
||||
visible: true,
|
||||
child: CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.burglarAlarm!.tr,
|
||||
rightTitle: state.getKeyInfosData.value.tamperAlert == 1
|
||||
? TranslationLoader.lanKeys!.opened!.tr
|
||||
: TranslationLoader.lanKeys!.closed!.tr,
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
Get.toNamed(Routers.burglarAlarmPage,
|
||||
arguments: state.getKeyInfosData.value);
|
||||
}))),
|
||||
leftTitel:
|
||||
TranslationLoader.lanKeys!.burglarAlarm!.tr,
|
||||
rightTitle:
|
||||
state.getKeyInfosData.value.tamperAlert == 1
|
||||
? TranslationLoader.lanKeys!.opened!.tr
|
||||
: TranslationLoader.lanKeys!.closed!.tr,
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
Get.toNamed(Routers.burglarAlarmPage,
|
||||
arguments: state.getKeyInfosData.value);
|
||||
}))),
|
||||
SizedBox(height: 10.h),
|
||||
// 常开模式
|
||||
Obx(() => Visibility(
|
||||
visible: true,
|
||||
visible: true,
|
||||
child: CommonItem(
|
||||
leftTitel:
|
||||
TranslationLoader.lanKeys!.normallyOpenMode!.tr,
|
||||
rightTitle: state.getKeyInfosData.value.passageMode == 1
|
||||
? TranslationLoader.lanKeys!.opened!.tr
|
||||
: TranslationLoader.lanKeys!.closed!.tr,
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
Get.toNamed(Routers.normallyOpenModePage,
|
||||
arguments: state.getKeyInfosData.value);
|
||||
}))
|
||||
),
|
||||
leftTitel:
|
||||
TranslationLoader.lanKeys!.normallyOpenMode!.tr,
|
||||
rightTitle:
|
||||
state.getKeyInfosData.value.passageMode == 1
|
||||
? TranslationLoader.lanKeys!.opened!.tr
|
||||
: TranslationLoader.lanKeys!.closed!.tr,
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
Get.toNamed(Routers.normallyOpenModePage,
|
||||
arguments: state.getKeyInfosData.value);
|
||||
}))),
|
||||
// 远程开锁
|
||||
Obx(() => Visibility(
|
||||
visible:true,
|
||||
visible: true,
|
||||
child: CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.remoteUnlocking!.tr,
|
||||
rightTitle: state.getKeyInfosData.value.remoteEnable == 1
|
||||
? TranslationLoader.lanKeys!.opened!.tr
|
||||
: TranslationLoader.lanKeys!.closed!.tr,
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
Get.toNamed(Routers.remoteUnlockingPage,
|
||||
arguments: state.getKeyInfosData.value);
|
||||
}))
|
||||
),
|
||||
leftTitel:
|
||||
TranslationLoader.lanKeys!.remoteUnlocking!.tr,
|
||||
rightTitle:
|
||||
state.getKeyInfosData.value.remoteEnable == 1
|
||||
? TranslationLoader.lanKeys!.opened!.tr
|
||||
: TranslationLoader.lanKeys!.closed!.tr,
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
Get.toNamed(Routers.remoteUnlockingPage,
|
||||
arguments: state.getKeyInfosData.value);
|
||||
}))),
|
||||
// 重置键
|
||||
Obx(() => Visibility(
|
||||
visible: true,
|
||||
child: CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.resetButton!.tr,
|
||||
rightTitle: state.getKeyInfosData.value.resetButton == 1
|
||||
? TranslationLoader.lanKeys!.opened!.tr
|
||||
: TranslationLoader.lanKeys!.closed!.tr,
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
Get.toNamed(Routers.resetButtonPage,
|
||||
arguments: state.getKeyInfosData.value);
|
||||
}))
|
||||
),
|
||||
leftTitel: TranslationLoader.lanKeys!.resetButton!.tr,
|
||||
rightTitle:
|
||||
state.getKeyInfosData.value.resetButton == 1
|
||||
? TranslationLoader.lanKeys!.opened!.tr
|
||||
: TranslationLoader.lanKeys!.closed!.tr,
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
Get.toNamed(Routers.resetButtonPage,
|
||||
arguments: state.getKeyInfosData.value);
|
||||
}))),
|
||||
SizedBox(height: 10.h),
|
||||
//---田总新增展示
|
||||
// Obx(() =>
|
||||
Visibility(
|
||||
Visibility(
|
||||
visible: true,
|
||||
child: CommonItem(
|
||||
leftTitel: '面容开锁',
|
||||
rightTitle: "",
|
||||
isHaveLine: true,
|
||||
isHaveRightWidget: true,
|
||||
rightWidget:
|
||||
SizedBox(width: 60.w, child: _otherUnHaveDoneSwitch()))),
|
||||
leftTitel: '面容开锁',
|
||||
rightTitle: "",
|
||||
isHaveLine: true,
|
||||
isHaveRightWidget: true,
|
||||
rightWidget: SizedBox(
|
||||
width: 60.w, child: _otherUnHaveDoneSwitch()))),
|
||||
// ),
|
||||
// Obx(() =>
|
||||
Visibility(
|
||||
visible: true,
|
||||
child: CommonItem(
|
||||
leftTitel: '感应距离',
|
||||
rightTitle: "",
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
Toast.show(msg: "功能暂未开放");
|
||||
}
|
||||
)),
|
||||
Visibility(
|
||||
visible: true,
|
||||
child: CommonItem(
|
||||
leftTitel: '感应距离',
|
||||
rightTitle: "",
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
Toast.show(msg: "功能暂未开放");
|
||||
})),
|
||||
// ),
|
||||
// Obx(() =>
|
||||
Visibility(
|
||||
Visibility(
|
||||
visible: true,
|
||||
child: CommonItem(
|
||||
leftTitel: '自动亮屏',
|
||||
rightTitle: "",
|
||||
isHaveLine: true,
|
||||
isHaveRightWidget: true,
|
||||
rightWidget:
|
||||
SizedBox(width: 60.w, child: _otherUnHaveDoneSwitch()))),
|
||||
rightWidget: SizedBox(
|
||||
width: 60.w, child: _otherUnHaveDoneSwitch()))),
|
||||
// ),
|
||||
// Obx(() =>
|
||||
Visibility(
|
||||
Visibility(
|
||||
visible: true,
|
||||
child: CommonItem(
|
||||
leftTitel: '逗留警告',
|
||||
rightTitle: "",
|
||||
isHaveLine: true,
|
||||
isHaveRightWidget: true,
|
||||
rightWidget:
|
||||
SizedBox(width: 60.w, child: _otherUnHaveDoneSwitch()))),
|
||||
rightWidget: SizedBox(
|
||||
width: 60.w, child: _otherUnHaveDoneSwitch()))),
|
||||
// ),
|
||||
// Obx(() =>
|
||||
Visibility(
|
||||
Visibility(
|
||||
visible: true,
|
||||
child: CommonItem(
|
||||
leftTitel: '异常警告',
|
||||
rightTitle: "",
|
||||
isHaveLine: true,
|
||||
isHaveRightWidget: true,
|
||||
rightWidget:
|
||||
SizedBox(width: 60.w, child: _otherUnHaveDoneSwitch()))),
|
||||
rightWidget: SizedBox(
|
||||
width: 60.w, child: _otherUnHaveDoneSwitch()))),
|
||||
// ),
|
||||
// Obx(() =>
|
||||
Visibility(
|
||||
Visibility(
|
||||
visible: true,
|
||||
child: CommonItem(
|
||||
leftTitel: '开门方向设置',
|
||||
rightTitle: "",
|
||||
isHaveDirection: true,
|
||||
isHaveLine: true,
|
||||
leftTitel: '开门方向设置',
|
||||
rightTitle: "",
|
||||
isHaveDirection: true,
|
||||
isHaveLine: true,
|
||||
action: () {
|
||||
Toast.show(msg: "功能暂未开放");
|
||||
}
|
||||
)),
|
||||
})),
|
||||
// ),
|
||||
// Obx(() =>
|
||||
Visibility(
|
||||
Visibility(
|
||||
visible: true,
|
||||
child: CommonItem(
|
||||
leftTitel: '电机功率设置',
|
||||
@ -291,8 +313,7 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
Toast.show(msg: "功能暂未开放");
|
||||
}
|
||||
)),
|
||||
})),
|
||||
// ),
|
||||
SizedBox(height: 10.h),
|
||||
//-----新增至此
|
||||
@ -307,42 +328,41 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
|
||||
visible: true,
|
||||
child: CommonItem(
|
||||
leftTitel:
|
||||
TranslationLoader.lanKeys!.markedHouseState!.tr,
|
||||
TranslationLoader.lanKeys!.markedHouseState!.tr,
|
||||
rightTitle: title,
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
Get.toNamed(Routers.markedHouseStatePage,
|
||||
arguments: state.getKeyInfosData.value);
|
||||
})
|
||||
);
|
||||
}));
|
||||
}),
|
||||
// Obx(() =>
|
||||
Visibility(
|
||||
Visibility(
|
||||
visible: true,
|
||||
child: CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.checkingIn!.tr,
|
||||
rightTitle: "",
|
||||
isHaveLine: true,
|
||||
isHaveRightWidget: true,
|
||||
rightWidget:
|
||||
SizedBox(width: 60.w, child: _openCheckInSwitch())
|
||||
)),
|
||||
rightWidget: SizedBox(
|
||||
width: 60.w, child: _openCheckInSwitch()))),
|
||||
// ),
|
||||
// Obx(() =>
|
||||
Visibility(
|
||||
Visibility(
|
||||
visible: true,
|
||||
child: CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.unlockReminder!.tr,
|
||||
leftTitel:
|
||||
TranslationLoader.lanKeys!.unlockReminder!.tr,
|
||||
rightTitle: "",
|
||||
isHaveLine: false,
|
||||
isHaveRightWidget: true,
|
||||
rightWidget:
|
||||
SizedBox(width: 60.w, child: _lockRemindSwitch()))),
|
||||
rightWidget: SizedBox(
|
||||
width: 60.w, child: _lockRemindSwitch()))),
|
||||
// ),
|
||||
SizedBox(height: 10.h),
|
||||
// Obx(() =>
|
||||
Visibility(
|
||||
Visibility(
|
||||
visible: true,
|
||||
child: CommonItem(
|
||||
leftTitel: TranslationLoader
|
||||
@ -355,20 +375,20 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
|
||||
})),
|
||||
// ),
|
||||
// Obx(() =>
|
||||
Visibility(
|
||||
Visibility(
|
||||
visible: true,
|
||||
child: CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.lockTime!.tr,
|
||||
rightTitle: "",
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
Get.toNamed(Routers.lockTimePage,
|
||||
arguments: state.getKeyInfosData.value);
|
||||
})),
|
||||
leftTitel: TranslationLoader.lanKeys!.lockTime!.tr,
|
||||
rightTitle: "",
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
Get.toNamed(Routers.lockTimePage,
|
||||
arguments: state.getKeyInfosData.value);
|
||||
})),
|
||||
// ),
|
||||
// Obx(() =>
|
||||
Visibility(
|
||||
Visibility(
|
||||
visible: true,
|
||||
child: CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.diagnose!.tr,
|
||||
@ -381,7 +401,7 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
|
||||
})),
|
||||
// ),
|
||||
// Obx(() =>
|
||||
Visibility(
|
||||
Visibility(
|
||||
visible: true,
|
||||
child: CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.uploadData!.tr,
|
||||
@ -393,11 +413,11 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
|
||||
})),
|
||||
// ),
|
||||
// Obx(() =>
|
||||
Visibility(
|
||||
Visibility(
|
||||
visible: true,
|
||||
child: CommonItem(
|
||||
leftTitel:
|
||||
TranslationLoader.lanKeys!.importOtherLockData!.tr,
|
||||
leftTitel: TranslationLoader
|
||||
.lanKeys!.importOtherLockData!.tr,
|
||||
rightTitle: "",
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
@ -406,10 +426,11 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
|
||||
})),
|
||||
// ),
|
||||
// Obx(() =>
|
||||
Visibility(
|
||||
Visibility(
|
||||
visible: true,
|
||||
child: CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.lockEscalation!.tr,
|
||||
leftTitel:
|
||||
TranslationLoader.lanKeys!.lockEscalation!.tr,
|
||||
rightTitle: "",
|
||||
isHaveLine: false,
|
||||
isHaveDirection: true,
|
||||
@ -419,7 +440,8 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
|
||||
// ),
|
||||
SizedBox(height: 30.h),
|
||||
Container(
|
||||
padding: EdgeInsets.only(left: 20.w, right: 20.w, bottom: 30.h),
|
||||
padding:
|
||||
EdgeInsets.only(left: 20.w, right: 20.w, bottom: 30.h),
|
||||
child: SubmitBtn(
|
||||
btnName: TranslationLoader.lanKeys!.delete!.tr,
|
||||
isDelete: true,
|
||||
|
||||
@ -78,15 +78,15 @@ class _AddWirelessKeyboardPageState extends State<AddWirelessKeyboardPage> {
|
||||
SizedBox(
|
||||
height: 20.h,
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(left: 20.w, right: 20.w),
|
||||
child: SubmitBtn(
|
||||
btnName: TranslationLoader.lanKeys!.theScreenNeverFlickered!.tr,
|
||||
onClick: () {
|
||||
Navigator.pushNamed(
|
||||
context, Routers.addWirelessKeyboardScreenNotLightOnPage);
|
||||
}),
|
||||
),
|
||||
// Container(
|
||||
// margin: EdgeInsets.only(left: 20.w, right: 20.w),
|
||||
// child: SubmitBtn(
|
||||
// btnName: TranslationLoader.lanKeys!.theScreenNeverFlickered!.tr,
|
||||
// onClick: () {
|
||||
// Navigator.pushNamed(
|
||||
// context, Routers.addWirelessKeyboardScreenNotLightOnPage);
|
||||
// }),
|
||||
// ),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/tools/noData.dart';
|
||||
|
||||
import '../../../../../app_settings/app_colors.dart';
|
||||
import '../../../../../tools/titleAppBar.dart';
|
||||
@ -15,6 +16,7 @@ class SeletWirelessKeyboardPage extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _SeletWirelessKeyboardPageState extends State<SeletWirelessKeyboardPage> {
|
||||
List dataList = [];
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
@ -24,13 +26,16 @@ class _SeletWirelessKeyboardPageState extends State<SeletWirelessKeyboardPage> {
|
||||
"${TranslationLoader.lanKeys!.selet!.tr}${TranslationLoader.lanKeys!.wirelessKeyboard!.tr}",
|
||||
haveBack: true,
|
||||
backgroundColor: AppColors.mainColor),
|
||||
body: ListView.builder(
|
||||
itemCount: 20,
|
||||
itemBuilder: (c, index) {
|
||||
return nearbyLockItem('images/icon_lock.png', "MCBN01-ea9240", () {
|
||||
// Navigator.pushNamed(context, Routers.saveLockPage);
|
||||
});
|
||||
}),
|
||||
body: dataList.isEmpty
|
||||
? const NoData()
|
||||
: ListView.builder(
|
||||
itemCount: 20,
|
||||
itemBuilder: (c, index) {
|
||||
return nearbyLockItem('images/icon_lock.png', "MCBN01-ea9240",
|
||||
() {
|
||||
// Navigator.pushNamed(context, Routers.saveLockPage);
|
||||
});
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -2,6 +2,7 @@ import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/tools/noData.dart';
|
||||
|
||||
import '../../../../../appRouters.dart';
|
||||
import '../../../../../app_settings/app_colors.dart';
|
||||
@ -17,6 +18,7 @@ class WirelessKeyboardPage extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _WirelessKeyboardPageState extends State<WirelessKeyboardPage> {
|
||||
List dataList = [];
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
@ -55,14 +57,16 @@ class _WirelessKeyboardPageState extends State<WirelessKeyboardPage> {
|
||||
}
|
||||
|
||||
Widget _buildMainUI() {
|
||||
return ListView.builder(
|
||||
itemCount: 10,
|
||||
itemBuilder: (c, index) {
|
||||
return _electronicKeyItem('images/icon_password.png', "张三",
|
||||
"2023.6.21 11.15", "2023.6.21 11.15", () {
|
||||
// Navigator.pushNamed(context, Routers.electronicKeyDetailPage);
|
||||
});
|
||||
});
|
||||
return dataList.isEmpty
|
||||
? const NoData()
|
||||
: ListView.builder(
|
||||
itemCount: 10,
|
||||
itemBuilder: (c, index) {
|
||||
return _electronicKeyItem('images/icon_password.png', "张三",
|
||||
"2023.6.21 11.15", "2023.6.21 11.15", () {
|
||||
// Navigator.pushNamed(context, Routers.electronicKeyDetailPage);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Widget _electronicKeyItem(String lockTypeIcon, String lockTypeTitle,
|
||||
|
||||
@ -86,7 +86,7 @@ class _LockDetailPageState extends State<LockDetailPage> with RouteAware {
|
||||
// KeyInfos keyInfo = widget.lockMainEntity.data!.keyInfos![0];
|
||||
return Column(
|
||||
children: [
|
||||
SizedBox(height: 30.h),
|
||||
SizedBox(height: 50.h),
|
||||
Stack(
|
||||
alignment: Alignment.centerRight,
|
||||
children: [
|
||||
@ -120,7 +120,7 @@ class _LockDetailPageState extends State<LockDetailPage> with RouteAware {
|
||||
Container(
|
||||
// width: 1.sw,
|
||||
color: Colors.white,
|
||||
height: 280.w,
|
||||
height: 330.w,
|
||||
child: Stack(
|
||||
children: [
|
||||
Center(
|
||||
@ -131,8 +131,11 @@ class _LockDetailPageState extends State<LockDetailPage> with RouteAware {
|
||||
// logic.editLockUserAction();
|
||||
// logic.factoryDataResetAction();
|
||||
},
|
||||
child: Image.asset('images/main/icon_main_openLockBtn.png',
|
||||
width: 268.w, height: 268.w),
|
||||
child: Image.asset(
|
||||
'images/main/icon_main_openLockBtn.png',
|
||||
width: 330.w,
|
||||
height: 330.w,
|
||||
),
|
||||
)),
|
||||
// Visibility(
|
||||
// visible:
|
||||
@ -150,21 +153,21 @@ class _LockDetailPageState extends State<LockDetailPage> with RouteAware {
|
||||
SizedBox(
|
||||
height: 30.h,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
'门已上锁',
|
||||
style: TextStyle(
|
||||
fontSize: 26.sp,
|
||||
color: Colors.black,
|
||||
fontWeight: FontWeight.w500),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 6.h,
|
||||
),
|
||||
// Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.center,
|
||||
// children: [
|
||||
// Text(
|
||||
// '门已上锁',
|
||||
// style: TextStyle(
|
||||
// fontSize: 26.sp,
|
||||
// color: Colors.black,
|
||||
// fontWeight: FontWeight.w500),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// SizedBox(
|
||||
// height: 6.h,
|
||||
// ),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
@ -187,14 +190,15 @@ class _LockDetailPageState extends State<LockDetailPage> with RouteAware {
|
||||
'images/icon_electronicKey_admin.png',
|
||||
width: 24.w,
|
||||
height: 20.w,
|
||||
color: AppColors.mainColor, //应根据状态显示(当前角色为超级管理员 应显示蓝色图标)
|
||||
),
|
||||
SizedBox(
|
||||
width: 6.w,
|
||||
),
|
||||
Text(
|
||||
'超级管理员',
|
||||
style:
|
||||
TextStyle(fontSize: 20.sp, color: AppColors.btnDisableColor),
|
||||
style: TextStyle(
|
||||
fontSize: 20.sp, color: AppColors.darkGrayTextColor),
|
||||
),
|
||||
SizedBox(
|
||||
width: 80.w,
|
||||
@ -265,10 +269,10 @@ class _LockDetailPageState extends State<LockDetailPage> with RouteAware {
|
||||
bottomItem('images/main/icon_main_electronicKey.png',
|
||||
TranslationLoader.lanKeys!.electronicKey!.tr, () {
|
||||
Get.toNamed(Routers.electronicKeyListPage, arguments: {
|
||||
"lockMainEntity": widget.lockMainEntity,
|
||||
"keyInfo": widget.keyInfo
|
||||
});
|
||||
}),
|
||||
"lockMainEntity": widget.lockMainEntity,
|
||||
"keyInfo": widget.keyInfo
|
||||
});
|
||||
}),
|
||||
|
||||
// 密码
|
||||
bottomItem('images/main/icon_main_password.png',
|
||||
@ -280,28 +284,24 @@ class _LockDetailPageState extends State<LockDetailPage> with RouteAware {
|
||||
}),
|
||||
|
||||
// ic卡
|
||||
bottomItem('images/main/icon_main_icCard.png', TranslationLoader.lanKeys!.card!.tr, () {
|
||||
Get.toNamed(Routers.otherTypeKeyListPage, arguments: {
|
||||
"lockId": widget.keyInfo.lockId,
|
||||
"fromType": 0
|
||||
});
|
||||
}),
|
||||
bottomItem('images/main/icon_main_icCard.png',
|
||||
TranslationLoader.lanKeys!.card!.tr, () {
|
||||
Get.toNamed(Routers.otherTypeKeyListPage,
|
||||
arguments: {"lockId": widget.keyInfo.lockId, "fromType": 0});
|
||||
}),
|
||||
|
||||
// 指纹
|
||||
bottomItem('images/main/icon_main_fingerprint.png', TranslationLoader.lanKeys!.fingerprint!.tr, () {
|
||||
Get.toNamed(Routers.otherTypeKeyListPage, arguments: {
|
||||
"lockId": widget.keyInfo.lockId,
|
||||
"fromType": 1
|
||||
});
|
||||
bottomItem('images/main/icon_main_fingerprint.png',
|
||||
TranslationLoader.lanKeys!.fingerprint!.tr, () {
|
||||
Get.toNamed(Routers.otherTypeKeyListPage,
|
||||
arguments: {"lockId": widget.keyInfo.lockId, "fromType": 1});
|
||||
}),
|
||||
|
||||
// 遥控
|
||||
bottomItem('images/main/icon_main_remoteControl.png', TranslationLoader.lanKeys!.remoteControl!.tr, () {
|
||||
// Get.toNamed(Routers.otherTypeKeyListPage, arguments: {
|
||||
// "lockId": widget.keyInfo.lockId,
|
||||
// "fromType": 2
|
||||
// });
|
||||
Toast.show(msg: "功能暂未开放");
|
||||
bottomItem('images/main/icon_main_remoteControl.png',
|
||||
TranslationLoader.lanKeys!.remoteControl!.tr, () {
|
||||
Get.toNamed(Routers.otherTypeKeyListPage,
|
||||
arguments: {"lockId": widget.keyInfo.lockId, "fromType": 2});
|
||||
}),
|
||||
];
|
||||
showWidgetArr.addAll(defaultWidgetArr);
|
||||
@ -345,7 +345,7 @@ class _LockDetailPageState extends State<LockDetailPage> with RouteAware {
|
||||
bottomItem(
|
||||
'images/main/icon_main_set.png', TranslationLoader.lanKeys!.set!.tr,
|
||||
() {
|
||||
BlueManage().stopScan();
|
||||
BlueManage().stopScan();
|
||||
Get.toNamed(Routers.lockSetPage, arguments: widget.keyInfo);
|
||||
}),
|
||||
];
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:get/get.dart';
|
||||
@ -13,19 +12,19 @@ class OtherTypeAddKeyLogic extends BaseGetXController {
|
||||
OtherTypeAddKeyState state = OtherTypeAddKeyState();
|
||||
|
||||
// 添加指纹
|
||||
void addFingerprintsData() async{
|
||||
var fingerprintType = 0;// 永久:1;限时2,单次3,循环:4
|
||||
void addFingerprintsData() async {
|
||||
var fingerprintType = 0; // 永久:1;限时2,单次3,循环:4
|
||||
var startDate = "";
|
||||
var endDate = "";
|
||||
if(state.seletType.value == "0"){
|
||||
if (state.seletType.value == "0") {
|
||||
fingerprintType = 1;
|
||||
}else if(state.seletType.value == "1"){
|
||||
} else if (state.seletType.value == "1") {
|
||||
fingerprintType = 2;
|
||||
if(state.beginTimeTimestamp.value.isEmpty){
|
||||
if (state.beginTimeTimestamp.value.isEmpty) {
|
||||
Toast.show(msg: "请选择开始时间");
|
||||
return;
|
||||
}
|
||||
if(state.endTimeTimestamp.value.isEmpty){
|
||||
if (state.endTimeTimestamp.value.isEmpty) {
|
||||
Toast.show(msg: "请选择开始时间");
|
||||
return;
|
||||
}
|
||||
@ -35,25 +34,27 @@ class OtherTypeAddKeyLogic extends BaseGetXController {
|
||||
// return;
|
||||
// }
|
||||
|
||||
print("fasdfasdfasdf:${int.parse(state.beginTimeTimestamp.value)} == ${int.parse(state.endTimeTimestamp.value)}");
|
||||
if(int.parse(state.beginTimeTimestamp.value) >= int.parse(state.endTimeTimestamp.value)){
|
||||
print(
|
||||
"fasdfasdfasdf:${int.parse(state.beginTimeTimestamp.value)} == ${int.parse(state.endTimeTimestamp.value)}");
|
||||
if (int.parse(state.beginTimeTimestamp.value) >=
|
||||
int.parse(state.endTimeTimestamp.value)) {
|
||||
Toast.show(msg: "失效时间要大于生效时间");
|
||||
return;
|
||||
}
|
||||
|
||||
startDate = state.beginTimeTimestamp.value;
|
||||
endDate = state.endTimeTimestamp.value;
|
||||
}else if(state.seletType.value == "2"){
|
||||
if(state.effectiveDateTime.value <= 0){
|
||||
} else if (state.seletType.value == "2") {
|
||||
if (state.effectiveDateTime.value <= 0) {
|
||||
Toast.show(msg: "请选择生效时间");
|
||||
return;
|
||||
}
|
||||
if(state.failureDateTime.value <= 0){
|
||||
if (state.failureDateTime.value <= 0) {
|
||||
Toast.show(msg: "请选择失效时间");
|
||||
return;
|
||||
}
|
||||
|
||||
if(state.weekdaysList.value.isEmpty){
|
||||
if (state.weekdaysList.value.isEmpty) {
|
||||
Toast.show(msg: "请选择有效日");
|
||||
return;
|
||||
}
|
||||
@ -63,7 +64,7 @@ class OtherTypeAddKeyLogic extends BaseGetXController {
|
||||
// return;
|
||||
// }
|
||||
|
||||
if(state.effectiveDateTime.value >= state.failureDateTime.value){
|
||||
if (state.effectiveDateTime.value >= state.failureDateTime.value) {
|
||||
Toast.show(msg: "失效时间要大于生效时间");
|
||||
return;
|
||||
}
|
||||
@ -81,7 +82,8 @@ class OtherTypeAddKeyLogic extends BaseGetXController {
|
||||
"endDate": endDate,
|
||||
"addType": "1",
|
||||
"cardName": state.nameController.text,
|
||||
"cardNumber": (Random().nextInt(100000000) + 10000000).floor().toString(),
|
||||
"cardNumber":
|
||||
(Random().nextInt(100000000) + 10000000).floor().toString(),
|
||||
"cardType": fingerprintType.toString(),
|
||||
"isCoerced": state.isStressFingerprint.value ? "1" : "2",
|
||||
"startDate": startDate,
|
||||
@ -108,6 +110,20 @@ class OtherTypeAddKeyLogic extends BaseGetXController {
|
||||
break;
|
||||
case 1:
|
||||
// 指纹
|
||||
Get.toNamed(Routers.addFingerprintPage, arguments: {
|
||||
"lockId": state.lockId.value,
|
||||
"endDate": endDate,
|
||||
"addType": "1",
|
||||
"fingerprintName": state.nameController.text,
|
||||
"fingerprintNumber": "123456",
|
||||
"fingerprintType": fingerprintType.toString(),
|
||||
"isCoerced": state.isStressFingerprint.value ? "1" : "2",
|
||||
"startDate": startDate,
|
||||
"weekDay": state.weekdaysList.value,
|
||||
"fromType": state.fromType.value,
|
||||
});
|
||||
|
||||
/* 根据田总需求 无需tips页面 直接跳转到添加页面
|
||||
Get.toNamed(Routers.addFingerprintTipPage, arguments: {
|
||||
"lockId": state.lockId.value,
|
||||
"endDate": endDate,
|
||||
@ -120,6 +136,7 @@ class OtherTypeAddKeyLogic extends BaseGetXController {
|
||||
"weekDay": state.weekdaysList.value,
|
||||
"fromType": state.fromType.value,
|
||||
});
|
||||
*/
|
||||
|
||||
// var entity = await ApiRepository.to.addFingerprintsData(
|
||||
// lockId: state.lockId.value.toString(),
|
||||
@ -138,34 +155,28 @@ class OtherTypeAddKeyLogic extends BaseGetXController {
|
||||
// }
|
||||
break;
|
||||
case 2:
|
||||
// 遥控
|
||||
// 遥控
|
||||
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
// TODO: implement onReady
|
||||
super.onReady();
|
||||
|
||||
|
||||
}
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
// TODO: implement onInit
|
||||
super.onInit();
|
||||
|
||||
}
|
||||
|
||||
@override
|
||||
void onClose() {
|
||||
// TODO: implement onClose
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
import 'package:date_format/date_format.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/main/lockDetail/passwordKey/passwordKeyList/passwordKeyListEntity.dart';
|
||||
@ -26,6 +28,7 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage> {
|
||||
PasswordKeyListItem itemData = PasswordKeyListItem();
|
||||
late TextEditingController _inputPwdController;
|
||||
late TextEditingController _inputNameController;
|
||||
static const methodChannel = MethodChannel('flutter_native_ios');
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
@ -33,42 +36,14 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage> {
|
||||
|
||||
_inputPwdController = TextEditingController();
|
||||
_inputNameController = TextEditingController();
|
||||
|
||||
// _initFluwx();
|
||||
}
|
||||
|
||||
// _initFluwx() async {
|
||||
// await registerWxApi(
|
||||
// appId: "", doOnAndroid: true, doOnIOS: true, universalLink: "");
|
||||
// }
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
dynamic obj = ModalRoute.of(context)?.settings.arguments;
|
||||
if (obj != null && (obj["itemData"] != null)) {
|
||||
itemData = obj["itemData"];
|
||||
}
|
||||
List<String> nameItems = <String>[
|
||||
'微信',
|
||||
'朋友圈',
|
||||
'QQ',
|
||||
'QQ空间',
|
||||
'微博',
|
||||
'FaceBook',
|
||||
'邮件',
|
||||
'链接'
|
||||
];
|
||||
List<String> urlItems = <String>[
|
||||
'icon_wechat.png',
|
||||
'icon_wechat_moments.png',
|
||||
'icon_qq.png',
|
||||
'icon_qzone.png',
|
||||
'icon_sina.png',
|
||||
'icon_facebook.png',
|
||||
'icon_email.png',
|
||||
'icon_copylink.png'
|
||||
];
|
||||
|
||||
return Scaffold(
|
||||
backgroundColor: AppColors.mainBackgroundColor,
|
||||
appBar: TitleAppBar(
|
||||
@ -83,29 +58,7 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage> {
|
||||
width: 30.w,
|
||||
),
|
||||
onPressed: () {
|
||||
/*
|
||||
showModalBottomSheet(
|
||||
context: context,
|
||||
isScrollControlled: true,
|
||||
builder: (context) {
|
||||
return Container(
|
||||
decoration: const BoxDecoration(
|
||||
color: Colors.white,
|
||||
),
|
||||
constraints: const BoxConstraints(maxHeight: 700),
|
||||
child: Row(
|
||||
children: [
|
||||
Image.asset(
|
||||
'images/icon_wechat.png',
|
||||
width: 50.0,
|
||||
height: 50.0,
|
||||
fit: BoxFit.fill,
|
||||
)
|
||||
],
|
||||
),
|
||||
); //设置maxHeight为你想要的数字就行
|
||||
});
|
||||
*/
|
||||
_openModalBottomSheet();
|
||||
},
|
||||
),
|
||||
],
|
||||
@ -371,91 +324,124 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _shareWidget(BuildContext context) {
|
||||
List<String> nameItems = <String>[
|
||||
'微信',
|
||||
'朋友圈',
|
||||
'QQ',
|
||||
'QQ空间',
|
||||
'微博',
|
||||
'FaceBook',
|
||||
'邮件',
|
||||
'链接'
|
||||
];
|
||||
List<String> urlItems = <String>[
|
||||
'icon_wechat.png',
|
||||
'icon_wechat_moments.png',
|
||||
'icon_qq.png',
|
||||
'icon_qzone.png',
|
||||
'icon_sina.png',
|
||||
'icon_facebook.png',
|
||||
'icon_email.png',
|
||||
'icon_copylink.png'
|
||||
];
|
||||
|
||||
return Container(
|
||||
color: Colors.red,
|
||||
height: 250.0,
|
||||
child: GridView.builder(
|
||||
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 4, mainAxisSpacing: 5.0, childAspectRatio: 1.0),
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return Image.asset(
|
||||
'images/${urlItems[index]}',
|
||||
width: 50.0,
|
||||
height: 50.0,
|
||||
fit: BoxFit.fill,
|
||||
);
|
||||
},
|
||||
itemCount: nameItems.length,
|
||||
),
|
||||
/*
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(0.0, 10.0, 0.0, 0.0),
|
||||
child: SizedBox(
|
||||
height: 190.0,
|
||||
child: GridView.builder(
|
||||
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 4,
|
||||
mainAxisSpacing: 5.0,
|
||||
childAspectRatio: 1.0),
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return Column(
|
||||
children: <Widget>[
|
||||
Padding(
|
||||
padding:
|
||||
const EdgeInsets.fromLTRB(0.0, 6.0, 0.0, 6.0),
|
||||
child: Image.asset(
|
||||
'images/${urlItems[index]}',
|
||||
width: 50.0,
|
||||
height: 50.0,
|
||||
fit: BoxFit.fill,
|
||||
)),
|
||||
Text(nameItems[index])
|
||||
],
|
||||
);
|
||||
},
|
||||
itemCount: nameItems.length,
|
||||
Future _openModalBottomSheet() async {
|
||||
showModalBottomSheet(
|
||||
context: context,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadiusDirectional.circular(10)),
|
||||
constraints: BoxConstraints(maxHeight: 260.h),
|
||||
builder: (BuildContext context) {
|
||||
return Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: ScreenUtil().screenWidth,
|
||||
height: 180.h,
|
||||
child: ListView(
|
||||
scrollDirection: Axis.horizontal, //横向滚动
|
||||
children: initBottomSheetList()),
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
height: 0.5,
|
||||
color: Colors.blueGrey,
|
||||
),
|
||||
const Center(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.fromLTRB(0.0, 8.0, 0.0, 8.0),
|
||||
Container(
|
||||
height: 8.h,
|
||||
color: AppColors.greyBackgroundColor,
|
||||
),
|
||||
TextButton(
|
||||
style: ButtonStyle(
|
||||
overlayColor:
|
||||
MaterialStateProperty.all<Color>(Colors.white)),
|
||||
child: Text(
|
||||
'取 消',
|
||||
style: TextStyle(fontSize: 18.0, color: Colors.blueGrey),
|
||||
)),
|
||||
)
|
||||
],
|
||||
'取消',
|
||||
style: TextStyle(
|
||||
color: Colors.black, fontSize: ScreenUtil().setSp(24)),
|
||||
),
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
)
|
||||
],
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
List<Widget> initBottomSheetList() {
|
||||
List<Widget> widgetList = [];
|
||||
|
||||
widgetList.add(buildCenter3('images/icon_wechat.png', '微信好友', 0));
|
||||
widgetList.add(buildCenter3('images/icon_message.png', '短信', 1));
|
||||
widgetList.add(buildCenter3('images/icon_email.png', '邮件', 2));
|
||||
widgetList.add(buildCenter3('images/icon_more.png', '更多', 3));
|
||||
|
||||
return widgetList;
|
||||
}
|
||||
|
||||
GestureDetector buildCenter3(
|
||||
String imageName, String titleStr, int itemIndex) {
|
||||
return GestureDetector(
|
||||
child: Container(
|
||||
width: 120.w,
|
||||
// height: 64.h,
|
||||
margin:
|
||||
EdgeInsets.only(top: 20.w, bottom: 20.w, left: 10.w, right: 10.w),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Image.asset(
|
||||
imageName,
|
||||
width: 50.w,
|
||||
height: 50.h,
|
||||
),
|
||||
SizedBox(
|
||||
height: 16.w,
|
||||
),
|
||||
Text(
|
||||
titleStr,
|
||||
style: TextStyle(
|
||||
fontSize: ScreenUtil().setSp(20), color: Colors.black),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
*/
|
||||
onTap: () => _jumpSmartDeviceRoute(itemIndex),
|
||||
);
|
||||
}
|
||||
|
||||
_jumpSmartDeviceRoute(int itemIndex) {
|
||||
switch (itemIndex) {
|
||||
case 0:
|
||||
//微信好友
|
||||
{
|
||||
String pwdShareStr =
|
||||
'您好,您的密码是:${itemData.keyboardPwd}\n生效时间:${itemData.startDate}\n类型:永久\n锁名:${itemData.keyboardPwdName}';
|
||||
tokNative('flutter_sharePassword_to_ios',
|
||||
arguments: {'pwdShareStr': pwdShareStr}).then((result) {
|
||||
print('$result');
|
||||
});
|
||||
print('与原生交互');
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
//短信
|
||||
{}
|
||||
break;
|
||||
case 2:
|
||||
//邮件
|
||||
{
|
||||
Navigator.pushNamed(context, Routers.sendEmailNotificationPage);
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
//更多
|
||||
{}
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
|
||||
static Future<dynamic> tokNative(String method,
|
||||
{required Map arguments}) async {
|
||||
if (arguments == null) {
|
||||
return await methodChannel.invokeMethod(method);
|
||||
} else {
|
||||
return await methodChannel.invokeMethod(method, arguments);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,11 +1,13 @@
|
||||
import 'package:date_format/date_format.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_pickers/pickers.dart';
|
||||
import 'package:flutter_pickers/style/default_style.dart';
|
||||
import 'package:flutter_pickers/time_picker/model/date_mode.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/app_settings/app_colors.dart';
|
||||
import 'package:star_lock/main/lockDetail/passwordKey/passwordKey_perpetual/passwordKey_perpetual_logic.dart';
|
||||
import 'package:star_lock/main/lockMian/entity/lockInfoEntity.dart';
|
||||
import 'package:star_lock/network/api_repository.dart';
|
||||
@ -37,6 +39,7 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> {
|
||||
final TextEditingController _nameController = TextEditingController();
|
||||
final TextEditingController _pwdController = TextEditingController();
|
||||
final logic = Get.put(PasswordKeyPerpetualLogic());
|
||||
static const methodChannel = MethodChannel('flutter_native_ios');
|
||||
|
||||
late bool _isSendSuccess; //是否发送成功
|
||||
late bool _isPermanent; //是否永久
|
||||
@ -581,7 +584,7 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> {
|
||||
OutLineBtn(
|
||||
btnName: '分享',
|
||||
onClick: () {
|
||||
Navigator.pushNamed(context, Routers.sendEmailNotificationPage);
|
||||
_openModalBottomSheet();
|
||||
},
|
||||
),
|
||||
SizedBox(
|
||||
@ -644,4 +647,125 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> {
|
||||
String intToStr(int v) {
|
||||
return (v < 10) ? "0$v" : "$v";
|
||||
}
|
||||
|
||||
Future _openModalBottomSheet() async {
|
||||
showModalBottomSheet(
|
||||
context: context,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadiusDirectional.circular(10)),
|
||||
constraints: BoxConstraints(maxHeight: 260.h),
|
||||
builder: (BuildContext context) {
|
||||
return Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: ScreenUtil().screenWidth,
|
||||
height: 180.h,
|
||||
child: ListView(
|
||||
scrollDirection: Axis.horizontal, //横向滚动
|
||||
children: initBottomSheetList()),
|
||||
),
|
||||
Container(
|
||||
height: 8.h,
|
||||
color: AppColors.greyBackgroundColor,
|
||||
),
|
||||
TextButton(
|
||||
style: ButtonStyle(
|
||||
overlayColor:
|
||||
MaterialStateProperty.all<Color>(Colors.white)),
|
||||
child: Text(
|
||||
'取消',
|
||||
style: TextStyle(
|
||||
color: Colors.black, fontSize: ScreenUtil().setSp(24)),
|
||||
),
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
},
|
||||
)
|
||||
],
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
List<Widget> initBottomSheetList() {
|
||||
List<Widget> widgetList = [];
|
||||
|
||||
widgetList.add(buildCenter3('images/icon_wechat.png', '微信好友', 0));
|
||||
widgetList.add(buildCenter3('images/icon_message.png', '短信', 1));
|
||||
widgetList.add(buildCenter3('images/icon_email.png', '邮件', 2));
|
||||
widgetList.add(buildCenter3('images/icon_more.png', '更多', 3));
|
||||
|
||||
return widgetList;
|
||||
}
|
||||
|
||||
GestureDetector buildCenter3(
|
||||
String imageName, String titleStr, int itemIndex) {
|
||||
return GestureDetector(
|
||||
child: Container(
|
||||
width: 120.w,
|
||||
// height: 64.h,
|
||||
margin:
|
||||
EdgeInsets.only(top: 20.w, bottom: 20.w, left: 10.w, right: 10.w),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Image.asset(
|
||||
imageName,
|
||||
width: 50.w,
|
||||
height: 50.h,
|
||||
),
|
||||
SizedBox(
|
||||
height: 16.w,
|
||||
),
|
||||
Text(
|
||||
titleStr,
|
||||
style: TextStyle(
|
||||
fontSize: ScreenUtil().setSp(20), color: Colors.black),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
onTap: () => _jumpSmartDeviceRoute(itemIndex),
|
||||
);
|
||||
}
|
||||
|
||||
//\n生效时间:${itemData.startDate}\n类型:永久\n锁名:${itemData.keyboardPwdName}
|
||||
_jumpSmartDeviceRoute(int itemIndex) {
|
||||
switch (itemIndex) {
|
||||
case 0:
|
||||
//微信好友
|
||||
{
|
||||
String pwdShareStr = '您好,您的密码是:$_getPwdStr';
|
||||
tokNative('flutter_sharePassword_to_ios',
|
||||
arguments: {'pwdShareStr': pwdShareStr}).then((result) {
|
||||
print('$result');
|
||||
});
|
||||
print('与原生交互');
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
//短信
|
||||
{}
|
||||
break;
|
||||
case 2:
|
||||
//邮件
|
||||
{
|
||||
Navigator.pushNamed(context, Routers.sendEmailNotificationPage);
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
//更多
|
||||
{}
|
||||
break;
|
||||
default:
|
||||
}
|
||||
}
|
||||
|
||||
static Future<dynamic> tokNative(String method,
|
||||
{required Map arguments}) async {
|
||||
if (arguments == null) {
|
||||
return await methodChannel.invokeMethod(method);
|
||||
} else {
|
||||
return await methodChannel.invokeMethod(method, arguments);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/app_settings/app_colors.dart';
|
||||
import 'package:star_lock/tools/submitBtn.dart';
|
||||
|
||||
import '../../../appRouters.dart';
|
||||
import '../../../baseWidget.dart';
|
||||
@ -97,7 +98,7 @@ class _StarLockMainPageState extends State<StarLockMainPage> with BaseWidget {
|
||||
|
||||
Widget unHaveData() {
|
||||
return Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
// mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
@ -105,6 +106,7 @@ class _StarLockMainPageState extends State<StarLockMainPage> with BaseWidget {
|
||||
Container(
|
||||
width: 330.w,
|
||||
height: 330.w,
|
||||
margin: EdgeInsets.only(top: 180.h),
|
||||
// decoration: BoxDecoration(
|
||||
// border: Border.all(width: 4.w, color: AppColors.mainColor),
|
||||
// borderRadius: BorderRadius.circular(110.w),
|
||||
@ -131,11 +133,8 @@ class _StarLockMainPageState extends State<StarLockMainPage> with BaseWidget {
|
||||
)),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: h(50.h),
|
||||
),
|
||||
Container(
|
||||
padding: EdgeInsets.all(30.w),
|
||||
padding: EdgeInsets.only(top: 10.h),
|
||||
child: Text(
|
||||
TranslationLoader
|
||||
.lanKeys!.whenAddingLockThePhoneMustBeNextToTheLock!.tr,
|
||||
@ -143,7 +142,11 @@ class _StarLockMainPageState extends State<StarLockMainPage> with BaseWidget {
|
||||
fontSize: 26.sp,
|
||||
// fontWeight: FontWeight.w800,
|
||||
color: Colors.black),
|
||||
))
|
||||
)),
|
||||
SizedBox(
|
||||
height: 200.h,
|
||||
),
|
||||
SubmitBtn(btnName: '演示模式')
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
@ -12,10 +12,14 @@ import '../../translations/trans_lib.dart';
|
||||
// 网页的宏定义网址
|
||||
class XSWebviewURLMacro {
|
||||
static const baseWebURL = 'https://pre.lock.star-lock.cn:8093'; //baseURL
|
||||
static const userAgreementURL =
|
||||
'$baseWebURL/page/detail?pageId=1&lang=cn'; //1用户协议
|
||||
static const privacyPolicyURL =
|
||||
'$baseWebURL/page/detail?pageId=2&lang=cn'; //2隐私政策
|
||||
static const userAgreementURL = '$baseWebURL/app/userAgreement'; //用户协议
|
||||
static const privacyPolicyURL = '$baseWebURL/app/privacy'; //隐私政策
|
||||
static const collectionListURL =
|
||||
'$baseWebURL/app/personalInformationCollectionList'; //个人信息收集清单
|
||||
static const thirdPartyInfShareListURL =
|
||||
'$baseWebURL/app/thirdPartyInformationSharingList'; //第三方信息共享清单
|
||||
static const appPermissionDescURL =
|
||||
'$baseWebURL/app/applicationPermissionDescription'; //应用权限说明
|
||||
}
|
||||
|
||||
class AbountPage extends StatefulWidget {
|
||||
@ -66,7 +70,11 @@ class _AbountPageState extends State<AbountPage> {
|
||||
isHaveLine: false,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
Toast.show(msg: "功能暂未开放");
|
||||
Navigator.pushNamed(context, Routers.webviewShowPage,
|
||||
arguments: {
|
||||
"url": XSWebviewURLMacro.userAgreementURL,
|
||||
"title": '介绍'
|
||||
});
|
||||
}),
|
||||
Divider(
|
||||
height: 1,
|
||||
@ -117,7 +125,11 @@ class _AbountPageState extends State<AbountPage> {
|
||||
isHaveLine: false,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
Toast.show(msg: "功能暂未开放");
|
||||
Navigator.pushNamed(context, Routers.webviewShowPage,
|
||||
arguments: {
|
||||
"url": XSWebviewURLMacro.collectionListURL,
|
||||
"title": '个人信息收集清单'
|
||||
});
|
||||
}),
|
||||
Divider(
|
||||
height: 1,
|
||||
@ -132,7 +144,11 @@ class _AbountPageState extends State<AbountPage> {
|
||||
isHaveLine: false,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
Toast.show(msg: "功能暂未开放");
|
||||
Navigator.pushNamed(context, Routers.webviewShowPage,
|
||||
arguments: {
|
||||
"url": XSWebviewURLMacro.appPermissionDescURL,
|
||||
"title": '应用权限说明'
|
||||
});
|
||||
}),
|
||||
Divider(
|
||||
height: 1,
|
||||
@ -147,7 +163,11 @@ class _AbountPageState extends State<AbountPage> {
|
||||
isHaveLine: false,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
Toast.show(msg: "功能暂未开放");
|
||||
Navigator.pushNamed(context, Routers.webviewShowPage,
|
||||
arguments: {
|
||||
"url": XSWebviewURLMacro.thirdPartyInfShareListURL,
|
||||
"title": '第三方信息共享清单'
|
||||
});
|
||||
}),
|
||||
],
|
||||
),
|
||||
|
||||
23
star_lock/lib/mine/addLock/addLock/addLock_logic.dart
Normal file
@ -0,0 +1,23 @@
|
||||
import 'package:star_lock/mine/addLock/addLock/addLock_state.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
|
||||
class AddLockLogic extends BaseGetXController {
|
||||
final AddLockState state = AddLockState();
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
// TODO: implement onReady
|
||||
super.onReady();
|
||||
}
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
// TODO: implement onInit
|
||||
super.onInit();
|
||||
}
|
||||
|
||||
@override
|
||||
void onClose() {
|
||||
// TODO: implement onClose
|
||||
}
|
||||
}
|
||||
@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:permission_handler/permission_handler.dart';
|
||||
import 'package:star_lock/mine/addLock/addLock/addLock_logic.dart';
|
||||
|
||||
import '../../../appRouters.dart';
|
||||
import '../../../app_settings/app_colors.dart';
|
||||
@ -20,6 +21,9 @@ class AddLockPage extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _AddLockPageState extends State<AddLockPage> with BaseWidget {
|
||||
final logic = Get.put(AddLockLogic());
|
||||
final state = Get.find<AddLockLogic>().state;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
@ -49,11 +53,11 @@ class _AddLockPageState extends State<AddLockPage> with BaseWidget {
|
||||
SizedBox(
|
||||
height: 120.h,
|
||||
),
|
||||
Image.asset(
|
||||
'images/lockType/addLock_touchScreen.png',
|
||||
width: 278.w,
|
||||
height: 278.w,
|
||||
),
|
||||
Obx(() => Image.asset(
|
||||
state.lockTypeImg.value,
|
||||
width: 278.w,
|
||||
height: 278.w,
|
||||
)),
|
||||
SizedBox(
|
||||
height: 120.h,
|
||||
),
|
||||
@ -73,17 +77,16 @@ class _AddLockPageState extends State<AddLockPage> with BaseWidget {
|
||||
btnName: TranslationLoader.lanKeys!.next!.tr,
|
||||
borderRadius: 20.w,
|
||||
onClick: () {
|
||||
if(Platform.isIOS){
|
||||
if (Platform.isIOS) {
|
||||
Navigator.pushNamed(context, Routers.nearbyLockPage);
|
||||
}else {
|
||||
getMicrophonePermission()
|
||||
.then((value) {
|
||||
} else {
|
||||
getMicrophonePermission().then((value) {
|
||||
if (value) {
|
||||
// 有权限
|
||||
Navigator.pushNamed(context, Routers.nearbyLockPage);
|
||||
}else{
|
||||
} else {
|
||||
//没有权限
|
||||
openAppSettings();//打开app系统设置
|
||||
openAppSettings(); //打开app系统设置
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
29
star_lock/lib/mine/addLock/addLock/addLock_state.dart
Normal file
@ -0,0 +1,29 @@
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class AddLockState {
|
||||
var getLockType = 1.obs; //0-所有锁;1-门锁;2-NFC无源锁;3-挂锁;4-保险箱锁;5-车位锁;6-智能门禁;7-网关
|
||||
var lockTypeImg = 'images/lockType/addLock_touchScreen.png'.obs; //不同类型锁图片更换
|
||||
|
||||
AddLockState() {
|
||||
Map map = Get.arguments;
|
||||
if (map.isNotEmpty) {
|
||||
if (map["getLockType"] != null) {
|
||||
getLockType.value = map["getLockType"];
|
||||
//保险箱锁
|
||||
if (getLockType.value == 4) {
|
||||
lockTypeImg.value = "images/lockType/addLock_safeBg.png";
|
||||
} else if (getLockType.value == 5) {
|
||||
//车位锁
|
||||
lockTypeImg.value = "images/lockType/addLock_parkingBg.png";
|
||||
} else if (getLockType.value == 6) {
|
||||
//智能门禁
|
||||
lockTypeImg.value = "images/lockType/addLock_entranceGuardBg.png";
|
||||
}
|
||||
} else {
|
||||
lockTypeImg.value = 'images/lockType/addLock_touchScreen.png';
|
||||
}
|
||||
} else {
|
||||
lockTypeImg.value = 'images/lockType/addLock_touchScreen.png';
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,6 +1,9 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:permission_handler/permission_handler.dart';
|
||||
|
||||
import '../../../appRouters.dart';
|
||||
import '../../../app_settings/app_colors.dart';
|
||||
@ -40,33 +43,34 @@ class _SeletLockTypePageState extends State<SeletLockTypePage> with BaseWidget {
|
||||
children: [
|
||||
lockTypeItem('images/lockType/lockType_doorLock.png',
|
||||
TranslationLoader.lanKeys!.doorLock!.tr, () {
|
||||
Navigator.pushNamed(context, Routers.addLockPage);
|
||||
Navigator.pushNamed(context, Routers.addLockPage,
|
||||
arguments: {'getLockType': 1});
|
||||
}),
|
||||
lockTypeItem('images/lockType/lockType_NFCLock.png',
|
||||
TranslationLoader.lanKeys!.NFCPassiveLock!.tr, () {
|
||||
// Navigator.pushNamed(context, Routers.addLockPage);
|
||||
Toast.show(msg: "功能暂未开放");
|
||||
getNearByLimits();
|
||||
}),
|
||||
lockTypeItem('images/lockType/lockType_padlock.png',
|
||||
TranslationLoader.lanKeys!.padlock!.tr, () {
|
||||
// Navigator.pushNamed(context, Routers.addLockPage);
|
||||
Toast.show(msg: "功能暂未开放");
|
||||
getNearByLimits();
|
||||
}),
|
||||
lockTypeItem('images/lockType/lockType_safeLock.png',
|
||||
TranslationLoader.lanKeys!.safeLock!.tr, () {
|
||||
// Navigator.pushNamed(context, Routers.addLockPage);
|
||||
Toast.show(msg: "功能暂未开放");
|
||||
Navigator.pushNamed(context, Routers.addLockPage,
|
||||
arguments: {'getLockType': 4});
|
||||
}),
|
||||
lockTypeItem('images/lockType/lockType_parkingLock.png',
|
||||
TranslationLoader.lanKeys!.parkingLock!.tr, () {
|
||||
// Navigator.pushNamed(context, Routers.addLockPage);
|
||||
Toast.show(msg: "功能暂未开放");
|
||||
Navigator.pushNamed(context, Routers.addLockPage,
|
||||
arguments: {'getLockType': 5});
|
||||
}),
|
||||
lockTypeItem('images/lockType/lockType_entranceGuardLock.png',
|
||||
TranslationLoader.lanKeys!.itelligentAccessControl!.tr,
|
||||
() {
|
||||
// Navigator.pushNamed(context, Routers.addLockPage);
|
||||
Toast.show(msg: "功能暂未开放");
|
||||
Navigator.pushNamed(context, Routers.addLockPage,
|
||||
arguments: {'getLockType': 6});
|
||||
}),
|
||||
|
||||
// lockTypeItem('images/lockType/lockType_bicycleLock.png',
|
||||
@ -76,7 +80,7 @@ class _SeletLockTypePageState extends State<SeletLockTypePage> with BaseWidget {
|
||||
lockTypeItem('images/lockType/lockType_gatewayLock.png',
|
||||
TranslationLoader.lanKeys!.gateway!.tr, () {
|
||||
// Navigator.pushNamed(context, Routers.gatewayListPage);
|
||||
Toast.show(msg: "功能暂未开放");
|
||||
getNearByLimits();
|
||||
}),
|
||||
],
|
||||
),
|
||||
@ -90,7 +94,8 @@ class _SeletLockTypePageState extends State<SeletLockTypePage> with BaseWidget {
|
||||
Widget allLock() {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
Navigator.pushNamed(context, Routers.addLockPage);
|
||||
Navigator.pushNamed(context, Routers.addLockPage,
|
||||
arguments: {'getLockType': 0});
|
||||
},
|
||||
child: Container(
|
||||
height: 150.h,
|
||||
@ -174,6 +179,41 @@ class _SeletLockTypePageState extends State<SeletLockTypePage> with BaseWidget {
|
||||
);
|
||||
}
|
||||
|
||||
//跳转到附近的锁页面先判断权限
|
||||
void getNearByLimits() {
|
||||
if (Platform.isIOS) {
|
||||
Navigator.pushNamed(context, Routers.nearbyLockPage);
|
||||
} else {
|
||||
getMicrophonePermission().then((value) {
|
||||
if (value) {
|
||||
// 有权限
|
||||
Navigator.pushNamed(context, Routers.nearbyLockPage);
|
||||
} else {
|
||||
//没有权限
|
||||
openAppSettings(); //打开app系统设置
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
///请求权限
|
||||
Future<bool> getMicrophonePermission() async {
|
||||
// You can request multiple permissions at once.
|
||||
Map<Permission, PermissionStatus> statuses = await [
|
||||
Permission.bluetoothScan,
|
||||
Permission.bluetoothConnect,
|
||||
Permission.location,
|
||||
].request();
|
||||
|
||||
//granted 通过,denied 被拒绝,permanentlyDenied 拒绝且不在提示
|
||||
if (statuses[Permission.bluetoothScan]!.isGranted &&
|
||||
statuses[Permission.bluetoothConnect]!.isGranted &&
|
||||
statuses[Permission.location]!.isGranted) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void onShow() {}
|
||||
|
||||
void onHide() {}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/tools/noData.dart';
|
||||
|
||||
import '../../appRouters.dart';
|
||||
import '../../app_settings/app_colors.dart';
|
||||
@ -15,6 +16,7 @@ class MessageListPage extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _MessageListPageState extends State<MessageListPage> {
|
||||
List dataList = [];
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
@ -23,14 +25,17 @@ class _MessageListPageState extends State<MessageListPage> {
|
||||
barTitle: TranslationLoader.lanKeys!.message!.tr,
|
||||
haveBack: true,
|
||||
backgroundColor: AppColors.mainColor),
|
||||
body: ListView.builder(
|
||||
itemCount: 10,
|
||||
itemBuilder: (c, index) {
|
||||
return _seletGatewayListListItem(
|
||||
'images/controls_user.png', "您的钥匙已发送成功", "2023.6.21 11.15", () {
|
||||
// Navigator.pushNamed(context, Routers.gatewayConfigurationWifiPage);
|
||||
});
|
||||
}),
|
||||
body: dataList.isEmpty
|
||||
? const NoData()
|
||||
: ListView.builder(
|
||||
itemCount: 10,
|
||||
itemBuilder: (c, index) {
|
||||
return _seletGatewayListListItem(
|
||||
'images/controls_user.png', "您的钥匙已发送成功", "2023.6.21 11.15",
|
||||
() {
|
||||
// Navigator.pushNamed(context, Routers.gatewayConfigurationWifiPage);
|
||||
});
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -136,8 +136,8 @@ class _StarLockMinePageState extends State<StarLockMinePage> with BaseWidget {
|
||||
// }),
|
||||
mineItem('images/mine/icon_mine_main_message.png',
|
||||
TranslationLoader.lanKeys!.message!.tr, () {
|
||||
// Navigator.pushNamed(context, Routers.messageListPage);
|
||||
Toast.show(msg: "功能暂未开放");
|
||||
Navigator.pushNamed(context, Routers.messageListPage);
|
||||
// Toast.show(msg: "功能暂未开放");
|
||||
}),
|
||||
//删除“客服”行
|
||||
// mineItem('images/mine/icon_mine_main_supportStaff.png',
|
||||
|
||||
@ -0,0 +1,124 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/appRouters.dart';
|
||||
import 'package:star_lock/mine/mineSet/addAuthorizedAdministrator/AddAuthorizedAdministrator_state.dart';
|
||||
import 'package:star_lock/network/api_repository.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
import 'package:star_lock/tools/toast.dart';
|
||||
import 'package:star_lock/translations/trans_lib.dart';
|
||||
|
||||
class AddAuthorizedAdministratorLogic extends BaseGetXController {
|
||||
final AddAuthorizedAdministratorState state =
|
||||
AddAuthorizedAdministratorState();
|
||||
|
||||
//发送批量授权管理员
|
||||
Future<void> addAuthorizedAdminRequest() async {
|
||||
String getFailureDateTime = '0';
|
||||
String getEffectiveDateTime = '0';
|
||||
if (state.tabController!.index == 1) {
|
||||
getFailureDateTime =
|
||||
state.failureDateTime.value.millisecondsSinceEpoch.toString();
|
||||
getEffectiveDateTime =
|
||||
state.effectiveDateTime.value.millisecondsSinceEpoch.toString();
|
||||
}
|
||||
var entity = await ApiRepository.to.addAuthorizedAdmin(
|
||||
state.isCreateUser.value ? "1" : "0",
|
||||
getFailureDateTime,
|
||||
state.isRemoteUnlock.value == true ? '1' : '2',
|
||||
[],
|
||||
state.lockIdList,
|
||||
state.keyNameController.text,
|
||||
getEffectiveDateTime,
|
||||
state.emailOrPhoneController.text,
|
||||
state.countryCode.value,
|
||||
'1',
|
||||
);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
print('发送电子钥匙成功');
|
||||
state.isSendSuccess.value = true;
|
||||
} else {
|
||||
Toast.show(msg: '${entity.errorMsg}');
|
||||
if (entity.errorCode == 425) {
|
||||
//用户未注册
|
||||
state.isCreateUser.value = true;
|
||||
addAuthorizedAdminRequest();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//发送钥匙请求
|
||||
Future<void> sendElectronicKeyRequest(BuildContext widgetContext) async {
|
||||
String getFailureDateTime = '0';
|
||||
String getEffectiveDateTime = '0';
|
||||
String lockID = state.keyInfo.value.lockId.toString();
|
||||
String getKeyType = (int.parse(state.type.value) + 1).toString();
|
||||
if (state.type.value == '0') {
|
||||
getFailureDateTime =
|
||||
state.failureDateTime.value.millisecondsSinceEpoch.toString();
|
||||
getEffectiveDateTime =
|
||||
state.effectiveDateTime.value.millisecondsSinceEpoch.toString();
|
||||
}
|
||||
|
||||
var entity = await ApiRepository.to.sendElectronicKey(
|
||||
createUser: state.isCreateUser.value ? "1" : "0",
|
||||
countryCode: state.countryCode.value,
|
||||
usernameType: '1',
|
||||
endDate: getFailureDateTime,
|
||||
faceAuthentication: state.isAuthentication.value == true ? '1' : '2',
|
||||
isCameraEnable: '2',
|
||||
isRemoteUnlock: state.isRemoteUnlock.value == true ? '1' : '2',
|
||||
keyNameForAdmin: state.keyNameController.text,
|
||||
keyRight: '0',
|
||||
keyType: getKeyType,
|
||||
lockId: lockID,
|
||||
operatorUid: '',
|
||||
receiverUsername: state.emailOrPhoneController.text,
|
||||
remarks: '',
|
||||
startDate: getEffectiveDateTime,
|
||||
weekDays: state.weekdaysList);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
print('发送电子钥匙成功');
|
||||
state.isSendSuccess.value = true;
|
||||
} else {
|
||||
if (entity.errorCode == 425) {
|
||||
//用户未注册
|
||||
_showDialog(widgetContext, '${entity.errorMsg}');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//用户未注册确认弹窗
|
||||
void _showDialog(widgetContext, String errMsg) {
|
||||
showCupertinoDialog(
|
||||
context: widgetContext,
|
||||
builder: (context) {
|
||||
return CupertinoAlertDialog(
|
||||
title: const Text('接收者号码未注册,请选择号码所在的国家并重新发送'),
|
||||
actions: [
|
||||
CupertinoDialogAction(
|
||||
child: Text(TranslationLoader.lanKeys!.cancel!.tr),
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
CupertinoDialogAction(
|
||||
child: Text(TranslationLoader.lanKeys!.selet!.tr),
|
||||
onPressed: () async {
|
||||
//选择国家代码
|
||||
state.isCreateUser.value = true;
|
||||
Navigator.of(context).pop();
|
||||
|
||||
var result = await Get.toNamed(Routers.seletCountryRegionPage);
|
||||
if (result != null) {
|
||||
result as Map<String, dynamic>;
|
||||
state.countryCode.value = result['code'];
|
||||
state.countryName.value = result['countryName'];
|
||||
}
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,39 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_native_contact_picker/flutter_native_contact_picker.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/main/lockMian/entity/lockInfoEntity.dart';
|
||||
|
||||
class AddAuthorizedAdministratorState {
|
||||
late TabController? tabController;
|
||||
TextEditingController emailOrPhoneController =
|
||||
TextEditingController(); //邮箱/手机号输入框
|
||||
TextEditingController keyNameController = TextEditingController(); //钥匙名输入框
|
||||
|
||||
final FlutterContactPicker contactPicker = FlutterContactPicker();
|
||||
late Contact contact;
|
||||
var type = ''.obs;
|
||||
var lockIdList = [].obs;
|
||||
var weekdaysList = [].obs;
|
||||
var isCreateUser = false.obs; //用户未注册时传1 已注册传0
|
||||
var selectEffectiveDate =
|
||||
'${DateTime.now().year}-${DateTime.now().month}-${DateTime.now().day} ${DateTime.now().hour}:${DateTime.now().minute}'
|
||||
.obs; //默认为当前时间
|
||||
var selectFailureDate =
|
||||
'${DateTime.now().year}-${DateTime.now().month}-${DateTime.now().day} ${DateTime.now().hour}:${DateTime.now().minute}'
|
||||
.obs; //默认为当前时间
|
||||
final effectiveDateTime = DateTime.now().obs;
|
||||
final failureDateTime = DateTime.now().obs;
|
||||
var countryName = '中国'.obs;
|
||||
var countryCode = '86'.obs;
|
||||
var isSendSuccess = false.obs;
|
||||
final isRemoteUnlock = false.obs; //是否允许远程开锁
|
||||
final isAuthentication = false.obs; //是否允许实名认证
|
||||
final keyInfo = KeyInfos().obs;
|
||||
final lockMainEntity = LockMainEntity().obs;
|
||||
|
||||
AddAuthorizedAdministratorState() {
|
||||
Map map = Get.arguments;
|
||||
lockMainEntity.value = map["lockMainEntity"];
|
||||
keyInfo.value = map["keyInfo"];
|
||||
}
|
||||
}
|
||||
@ -6,6 +6,7 @@ import 'package:star_lock/appRouters.dart';
|
||||
import 'package:star_lock/app_settings/app_colors.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupListEntity.dart';
|
||||
import 'package:star_lock/tools/ExpandedListView.dart';
|
||||
import 'package:star_lock/tools/noData.dart';
|
||||
import 'package:star_lock/tools/submitBtn.dart';
|
||||
import 'package:star_lock/translations/trans_lib.dart';
|
||||
|
||||
@ -28,6 +29,7 @@ class _AuthorityManagementPageState extends State<AuthorityManagementPage>
|
||||
bool isDeviceSelect = false;
|
||||
int selectDeviceIndex = 0;
|
||||
int selectNameIndex = 0;
|
||||
List dataList = [];
|
||||
|
||||
List tabs = [
|
||||
TranslationLoader.lanKeys!.name!.tr,
|
||||
@ -83,9 +85,10 @@ class _AuthorityManagementPageState extends State<AuthorityManagementPage>
|
||||
)),
|
||||
),
|
||||
),
|
||||
body: TabBarView(
|
||||
controller: _tabController,
|
||||
children: [_permissionNameList(), _permissionDeviceList()])));
|
||||
body: TabBarView(controller: _tabController, children: [
|
||||
dataList.isEmpty ? const NoData() : _permissionNameList(),
|
||||
dataList.isEmpty ? const NoData() : _permissionDeviceList()
|
||||
])));
|
||||
}
|
||||
|
||||
//姓名列表
|
||||
|
||||
@ -4,6 +4,7 @@ import 'package:get/get.dart';
|
||||
import 'package:star_lock/mine/mineSet/authorizedAdministrator/authorizedAdminListEntity.dart';
|
||||
import 'package:star_lock/network/api_repository.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
import 'package:star_lock/tools/noData.dart';
|
||||
|
||||
import '../../../../appRouters.dart';
|
||||
import '../../../../app_settings/app_colors.dart';
|
||||
@ -131,12 +132,14 @@ class _AuthorizedAdministratorListPageState
|
||||
}
|
||||
|
||||
Widget _buildMainUI(List itemList) {
|
||||
return ListView.builder(
|
||||
itemCount: itemList.length,
|
||||
itemBuilder: (c, index) {
|
||||
AuthorizedAdminListItem itemData = itemList[index];
|
||||
return _electronicKeyItem(itemData);
|
||||
});
|
||||
return itemList.isEmpty
|
||||
? const NoData()
|
||||
: ListView.builder(
|
||||
itemCount: itemList.length,
|
||||
itemBuilder: (c, index) {
|
||||
AuthorizedAdminListItem itemData = itemList[index];
|
||||
return _electronicKeyItem(itemData);
|
||||
});
|
||||
}
|
||||
|
||||
Widget _electronicKeyItem(AuthorizedAdminListItem itemData) {
|
||||
|
||||
@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupListEntity.dart';
|
||||
import 'package:star_lock/tools/noData.dart';
|
||||
|
||||
import '../../../../../app_settings/app_colors.dart';
|
||||
import '../../../../../tools/titleAppBar.dart';
|
||||
@ -55,7 +56,7 @@ class _LockItemListPageState extends State<LockItemListPage> {
|
||||
);
|
||||
},
|
||||
)
|
||||
: Container(),
|
||||
: const NoData(),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -4,6 +4,7 @@ import 'package:get/get.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserListEntity.dart';
|
||||
import 'package:star_lock/network/api_repository.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
import 'package:star_lock/tools/noData.dart';
|
||||
|
||||
import '../../../../appRouters.dart';
|
||||
import '../../../../app_settings/app_colors.dart';
|
||||
@ -119,19 +120,21 @@ class _LockUserManageListPageState extends State<LockUserManageListPage> {
|
||||
}
|
||||
|
||||
Widget _buildMainUI() {
|
||||
return ListView.separated(
|
||||
itemCount: dataList.length,
|
||||
itemBuilder: (c, index) {
|
||||
LockUserData indexEntity = dataList[index];
|
||||
return _electronicKeyItem(indexEntity);
|
||||
},
|
||||
separatorBuilder: (BuildContext context, int index) {
|
||||
return const Divider(
|
||||
height: 1,
|
||||
color: AppColors.greyLineColor,
|
||||
);
|
||||
},
|
||||
);
|
||||
return dataList.isEmpty
|
||||
? const NoData()
|
||||
: ListView.separated(
|
||||
itemCount: dataList.length,
|
||||
itemBuilder: (c, index) {
|
||||
LockUserData indexEntity = dataList[index];
|
||||
return _electronicKeyItem(indexEntity);
|
||||
},
|
||||
separatorBuilder: (BuildContext context, int index) {
|
||||
return const Divider(
|
||||
height: 1,
|
||||
color: AppColors.greyLineColor,
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
//请求锁用户列表
|
||||
|
||||
@ -93,15 +93,15 @@ class _MineSetPageState extends State<MineSetPage> {
|
||||
Navigator.pushNamed(
|
||||
context, Routers.authorizedAdministratorListPage);
|
||||
}),
|
||||
//by DaisyWu 新增--权限管理
|
||||
//by DaisyWu 新增--批量授权
|
||||
CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.authorityManagement!.tr,
|
||||
rightTitle: "",
|
||||
isHaveLine: true,
|
||||
isHaveDirection: true,
|
||||
action: () {
|
||||
// Navigator.pushNamed(context, Routers.authorityManagementPage);
|
||||
Toast.show(msg: "功能暂未开放");
|
||||
Navigator.pushNamed(context, Routers.authorityManagementPage);
|
||||
// Toast.show(msg: "功能暂未开放");
|
||||
}),
|
||||
CommonItem(
|
||||
leftTitel: TranslationLoader.lanKeys!.lockGroup!.tr,
|
||||
|
||||
@ -31,59 +31,51 @@ class _ValueAddedServicesPageListState
|
||||
_valueAddedServicesItem(
|
||||
Image.asset('images/mine/icon_mine_valueAddedServices_note.png'),
|
||||
TranslationLoader.lanKeys!.note!.tr, () {
|
||||
Toast.show(msg: "功能暂未开放");
|
||||
// Navigator.pushNamed(
|
||||
// context, Routers.valueAddedServicesNoteAndEmailDetailPage,
|
||||
// arguments: 1);
|
||||
Navigator.pushNamed(
|
||||
context, Routers.valueAddedServicesNoteAndEmailDetailPage,
|
||||
arguments: 1);
|
||||
}),
|
||||
_valueAddedServicesItem(
|
||||
Image.asset('images/mine/icon_mine_valueAddedServices_email.png'),
|
||||
TranslationLoader.lanKeys!.mail!.tr, () {
|
||||
Toast.show(msg: "功能暂未开放");
|
||||
// Navigator.pushNamed(
|
||||
// context, Routers.valueAddedServicesNoteAndEmailDetailPage,
|
||||
// arguments: 2);
|
||||
Navigator.pushNamed(
|
||||
context, Routers.valueAddedServicesNoteAndEmailDetailPage,
|
||||
arguments: 2);
|
||||
}),
|
||||
_valueAddedServicesItem(
|
||||
Image.asset(
|
||||
'images/mine/icon_mine_valueAddedServices_realName.png'),
|
||||
TranslationLoader.lanKeys!.realNameAuthentication!.tr, () {
|
||||
Toast.show(msg: "功能暂未开放");
|
||||
// Navigator.pushNamed(
|
||||
// context, Routers.valueAddedServicesRealNamePage);
|
||||
Navigator.pushNamed(
|
||||
context, Routers.valueAddedServicesRealNamePage);
|
||||
}),
|
||||
_valueAddedServicesItem(
|
||||
Image.asset('images/mine/icon_mine_valueAddedServices_vip.png'),
|
||||
TranslationLoader.lanKeys!.advancedFunction!.tr, () {
|
||||
Toast.show(msg: "功能暂未开放");
|
||||
// Navigator.pushNamed(
|
||||
// context, Routers.valueAddedServicesHighFunctionPage);
|
||||
Navigator.pushNamed(
|
||||
context, Routers.valueAddedServicesHighFunctionPage);
|
||||
}),
|
||||
_valueAddedServicesItem(
|
||||
Image.asset('images/mine/icon_mine_valueAddedServices_push.png'),
|
||||
TranslationLoader.lanKeys!.pushMessage!.tr, () {
|
||||
Toast.show(msg: "功能暂未开放");
|
||||
// Navigator.pushNamed(context, Routers.gatewayDetailPage);
|
||||
Navigator.pushNamed(context, Routers.gatewayDetailPage);
|
||||
}),
|
||||
_valueAddedServicesItem(
|
||||
Image.asset(
|
||||
'images/mine/icon_mine_valueAddedServices_checkIn.png'),
|
||||
TranslationLoader.lanKeys!.checkingIn!.tr, () {
|
||||
Toast.show(msg: "功能暂未开放");
|
||||
// Navigator.pushNamed(context, Routers.gatewayDetailPage);
|
||||
Navigator.pushNamed(context, Routers.gatewayDetailPage);
|
||||
}),
|
||||
_valueAddedServicesItem(
|
||||
Image.asset(
|
||||
'images/mine/icon_mine_valueAddedServices_storage.png'),
|
||||
TranslationLoader.lanKeys!.recordsRetention!.tr, () {
|
||||
Toast.show(msg: "功能暂未开放");
|
||||
// Navigator.pushNamed(context, Routers.gatewayDetailPage);
|
||||
Navigator.pushNamed(context, Routers.gatewayDetailPage);
|
||||
}),
|
||||
_valueAddedServicesItem(
|
||||
Image.asset('images/mine/icon_mine_valueAddedServices_vip.png'),
|
||||
'可视对讲', () {
|
||||
Toast.show(msg: "功能暂未开放");
|
||||
// Navigator.pushNamed(context, Routers.gatewayDetailPage);
|
||||
Navigator.pushNamed(context, Routers.gatewayDetailPage);
|
||||
}),
|
||||
_valueAddedServicesItem(
|
||||
Text(
|
||||
@ -94,8 +86,7 @@ class _ValueAddedServicesPageListState
|
||||
fontWeight: FontWeight.w600),
|
||||
),
|
||||
"Amazon Alexa", () {
|
||||
Toast.show(msg: "功能暂未开放");
|
||||
// Navigator.pushNamed(context, Routers.gatewayDetailPage);
|
||||
Navigator.pushNamed(context, Routers.gatewayDetailPage);
|
||||
}),
|
||||
_valueAddedServicesItem(
|
||||
Text(
|
||||
@ -106,8 +97,7 @@ class _ValueAddedServicesPageListState
|
||||
fontWeight: FontWeight.w600),
|
||||
),
|
||||
"Google Home", () {
|
||||
Toast.show(msg: "功能暂未开放");
|
||||
// Navigator.pushNamed(context, Routers.gatewayDetailPage);
|
||||
Navigator.pushNamed(context, Routers.gatewayDetailPage);
|
||||
}),
|
||||
],
|
||||
),
|
||||
|
||||
@ -74,9 +74,10 @@ class BaseProvider extends GetConnect with Api {
|
||||
case 430: //与葛工约定弹出ErrorMsg
|
||||
Toast.show(msg: T["errorMsg"]);
|
||||
break;
|
||||
case 425:
|
||||
Toast.show(msg: "用户不存在");
|
||||
break;
|
||||
//已单独处理,暂不做全局弹窗
|
||||
// case 425:
|
||||
// Toast.show(msg: "用户不存在");
|
||||
// break;
|
||||
case 10001:
|
||||
Toast.show(msg: "数据不存在");
|
||||
break;
|
||||
|
||||
@ -136,22 +136,22 @@ class ApiRepository {
|
||||
|
||||
//发送电子钥匙
|
||||
Future<AuthorizedAdminSendEntity> sendElectronicKey(
|
||||
String createUser,
|
||||
String countryCode,
|
||||
String usernameType,
|
||||
String endDate,
|
||||
String faceAuthentication,
|
||||
String isCameraEnable,
|
||||
String isRemoteUnlock,
|
||||
String keyNameForAdmin,
|
||||
String keyRight,
|
||||
String keyType,
|
||||
String lockId,
|
||||
String operatorUid,
|
||||
String receiverUsername,
|
||||
String remarks,
|
||||
String startDate,
|
||||
List weekDays) async {
|
||||
{required String createUser,
|
||||
required String countryCode,
|
||||
required String usernameType,
|
||||
required String endDate,
|
||||
required String faceAuthentication,
|
||||
required String isCameraEnable,
|
||||
required String isRemoteUnlock,
|
||||
required String keyNameForAdmin,
|
||||
required String keyRight,
|
||||
required String keyType,
|
||||
required String lockId,
|
||||
required String operatorUid,
|
||||
required String receiverUsername,
|
||||
required String remarks,
|
||||
required String startDate,
|
||||
required List weekDays}) async {
|
||||
final res = await apiProvider.sendElectronicKey(
|
||||
createUser,
|
||||
countryCode,
|
||||
|
||||
@ -107,7 +107,7 @@ class _ExpandedListTileState extends State<ExpandedListTile> {
|
||||
width: 10.w,
|
||||
)),
|
||||
AnimatedRotation(
|
||||
turns: _isExpanded ? 0 : -0.5,
|
||||
turns: _isExpanded ? -0.5 : 0,
|
||||
duration: _animationDuration,
|
||||
child: const Icon(Icons.keyboard_arrow_down),
|
||||
),
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:star_lock/app_settings/app_colors.dart';
|
||||
|
||||
class NoData extends StatelessWidget {
|
||||
const NoData({Key? key}) : super(key: key);
|
||||
@ -10,8 +11,22 @@ class NoData extends StatelessWidget {
|
||||
width: 1.sw,
|
||||
height: 1.sh - ScreenUtil().statusBarHeight,
|
||||
child: Center(
|
||||
child: Image.asset('images/icon_unHaveData.png',width: 300.w,height: 240.w),
|
||||
),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Image.asset(
|
||||
'images/icon_noData.png',
|
||||
width: 160.w,
|
||||
height: 180.h,
|
||||
),
|
||||
Text(
|
||||
'暂无数据',
|
||||
style:
|
||||
TextStyle(color: AppColors.darkGrayTextColor, fontSize: 22.sp),
|
||||
)
|
||||
],
|
||||
)),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||