diff --git a/.DS_Store b/.DS_Store index d50c782e..c3deee4d 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 00000000..26d33521 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 00000000..3ce5b9d9 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/starLock.iml b/.idea/starLock.iml new file mode 100644 index 00000000..5164eec4 --- /dev/null +++ b/.idea/starLock.iml @@ -0,0 +1,259 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 00000000..35eb1ddf --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/star_lock/android/app/src/main/res/drawable-v21/launch_background.xml b/star_lock/android/app/src/main/res/drawable-v21/launch_background.xml index f74085f3..dd2edc21 100644 --- a/star_lock/android/app/src/main/res/drawable-v21/launch_background.xml +++ b/star_lock/android/app/src/main/res/drawable-v21/launch_background.xml @@ -1,12 +1,12 @@ - + - + android:src="@mipmap/ic_logo" /> + diff --git a/star_lock/android/app/src/main/res/drawable/launch_background.xml b/star_lock/android/app/src/main/res/drawable/launch_background.xml index 304732f8..dd2edc21 100644 --- a/star_lock/android/app/src/main/res/drawable/launch_background.xml +++ b/star_lock/android/app/src/main/res/drawable/launch_background.xml @@ -4,9 +4,9 @@ - + android:src="@mipmap/ic_logo" /> + diff --git a/star_lock/images/main/icon_lockDetail_messageReminding.png b/star_lock/images/main/icon_lockDetail_messageReminding.png index 3c819abd..8f170aa5 100644 Binary files a/star_lock/images/main/icon_lockDetail_messageReminding.png and b/star_lock/images/main/icon_lockDetail_messageReminding.png differ diff --git a/star_lock/images/main/icon_lockDetail_videoLog.png b/star_lock/images/main/icon_lockDetail_videoLog.png index 532004cf..982c7554 100644 Binary files a/star_lock/images/main/icon_lockDetail_videoLog.png and b/star_lock/images/main/icon_lockDetail_videoLog.png differ diff --git a/star_lock/images/main/icon_lockElectricLevel_1.png b/star_lock/images/main/icon_lockElectricLevel_1.png new file mode 100644 index 00000000..54a99246 Binary files /dev/null and b/star_lock/images/main/icon_lockElectricLevel_1.png differ diff --git a/star_lock/images/main/icon_lockElectricLevel_2.png b/star_lock/images/main/icon_lockElectricLevel_2.png new file mode 100644 index 00000000..e9eb3622 Binary files /dev/null and b/star_lock/images/main/icon_lockElectricLevel_2.png differ diff --git a/star_lock/images/main/icon_lockElectricLevel_3.png b/star_lock/images/main/icon_lockElectricLevel_3.png new file mode 100644 index 00000000..c1054880 Binary files /dev/null and b/star_lock/images/main/icon_lockElectricLevel_3.png differ diff --git a/star_lock/images/main/icon_lockElectricLevel_4.png b/star_lock/images/main/icon_lockElectricLevel_4.png new file mode 100644 index 00000000..f57b60ab Binary files /dev/null and b/star_lock/images/main/icon_lockElectricLevel_4.png differ diff --git a/star_lock/images/main/icon_lockElectricLevel_5.png b/star_lock/images/main/icon_lockElectricLevel_5.png new file mode 100644 index 00000000..eef3c9c0 Binary files /dev/null and b/star_lock/images/main/icon_lockElectricLevel_5.png differ diff --git a/star_lock/ios/Podfile b/star_lock/ios/Podfile index daacc084..573ef8f2 100644 --- a/star_lock/ios/Podfile +++ b/star_lock/ios/Podfile @@ -1,5 +1,5 @@ # Uncomment this line to define a global platform for your project - platform :ios, '11.0' +# platform :ios, '11.0' #use_modular_headers! use_frameworks! :linkage => :static # CocoaPods analytics sends network stats synchronously affecting flutter build latency. diff --git a/star_lock/ios/Podfile.lock b/star_lock/ios/Podfile.lock new file mode 100644 index 00000000..8df8d446 --- /dev/null +++ b/star_lock/ios/Podfile.lock @@ -0,0 +1,214 @@ +PODS: + - aj_captcha_flutter (0.0.1): + - Flutter + - AlicloudPush (1.9.9.8): + - AlicloudSender + - AlicloudUT + - AlicloudUtils + - AlicloudSender (1.0.0.3): + - AlicloudUTDID + - EMASRest + - AlicloudUT (5.2.0.16): + - AlicloudUTDID + - AlicloudUTDID (1.5.0.94) + - AlicloudUtils (1.4.1): + - AlicloudUTDID + - aliyun_push (0.0.1): + - AlicloudPush + - Flutter + - AMap3DMap (9.7.0): + - AMapFoundation (>= 1.8.0) + - amap_flutter_location (0.0.1): + - AMapLocation + - Flutter + - amap_flutter_map (0.0.1): + - AMap3DMap + - Flutter + - AMapFoundation (1.8.2) + - AMapLocation (2.10.0): + - AMapFoundation (>= 1.8.0) + - auto_orientation (0.0.1): + - Flutter + - camera_avfoundation (0.0.1): + - Flutter + - device_info_plus (0.0.1): + - Flutter + - EMASRest (11.1.1.2) + - Flutter (1.0.0) + - flutter_native_contact_picker (0.0.1): + - Flutter + - fluttertoast (0.0.2): + - Flutter + - Toast + - FMDB (2.7.5): + - FMDB/standard (= 2.7.5) + - FMDB/standard (2.7.5) + - google_maps_flutter_ios (0.0.1): + - Flutter + - GoogleMaps (< 8.0) + - GoogleMaps (5.2.0): + - GoogleMaps/Maps (= 5.2.0) + - GoogleMaps/Base (5.2.0) + - GoogleMaps/Maps (5.2.0): + - GoogleMaps/Base + - image_picker_ios (0.0.1): + - Flutter + - network_info_plus (0.0.1): + - Flutter + - package_info_plus (0.4.5): + - Flutter + - path_provider_foundation (0.0.1): + - Flutter + - FlutterMacOS + - permission_handler_apple (9.1.1): + - Flutter + - Protobuf (3.25.1) + - reactive_ble_mobile (0.0.1): + - Flutter + - Protobuf (~> 3.5) + - SwiftProtobuf (~> 1.0) + - shared_preferences_foundation (0.0.1): + - Flutter + - FlutterMacOS + - sqflite (0.0.3): + - Flutter + - FMDB (>= 2.7.5) + - SwiftProtobuf (1.25.1) + - Toast (4.0.0) + - url_launcher_ios (0.0.1): + - Flutter + - video_player_avfoundation (0.0.1): + - Flutter + - webview_flutter_wkwebview (0.0.1): + - Flutter + +DEPENDENCIES: + - aj_captcha_flutter (from `.symlinks/plugins/aj_captcha_flutter/ios`) + - AlicloudPush (~> 1.9.9) + - aliyun_push (from `.symlinks/plugins/aliyun_push/ios`) + - amap_flutter_location (from `.symlinks/plugins/amap_flutter_location/ios`) + - amap_flutter_map (from `.symlinks/plugins/amap_flutter_map/ios`) + - auto_orientation (from `.symlinks/plugins/auto_orientation/ios`) + - camera_avfoundation (from `.symlinks/plugins/camera_avfoundation/ios`) + - device_info_plus (from `.symlinks/plugins/device_info_plus/ios`) + - Flutter (from `Flutter`) + - flutter_native_contact_picker (from `.symlinks/plugins/flutter_native_contact_picker/ios`) + - fluttertoast (from `.symlinks/plugins/fluttertoast/ios`) + - google_maps_flutter_ios (from `.symlinks/plugins/google_maps_flutter_ios/ios`) + - image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`) + - network_info_plus (from `.symlinks/plugins/network_info_plus/ios`) + - package_info_plus (from `.symlinks/plugins/package_info_plus/ios`) + - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`) + - permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`) + - reactive_ble_mobile (from `.symlinks/plugins/reactive_ble_mobile/ios`) + - shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`) + - sqflite (from `.symlinks/plugins/sqflite/ios`) + - url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`) + - video_player_avfoundation (from `.symlinks/plugins/video_player_avfoundation/ios`) + - webview_flutter_wkwebview (from `.symlinks/plugins/webview_flutter_wkwebview/ios`) + +SPEC REPOS: + https://github.com/aliyun/aliyun-specs.git: + - AlicloudPush + - AlicloudSender + - AlicloudUT + - AlicloudUTDID + - AlicloudUtils + - EMASRest + https://github.com/CocoaPods/Specs.git: + - AMap3DMap + - AMapFoundation + - AMapLocation + - FMDB + - GoogleMaps + - Protobuf + - SwiftProtobuf + - Toast + +EXTERNAL SOURCES: + aj_captcha_flutter: + :path: ".symlinks/plugins/aj_captcha_flutter/ios" + aliyun_push: + :path: ".symlinks/plugins/aliyun_push/ios" + amap_flutter_location: + :path: ".symlinks/plugins/amap_flutter_location/ios" + amap_flutter_map: + :path: ".symlinks/plugins/amap_flutter_map/ios" + auto_orientation: + :path: ".symlinks/plugins/auto_orientation/ios" + camera_avfoundation: + :path: ".symlinks/plugins/camera_avfoundation/ios" + device_info_plus: + :path: ".symlinks/plugins/device_info_plus/ios" + Flutter: + :path: Flutter + flutter_native_contact_picker: + :path: ".symlinks/plugins/flutter_native_contact_picker/ios" + fluttertoast: + :path: ".symlinks/plugins/fluttertoast/ios" + google_maps_flutter_ios: + :path: ".symlinks/plugins/google_maps_flutter_ios/ios" + image_picker_ios: + :path: ".symlinks/plugins/image_picker_ios/ios" + network_info_plus: + :path: ".symlinks/plugins/network_info_plus/ios" + package_info_plus: + :path: ".symlinks/plugins/package_info_plus/ios" + path_provider_foundation: + :path: ".symlinks/plugins/path_provider_foundation/darwin" + permission_handler_apple: + :path: ".symlinks/plugins/permission_handler_apple/ios" + reactive_ble_mobile: + :path: ".symlinks/plugins/reactive_ble_mobile/ios" + shared_preferences_foundation: + :path: ".symlinks/plugins/shared_preferences_foundation/darwin" + sqflite: + :path: ".symlinks/plugins/sqflite/ios" + url_launcher_ios: + :path: ".symlinks/plugins/url_launcher_ios/ios" + video_player_avfoundation: + :path: ".symlinks/plugins/video_player_avfoundation/ios" + webview_flutter_wkwebview: + :path: ".symlinks/plugins/webview_flutter_wkwebview/ios" + +SPEC CHECKSUMS: + aj_captcha_flutter: dd7af1aa064bdd621ae335b819bab07309c3c023 + AlicloudPush: 88529c9b796e4ece0601de0867b30359f55b61f7 + AlicloudSender: 1f468b6bd962a099ffc19d45e3608b0fe98f259d + AlicloudUT: 6d1cf30d57d096b7e9bb4b069dd0ba6ad59a3338 + AlicloudUTDID: 7323c443dcdf9a73e2224dc6ce51703671d7a765 + AlicloudUtils: 873a76615bebcee8b1996f20820d366e433c3eab + aliyun_push: e92c2a8ca91b134bfabf7631816cce5f36e04a44 + AMap3DMap: dce25dd3e51e6b92109caa7d0c97fc6055830fb3 + amap_flutter_location: 44ff5beb64f42e0bf5feb402fe299dac0013af6f + amap_flutter_map: 979e54d227cedac6c7504a2151bfbf3bcf96760a + AMapFoundation: 9885c48fc3a78fdfb84a0299a2293e56ea3c9fec + AMapLocation: 5248aec2455ebb5d104b367813c946430a2ee033 + auto_orientation: 102ed811a5938d52c86520ddd7ecd3a126b5d39d + camera_avfoundation: 3125e8cd1a4387f6f31c6c63abb8a55892a9eeeb + device_info_plus: e5c5da33f982a436e103237c0c85f9031142abed + EMASRest: 8df6f87836767a9415ad5cc4af739bc9d215b475 + Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 + flutter_native_contact_picker: bd430ba0fbf82768bb50c2c52a69a65759a8f907 + fluttertoast: 31b00dabfa7fb7bacd9e7dbee580d7a2ff4bf265 + FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a + google_maps_flutter_ios: abdac20d6ce8931f6ebc5f46616df241bfaa2cfd + GoogleMaps: 025272d5876d3b32604e5c080dc25eaf68764693 + image_picker_ios: 4a8aadfbb6dc30ad5141a2ce3832af9214a705b5 + network_info_plus: 122280582fe2fa2bbb8681a4269745cd5c3a9b32 + package_info_plus: 6c92f08e1f853dc01228d6f553146438dafcd14e + path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943 + permission_handler_apple: e76247795d700c14ea09e3a2d8855d41ee80a2e6 + Protobuf: d94761c33f1239c0a43a0817ca1a5f7f7c900241 + reactive_ble_mobile: 9ce6723d37ccf701dbffd202d487f23f5de03b4c + shared_preferences_foundation: 5b919d13b803cadd15ed2dc053125c68730e5126 + sqflite: 31f7eba61e3074736dff8807a9b41581e4f7f15a + SwiftProtobuf: 69f02cd54fb03201c5e6bf8b76f687c5ef7541a3 + Toast: 91b396c56ee72a5790816f40d3a94dd357abc196 + url_launcher_ios: 08a3dfac5fb39e8759aeb0abbd5d9480f30fc8b4 + video_player_avfoundation: 81e49bb3d9fb63dccf9fa0f6d877dc3ddbeac126 + webview_flutter_wkwebview: 2e2d318f21a5e036e2c3f26171342e95908bd60a + +PODFILE CHECKSUM: adf6d8caf5faa9ea4ee2a2ea37f5aea37a6520d7 + +COCOAPODS: 1.14.3 diff --git a/star_lock/ios/Runner.xcodeproj/project.pbxproj b/star_lock/ios/Runner.xcodeproj/project.pbxproj index 8d5130c6..ce180cb5 100644 --- a/star_lock/ios/Runner.xcodeproj/project.pbxproj +++ b/star_lock/ios/Runner.xcodeproj/project.pbxproj @@ -8,6 +8,7 @@ /* Begin PBXBuildFile section */ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; + 3364C3F42B0C902100AA5ABC /* lcokStarMain.png in Resources */ = {isa = PBXBuildFile; fileRef = 3364C3F32B0C902100AA5ABC /* lcokStarMain.png */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 3EF1E85D6F1EE0C0DCF8449F /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 09D8B2FA2B26BA5BFF31AB2A /* Pods_Runner.framework */; }; 8297E4102AE75AC500E886FA /* XSFlutterManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 8297E40E2AE75AC500E886FA /* XSFlutterManager.m */; }; @@ -143,6 +144,7 @@ 09D8B2FA2B26BA5BFF31AB2A /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; + 3364C3F32B0C902100AA5ABC /* lcokStarMain.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = lcokStarMain.png; sourceTree = ""; }; 33BF41252A96174D009D92E2 /* Runner.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Runner.entitlements; sourceTree = ""; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; @@ -604,6 +606,7 @@ 97C146F01CF9000F007C117D /* Runner */ = { isa = PBXGroup; children = ( + 3364C3F32B0C902100AA5ABC /* lcokStarMain.png */, 82C026552AEB6C050011FE6A /* img */, 82C026532AE8AC6D0011FE6A /* AliyunEmasServices-Info.plist */, 8297E4992AE7974700E886FA /* AppDelegate.h */, @@ -733,6 +736,7 @@ 82C026D72AEB6C050011FE6A /* mic.png in Resources */, 82C026C32AEB6C050011FE6A /* call_menu_on.png in Resources */, 82C026B02AEB6C050011FE6A /* call_call_on.png in Resources */, + 3364C3F42B0C902100AA5ABC /* lcokStarMain.png in Resources */, 82C026C82AEB6C050011FE6A /* hf.png in Resources */, 82C026BE2AEB6C050011FE6A /* vcontacts2.png in Resources */, 82C026AC2AEB6C050011FE6A /* spk.png in Resources */, @@ -1102,8 +1106,12 @@ PRODUCT_BUNDLE_IDENTIFIER = "cn.star-lock.starLock"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; + SUPPORTS_MACCATALYST = NO; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = 1; VERSIONING_SYSTEM = "apple-generic"; }; name = Profile; @@ -1347,9 +1355,13 @@ PRODUCT_BUNDLE_IDENTIFIER = "cn.star-lock.starLock"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; + SUPPORTS_MACCATALYST = NO; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = 1; VERSIONING_SYSTEM = "apple-generic"; }; name = Debug; @@ -1486,8 +1498,12 @@ PRODUCT_BUNDLE_IDENTIFIER = "cn.star-lock.starLock"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; + SUPPORTS_MACCATALYST = NO; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = 1; VERSIONING_SYSTEM = "apple-generic"; }; name = Release; diff --git a/star_lock/ios/Runner/AppDelegate.m b/star_lock/ios/Runner/AppDelegate.m index ccb74648..a78a580a 100644 --- a/star_lock/ios/Runner/AppDelegate.m +++ b/star_lock/ios/Runner/AppDelegate.m @@ -37,12 +37,12 @@ [self.window makeKeyAndVisible]; //关闭可视对讲功能 需打开时再解注释 - [self initSound]; - _udp = [[UdpHelper alloc] init]; - [_udp Open]; - _talk = [[talk_Class alloc] init]; + //[self initSound]; + //_udp = [[UdpHelper alloc] init]; + //[_udp Open]; + //_talk = [[talk_Class alloc] init]; - sysinfo.launchtime = [Sformat timestamp]; + //sysinfo.launchtime = [Sformat timestamp]; return YES; diff --git a/star_lock/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/star_lock/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json index 77cf5ba4..1d563436 100644 --- a/star_lock/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/star_lock/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -108,7 +108,7 @@ "size" : "83.5x83.5" }, { - "filename" : "Icon-App-1024x1024@1x.png", + "filename" : "icon-1024.png", "idiom" : "ios-marketing", "scale" : "1x", "size" : "1024x1024" diff --git a/star_lock/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/star_lock/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png deleted file mode 100644 index dc9ada47..00000000 Binary files a/star_lock/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png and /dev/null differ diff --git a/star_lock/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-1024.png b/star_lock/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-1024.png new file mode 100644 index 00000000..0e5e3ab8 Binary files /dev/null and b/star_lock/ios/Runner/Assets.xcassets/AppIcon.appiconset/icon-1024.png differ diff --git a/star_lock/ios/Runner/Assets.xcassets/Contents.json b/star_lock/ios/Runner/Assets.xcassets/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/star_lock/ios/Runner/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/star_lock/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/star_lock/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json index 0bedcf2f..a19a5492 100644 --- a/star_lock/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json +++ b/star_lock/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json @@ -2,22 +2,19 @@ "images" : [ { "idiom" : "universal", - "filename" : "LaunchImage.png", "scale" : "1x" }, { "idiom" : "universal", - "filename" : "LaunchImage@2x.png", "scale" : "2x" }, { "idiom" : "universal", - "filename" : "LaunchImage@3x.png", "scale" : "3x" } ], "info" : { - "version" : 1, - "author" : "xcode" + "author" : "xcode", + "version" : 1 } } diff --git a/star_lock/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/star_lock/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png deleted file mode 100644 index 9da19eac..00000000 Binary files a/star_lock/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png and /dev/null differ diff --git a/star_lock/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/star_lock/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png deleted file mode 100644 index 9da19eac..00000000 Binary files a/star_lock/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png and /dev/null differ diff --git a/star_lock/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/star_lock/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png deleted file mode 100644 index 9da19eac..00000000 Binary files a/star_lock/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png and /dev/null differ diff --git a/star_lock/ios/Runner/Base.lproj/LaunchScreen.storyboard b/star_lock/ios/Runner/Base.lproj/LaunchScreen.storyboard index f2e259c7..ceaf4276 100644 --- a/star_lock/ios/Runner/Base.lproj/LaunchScreen.storyboard +++ b/star_lock/ios/Runner/Base.lproj/LaunchScreen.storyboard @@ -1,8 +1,10 @@ - - + + + - + + @@ -14,24 +16,28 @@ + - + + - - + + + + - + - + diff --git a/star_lock/ios/Runner/Base.lproj/Main.storyboard b/star_lock/ios/Runner/Base.lproj/Main.storyboard index 69ea5b4d..1fb38200 100644 --- a/star_lock/ios/Runner/Base.lproj/Main.storyboard +++ b/star_lock/ios/Runner/Base.lproj/Main.storyboard @@ -3,7 +3,7 @@ - + diff --git a/star_lock/ios/Runner/lcokStarMain.png b/star_lock/ios/Runner/lcokStarMain.png new file mode 100644 index 00000000..15078627 Binary files /dev/null and b/star_lock/ios/Runner/lcokStarMain.png differ diff --git a/star_lock/lib/appRouters.dart b/star_lock/lib/appRouters.dart index 40ddf2ff..31d30827 100644 --- a/star_lock/lib/appRouters.dart +++ b/star_lock/lib/appRouters.dart @@ -6,22 +6,15 @@ import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/ma import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupList_page.dart'; import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendReceiver/massSendReceiver_page.dart'; import 'package:star_lock/main/lockDetail/lcokSet/addFamily/addFamily_page.dart'; -import 'package:star_lock/main/lockDetail/lcokSet/catEyeSet/catEyeSet_page.dart'; -import 'package:star_lock/main/lockDetail/lcokSet/catEyeWorkMode/catEyeWorkMode_page.dart'; -import 'package:star_lock/main/lockDetail/lcokSet/coerceFingerprint/coerceFingerprint_page.dart'; -import 'package:star_lock/main/lockDetail/lcokSet/coerceFingerprintList/coerceFingerprintList_page.dart'; -import 'package:star_lock/main/lockDetail/lcokSet/coerceOpenDoor/coerceOpenDoor_page.dart'; +import 'package:star_lock/main/lockDetail/lcokSet/catEyeSet/catEyeSet/catEyeSet_page.dart'; import 'package:star_lock/main/lockDetail/lcokSet/faceUnlock/faceUnlock_page.dart'; import 'package:star_lock/main/lockDetail/lcokSet/familyDetails/familyDetails_page.dart'; import 'package:star_lock/main/lockDetail/lcokSet/lockUser/lockUser_page.dart'; -import 'package:star_lock/main/lockDetail/lcokSet/lowBatteryReminder/lowBatteryReminder_page.dart'; import 'package:star_lock/main/lockDetail/lcokSet/motorPower/motorPower_page.dart'; -import 'package:star_lock/main/lockDetail/lcokSet/msgNotification/msgNotification_page.dart'; +import 'package:star_lock/main/lockDetail/lcokSet/msgNotification/msgNotification/msgNotification_page.dart'; import 'package:star_lock/main/lockDetail/lcokSet/notificationMode/notificationMode_page.dart'; import 'package:star_lock/main/lockDetail/lcokSet/openDoorDirection/openDoorDirection_page.dart'; -import 'package:star_lock/main/lockDetail/lcokSet/openDoorNotify/openDoorNotify_page.dart'; import 'package:star_lock/main/lockDetail/lockDetail/lockDetail_main_page.dart'; -import 'package:star_lock/main/lockDetail/lcokSet/nDaysUnopened/nDaysUnopened_page.dart'; import 'package:star_lock/main/lockDetail/otherTypeKey/addFace/addFace_page.dart'; import 'package:star_lock/mine/about/webviewShow_page.dart'; import 'package:star_lock/mine/mine/safeVerify/safeVerify_page.dart'; @@ -63,6 +56,7 @@ import 'main/lockDetail/lcokSet/basicInformation/editLockName/editLockName_page. import 'main/lockDetail/lcokSet/basicInformation/lockSeletGrouping/lockSeletGrouping_page.dart'; import 'main/lockDetail/lcokSet/basicInformation/uploadElectricQuantity/uploadElectricQuantity_page.dart'; import 'main/lockDetail/lcokSet/burglarAlarm/burglarAlarm_page.dart'; +import 'main/lockDetail/lcokSet/catEyeSet/catEyeWorkMode/catEyeWorkMode_page.dart'; import 'main/lockDetail/lcokSet/checkInCreatCompany/checkInCreatCompany_page.dart'; import 'main/lockDetail/lcokSet/configuringWifi/configuringWifi_page.dart'; import 'main/lockDetail/lcokSet/diagnose/diagnose_page.dart'; @@ -75,6 +69,12 @@ import 'main/lockDetail/lcokSet/lockSet/lockSet_page.dart'; import 'main/lockDetail/lcokSet/lockSoundSet/lockSoundSet_page.dart'; import 'main/lockDetail/lcokSet/lockTime/lockTime_page.dart'; import 'main/lockDetail/lcokSet/markedHouseState/markedHouseState_page.dart'; +import 'main/lockDetail/lcokSet/msgNotification/coerceOpenDoor/coerceFingerprint/coerceFingerprint_page.dart'; +import 'main/lockDetail/lcokSet/msgNotification/coerceOpenDoor/coerceFingerprintList/coerceFingerprintList_page.dart'; +import 'main/lockDetail/lcokSet/msgNotification/coerceOpenDoor/coerceOpenDoor/coerceOpenDoor_page.dart'; +import 'main/lockDetail/lcokSet/msgNotification/lowBatteryReminder/lowBatteryReminder_page.dart'; +import 'main/lockDetail/lcokSet/msgNotification/nDaysUnopened/nDaysUnopened_page.dart'; +import 'main/lockDetail/lcokSet/msgNotification/openDoorNotify/openDoorNotify_page.dart'; import 'main/lockDetail/lcokSet/normallyOpenMode/normallyOpenMode_page.dart'; import 'main/lockDetail/lcokSet/remoteUnlocking/remoteUnlocking_page.dart'; import 'main/lockDetail/lcokSet/resetButton/resetButton_page.dart'; diff --git a/star_lock/lib/blue/blue_manage.dart b/star_lock/lib/blue/blue_manage.dart index 0ca50143..3a4fc21b 100644 --- a/star_lock/lib/blue/blue_manage.dart +++ b/star_lock/lib/blue/blue_manage.dart @@ -120,6 +120,10 @@ class BlueManage{ } }); } + + if(deviceConnectionState == DeviceConnectionState.connected){ + return; + } _flutterReactiveBle!.connectToDevice(id: connectDeviceMacAddress, connectionTimeout: const Duration(seconds: 100000)).listen((connectionStateUpdate) async { // 获取状态 deviceConnectionState = connectionStateUpdate.connectionState; @@ -214,12 +218,15 @@ class BlueManage{ } // 重新连接 - Future judgeReconnect(String deviceMAC, String deviceName, ConnectStateCallBack? connectStateCallBack, {bool isShowLoading = true}) async { + Future judgeReconnect(String deviceMAC, String deviceName, ConnectStateCallBack? connectStateCallBack, {bool isShowLoading = true, bool isShowToast = true}) async { // print("11111111$deviceConnectionState"); - if(deviceMAC.isEmpty){ - Toast.show(msg: "未连接到设备,请确保在设备附近,设备未被连接,设备已打开"); - // return; + if(isShowToast){ + if(deviceMAC.isEmpty){ + Toast.show(msg: "未连接到设备,请确保在设备附近,设备未被连接,设备已打开"); + // return; + } } + if(deviceConnectionState == DeviceConnectionState.connected){ // print("2222222:$deviceConnectionState"); if(isShowLoading){ @@ -303,7 +310,7 @@ class BlueManage{ // 当包有头时 // 判断是否需要分包 dataLen = data[8] * 256 + data[9]; - print("dataLen1111:$dataLen getDataLength:${data.length}"); + // print("dataLen1111:$dataLen getDataLength:${data.length}"); if(dataLen + 12 > data.length){ // 当前包的长度小于实际的包时 分包添加 不解析 allData.addAll(data); @@ -318,7 +325,7 @@ class BlueManage{ // 当包没有头时 是分包的包 直接添加 allData.addAll(data); // var len = allData[8] * 256 + allData[9]; - print("dataLen222:$dataLen"); + // print("dataLen222:$dataLen"); if(dataLen <= (allData.length - 14)){ // 当长度小于等于当前包的数据时 直接解析数据 CommandReciverManager.appDataReceive(allData); diff --git a/star_lock/lib/blue/io_protocol/io_openLock.dart b/star_lock/lib/blue/io_protocol/io_openLock.dart index 3e376694..1cecd9b3 100644 --- a/star_lock/lib/blue/io_protocol/io_openLock.dart +++ b/star_lock/lib/blue/io_protocol/io_openLock.dart @@ -13,6 +13,7 @@ class OpenLockCommand extends SenderProtocol { String? userID; int? openMode; int? openTime; + String? onlineToken; List? token; int? needAuthor; List? signKey; @@ -22,6 +23,7 @@ class OpenLockCommand extends SenderProtocol { this.userID, this.openMode, this.openTime, + this.onlineToken, this.token, this.needAuthor, this.signKey, @@ -102,6 +104,15 @@ class OpenLockCommand extends SenderProtocol { data.addAll(authCode.bytes); } + //onlineToken 16 + print("onlineToken:$onlineToken"); + if(onlineToken!.isNotEmpty){ + int onlineTokenLength = utf8.encode(onlineToken!).length; + print("openDoorOnlineToken:${utf8.encode(onlineToken!)} utf8.encode(onlineToken!).length:${utf8.encode(onlineToken!).length}"); + data.addAll(utf8.encode(onlineToken!)); + data = getFixedLengthList(data, 16 - onlineTokenLength); + } + if ((data.length % 16) != 0) { int add = (16 - data.length % 16); for (int i = 0; i < add; i++) { diff --git a/star_lock/lib/blue/io_protocol/io_senderCustomPasswords.dart b/star_lock/lib/blue/io_protocol/io_senderCustomPasswords.dart index 80340749..1bbaca9e 100644 --- a/star_lock/lib/blue/io_protocol/io_senderCustomPasswords.dart +++ b/star_lock/lib/blue/io_protocol/io_senderCustomPasswords.dart @@ -8,7 +8,7 @@ import '../io_sender.dart'; import '../io_type.dart'; import 'package:crypto/crypto.dart' as crypto; -//TODO:设置自定义密码 +//TODO:设置开锁密码(备注:先添加管理员密码, 管理员满了后就是开锁密码) /* 备注:删除单个密码规则:pwd 设置为 6 个 0,UseCountLimit 设置为 0。删除全部密码规则:pwd 设置为 6 个 0,UseCountLimit 设置为 0,pwdNo 设置为 255,userId 设置为“DeleteAll !@#”,只有门锁管理员才有权限 **/ diff --git a/star_lock/lib/blue/sender_manage.dart b/star_lock/lib/blue/sender_manage.dart index 35fdc17f..6f9531ae 100644 --- a/star_lock/lib/blue/sender_manage.dart +++ b/star_lock/lib/blue/sender_manage.dart @@ -161,6 +161,7 @@ class IoSenderManage { String? userID, int? openMode, int? openTime, + String? onlineToken, List? token, int? needAuthor, List? signKey, @@ -172,6 +173,7 @@ class IoSenderManage { userID: userID, openMode: openMode, openTime: openTime, + onlineToken: onlineToken, token: token, needAuthor: needAuthor, signKey: signKey, diff --git a/star_lock/lib/main/lockDetail/authorizedAdmin/authorizedAdminDetail/authorizedAdminDetail_page.dart b/star_lock/lib/main/lockDetail/authorizedAdmin/authorizedAdminDetail/authorizedAdminDetail_page.dart index e872a383..e025e781 100644 --- a/star_lock/lib/main/lockDetail/authorizedAdmin/authorizedAdminDetail/authorizedAdminDetail_page.dart +++ b/star_lock/lib/main/lockDetail/authorizedAdmin/authorizedAdminDetail/authorizedAdminDetail_page.dart @@ -194,24 +194,6 @@ class _AuthorizedAdminDetailPageState extends State { hintText: "请输入要修改的名字", //不需要输入框下划线 border: InputBorder.none, - //左边图标设置 - // icon: Padding( - // padding: EdgeInsets.only(top:30.w, bottom: 20.w, right: 20.w, left: 20.w), - // child: Image.asset('images/main/icon_main_search.png', width: 40.w, height: 40.w,), - // ), - // //右边图标设置 - // suffixIcon: GestureDetector( - // onTap: () { - // //addPostFrameCallback是 StatefulWidge 渲染结束的回调,只会被调用一次 - // // SchedulerBinding.instance.addPostFrameCallback((_) { - // // _controller.text = ""; - // // }); - // }, - // child: Padding( - // padding: EdgeInsets.all(8), - // child: Image.asset('images/main/icon_main_cell.png', width: 50.w, height: 50.w,), - // ), - // ) ), ), ) diff --git a/star_lock/lib/main/lockDetail/electronicKey/sendElectronicKey/sendElectronicManageKey/sendElectronicKeyManage_tabbar.dart b/star_lock/lib/main/lockDetail/electronicKey/sendElectronicKey/sendElectronicManageKey/sendElectronicKeyManage_tabbar.dart index 824b731a..1329f520 100644 --- a/star_lock/lib/main/lockDetail/electronicKey/sendElectronicKey/sendElectronicManageKey/sendElectronicKeyManage_tabbar.dart +++ b/star_lock/lib/main/lockDetail/electronicKey/sendElectronicKey/sendElectronicManageKey/sendElectronicKeyManage_tabbar.dart @@ -79,7 +79,7 @@ class _SendElectronicKeyManageTabbarState return Tab( // text: item.title, child: Container( - width: 1.sw / 8, + // width: 1.sw / 8, margin: EdgeInsets.all(10.w), // color: Colors.red, child: Text( diff --git a/star_lock/lib/main/lockDetail/lcokSet/automaticBlocking/automaticBlocking_logic.dart b/star_lock/lib/main/lockDetail/lcokSet/automaticBlocking/automaticBlocking_logic.dart index 5b8d43b5..7a9e4bf8 100644 --- a/star_lock/lib/main/lockDetail/lcokSet/automaticBlocking/automaticBlocking_logic.dart +++ b/star_lock/lib/main/lockDetail/lcokSet/automaticBlocking/automaticBlocking_logic.dart @@ -138,7 +138,7 @@ class AutomaticBlockingLogic extends BaseGetXController{ privateKey: getPrivateKeyList ); } - }, isShowLoading: true); + }); } // 设置支持功能(带参数) diff --git a/star_lock/lib/main/lockDetail/lcokSet/basicInformation/adminOpenLockPassword/adminOpenLockPassword_logic.dart b/star_lock/lib/main/lockDetail/lcokSet/basicInformation/adminOpenLockPassword/adminOpenLockPassword_logic.dart index 78edf145..35f2e215 100644 --- a/star_lock/lib/main/lockDetail/lcokSet/basicInformation/adminOpenLockPassword/adminOpenLockPassword_logic.dart +++ b/star_lock/lib/main/lockDetail/lcokSet/basicInformation/adminOpenLockPassword/adminOpenLockPassword_logic.dart @@ -36,7 +36,7 @@ class AdminOpenLockPasswordLogic extends BaseGetXController{ privateKey: getPrivateKeyList ); } - }, isShowLoading: true); + }); } @override diff --git a/star_lock/lib/main/lockDetail/lcokSet/burglarAlarm/burglarAlarm_logic.dart b/star_lock/lib/main/lockDetail/lcokSet/burglarAlarm/burglarAlarm_logic.dart index 6398a687..41322f74 100644 --- a/star_lock/lib/main/lockDetail/lcokSet/burglarAlarm/burglarAlarm_logic.dart +++ b/star_lock/lib/main/lockDetail/lcokSet/burglarAlarm/burglarAlarm_logic.dart @@ -133,7 +133,7 @@ class BurglarAlarmLogic extends BaseGetXController{ privateKey: getPrivateKeyList ); } - }, isShowLoading: true); + }); } // 设置支持功能(带参数) diff --git a/star_lock/lib/main/lockDetail/lcokSet/catEyeSet/catEyeSet_logic.dart b/star_lock/lib/main/lockDetail/lcokSet/catEyeSet/catEyeSet/catEyeSet_logic.dart similarity index 65% rename from star_lock/lib/main/lockDetail/lcokSet/catEyeSet/catEyeSet_logic.dart rename to star_lock/lib/main/lockDetail/lcokSet/catEyeSet/catEyeSet/catEyeSet_logic.dart index ee813201..42f67ac1 100644 --- a/star_lock/lib/main/lockDetail/lcokSet/catEyeSet/catEyeSet_logic.dart +++ b/star_lock/lib/main/lockDetail/lcokSet/catEyeSet/catEyeSet/catEyeSet_logic.dart @@ -1,6 +1,7 @@ -import 'package:star_lock/main/lockDetail/lcokSet/catEyeSet/catEyeSet_state.dart'; import 'package:star_lock/tools/baseGetXController.dart'; +import 'catEyeSet_state.dart'; + class CatEyeSetLogic extends BaseGetXController { final CatEyeSetState state = CatEyeSetState(); } diff --git a/star_lock/lib/main/lockDetail/lcokSet/catEyeSet/catEyeSet_page.dart b/star_lock/lib/main/lockDetail/lcokSet/catEyeSet/catEyeSet/catEyeSet_page.dart similarity index 93% rename from star_lock/lib/main/lockDetail/lcokSet/catEyeSet/catEyeSet_page.dart rename to star_lock/lib/main/lockDetail/lcokSet/catEyeSet/catEyeSet/catEyeSet_page.dart index 27abc1fa..2b9bb695 100644 --- a/star_lock/lib/main/lockDetail/lcokSet/catEyeSet/catEyeSet_page.dart +++ b/star_lock/lib/main/lockDetail/lcokSet/catEyeSet/catEyeSet/catEyeSet_page.dart @@ -1,13 +1,14 @@ 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/appRouters.dart'; -import 'package:star_lock/main/lockDetail/lcokSet/catEyeSet/catEyeSet_logic.dart'; +import 'package:star_lock/main/lockDetail/lcokSet/catEyeSet/catEyeSet/catEyeSet_logic.dart'; import 'package:star_lock/tools/commonItem.dart'; import 'package:star_lock/tools/custom_bottom_sheet.dart'; -import '../../../../app_settings/app_colors.dart'; -import '../../../../tools/titleAppBar.dart'; +import '../../../../../app_settings/app_colors.dart'; +import '../../../../../tools/titleAppBar.dart'; class CatEyeSetPage extends StatefulWidget { const CatEyeSetPage({Key? key}) : super(key: key); @@ -23,7 +24,7 @@ class _CatEyeSetPageState extends State { @override Widget build(BuildContext context) { return Scaffold( - backgroundColor: Colors.white, + backgroundColor: AppColors.mainBackgroundColor, appBar: TitleAppBar( barTitle: '猫眼设置', haveBack: true, @@ -33,6 +34,7 @@ class _CatEyeSetPageState extends State { CommonItem( leftTitel: '猫眼工作模式', rightTitle: "", + allHeight: 70.h, isHaveLine: true, isHaveDirection: true, action: () { diff --git a/star_lock/lib/main/lockDetail/lcokSet/catEyeSet/catEyeSet_state.dart b/star_lock/lib/main/lockDetail/lcokSet/catEyeSet/catEyeSet/catEyeSet_state.dart similarity index 100% rename from star_lock/lib/main/lockDetail/lcokSet/catEyeSet/catEyeSet_state.dart rename to star_lock/lib/main/lockDetail/lcokSet/catEyeSet/catEyeSet/catEyeSet_state.dart diff --git a/star_lock/lib/main/lockDetail/lcokSet/catEyeWorkMode/catEyeWorkMode_page.dart b/star_lock/lib/main/lockDetail/lcokSet/catEyeSet/catEyeWorkMode/catEyeWorkMode_page.dart similarity index 97% rename from star_lock/lib/main/lockDetail/lcokSet/catEyeWorkMode/catEyeWorkMode_page.dart rename to star_lock/lib/main/lockDetail/lcokSet/catEyeSet/catEyeWorkMode/catEyeWorkMode_page.dart index b69ac372..24154e55 100644 --- a/star_lock/lib/main/lockDetail/lcokSet/catEyeWorkMode/catEyeWorkMode_page.dart +++ b/star_lock/lib/main/lockDetail/lcokSet/catEyeSet/catEyeWorkMode/catEyeWorkMode_page.dart @@ -1,8 +1,9 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; -import '../../../../app_settings/app_colors.dart'; -import '../../../../tools/titleAppBar.dart'; +import '../../../../../app_settings/app_colors.dart'; +import '../../../../../tools/titleAppBar.dart'; + class CatEyeWorkModePage extends StatefulWidget { const CatEyeWorkModePage({Key? key}) : super(key: key); diff --git a/star_lock/lib/main/lockDetail/lcokSet/configuringWifi/configuringWifi_logic.dart b/star_lock/lib/main/lockDetail/lcokSet/configuringWifi/configuringWifi_logic.dart index 2573a862..a5805f28 100644 --- a/star_lock/lib/main/lockDetail/lcokSet/configuringWifi/configuringWifi_logic.dart +++ b/star_lock/lib/main/lockDetail/lcokSet/configuringWifi/configuringWifi_logic.dart @@ -172,7 +172,7 @@ class ConfiguringWifiLogic extends BaseGetXController{ privateKey: getPrivateKeyList, ); } - }); + }, isShowLoading: true); } final _networkInfo = NetworkInfo(); diff --git a/star_lock/lib/main/lockDetail/lcokSet/faceUnlock/faceUnlock_page.dart b/star_lock/lib/main/lockDetail/lcokSet/faceUnlock/faceUnlock_page.dart index 20aebe50..fa2e2934 100644 --- a/star_lock/lib/main/lockDetail/lcokSet/faceUnlock/faceUnlock_page.dart +++ b/star_lock/lib/main/lockDetail/lcokSet/faceUnlock/faceUnlock_page.dart @@ -33,6 +33,7 @@ class _FaceUnlockPageState extends State { CommonItem( leftTitel: '面容开锁', rightTitle: "", + allHeight: 70.h, isHaveLine: true, isHaveRightWidget: true, rightWidget: diff --git a/star_lock/lib/main/lockDetail/lcokSet/lockSet/lockSet_logic.dart b/star_lock/lib/main/lockDetail/lcokSet/lockSet/lockSet_logic.dart index 39a76a8a..4848868e 100644 --- a/star_lock/lib/main/lockDetail/lcokSet/lockSet/lockSet_logic.dart +++ b/star_lock/lib/main/lockDetail/lcokSet/lockSet/lockSet_logic.dart @@ -202,7 +202,13 @@ class LockSetLogic extends BaseGetXController { //成功 print("${reply.commandType}数据解析成功"); // Toast.show(msg: "操作成功");featureEnable = state.isOpenStayWarn.value == 1 ? 0 : 1; - if(state.settingUpSupportFeatures == 56){ + if(state.settingUpSupportFeatures == 55){ + // APP开锁时是否需联网 + state.isOpenLockNeedOnline.value = state.isOpenLockNeedOnline.value == 1 ? 0 : 1; + state.lockSetInfoData.value.lockSettingInfo!.appUnlockOnline = state.isOpenLockNeedOnline.value; + setLockSetOpenLockNeedOnline(); + eventBus.fire(LockSetChangeSetRefreshLockDetailWithType(0, state.lockSetInfoData.value.lockSettingInfo!.appUnlockOnline!)); + }else if(state.settingUpSupportFeatures == 56){ // 蓝牙广播 state.isOpenBlueBroadcast.value = state.isOpenBlueBroadcast.value == 1 ? 0 : 1; state.lockSetInfoData.value.lockSettingInfo!.bluetoothBroadcast = state.isOpenBlueBroadcast.value; @@ -215,7 +221,6 @@ class LockSetLogic extends BaseGetXController { state.isOpenExceptionWarnings.value = state.isOpenExceptionWarnings.value == 1 ? 0 : 1; state.lockSetInfoData.value.lockSettingInfo!.abnormalWarn = state.isOpenExceptionWarnings.value; } - print("isOpenBlueBroadcast111:${state.isOpenBlueBroadcast.value}"); break; case 0x06: @@ -337,7 +342,10 @@ class LockSetLogic extends BaseGetXController { state.settingUpSupportFeatures = type; var featureEnable = 0; - if(type == 56){ + if(type == 55){ + // APP开锁时是否需联网 + featureEnable = state.isOpenLockNeedOnline.value == 1 ? 0 : 1; + }else if(type == 56){ // 蓝牙广播 featureEnable = state.isOpenBlueBroadcast.value == 1 ? 0 : 1; }else if(type == 61){ @@ -371,9 +379,11 @@ class LockSetLogic extends BaseGetXController { state.lockFeature.value = state.lockSetInfoData.value.lockFeature!; state.lockStatus.value = state.lockSetInfoData.value.lockStatus!; state.isAttendance.value = state.lockSettingInfo.value.attendance!; + state.isOpenLockNeedOnline.value = state.lockSettingInfo.value.appUnlockOnline!; state.isOpenBlueBroadcast.value = state.lockSettingInfo.value.bluetoothBroadcast!; state.isOpenExceptionWarnings.value = state.lockSettingInfo.value.bluetoothBroadcast!; + // await _readSupportFunctionsNoParameters(56); // _readSupportFunctionsNoParameters(62); } @@ -406,7 +416,7 @@ class LockSetLogic extends BaseGetXController { password: state.passwordTF.text, ); if (entity.errorCode!.codeIsSuccessful) { - // deletLockInfoData(); + deletLockInfoData(); blockDeletNumberCheckPasswordCallback(); // if(state.currentDeviceUUid.value.isEmpty){ @@ -459,6 +469,8 @@ class LockSetLogic extends BaseGetXController { state.isAttendance.value = (state.isAttendance.value == 1 ? 0 : 1); state.lockSettingInfo.value.attendance = state.isAttendance.value; + + eventBus.fire(LockSetChangeSetRefreshLockDetailWithType(0, state.lockSettingInfo.value.attendance!)); print("state.lockSettingInfo.value.attendance:${state.lockSettingInfo.value.attendance}"); Toast.show(msg: "设置成功"); } @@ -479,6 +491,24 @@ class LockSetLogic extends BaseGetXController { } else {} } + // 设置是否打开开锁时是否需联网 + void setLockSetOpenLockNeedOnline() async { + var entity = await ApiRepository.to.setOpenLockNeedOnlineData( + lockId: state.lockSetInfoData.value.lockId!, + appUnlockOnline:state.isOpenLockNeedOnline.value == 1 ? 0 : 1, + ); + if(entity.errorCode!.codeIsSuccessful){ + eventBus.fire(RefreshLockListInfoDataEvent()); + + state.isAttendance.value = (state.isAttendance.value == 1 ? 0 : 1); + state.lockSettingInfo.value.attendance = state.isAttendance.value; + + eventBus.fire(LockSetChangeSetRefreshLockDetailWithType(0, state.lockSettingInfo.value.attendance!)); + print("state.lockSettingInfo.value.attendance:${state.lockSettingInfo.value.attendance}"); + Toast.show(msg: "设置成功"); + } + } + // 下级界面修改成功后传递数据 StreamSubscription? _passCurrentLockInformationEvent; void initLoadDataAction(BlockSetStateCallback blockSetStateCallback) { diff --git a/star_lock/lib/main/lockDetail/lcokSet/lockSet/lockSet_page.dart b/star_lock/lib/main/lockDetail/lcokSet/lockSet/lockSet_page.dart index f8a1b2e3..5bc6bac0 100644 --- a/star_lock/lib/main/lockDetail/lcokSet/lockSet/lockSet_page.dart +++ b/star_lock/lib/main/lockDetail/lcokSet/lockSet/lockSet_page.dart @@ -414,6 +414,19 @@ class _LockSetPageState extends State with RouteAware { isHaveRightWidget: true, rightWidget: _lockRemindSwitch())), ), + // APP开锁时是否需联网 + Obx(() => + Visibility( + visible: state.lockFeature.value.appUnlockOnline == 1 ? true : false, + child: + CommonItem( + leftTitel: "开锁时是否需联网", + rightTitle: "", + isHaveLine: false, + isHaveRightWidget: true, + rightWidget: _openLockNeedOnlineSwitch()), + ), + ), SizedBox(height: 10.h), // wifi配网 Obx( @@ -533,6 +546,7 @@ class _LockSetPageState extends State with RouteAware { style: TextStyle(fontSize: 22.sp, color: AppColors.darkGrayTextColor)); } + // 开启考勤 CupertinoSwitch _openCheckInSwitch() { // print("111111state.lockSettingInfo.value.attendance:${state.lockSettingInfo.value.attendance}"); return CupertinoSwitch( @@ -552,6 +566,7 @@ class _LockSetPageState extends State with RouteAware { ); } + // 开锁提醒 CupertinoSwitch _lockRemindSwitch() { return CupertinoSwitch( activeColor: CupertinoColors.activeBlue, @@ -566,6 +581,21 @@ class _LockSetPageState extends State with RouteAware { ); } + // APP开锁时是否需联网 + CupertinoSwitch _openLockNeedOnlineSwitch() { + return CupertinoSwitch( + activeColor: CupertinoColors.activeBlue, + trackColor: CupertinoColors.systemGrey5, + thumbColor: CupertinoColors.white, + value: (state.isOpenLockNeedOnline.value) == 1 ? true : false, + onChanged: (value) { + setState(() { + logic.sendBurglarAlarm(55); + }); + }, + ); + } + // 异常警告 CupertinoSwitch _lockExceptionWarningsSwitch() { print("isOpenBlueBroadcast222:${state.isOpenExceptionWarnings.value}"); diff --git a/star_lock/lib/main/lockDetail/lcokSet/lockSet/lockSet_state.dart b/star_lock/lib/main/lockDetail/lcokSet/lockSet/lockSet_state.dart index 759af3ef..a49a2fed 100644 --- a/star_lock/lib/main/lockDetail/lcokSet/lockSet/lockSet_state.dart +++ b/star_lock/lib/main/lockDetail/lcokSet/lockSet/lockSet_state.dart @@ -13,6 +13,7 @@ class LockSetState { var isAttendance = 0.obs;// 是否开启考勤 var currentDeviceUUid = "".obs;// 当前设备的uuid + var isOpenLockNeedOnline = 0.obs;// APP开锁时是否需联网 var isLockPickingReminder = 0.obs;// 是否开启开锁提醒 var isOpenBlueBroadcast = 0.obs;// 是否开启蓝牙广播 diff --git a/star_lock/lib/main/lockDetail/lcokSet/lockSoundSet/lockSoundSet_logic.dart b/star_lock/lib/main/lockDetail/lcokSet/lockSoundSet/lockSoundSet_logic.dart index 6baebc17..c4ff99cf 100644 --- a/star_lock/lib/main/lockDetail/lcokSet/lockSoundSet/lockSoundSet_logic.dart +++ b/star_lock/lib/main/lockDetail/lcokSet/lockSoundSet/lockSoundSet_logic.dart @@ -141,7 +141,7 @@ class LockSoundSetLogic extends BaseGetXController { privateKey: getPrivateKeyList ); } - }, isShowLoading: true); + }); } // 设置支持功能(带参数) diff --git a/star_lock/lib/main/lockDetail/lcokSet/lockTime/lockTime_logic.dart b/star_lock/lib/main/lockDetail/lcokSet/lockTime/lockTime_logic.dart index 34464025..af85a3e9 100644 --- a/star_lock/lib/main/lockDetail/lcokSet/lockTime/lockTime_logic.dart +++ b/star_lock/lib/main/lockDetail/lcokSet/lockTime/lockTime_logic.dart @@ -31,58 +31,58 @@ class LockTimeLogic extends BaseGetXController{ } // 获取锁状态 - if(reply is GetLockStatuReply) { - _replyGetLockStatus(reply); - } + // if(reply is GetLockStatuReply) { + // _replyGetLockStatus(reply); + // } }); } // 获取锁状态数据解析 - Future _replyGetLockStatus(Reply reply) async { - int status = reply.data[2]; - switch(status){ - case 0x00: - //成功 - print("${reply.commandType}数据解析成功"); - - // 锁当前时间 - var lockTime = reply.data.sublist(60, 64); - - int value = ( - (0xff & lockTime[(0)]) << 24 | - (0xff & lockTime[1]) << 16 | - (0xff & lockTime[2]) << 8 | - (0xFF & lockTime[3])); - - String dataEime = DateTool().dateToYMDHNSString("$value"); - state.dateTime.value = dataEime; - - // String dataEime = DateTool().dateToYMDHNSString("${value}"); - // state.dateTime.value = dataEime; - print("lockTime:$lockTime value:$value dataEime:$dataEime"); - break; - case 0x06: - //无权限 - print("${reply.commandType}需要鉴权"); - - break; - case 0x07: - //无权限 - print("${reply.commandType}用户无权限"); - - break; - case 0x09: - // 权限校验错误 - print("${reply.commandType}权限校验错误"); - - break; - default: - //失败 - print("${reply.commandType}失败"); - - break; - } - } + // Future _replyGetLockStatus(Reply reply) async { + // int status = reply.data[2]; + // switch(status){ + // case 0x00: + // //成功 + // print("${reply.commandType}数据解析成功"); + // + // // 锁当前时间 + // var lockTime = reply.data.sublist(60, 64); + // + // int value = ( + // (0xff & lockTime[(0)]) << 24 | + // (0xff & lockTime[1]) << 16 | + // (0xff & lockTime[2]) << 8 | + // (0xFF & lockTime[3])); + // + // String dataEime = DateTool().dateToYMDHNSString("$value"); + // state.dateTime.value = dataEime; + // + // // String dataEime = DateTool().dateToYMDHNSString("${value}"); + // // state.dateTime.value = dataEime; + // print("lockTime:$lockTime value:$value dataEime:$dataEime"); + // break; + // case 0x06: + // //无权限 + // print("${reply.commandType}需要鉴权"); + // + // break; + // case 0x07: + // //无权限 + // print("${reply.commandType}用户无权限"); + // + // break; + // case 0x09: + // // 权限校验错误 + // print("${reply.commandType}权限校验错误"); + // + // break; + // default: + // //失败 + // print("${reply.commandType}失败"); + // + // break; + // } + // } // 校时数据解析 Future _replyTiming(Reply reply) async { @@ -129,20 +129,20 @@ class LockTimeLogic extends BaseGetXController{ } // 获取锁状态 - Future _getLockStatus() async { - // 进来之后首先连接 - BlueManage().judgeReconnect(BlueManage().connectDeviceMacAddress, BlueManage().connectDeviceName, (DeviceConnectionState state) async { - if (state == DeviceConnectionState.connected) { - var privateKey = await Storage.getStringList(saveBluePrivateKey); - List getPrivateKeyList = changeStringListToIntList(privateKey!); - IoSenderManage.senderGetLockStatu( - lockID:BlueManage().connectDeviceName, - userID:await Storage.getUid(), - privateKey:getPrivateKeyList, - ); - } - }, isShowLoading: false); - } + // Future _getLockStatus() async { + // // 进来之后首先连接 + // BlueManage().judgeReconnect(BlueManage().connectDeviceMacAddress, BlueManage().connectDeviceName, (DeviceConnectionState state) async { + // if (state == DeviceConnectionState.connected) { + // var privateKey = await Storage.getStringList(saveBluePrivateKey); + // List getPrivateKeyList = changeStringListToIntList(privateKey!); + // IoSenderManage.senderGetLockStatu( + // lockID:BlueManage().connectDeviceName, + // userID:await Storage.getUid(), + // privateKey:getPrivateKeyList, + // ); + // } + // }, isShowLoading: false); + // } // 校验时间 Future sendTiming() async { diff --git a/star_lock/lib/main/lockDetail/lcokSet/motorPower/motorPower_logic.dart b/star_lock/lib/main/lockDetail/lcokSet/motorPower/motorPower_logic.dart index 6b0f5c69..822797bf 100644 --- a/star_lock/lib/main/lockDetail/lcokSet/motorPower/motorPower_logic.dart +++ b/star_lock/lib/main/lockDetail/lcokSet/motorPower/motorPower_logic.dart @@ -132,7 +132,7 @@ class MotorPowerLogic extends BaseGetXController { privateKey: getPrivateKeyList ); } - }, isShowLoading: true); + }); } // 设置支持功能(带参数) diff --git a/star_lock/lib/main/lockDetail/lcokSet/coerceFingerprint/coerceFingerprint_logic.dart b/star_lock/lib/main/lockDetail/lcokSet/msgNotification/coerceOpenDoor/coerceFingerprint/coerceFingerprint_logic.dart similarity index 100% rename from star_lock/lib/main/lockDetail/lcokSet/coerceFingerprint/coerceFingerprint_logic.dart rename to star_lock/lib/main/lockDetail/lcokSet/msgNotification/coerceOpenDoor/coerceFingerprint/coerceFingerprint_logic.dart diff --git a/star_lock/lib/main/lockDetail/lcokSet/coerceFingerprint/coerceFingerprint_page.dart b/star_lock/lib/main/lockDetail/lcokSet/msgNotification/coerceOpenDoor/coerceFingerprint/coerceFingerprint_page.dart similarity index 96% rename from star_lock/lib/main/lockDetail/lcokSet/coerceFingerprint/coerceFingerprint_page.dart rename to star_lock/lib/main/lockDetail/lcokSet/msgNotification/coerceOpenDoor/coerceFingerprint/coerceFingerprint_page.dart index 166eed11..a14e83b0 100644 --- a/star_lock/lib/main/lockDetail/lcokSet/coerceFingerprint/coerceFingerprint_page.dart +++ b/star_lock/lib/main/lockDetail/lcokSet/msgNotification/coerceOpenDoor/coerceFingerprint/coerceFingerprint_page.dart @@ -5,8 +5,8 @@ import 'package:star_lock/appRouters.dart'; import 'package:star_lock/tools/commonItem.dart'; import 'package:star_lock/tools/submitBtn.dart'; -import '../../../../../app_settings/app_colors.dart'; -import '../../../../../tools/titleAppBar.dart'; +import '../../../../../../app_settings/app_colors.dart'; +import '../../../../../../tools/titleAppBar.dart'; class CoerceFingerprintPage extends StatefulWidget { const CoerceFingerprintPage({Key? key}) : super(key: key); diff --git a/star_lock/lib/main/lockDetail/lcokSet/coerceFingerprint/coerceFingerprint_state.dart b/star_lock/lib/main/lockDetail/lcokSet/msgNotification/coerceOpenDoor/coerceFingerprint/coerceFingerprint_state.dart similarity index 100% rename from star_lock/lib/main/lockDetail/lcokSet/coerceFingerprint/coerceFingerprint_state.dart rename to star_lock/lib/main/lockDetail/lcokSet/msgNotification/coerceOpenDoor/coerceFingerprint/coerceFingerprint_state.dart diff --git a/star_lock/lib/main/lockDetail/lcokSet/coerceFingerprintList/coerceFingerprintList_logic.dart b/star_lock/lib/main/lockDetail/lcokSet/msgNotification/coerceOpenDoor/coerceFingerprintList/coerceFingerprintList_logic.dart similarity index 100% rename from star_lock/lib/main/lockDetail/lcokSet/coerceFingerprintList/coerceFingerprintList_logic.dart rename to star_lock/lib/main/lockDetail/lcokSet/msgNotification/coerceOpenDoor/coerceFingerprintList/coerceFingerprintList_logic.dart diff --git a/star_lock/lib/main/lockDetail/lcokSet/coerceFingerprintList/coerceFingerprintList_page.dart b/star_lock/lib/main/lockDetail/lcokSet/msgNotification/coerceOpenDoor/coerceFingerprintList/coerceFingerprintList_page.dart similarity index 95% rename from star_lock/lib/main/lockDetail/lcokSet/coerceFingerprintList/coerceFingerprintList_page.dart rename to star_lock/lib/main/lockDetail/lcokSet/msgNotification/coerceOpenDoor/coerceFingerprintList/coerceFingerprintList_page.dart index 0d99a0c5..1e7ad2e2 100644 --- a/star_lock/lib/main/lockDetail/lcokSet/coerceFingerprintList/coerceFingerprintList_page.dart +++ b/star_lock/lib/main/lockDetail/lcokSet/msgNotification/coerceOpenDoor/coerceFingerprintList/coerceFingerprintList_page.dart @@ -2,10 +2,11 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:star_lock/main/lockDetail/lcokSet/lockUser/lockUser_logic.dart'; -import '../../../../app_settings/app_colors.dart'; -import '../../../../tools/submitBtn.dart'; -import '../../../../tools/titleAppBar.dart'; -import '../../../../translations/trans_lib.dart'; + +import '../../../../../../app_settings/app_colors.dart'; +import '../../../../../../tools/submitBtn.dart'; +import '../../../../../../tools/titleAppBar.dart'; +import '../../../../../../translations/trans_lib.dart'; class CoerceFingerprintListPage extends StatefulWidget { const CoerceFingerprintListPage({Key? key}) : super(key: key); diff --git a/star_lock/lib/main/lockDetail/lcokSet/coerceFingerprintList/coerceFingerprintList_state.dart b/star_lock/lib/main/lockDetail/lcokSet/msgNotification/coerceOpenDoor/coerceFingerprintList/coerceFingerprintList_state.dart similarity index 100% rename from star_lock/lib/main/lockDetail/lcokSet/coerceFingerprintList/coerceFingerprintList_state.dart rename to star_lock/lib/main/lockDetail/lcokSet/msgNotification/coerceOpenDoor/coerceFingerprintList/coerceFingerprintList_state.dart diff --git a/star_lock/lib/main/lockDetail/lcokSet/coerceOpenDoor/coerceOpenDoor_logic.dart b/star_lock/lib/main/lockDetail/lcokSet/msgNotification/coerceOpenDoor/coerceOpenDoor/coerceOpenDoor_logic.dart similarity index 65% rename from star_lock/lib/main/lockDetail/lcokSet/coerceOpenDoor/coerceOpenDoor_logic.dart rename to star_lock/lib/main/lockDetail/lcokSet/msgNotification/coerceOpenDoor/coerceOpenDoor/coerceOpenDoor_logic.dart index cf0d75b2..dbd8306c 100644 --- a/star_lock/lib/main/lockDetail/lcokSet/coerceOpenDoor/coerceOpenDoor_logic.dart +++ b/star_lock/lib/main/lockDetail/lcokSet/msgNotification/coerceOpenDoor/coerceOpenDoor/coerceOpenDoor_logic.dart @@ -1,6 +1,7 @@ -import 'package:star_lock/main/lockDetail/lcokSet/coerceOpenDoor/coerceOpenDoor_state.dart'; import 'package:star_lock/tools/baseGetXController.dart'; +import 'coerceOpenDoor_state.dart'; + class CoerceOpenDoorLogic extends BaseGetXController { final CoerceOpenDoorState state = CoerceOpenDoorState(); } diff --git a/star_lock/lib/main/lockDetail/lcokSet/coerceOpenDoor/coerceOpenDoor_page.dart b/star_lock/lib/main/lockDetail/lcokSet/msgNotification/coerceOpenDoor/coerceOpenDoor/coerceOpenDoor_page.dart similarity index 95% rename from star_lock/lib/main/lockDetail/lcokSet/coerceOpenDoor/coerceOpenDoor_page.dart rename to star_lock/lib/main/lockDetail/lcokSet/msgNotification/coerceOpenDoor/coerceOpenDoor/coerceOpenDoor_page.dart index 8899b845..4171e4de 100644 --- a/star_lock/lib/main/lockDetail/lcokSet/coerceOpenDoor/coerceOpenDoor_page.dart +++ b/star_lock/lib/main/lockDetail/lcokSet/msgNotification/coerceOpenDoor/coerceOpenDoor/coerceOpenDoor_page.dart @@ -2,10 +2,11 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:star_lock/appRouters.dart'; -import 'package:star_lock/main/lockDetail/lcokSet/coerceOpenDoor/coerceOpenDoor_logic.dart'; -import '../../../../app_settings/app_colors.dart'; -import '../../../../tools/submitBtn.dart'; -import '../../../../tools/titleAppBar.dart'; + +import '../../../../../../app_settings/app_colors.dart'; +import '../../../../../../tools/submitBtn.dart'; +import '../../../../../../tools/titleAppBar.dart'; +import 'coerceOpenDoor_logic.dart'; class CoerceOpenDoorPage extends StatefulWidget { const CoerceOpenDoorPage({Key? key}) : super(key: key); diff --git a/star_lock/lib/main/lockDetail/lcokSet/coerceOpenDoor/coerceOpenDoor_state.dart b/star_lock/lib/main/lockDetail/lcokSet/msgNotification/coerceOpenDoor/coerceOpenDoor/coerceOpenDoor_state.dart similarity index 100% rename from star_lock/lib/main/lockDetail/lcokSet/coerceOpenDoor/coerceOpenDoor_state.dart rename to star_lock/lib/main/lockDetail/lcokSet/msgNotification/coerceOpenDoor/coerceOpenDoor/coerceOpenDoor_state.dart diff --git a/star_lock/lib/main/lockDetail/lcokSet/lowBatteryReminder/lowBatteryReminder_logic.dart b/star_lock/lib/main/lockDetail/lcokSet/msgNotification/lowBatteryReminder/lowBatteryReminder_logic.dart similarity index 64% rename from star_lock/lib/main/lockDetail/lcokSet/lowBatteryReminder/lowBatteryReminder_logic.dart rename to star_lock/lib/main/lockDetail/lcokSet/msgNotification/lowBatteryReminder/lowBatteryReminder_logic.dart index 833130f5..b080d53f 100644 --- a/star_lock/lib/main/lockDetail/lcokSet/lowBatteryReminder/lowBatteryReminder_logic.dart +++ b/star_lock/lib/main/lockDetail/lcokSet/msgNotification/lowBatteryReminder/lowBatteryReminder_logic.dart @@ -1,6 +1,7 @@ -import 'package:star_lock/main/lockDetail/lcokSet/lowBatteryReminder/lowBatteryReminder_state.dart'; import 'package:star_lock/tools/baseGetXController.dart'; +import 'lowBatteryReminder_state.dart'; + class LowBatteryReminderLogic extends BaseGetXController { LowBatteryReminderState state = LowBatteryReminderState(); } diff --git a/star_lock/lib/main/lockDetail/lcokSet/lowBatteryReminder/lowBatteryReminder_page.dart b/star_lock/lib/main/lockDetail/lcokSet/msgNotification/lowBatteryReminder/lowBatteryReminder_page.dart similarity index 97% rename from star_lock/lib/main/lockDetail/lcokSet/lowBatteryReminder/lowBatteryReminder_page.dart rename to star_lock/lib/main/lockDetail/lcokSet/msgNotification/lowBatteryReminder/lowBatteryReminder_page.dart index 1b2a5e4f..7bdc2f5f 100644 --- a/star_lock/lib/main/lockDetail/lcokSet/lowBatteryReminder/lowBatteryReminder_page.dart +++ b/star_lock/lib/main/lockDetail/lcokSet/msgNotification/lowBatteryReminder/lowBatteryReminder_page.dart @@ -3,12 +3,12 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:star_lock/appRouters.dart'; -import 'package:star_lock/main/lockDetail/lcokSet/lowBatteryReminder/lowBatteryReminder_logic.dart'; import 'package:star_lock/tools/commonItem.dart'; import 'package:star_lock/tools/submitBtn.dart'; import '../../../../../app_settings/app_colors.dart'; import '../../../../../tools/titleAppBar.dart'; +import 'lowBatteryReminder_logic.dart'; class LowBatteryReminderPage extends StatefulWidget { const LowBatteryReminderPage({Key? key}) : super(key: key); diff --git a/star_lock/lib/main/lockDetail/lcokSet/lowBatteryReminder/lowBatteryReminder_state.dart b/star_lock/lib/main/lockDetail/lcokSet/msgNotification/lowBatteryReminder/lowBatteryReminder_state.dart similarity index 100% rename from star_lock/lib/main/lockDetail/lcokSet/lowBatteryReminder/lowBatteryReminder_state.dart rename to star_lock/lib/main/lockDetail/lcokSet/msgNotification/lowBatteryReminder/lowBatteryReminder_state.dart diff --git a/star_lock/lib/main/lockDetail/lcokSet/msgNotification/msgNotification_logic.dart b/star_lock/lib/main/lockDetail/lcokSet/msgNotification/msgNotification/msgNotification_logic.dart similarity index 65% rename from star_lock/lib/main/lockDetail/lcokSet/msgNotification/msgNotification_logic.dart rename to star_lock/lib/main/lockDetail/lcokSet/msgNotification/msgNotification/msgNotification_logic.dart index 9817187a..0c09a6ee 100644 --- a/star_lock/lib/main/lockDetail/lcokSet/msgNotification/msgNotification_logic.dart +++ b/star_lock/lib/main/lockDetail/lcokSet/msgNotification/msgNotification/msgNotification_logic.dart @@ -1,5 +1,6 @@ -import 'package:star_lock/main/lockDetail/lcokSet/msgNotification/msgNotification_state.dart'; + import 'package:star_lock/tools/baseGetXController.dart'; +import 'msgNotification_state.dart'; class MsgNotificationLogic extends BaseGetXController { final MsgNotificationState state = MsgNotificationState(); diff --git a/star_lock/lib/main/lockDetail/lcokSet/msgNotification/msgNotification_page.dart b/star_lock/lib/main/lockDetail/lcokSet/msgNotification/msgNotification/msgNotification_page.dart similarity index 76% rename from star_lock/lib/main/lockDetail/lcokSet/msgNotification/msgNotification_page.dart rename to star_lock/lib/main/lockDetail/lcokSet/msgNotification/msgNotification/msgNotification_page.dart index e65d973c..85fafd44 100644 --- a/star_lock/lib/main/lockDetail/lcokSet/msgNotification/msgNotification_page.dart +++ b/star_lock/lib/main/lockDetail/lcokSet/msgNotification/msgNotification/msgNotification_page.dart @@ -3,11 +3,11 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:star_lock/appRouters.dart'; -import 'package:star_lock/main/lockDetail/lcokSet/msgNotification/msgNotification_logic.dart'; +import 'package:star_lock/main/lockDetail/lcokSet/msgNotification/msgNotification/msgNotification_logic.dart'; -import '../../../../app_settings/app_colors.dart'; -import '../../../../tools/commonItem.dart'; -import '../../../../tools/titleAppBar.dart'; +import '../../../../../app_settings/app_colors.dart'; +import '../../../../../tools/commonItem.dart'; +import '../../../../../tools/titleAppBar.dart'; class MsgNotificationPage extends StatefulWidget { const MsgNotificationPage({Key? key}) : super(key: key); @@ -38,7 +38,7 @@ class _MsgNotificationPageState extends State { @override Widget build(BuildContext context) { return Scaffold( - backgroundColor: Colors.white, + backgroundColor: AppColors.mainBackgroundColor, appBar: TitleAppBar( barTitle: '消息提醒', haveBack: true, @@ -51,31 +51,33 @@ class _MsgNotificationPageState extends State { Widget _buildMainItem() { return Column( children: [ - Container( - alignment: Alignment.centerLeft, - margin: EdgeInsets.only(left: 40.w, top: 40.h, bottom: 30.h), - child: Text( - '门锁通知', - style: - TextStyle(color: AppColors.msgNoticeTextColor, fontSize: 24.sp), - ), - ), + // Container( + // alignment: Alignment.centerLeft, + // margin: EdgeInsets.only(left: 40.w, top: 20.h, bottom: 20.h), + // child: Text( + // '门锁通知', + // style: TextStyle(color: Colors.black, fontSize: 26.sp, fontWeight: FontWeight.w500), + // ), + // ), + // Divider( + // color: AppColors.greyLineColor, + // indent: 20.w, + // endIndent: 20.w, + // height: 1, + // ), CommonItem( leftTitel: '开门通知', rightTitle: "已启用", - isHaveLine: false, + isHaveLine: true, isHaveDirection: true, action: () { Get.toNamed(Routers.openDoorNotifyPage); }, ), - SizedBox( - height: 20.h, - ), CommonItem( leftTitel: 'N天未开门', rightTitle: "已启用", - isHaveLine: false, + isHaveLine: true, isHaveDirection: true, action: () { Get.toNamed(Routers.nDaysUnopenedPage); @@ -91,40 +93,28 @@ class _MsgNotificationPageState extends State { // isHaveRightWidget: true, // rightWidget: // SizedBox(width: 60.w, height: 50.h, child: _switch(1)))), - SizedBox( - height: 20.h, - ), Obx(() => CommonItem( leftTitel: '门未关好', rightTitle: "", - isHaveLine: false, + isHaveLine: true, isHaveRightWidget: true, rightWidget: SizedBox(width: 60.w, height: 50.h, child: _switch(2)))), - SizedBox( - height: 20.h, - ), CommonItem( leftTitel: '防拆报警', rightTitle: "已启用", - isHaveLine: false, + isHaveLine: true, isHaveDirection: true, ), - SizedBox( - height: 20.h, - ), CommonItem( leftTitel: '低电量提醒', rightTitle: "已启用", - isHaveLine: false, + isHaveLine: true, isHaveDirection: true, action: () { Get.toNamed(Routers.lowBatteryReminderPage); }, ), - SizedBox( - height: 20.h, - ), CommonItem( leftTitel: '胁迫开门', rightTitle: "", @@ -134,17 +124,16 @@ class _MsgNotificationPageState extends State { Get.toNamed(Routers.coerceOpenDoorPage); }, ), + // Container( + // alignment: Alignment.centerLeft, + // margin: EdgeInsets.only(left: 40.w, top: 20.h, bottom: 20.h), + // child: Text( + // '门铃通知', + // style: TextStyle(color: Colors.black, fontSize: 26.sp, fontWeight: FontWeight.w500), + // ), + // ), SizedBox( - height: 30.h, - ), - Container( - alignment: Alignment.centerLeft, - margin: EdgeInsets.only(left: 40.w, top: 40.h, bottom: 30.h), - child: Text( - '门铃通知', - style: - TextStyle(color: AppColors.msgNoticeTextColor, fontSize: 24.sp), - ), + height: 10.h, ), Obx(() => CommonItem( leftTitel: '有人按门铃', @@ -153,22 +142,21 @@ class _MsgNotificationPageState extends State { isHaveRightWidget: true, rightWidget: SizedBox(width: 60.w, height: 50.h, child: _switch(3)))), + // Container( + // alignment: Alignment.centerLeft, + // margin: EdgeInsets.only(left: 40.w, top: 40.h, bottom: 30.h), + // child: Text( + // '猫眼通知', + // style:TextStyle(color: Colors.black, fontSize: 26.sp, fontWeight: FontWeight.w500) + // ), + // ), SizedBox( - height: 30.h, - ), - Container( - alignment: Alignment.centerLeft, - margin: EdgeInsets.only(left: 40.w, top: 40.h, bottom: 30.h), - child: Text( - '猫眼通知', - style: - TextStyle(color: AppColors.msgNoticeTextColor, fontSize: 24.sp), - ), + height: 10.h, ), Obx(() => CommonItem( leftTitel: '有人出现在门口', rightTitle: "", - isHaveLine: false, + isHaveLine: true, isHaveRightWidget: true, rightWidget: SizedBox(width: 60.w, height: 50.h, child: _switch(4)))), diff --git a/star_lock/lib/main/lockDetail/lcokSet/msgNotification/msgNotification_state.dart b/star_lock/lib/main/lockDetail/lcokSet/msgNotification/msgNotification/msgNotification_state.dart similarity index 100% rename from star_lock/lib/main/lockDetail/lcokSet/msgNotification/msgNotification_state.dart rename to star_lock/lib/main/lockDetail/lcokSet/msgNotification/msgNotification/msgNotification_state.dart diff --git a/star_lock/lib/main/lockDetail/lcokSet/nDaysUnopened/nDaysUnopened_logic.dart b/star_lock/lib/main/lockDetail/lcokSet/msgNotification/nDaysUnopened/nDaysUnopened_logic.dart similarity index 64% rename from star_lock/lib/main/lockDetail/lcokSet/nDaysUnopened/nDaysUnopened_logic.dart rename to star_lock/lib/main/lockDetail/lcokSet/msgNotification/nDaysUnopened/nDaysUnopened_logic.dart index 5b7aa719..e986ef89 100644 --- a/star_lock/lib/main/lockDetail/lcokSet/nDaysUnopened/nDaysUnopened_logic.dart +++ b/star_lock/lib/main/lockDetail/lcokSet/msgNotification/nDaysUnopened/nDaysUnopened_logic.dart @@ -1,6 +1,7 @@ -import 'package:star_lock/main/lockDetail/lcokSet/nDaysUnopened/nDaysUnopened_state.dart'; import 'package:star_lock/tools/baseGetXController.dart'; +import 'nDaysUnopened_state.dart'; + class NDaysUnopenedLogic extends BaseGetXController { NDaysUnopenedState state = NDaysUnopenedState(); } diff --git a/star_lock/lib/main/lockDetail/lcokSet/nDaysUnopened/nDaysUnopened_page.dart b/star_lock/lib/main/lockDetail/lcokSet/msgNotification/nDaysUnopened/nDaysUnopened_page.dart similarity index 98% rename from star_lock/lib/main/lockDetail/lcokSet/nDaysUnopened/nDaysUnopened_page.dart rename to star_lock/lib/main/lockDetail/lcokSet/msgNotification/nDaysUnopened/nDaysUnopened_page.dart index 3da8e3d7..241a6716 100644 --- a/star_lock/lib/main/lockDetail/lcokSet/nDaysUnopened/nDaysUnopened_page.dart +++ b/star_lock/lib/main/lockDetail/lcokSet/msgNotification/nDaysUnopened/nDaysUnopened_page.dart @@ -5,12 +5,12 @@ import 'package:flutter_pickers/style/default_style.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:star_lock/appRouters.dart'; -import 'package:star_lock/main/lockDetail/lcokSet/nDaysUnopened/nDaysUnopened_logic.dart'; import 'package:star_lock/tools/commonItem.dart'; import 'package:star_lock/tools/submitBtn.dart'; import '../../../../../app_settings/app_colors.dart'; import '../../../../../tools/titleAppBar.dart'; +import 'nDaysUnopened_logic.dart'; class NDaysUnopenedPage extends StatefulWidget { const NDaysUnopenedPage({Key? key}) : super(key: key); diff --git a/star_lock/lib/main/lockDetail/lcokSet/nDaysUnopened/nDaysUnopened_state.dart b/star_lock/lib/main/lockDetail/lcokSet/msgNotification/nDaysUnopened/nDaysUnopened_state.dart similarity index 100% rename from star_lock/lib/main/lockDetail/lcokSet/nDaysUnopened/nDaysUnopened_state.dart rename to star_lock/lib/main/lockDetail/lcokSet/msgNotification/nDaysUnopened/nDaysUnopened_state.dart diff --git a/star_lock/lib/main/lockDetail/lcokSet/openDoorNotify/openDoorNotify_logic.dart b/star_lock/lib/main/lockDetail/lcokSet/msgNotification/openDoorNotify/openDoorNotify_logic.dart similarity index 65% rename from star_lock/lib/main/lockDetail/lcokSet/openDoorNotify/openDoorNotify_logic.dart rename to star_lock/lib/main/lockDetail/lcokSet/msgNotification/openDoorNotify/openDoorNotify_logic.dart index 3d826370..4bac0f4b 100644 --- a/star_lock/lib/main/lockDetail/lcokSet/openDoorNotify/openDoorNotify_logic.dart +++ b/star_lock/lib/main/lockDetail/lcokSet/msgNotification/openDoorNotify/openDoorNotify_logic.dart @@ -1,5 +1,6 @@ -import 'package:star_lock/main/lockDetail/lcokSet/openDoorNotify/openDoorNotify_state.dart'; + import 'package:star_lock/tools/baseGetXController.dart'; +import 'openDoorNotify_state.dart'; class OpenDoorNotifyLogic extends BaseGetXController { final OpenDoorNotifyState state = OpenDoorNotifyState(); diff --git a/star_lock/lib/main/lockDetail/lcokSet/openDoorNotify/openDoorNotify_page.dart b/star_lock/lib/main/lockDetail/lcokSet/msgNotification/openDoorNotify/openDoorNotify_page.dart similarity index 95% rename from star_lock/lib/main/lockDetail/lcokSet/openDoorNotify/openDoorNotify_page.dart rename to star_lock/lib/main/lockDetail/lcokSet/msgNotification/openDoorNotify/openDoorNotify_page.dart index cd52a042..c24a07e3 100644 --- a/star_lock/lib/main/lockDetail/lcokSet/openDoorNotify/openDoorNotify_page.dart +++ b/star_lock/lib/main/lockDetail/lcokSet/msgNotification/openDoorNotify/openDoorNotify_page.dart @@ -2,10 +2,11 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:star_lock/appRouters.dart'; -import 'package:star_lock/main/lockDetail/lcokSet/openDoorNotify/openDoorNotify_logic.dart'; -import '../../../../app_settings/app_colors.dart'; -import '../../../../tools/submitBtn.dart'; -import '../../../../tools/titleAppBar.dart'; + +import '../../../../../app_settings/app_colors.dart'; +import '../../../../../tools/submitBtn.dart'; +import '../../../../../tools/titleAppBar.dart'; +import 'openDoorNotify_logic.dart'; class OpenDoorNotifyPage extends StatefulWidget { const OpenDoorNotifyPage({Key? key}) : super(key: key); diff --git a/star_lock/lib/main/lockDetail/lcokSet/openDoorNotify/openDoorNotify_state.dart b/star_lock/lib/main/lockDetail/lcokSet/msgNotification/openDoorNotify/openDoorNotify_state.dart similarity index 100% rename from star_lock/lib/main/lockDetail/lcokSet/openDoorNotify/openDoorNotify_state.dart rename to star_lock/lib/main/lockDetail/lcokSet/msgNotification/openDoorNotify/openDoorNotify_state.dart diff --git a/star_lock/lib/main/lockDetail/lcokSet/normallyOpenMode/normallyOpenMode_logic.dart b/star_lock/lib/main/lockDetail/lcokSet/normallyOpenMode/normallyOpenMode_logic.dart index cba0c7a2..9853b9e4 100644 --- a/star_lock/lib/main/lockDetail/lcokSet/normallyOpenMode/normallyOpenMode_logic.dart +++ b/star_lock/lib/main/lockDetail/lcokSet/normallyOpenMode/normallyOpenMode_logic.dart @@ -160,7 +160,7 @@ class NormallyOpenModeLogic extends BaseGetXController{ privateKey: getPrivateKeyList ); } - }, isShowLoading: true); + }); } // 设置支持功能(带参数) diff --git a/star_lock/lib/main/lockDetail/lcokSet/openDoorDirection/openDoorDirection_logic.dart b/star_lock/lib/main/lockDetail/lcokSet/openDoorDirection/openDoorDirection_logic.dart index 0325f044..ea6cc020 100644 --- a/star_lock/lib/main/lockDetail/lcokSet/openDoorDirection/openDoorDirection_logic.dart +++ b/star_lock/lib/main/lockDetail/lcokSet/openDoorDirection/openDoorDirection_logic.dart @@ -134,7 +134,7 @@ class OpenDoorDirectionLogic extends BaseGetXController { privateKey: getPrivateKeyList ); } - }, isShowLoading: true); + }); } // 设置支持功能(带参数) diff --git a/star_lock/lib/main/lockDetail/lcokSet/resetButton/resetButton_logic.dart b/star_lock/lib/main/lockDetail/lcokSet/resetButton/resetButton_logic.dart index 27d8f66b..8e22c031 100644 --- a/star_lock/lib/main/lockDetail/lcokSet/resetButton/resetButton_logic.dart +++ b/star_lock/lib/main/lockDetail/lcokSet/resetButton/resetButton_logic.dart @@ -135,7 +135,7 @@ class ResetButtonLogic extends BaseGetXController{ privateKey: getPrivateKeyList ); } - }, isShowLoading: true); + }); } // 设置支持功能(带参数) diff --git a/star_lock/lib/main/lockDetail/lcokSet/uploadData/uploadData_page.dart b/star_lock/lib/main/lockDetail/lcokSet/uploadData/uploadData_page.dart index 457775c7..6ddfa29b 100644 --- a/star_lock/lib/main/lockDetail/lcokSet/uploadData/uploadData_page.dart +++ b/star_lock/lib/main/lockDetail/lcokSet/uploadData/uploadData_page.dart @@ -27,7 +27,7 @@ class _UploadDataPageState extends State { Row( mainAxisAlignment: MainAxisAlignment.start, children: [ - Expanded(child: Text(TranslationLoader.lanKeys!.uploadDataTip!.tr, style: TextStyle(fontSize: 24.sp,),)), + Expanded(child: Text(TranslationLoader.lanKeys!.uploadDataTip!.tr, style: TextStyle(fontSize: 22.sp, color: AppColors.darkGrayTextColor),)), ], ), SizedBox(height: 30.h,), diff --git a/star_lock/lib/main/lockDetail/lockDetail/lockDetail_logic.dart b/star_lock/lib/main/lockDetail/lockDetail/lockDetail_logic.dart index c63695c4..77e57442 100644 --- a/star_lock/lib/main/lockDetail/lockDetail/lockDetail_logic.dart +++ b/star_lock/lib/main/lockDetail/lockDetail/lockDetail_logic.dart @@ -1,14 +1,10 @@ import 'dart:async'; -import 'dart:convert'; import 'dart:io'; -import 'package:flutter/material.dart'; -import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_reactive_ble/flutter_reactive_ble.dart'; import 'package:permission_handler/permission_handler.dart'; import 'package:star_lock/blue/io_protocol/io_editUser.dart'; -import 'package:star_lock/blue/io_protocol/io_factoryDataReset.dart'; import 'package:star_lock/blue/io_protocol/io_getLockStatu.dart'; import 'package:star_lock/blue/io_type.dart'; import 'package:star_lock/tools/toast.dart'; @@ -18,12 +14,9 @@ import '../../../blue/io_protocol/io_getStarLockStatusInfo.dart'; import '../../../blue/io_protocol/io_openLock.dart'; import '../../../blue/io_protocol/io_referEventRecordTime.dart'; import '../../../blue/io_reply.dart'; -import '../../../blue/io_tool/io_manager.dart'; import '../../../blue/io_tool/io_tool.dart'; import '../../../blue/io_tool/manager_event_bus.dart'; import '../../../blue/sender_manage.dart'; -import '../../../login/login/entity/LoginData.dart'; -import '../../../login/login/entity/LoginEntity.dart'; import '../../../network/api_repository.dart'; import '../../../tools/baseGetXController.dart'; import '../../../tools/eventBusEventManage.dart'; @@ -31,6 +24,7 @@ import '../../../tools/storage.dart'; import '../electronicKey/electronicKeyDetail/keyOperationRecordEntity.dart'; import '../lockOperatingRecord/lockOperatingRecordGetLastRecordTime_entity.dart'; import 'lockDetail_state.dart'; +import 'lockNetToken_entity.dart'; class LockDetailLogic extends BaseGetXController{ final LockDetailState state = LockDetailState(); @@ -44,15 +38,10 @@ class LockDetailLogic extends BaseGetXController{ _replyOpenLock(reply); } - // 获取锁状态 - if(reply is GetLockStatuReply) { - _replyGetLockStatus(reply); - } - // 编辑锁用户 - if(reply is EditUserReply){ - _replyEditUserKey(reply); - } + // if(reply is EditUserReply){ + // _replyEditUserKey(reply); + // } // 获取星锁状态信息 if(reply is GetStarLockStatuInfoReply){ @@ -76,11 +65,12 @@ class LockDetailLogic extends BaseGetXController{ var tokenData = reply.data.sublist(2, 6); var saveStrList = changeIntListToStringList(tokenData); - print("openDoorToken:$tokenData"); + // print("openDoorToken:$tokenData"); Storage.setStringList(saveBlueToken, saveStrList); // 电量 int power = reply.data[7]; + state.electricQuantity.value = power; int status = reply.data[6]; print("status:$status"); @@ -96,15 +86,15 @@ class LockDetailLogic extends BaseGetXController{ // state.animationController.isCompleted; break; case 0x06: - //无权限 + //无权限 print("${reply.commandType}需要鉴权"); - print("millisecondsSinceEpoch/1000:${DateTime.now().millisecondsSinceEpoch~/1000}"); IoSenderManage.senderOpenLock( keyID: BlueManage().connectDeviceName, userID: await Storage.getUid(), openMode: 1, openTime: DateTime.now().millisecondsSinceEpoch~/1000, + onlineToken:state.lockNetToken, token: tokenData, needAuthor: 1, signKey: signKeyDataList, @@ -130,139 +120,67 @@ class LockDetailLogic extends BaseGetXController{ } } - // 获取锁状态数据解析 - Future _replyGetLockStatus(Reply reply) async { - int status = reply.data[2]; - switch(status){ - case 0x00: - //成功 - print("${reply.commandType}数据解析成功"); - var softVersion = reply.data.sublist(3, 7); - print("softVersion:$softVersion"); - - var power = reply.data[7]; - print("power:$power"); - - // APP 用户数量 - var appUserCount = reply.data.sublist(50, 53); - print("appUserCount:$appUserCount"); - - // 黑名单用户数量 - var blacklistCount = reply.data[53]; - print("blacklistCount:$blacklistCount"); - - // 蓝牙钥匙数量 - var bleKeyCount = reply.data[54]; - print("bleKeyCount:$bleKeyCount"); - - // 剩余可添加用户数量 - var remainCount = reply.data.sublist(54, 56); - print("remainCount:$remainCount"); - - // 未上传开锁记录数量 - var notUploadCount = reply.data.sublist(56, 58); - print("notUploadCount:$notUploadCount"); - - // 已设置开门密码数量 - var pwdCount = reply.data[58]; - print("pwdCount:$pwdCount"); - - // 已设置开门指纹数量 - var fingerprintCount = reply.data[59]; - print("fingerprintCount:$fingerprintCount"); - - // 锁当前时间 - var lockTime = reply.data.sublist(60, 64); - print("lockTime:$lockTime"); - - // 硬件版本信息,为固件升级提供判断依据 - var hardVersion = reply.data.sublist(64, 68); - print("hardVersion:$hardVersion"); - - break; - case 0x06: - //无权限 - print("${reply.commandType}需要鉴权"); - - break; - case 0x07: - //无权限 - print("${reply.commandType}用户无权限"); - - break; - case 0x09: - // 权限校验错误 - print("${reply.commandType}权限校验错误"); - - break; - default: - //失败 - print("${reply.commandType}失败"); - - break; - } - } - // 编辑用户数据解析 - Future _replyEditUserKey(Reply reply) async { - var token = reply.data.sublist(2, 6); - var saveStrList = changeIntListToStringList(token); - print("_replyEditUserKeyToken:$token"); - Storage.setStringList(saveBlueToken, saveStrList); - - int status = reply.data[6]; - print("status:$status"); - - switch(status){ - case 0x00: - //成功 - print("${reply.commandType!.typeValue} 数据解析成功"); - - break; - case 0x06: - //无权限 - print("${reply.commandType!.typeValue} 需要鉴权"); - var privateKey = await Storage.getStringList(saveBluePrivateKey); - List getPrivateKeyList = changeStringListToIntList(privateKey!); - - var publicKey = await Storage.getStringList(saveBluePublicKey); - List publicKeyDataList = changeStringListToIntList(publicKey!); - - IoSenderManage.senderEditUser( - lockID:BlueManage().connectDeviceName, - authUserID:await Storage.getUid(), - keyID:"1", - userID:await Storage.getUid(), - openMode:1, - keyType:1, - startDate:0x11223344, - expireDate:0x11223344, - role:255, - password:"123456", - needAuthor:1, - publicKey:publicKeyDataList, - privateKey:getPrivateKeyList, - token: token - ); - break; - case 0x07: - //无权限 - print("${reply.commandType!.typeValue} 用户无权限"); - - break; - case 0x09: - // 权限校验错误 - print("${reply.commandType!.typeValue} 权限校验错误"); - - break; - default: - //失败 - print("${reply.commandType!.typeValue} 失败"); - - break; - } - } + // Future _replyEditUserKey(Reply reply) async { + // var token = reply.data.sublist(2, 6); + // var saveStrList = changeIntListToStringList(token); + // print("_replyEditUserKeyToken:$token"); + // Storage.setStringList(saveBlueToken, saveStrList); + // + // int status = reply.data[6]; + // print("status:$status"); + // + // switch(status){ + // case 0x00: + // //成功 + // print("${reply.commandType!.typeValue} 数据解析成功"); + // + // break; + // case 0x06: + // //无权限 + // print("${reply.commandType!.typeValue} 需要鉴权"); + // var privateKey = await Storage.getStringList(saveBluePrivateKey); + // List getPrivateKeyList = changeStringListToIntList(privateKey!); + // + // var publicKey = await Storage.getStringList(saveBluePublicKey); + // List publicKeyDataList = changeStringListToIntList(publicKey!); + // + // IoSenderManage.senderEditUser( + // lockID:BlueManage().connectDeviceName, + // authUserID:await Storage.getUid(), + // keyID:"1", + // userID:await Storage.getUid(), + // openMode:1, + // keyType:1, + // startDate:0x11223344, + // expireDate:0x11223344, + // role:255, + // password:"123456", + // needAuthor:1, + // publicKey:publicKeyDataList, + // privateKey:getPrivateKeyList, + // token: token + // ); + // break; + // case 0x07: + // //无权限 + // print("${reply.commandType!.typeValue} 用户无权限"); + // + // break; + // case 0x09: + // // 权限校验错误 + // print("${reply.commandType!.typeValue} 权限校验错误"); + // + // break; + // default: + // //失败 + // print("${reply.commandType!.typeValue} 失败"); + // + // break; + // } + // } + // 获取锁状态数据解析 Future _replyGetStarLockStatusInfo(Reply reply) async { int status = reply.data[2]; switch(status){ @@ -271,55 +189,55 @@ class LockDetailLogic extends BaseGetXController{ print("${reply.commandType}数据解析成功"); // 厂商名称 var vendor = reply.data.sublist(3, 23); - print("vendor:$vendor"); + // print("vendor:$vendor"); // 锁设备类型 var product = reply.data[23]; - print("product:$product"); + // print("product:$product"); // 产品名称 var model = reply.data.sublist(24, 44); - print("model:$model"); + // print("model:$model"); // 软件版本 var fwVersion = reply.data.sublist(44, 64); - print("fwVersion:$fwVersion"); + // print("fwVersion:$fwVersion"); // 硬件版本 var hwVersion = reply.data.sublist(64, 84); - print("hwVersion:$hwVersion"); + // print("hwVersion:$hwVersion"); // 厂商序列号 var serialNum0 = reply.data.sublist(84, 100); - print("serialNum0:$serialNum0"); + // print("serialNum0:$serialNum0"); // 成品商序列号 var serialNum1 = reply.data.sublist(100, 116); - print("serialNum1:$serialNum1"); + // print("serialNum1:$serialNum1"); // 蓝牙名称 var btDeviceName = reply.data.sublist(116, 132); - print("btDeviceName:$btDeviceName"); + // print("btDeviceName:$btDeviceName"); // 电池剩余电量 var battRemCap = reply.data[132]; - print("battRemCap:$battRemCap"); + // print("battRemCap:$battRemCap"); // 重置次数 var restoreCounter = reply.data.sublist(133, 135); - print("restoreCounter:$restoreCounter"); + // print("restoreCounter:$restoreCounter"); // 重置时间 var restoreDate = reply.data.sublist(135, 139); - print("restoreDate:$restoreDate"); + // print("restoreDate:$restoreDate"); // 主控芯片型号 var icPartNo = reply.data.sublist(139, 149); - print("icPartNo:$icPartNo"); + // print("icPartNo:$icPartNo"); // 有效时间 var indate = reply.data.sublist(149, 153); - print("indate:$indate"); + // print("indate:$indate"); break; case 0x06: @@ -356,9 +274,11 @@ class LockDetailLogic extends BaseGetXController{ reply.data.removeRange(0, 6); // 把得到的数据按8位分割成数组 然后塞进一个新的数组里面 var getList = splitList(reply.data, 8); + // print("getList:$getList"); var uploadList = []; for(int i = 0; i getPrivateKeyList = changeStringListToIntList(privateKey!); @@ -433,13 +353,14 @@ class LockDetailLogic extends BaseGetXController{ userID: await Storage.getUid(), openMode: 1, openTime: DateTime.now().millisecondsSinceEpoch~/1000, + onlineToken:state.lockNetToken, token: getTokenList, needAuthor: 1, signKey: signKeyDataList, privateKey: getPrivateKeyList, ); } - }, isShowLoading: false); + }, isShowLoading: false, isShowToast: false); } // 编辑用户事件 @@ -524,12 +445,12 @@ class LockDetailLogic extends BaseGetXController{ privateKey:getPrivateKeyList, ); } - }); + }, isShowLoading: false); } void startScanAction(){ BlueManage().startScan(true, (v){ - print("startScanAllDevice:${v}"); + // print("startScanAllDevice:${v}"); final knownDeviceIndex = v.indexWhere((d) => d.name == state.keyInfos.value.bluetooth!.bluetoothDeviceName!); // 当扫描到的时候 if (knownDeviceIndex >= 0) { @@ -545,7 +466,12 @@ class LockDetailLogic extends BaseGetXController{ startConnect() { state.lockState.value = 1; state.animationController.forward(); - openDoorAction(); + + if(state.isOpenLockNeedOnline.value == 0){ + openDoorAction(); + }else{ + getLockNetToken(); + } Future.delayed(const Duration(seconds: 10), () { if(state.lockState.value == 1){ @@ -563,6 +489,16 @@ class LockDetailLogic extends BaseGetXController{ } + // 获取手机联网token,根据锁设置里面获取的开锁时是否联网来判断是否调用这个接口 + void getLockNetToken() async { + LockNetTokenEntity entity = await ApiRepository.to.getLockNetToken(lockId: state.keyInfos.value.lockId.toString()); + if (entity.errorCode!.codeIsSuccessful) { + state.lockNetToken = entity.data!.token!; + print("state.lockNetToken:${state.lockNetToken}"); + openDoorAction(); + } + } + // 查询锁记录最后时间 void getLockRecordLastUploadDataTime() async { LockOperatingRecordGetLastRecordTimeEntity entity = @@ -583,20 +519,42 @@ class LockDetailLogic extends BaseGetXController{ } } + /// 锁设置里面开启关闭考勤刷新锁详情 + StreamSubscription? _lockSetOpenOrCloseCheckInRefreshLockDetailWithAttendanceEvent; + void initLockSetOpenOrCloseCheckInRefreshLockDetailWithAttendanceAction() { + // 蓝牙协议通知传输跟蓝牙之外的数据传输类不一样 eventBus + _lockSetOpenOrCloseCheckInRefreshLockDetailWithAttendanceEvent = eventBus.on().listen((event) { + if(event.type == 0){ + // 0考勤 + print("event.setResult:${event.setResult}"); + state.isAttendance.value = event.setResult; + state.keyInfos.value.lockSetting!.attendance = event.setResult; + print("state.keyInfos.value.lockSetting!.attendance:${state.keyInfos.value.lockSetting!.attendance}"); + }else if(event.type == 1){ + // 1 开锁时是否需联网 + state.isOpenLockNeedOnline.value = event.setResult; + state.keyInfos.value.lockSetting!.appUnlockOnline = event.setResult; + } + }); + } + @override void onReady() { // TODO: implement onReady super.onReady(); print("onReady()"); _initReplySubscription(); + initLockSetOpenOrCloseCheckInRefreshLockDetailWithAttendanceAction(); if(Platform.isIOS){ + print("有蓝牙权限开始扫描"); startScanAction(); }else{ getMicrophonePermission() .then((value) { if (value) { // 有权限 + print("有蓝牙权限开始扫描"); startScanAction(); }else{ //没有权限 @@ -610,7 +568,7 @@ class LockDetailLogic extends BaseGetXController{ void onInit() { // TODO: implement onInit super.onInit(); - print("lockDetail_onInit()"); + // print("lockDetail_onInit()"); // 进来获取锁状态 // connectBlue(); @@ -621,7 +579,10 @@ class LockDetailLogic extends BaseGetXController{ @override void onClose() { // TODO: implement onClose + print("锁详情界面销毁了"); + _replySubscription.cancel(); + _lockSetOpenOrCloseCheckInRefreshLockDetailWithAttendanceEvent!.cancel(); } ///请求录音相机权限 diff --git a/star_lock/lib/main/lockDetail/lockDetail/lockDetail_page.dart b/star_lock/lib/main/lockDetail/lockDetail/lockDetail_page.dart index 2e8736c7..548a9058 100644 --- a/star_lock/lib/main/lockDetail/lockDetail/lockDetail_page.dart +++ b/star_lock/lib/main/lockDetail/lockDetail/lockDetail_page.dart @@ -38,6 +38,10 @@ class _LockDetailPageState extends State super.initState(); state.keyInfos.value = widget.lockListInfoItemEntity; + state.isAttendance.value = state.keyInfos.value.lockSetting!.attendance!; + state.isOpenLockNeedOnline.value = state.keyInfos.value.lockSetting!.appUnlockOnline!; + state.electricQuantity.value = state.keyInfos.value.electricQuantity!; + BlueManage().connectDeviceName = state.keyInfos.value.bluetooth!.bluetoothDeviceName!; // BlueManage().connectDeviceMacAddress = @@ -74,7 +78,7 @@ class _LockDetailPageState extends State child: Column( children: [ topWidget(), - Expanded(child: bottomWidget()) + Expanded(child: Obx(() => bottomWidget())) ], ), ); @@ -85,35 +89,6 @@ class _LockDetailPageState extends State return Column( children: [ SizedBox(height: 50.h), - // Stack( - // alignment: Alignment.center, - // children: [ - // Align( - // alignment: Alignment.center, - // child: Text( - // widget.keyInfo!.lockAlias!, - // style: - // TextStyle(fontSize: 22.sp, fontWeight: FontWeight.w400), - // )), - // Row( - // mainAxisAlignment: MainAxisAlignment.end, - // children: [ - // Text( - // "100%", - // style: TextStyle( - // fontSize: 18.sp, color: AppColors.darkGrayTextColor), - // ), - // SizedBox(width: 2.w), - // Image.asset( - // 'images/main/icon_main_cell.png', - // width: 30.w, - // height: 24.w, - // ), - // SizedBox(width: 30.w), - // ], - // ), - // ], - // ), Stack( alignment: Alignment.center, children: [ @@ -126,15 +101,15 @@ class _LockDetailPageState extends State TextStyle(fontSize: 22.sp, fontWeight: FontWeight.w400), ))), Positioned( - child: Row( + child: Obx(() => Row( mainAxisAlignment: MainAxisAlignment.end, children: [ - Text("100%", style: TextStyle(fontSize: 18.sp, color: AppColors.darkGrayTextColor)), + Text("${state.electricQuantity.value}%", style: TextStyle(fontSize: 18.sp, color: AppColors.darkGrayTextColor)), SizedBox(width: 2.w), - Image.asset('images/main/icon_main_cell.png', width: 30.w, height: 24.w), + Image.asset(showElectricIcon(state.electricQuantity.value), width: 30.w, height: 24.w), SizedBox(width: 30.w), ], - ) + )) ) ], ), @@ -299,9 +274,9 @@ class _LockDetailPageState extends State List getShowWidget() { var showWidgetArr = []; - + print("pagepagepage:state.keyInfos.value.lockSetting!.attendance:${state.keyInfos.value.lockSetting!.attendance}"); // 考勤 - if (state.keyInfos.value.lockSetting!.attendance == 1) { + if (state.isAttendance.value == 1) { showWidgetArr.add(bottomItem('images/main/icon_main_clockingIn.png', TranslationLoader.lanKeys!.checkingIn!.tr, () { Get.toNamed(Routers.checkingInListPage, @@ -410,9 +385,7 @@ class _LockDetailPageState extends State Get.toNamed(Routers.msgNotificationPage); }), // 设置 - bottomItem( - 'images/main/icon_main_set.png', TranslationLoader.lanKeys!.set!.tr, - () { + bottomItem('images/main/icon_main_set.png', TranslationLoader.lanKeys!.set!.tr, () { BlueManage().stopScan(); Get.toNamed(Routers.lockSetPage, arguments: {"lockId": widget.lockListInfoItemEntity.lockId}); @@ -467,6 +440,21 @@ class _LockDetailPageState extends State }); } + String showElectricIcon (int electricnumber){ + if(electricnumber >= 100){ + return 'images/main/icon_lockElectricLevel_5.png'; + }else if((electricnumber > 50) && (electricnumber < 100)){ + return 'images/main/icon_lockElectricLevel_4.png'; + }else if((electricnumber > 25) && (electricnumber <= 50)){ + return 'images/main/icon_lockElectricLevel_3.png'; + }else if((electricnumber > 5) && (electricnumber <= 25)){ + return 'images/main/icon_lockElectricLevel_2.png'; + }else if(electricnumber <= 5){ + return 'images/main/icon_lockElectricLevel_1.png'; + } + return 'images/main/icon_lockElectricLevel_5.png'; + } + static Future tokNative(String method, {required Map arguments}) async { if (arguments == null) { diff --git a/star_lock/lib/main/lockDetail/lockDetail/lockDetail_state.dart b/star_lock/lib/main/lockDetail/lockDetail/lockDetail_state.dart index 1f836ecb..fcb5db03 100644 --- a/star_lock/lib/main/lockDetail/lockDetail/lockDetail_state.dart +++ b/star_lock/lib/main/lockDetail/lockDetail/lockDetail_state.dart @@ -17,6 +17,12 @@ import '../../lockMian/entity/lockListInfo_entity.dart'; class LockDetailState { Rx keyInfos = LockListInfoItemEntity().obs; + String lockNetToken = ""; + + var isAttendance = 0.obs;// 是否开启考勤 + var isOpenLockNeedOnline = 0.obs; // APP开锁时是否需联网 + var electricQuantity = 0.obs; // 电量 + //过渡动画控制器 late AnimationController animationController; var lockState = 0.obs;// 0未连接普通状态 1连接开锁中(展示动画) 2已连接开锁成功 3检测可用性 4连接失败 diff --git a/star_lock/lib/main/lockDetail/lockDetail/lockNetToken_entity.dart b/star_lock/lib/main/lockDetail/lockDetail/lockNetToken_entity.dart new file mode 100644 index 00000000..fc74063a --- /dev/null +++ b/star_lock/lib/main/lockDetail/lockDetail/lockNetToken_entity.dart @@ -0,0 +1,43 @@ +class LockNetTokenEntity { + int? errorCode; + String? description; + String? errorMsg; + Data? data; + + LockNetTokenEntity( + {this.errorCode, this.description, this.errorMsg, this.data}); + + LockNetTokenEntity.fromJson(Map json) { + errorCode = json['errorCode']; + description = json['description']; + errorMsg = json['errorMsg']; + data = json['data'] != null ? Data.fromJson(json['data']) : null; + } + + Map toJson() { + final Map data = {}; + data['errorCode'] = errorCode; + data['description'] = description; + data['errorMsg'] = errorMsg; + if (this.data != null) { + data['data'] = this.data!.toJson(); + } + return data; + } +} + +class Data { + String? token; + + Data({this.token}); + + Data.fromJson(Map json) { + token = json['token']; + } + + Map toJson() { + final Map data = {}; + data['token'] = token; + return data; + } +} \ No newline at end of file diff --git a/star_lock/lib/main/lockDetail/lockOperatingRecord/lockOperatingRecord_logic.dart b/star_lock/lib/main/lockDetail/lockOperatingRecord/lockOperatingRecord_logic.dart index 4f9984ef..6cd78e8e 100644 --- a/star_lock/lib/main/lockDetail/lockOperatingRecord/lockOperatingRecord_logic.dart +++ b/star_lock/lib/main/lockDetail/lockOperatingRecord/lockOperatingRecord_logic.dart @@ -81,9 +81,11 @@ class LockOperatingRecordLogic extends BaseGetXController{ reply.data.removeRange(0, 6); // 把得到的数据按8位分割成数组 然后塞进一个新的数组里面 var getList = splitList(reply.data, 8); + print("getList:$getList"); var uploadList = []; for(int i = 0; i senderQueryingFingerprintStatus() async { - BlueManage().judgeReconnect(BlueManage().connectDeviceMacAddress, BlueManage().connectDeviceName, (DeviceConnectionState state) async { + BlueManage().judgeReconnect(BlueManage().connectDeviceMacAddress, BlueManage().connectDeviceName,(DeviceConnectionState state) async { if (state == DeviceConnectionState.connected) { var privateKey = await Storage.getStringList(saveBluePrivateKey); List getPrivateKeyList = changeStringListToIntList(privateKey!); diff --git a/star_lock/lib/main/lockDetail/passwordKey/passwordKeyManage/passwordKeyManage_tabbar.dart b/star_lock/lib/main/lockDetail/passwordKey/passwordKeyManage/passwordKeyManage_tabbar.dart index ff466c5b..a9cd295e 100644 --- a/star_lock/lib/main/lockDetail/passwordKey/passwordKeyManage/passwordKeyManage_tabbar.dart +++ b/star_lock/lib/main/lockDetail/passwordKey/passwordKeyManage/passwordKeyManage_tabbar.dart @@ -84,8 +84,8 @@ class _PasswordKeyManageTabbarPageState Tab _tab(ItemView item) { return Tab( // text: item.title, - child: SizedBox( - width: item.title.length > 2 ? 1.sw / 8 : 1.sw / 12, + child: Container( + // width: item.title.length > 2 ? 1.sw / 8 : 1.sw / 12, // margin: EdgeInsets.all(10.w), // color: Colors.red, child: Text( diff --git a/star_lock/lib/main/lockDetail/videoLog/videoLog/videoLog_page.dart b/star_lock/lib/main/lockDetail/videoLog/videoLog/videoLog_page.dart index 73ee4ad7..69236e8a 100644 --- a/star_lock/lib/main/lockDetail/videoLog/videoLog/videoLog_page.dart +++ b/star_lock/lib/main/lockDetail/videoLog/videoLog/videoLog_page.dart @@ -102,7 +102,10 @@ class _VideoLogPageState extends State { state.isNavLocal.value = false; }); }, - child: Obx(() => Text("云存", style: state.isNavLocal.value == true ? TextStyle(color: Colors.grey, fontSize: 26.sp) : TextStyle(color: Colors.white, fontSize: 28.sp))) + child: Obx(() => Text("云存", + style: state.isNavLocal.value == true ? + TextStyle(color: Colors.grey, fontSize: 26.sp, fontWeight: FontWeight.w600) : + TextStyle(color: Colors.white, fontSize: 28.sp, fontWeight: FontWeight.w600))) ), TextButton( onPressed: (){ @@ -110,7 +113,10 @@ class _VideoLogPageState extends State { state.isNavLocal.value = true; }); }, - child: Obx(() => Text("本地", style: state.isNavLocal.value == true ? TextStyle(color: Colors.white, fontSize: 28.sp) : TextStyle(color: Colors.grey, fontSize: 26.sp))) + child: Obx(() => Text("本地", + style: state.isNavLocal.value == true ? + TextStyle(color: Colors.white, fontSize: 28.sp, fontWeight: FontWeight.w600) : + TextStyle(color: Colors.grey, fontSize: 26.sp, fontWeight: FontWeight.w600))) ), ], ), @@ -136,13 +142,13 @@ class _VideoLogPageState extends State { Expanded(child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text("3天滚动储存", style: TextStyle(fontSize: 26.sp)), + Text("3天滚动储存", style: TextStyle(fontSize: 24.sp)), SizedBox(height: 10.h), Text("星锁已为本设备免费提供3大滚动视频储存服务", style: TextStyle(fontSize: 22.sp, color: Colors.grey)), ], )), SizedBox(width: 15.w), - Text("去升级", style: TextStyle(fontSize: 24.sp)), + Text("去升级", style: TextStyle(fontSize: 22.sp)), Image(width: 40.w, height: 24.w, image: const AssetImage("images/icon_right_black.png")) ], ), @@ -170,7 +176,7 @@ class _VideoLogPageState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ // SizedBox(height: 20.h), - Text("下载列表", style: TextStyle(fontSize: 26.sp)), + Text("下载列表", style: TextStyle(fontSize: 24.sp)), SizedBox(height: 15.h), Text("暂无下载内容", style: TextStyle(fontSize: 22.sp, color: Colors.grey)), ], @@ -191,7 +197,7 @@ class _VideoLogPageState extends State { child: Row( // mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text(state.isNavLocal.value == true ? "已下载":"全部视频", style: TextStyle(fontSize: 28.sp)), + Text(state.isNavLocal.value == true ? "已下载":"全部视频", style: TextStyle(fontSize: 26.sp, fontWeight: FontWeight.w500)), Expanded(child: SizedBox(width: 10.w)), IconButton( icon: Image(width: 40.w, height: 40.w, image: const AssetImage("images/main/icon_lockDetail_monitoringEditVoice.png")), diff --git a/star_lock/lib/main/lockMian/demoMode/demoModeLockDetail/demoModeLockDetail_page.dart b/star_lock/lib/main/lockMian/demoMode/demoModeLockDetail/demoModeLockDetail_page.dart index a43409ab..c1cedd85 100644 --- a/star_lock/lib/main/lockMian/demoMode/demoModeLockDetail/demoModeLockDetail_page.dart +++ b/star_lock/lib/main/lockMian/demoMode/demoModeLockDetail/demoModeLockDetail_page.dart @@ -41,7 +41,11 @@ class _DemoModeLockDetailPageState extends State { height: 1.sh - ScreenUtil().statusBarHeight * 2, color: Colors.white, child: Column( - children: [topTip(), topWidget(), Expanded(child: bottomWidget())], + children: [ + topTip(), + topWidget(), + Expanded(child: bottomWidget()) + ], ), )); } @@ -375,4 +379,5 @@ class _DemoModeLockDetailPageState extends State { // Get.toNamed(Routers.seletLockTypePage); Toast.show(msg: "演示模式"); } + } diff --git a/star_lock/lib/main/lockMian/demoMode/demoModeLockSet/demoModeLockSet_page.dart b/star_lock/lib/main/lockMian/demoMode/demoModeLockSet/demoModeLockSet_page.dart index 16700a59..afaf947a 100644 --- a/star_lock/lib/main/lockMian/demoMode/demoModeLockSet/demoModeLockSet_page.dart +++ b/star_lock/lib/main/lockMian/demoMode/demoModeLockSet/demoModeLockSet_page.dart @@ -242,6 +242,12 @@ class _DemoModeLockSetPageState extends State { isHaveLine: false, isHaveRightWidget: true, rightWidget: _lockRemindSwitch()), + CommonItem( + leftTitel: "开锁时是否需联网", + rightTitle: "", + isHaveLine: false, + isHaveRightWidget: true, + rightWidget: _lockRemindSwitch()), SizedBox(height: 10.h), // wifi配网 CommonItem( diff --git a/star_lock/lib/main/lockMian/lockList/lockList_page.dart b/star_lock/lib/main/lockMian/lockList/lockList_page.dart index 89adbe12..4be593ed 100644 --- a/star_lock/lib/main/lockMian/lockList/lockList_page.dart +++ b/star_lock/lib/main/lockMian/lockList/lockList_page.dart @@ -144,7 +144,7 @@ class _LockListPageState extends State { ), SizedBox(width: 2.w), Image.asset( - 'images/main/icon_main_cell.png', + showElectricIcon(keyInfo.electricQuantity!), width: 30.w, height: 24.w, ), @@ -201,4 +201,19 @@ class _LockListPageState extends State { return useDateStr; } + String showElectricIcon (int electricnumber){ + if(electricnumber >= 100){ + return 'images/main/icon_lockElectricLevel_5.png'; + }else if((electricnumber > 50) && (electricnumber < 100)){ + return 'images/main/icon_lockElectricLevel_4.png'; + }else if((electricnumber > 25) && (electricnumber <= 50)){ + return 'images/main/icon_lockElectricLevel_3.png'; + }else if((electricnumber > 5) && (electricnumber <= 25)){ + return 'images/main/icon_lockElectricLevel_2.png'; + }else if(electricnumber <= 5){ + return 'images/main/icon_lockElectricLevel_1.png'; + } + return 'images/main/icon_lockElectricLevel_5.png'; + } + } diff --git a/star_lock/lib/main/lockMian/lockMain/lockMain_logic.dart b/star_lock/lib/main/lockMian/lockMain/lockMain_logic.dart index c18f56dd..2f84ecf2 100644 --- a/star_lock/lib/main/lockMian/lockMain/lockMain_logic.dart +++ b/star_lock/lib/main/lockMian/lockMain/lockMain_logic.dart @@ -90,6 +90,8 @@ class LockMainLogic extends BaseGetXController { } state.lockListInfoEntity.value = entity; }else{ + print("首页锁列表请求失败"); + state.dataLength.value = 0; // refreshController.loadFailed(); } // refreshController.refreshCompleted(); diff --git a/star_lock/lib/mine/about/about_page.dart b/star_lock/lib/mine/about/about_page.dart index 78c31c42..d7ec95e9 100644 --- a/star_lock/lib/mine/about/about_page.dart +++ b/star_lock/lib/mine/about/about_page.dart @@ -46,7 +46,7 @@ class _AbountPageState extends State { height: 20.h, ), Text( - "星锁 1.0.0.01(preRelease-20231118)", + "星锁 1.0.0.02(preRelease-20231124)", style: TextStyle(fontSize: 24.sp, color: AppColors.blackColor), ), SizedBox( diff --git a/star_lock/lib/mine/addLock/lockAddress/gaode/lockAddressGaoDe_page.dart b/star_lock/lib/mine/addLock/lockAddress/gaode/lockAddressGaoDe_page.dart index e1ba8ab4..a561527c 100644 --- a/star_lock/lib/mine/addLock/lockAddress/gaode/lockAddressGaoDe_page.dart +++ b/star_lock/lib/mine/addLock/lockAddress/gaode/lockAddressGaoDe_page.dart @@ -1,5 +1,6 @@ import 'dart:async'; +import 'dart:io'; import 'package:flutter/material.dart'; import 'package:amap_flutter_location/amap_flutter_location.dart'; @@ -57,7 +58,7 @@ class _LockAddressGaoDePageState extends State{ // EasyLoading.dismiss(); // } // }); - requestLocation(); + // requestLocation(); } Future requestPermission() async { @@ -69,8 +70,13 @@ class _LockAddressGaoDePageState extends State{ print("拒绝"); break; case PermissionStatus.granted: - _setLocationOption(); - location.startLocation(); + if(Platform.isIOS){ + _setLocationOption(); + requestIOSLocation(); + }else{ + requestAndroidLocation(); + location.startLocation(); + } break; case PermissionStatus.limited: print("限制"); @@ -82,7 +88,7 @@ class _LockAddressGaoDePageState extends State{ } } - Future requestLocation() async { + Future requestAndroidLocation() async { location.onLocationChanged().listen((event) { print("listenLocationChanged$event"); // EasyLoading.dismiss(); @@ -95,6 +101,22 @@ class _LockAddressGaoDePageState extends State{ }); } + Future requestIOSLocation() async { + location = AMapFlutterLocation() + ..setLocationOption(AMapLocationOption()) + ..onLocationChanged().listen((event) { + print("listenLocationChanged$event"); + // EasyLoading.dismiss(); + if (event.isNotEmpty) { + setState(() { + addressInfo = event; + }); + // location.stopLocation(); + } + }) + ..startLocation(); + } + @override Widget build(BuildContext context) { return Scaffold( @@ -123,9 +145,7 @@ class _LockAddressGaoDePageState extends State{ // ), // ], ), - body: - addressInfo != null ? - ListView( + body: ListView( children: [ Container( margin: EdgeInsets.only(left: 25.w, top: 40.h, bottom: 40.w), @@ -137,83 +157,73 @@ class _LockAddressGaoDePageState extends State{ ), ), SizedBox( - height: 1.sw/5*4, - width: 1.sw, child: - (addressInfo!["address"].toString().isNotEmpty) ? - AMapWidget( - apiKey: amapApiKeys, - // 初始化地图中心 - initialCameraPosition: ( - CameraPosition( - target: LatLng(double.parse(addressInfo!['latitude'].toString()), double.parse(addressInfo!['longitude'].toString())), - zoom: 10.0, - ) - ), - //定位小蓝点 - myLocationStyleOptions: MyLocationStyleOptions( - true, - ), - // 普通地图normal,卫星地图satellite,夜间视图night,导航视图 navi,公交视图bus, - mapType: MapType.normal, - // 缩放级别范围 - minMaxZoomPreference: const MinMaxZoomPreference(3, 20), - // 隐私政策包含高德 必须填写 - privacyStatement: const AMapPrivacyStatement(hasAgree: true, hasContains: true, hasShow: true), - // 地图创建成功时返回AMapController - onMapCreated: (AMapController controller) { - mapController = controller; - }, - ) : Container(), - ), - Container( - margin: EdgeInsets.only(left: 25.w, top: 20.h, right: 25.w), - child: Row( - mainAxisAlignment: MainAxisAlignment.start, + addressInfo != null ? + Column( children: [ - Text("检查以确保以下地址是正确的", style: TextStyle(fontSize: 24.sp)), - ], - ), - ), - // SizedBox(height: 20.h), - Container( - margin: EdgeInsets.only(left: 25.w, top: 20.h, right: 25.w), - // decoration: BoxDecoration( - // color: AppColors.mainColor, - // borderRadius: BorderRadius.circular(15.w), - // ), - child:Column( - children: [ - Container( - // height: h(53), - // padding: EdgeInsets.only(top: 15.h, bottom: 15, left:15.w, right: 15.w), - child: Row( - children: [ - // Image.asset('images/main/icon_addUserShowAddress.png', width: 30.w, height: 30.w), - // SizedBox(width: 10.w), - Expanded( - child: Text(addressInfo!["address"].toString() ?? "", style: const TextStyle(color: Colors.grey, fontSize: 16, fontWeight: FontWeight.w500, overflow: TextOverflow.clip)) - ), - ], + SizedBox( + height: 1.sw/5*4, + width: 1.sw, + child: AMapWidget( + apiKey: amapApiKeys, + // 初始化地图中心 + initialCameraPosition: ( + CameraPosition( + target: LatLng(double.parse(addressInfo!['latitude'].toString()), double.parse(addressInfo!['longitude'].toString())), + zoom: 10.0, + ) ), + //定位小蓝点 + myLocationStyleOptions: MyLocationStyleOptions( + true, + ), + // 普通地图normal,卫星地图satellite,夜间视图night,导航视图 navi,公交视图bus, + mapType: MapType.normal, + // 缩放级别范围 + minMaxZoomPreference: const MinMaxZoomPreference(3, 20), + // 隐私政策包含高德 必须填写 + privacyStatement: const AMapPrivacyStatement(hasAgree: true, hasContains: true, hasShow: true), + // 地图创建成功时返回AMapController + onMapCreated: (AMapController controller) { + mapController = controller; + }, ), - SizedBox(height: 5.h), - Container(height: 1.h, color: AppColors.mainColor,), - // Container( - // // height: h(52), - // padding: EdgeInsets.only(top: 15.h, bottom: 15, left:15.w, right: 15.w), - // child: Row( - // children: [ - // Image.asset('images/main/icon_addUserAddressShowTime.png', width: 30.w, height: 30.w), - // SizedBox(width: 10.w,), - // Expanded( - // child: Text(DateTool().getNowDateYMDHM(), style: const TextStyle(color: Colors.white, fontSize: 16, fontWeight: FontWeight.w500),) - // ), - // ], - // ), - // ), - ], - ) + ), + Container( + // color: Colors.red, + height: 45.h, + margin: EdgeInsets.only(left: 25.w, top: 20.h, right: 25.w), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Text("检查以确保以下地址是正确的", style: TextStyle(fontSize: 24.sp)), + ], + ), + ), + // SizedBox(height: 20.h), + Container( + // color: Colors.red, + // height: 45.h, + margin: EdgeInsets.only(left: 25.w, top: 20.h, right: 25.w), + child:Column( + children: [ + Row( + children: [ + Expanded( + child: Text(addressInfo!["address"].toString() ?? "", style: const TextStyle(color: Colors.grey, fontSize: 16, fontWeight: FontWeight.w500, overflow: TextOverflow.clip)) + ), + ], + ), + SizedBox(height: 5.h), + Container(height: 1.h, color: AppColors.mainColor,), + ], + ) + ), + ], + ) : SizedBox( + height: 1.sw/5*4 + 65.h*2, + child: const Center(child: Text('地图加载中,请稍候。。。'))) + , ), SizedBox(height:200.h), Row( @@ -291,8 +301,7 @@ class _LockAddressGaoDePageState extends State{ // ) // ),), ], - ) - : const Center(child: Text('地图加载中,请稍候。。。')), + ), ); } @@ -343,11 +352,10 @@ class _LockAddressGaoDePageState extends State{ location.setLocationOption(locationOption); } - @override void dispose() { super.dispose(); - + location.stopLocation(); location.destroy(); print("地图界面销毁了"); } diff --git a/star_lock/lib/mine/addLock/saveLock/saveLock_logic.dart b/star_lock/lib/mine/addLock/saveLock/saveLock_logic.dart index 519ce1d9..f6907287 100644 --- a/star_lock/lib/mine/addLock/saveLock/saveLock_logic.dart +++ b/star_lock/lib/mine/addLock/saveLock/saveLock_logic.dart @@ -36,6 +36,7 @@ class SaveLockLogic extends BaseGetXController { }); } + // 添加用户 Future _replyAddUserKey(Reply reply) async { var lockId = reply.data.sublist(2, 42); // print("lockId:$lockId"); @@ -101,6 +102,7 @@ class SaveLockLogic extends BaseGetXController { } } + // 获取星锁状态 Future _replyGetStarLockStatusInfo(Reply reply) async { int status = reply.data[2]; switch(status){ diff --git a/star_lock/lib/mine/mine/starLockMine_page.dart b/star_lock/lib/mine/mine/starLockMine_page.dart index 20053c4d..6205209b 100644 --- a/star_lock/lib/mine/mine/starLockMine_page.dart +++ b/star_lock/lib/mine/mine/starLockMine_page.dart @@ -1,19 +1,12 @@ -import 'dart:convert'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; -import 'package:star_lock/common/safetyVerification/entity/Data.dart'; -import 'package:star_lock/tools/toast.dart'; import '../../appRouters.dart'; import '../../app_settings/app_colors.dart'; import '../../baseWidget.dart'; -import '../../login/login/entity/LoginData.dart'; -import '../../login/login/entity/LoginEntity.dart'; -import '../../tools/store_service.dart'; import '../../tools/submitBtn.dart'; -import '../../tools/titleAppBar.dart'; import '../../translations/trans_lib.dart'; import 'starLockMine_logic.dart'; @@ -39,9 +32,7 @@ class _StarLockMinePageState extends State with BaseWidget { children: [ topWidget(), bottomListWidget(), - SizedBox( - height: 40.h, - ), + SizedBox(height: 40.h,), // keyBottomWidget() ], ), @@ -93,7 +84,7 @@ class _StarLockMinePageState extends State with BaseWidget { SizedBox( height: 20.h, ), - Text(state.mobile(), + Text(state.nickname(), style: TextStyle( fontSize: 22.sp, color: Colors.white, @@ -101,7 +92,7 @@ class _StarLockMinePageState extends State with BaseWidget { SizedBox( height: 10.h, ), - Text("${TranslationLoader.lanKeys!.accountNumber!.tr}:-", + Text("${TranslationLoader.lanKeys!.accountNumber!.tr}:${state.mobile().isNotEmpty ? state.mobile() : state.email()}", style: TextStyle( fontSize: 18.sp, color: Colors.white, diff --git a/star_lock/lib/mine/mine/starLockMine_state.dart b/star_lock/lib/mine/mine/starLockMine_state.dart index 315848ec..1008ae15 100644 --- a/star_lock/lib/mine/mine/starLockMine_state.dart +++ b/star_lock/lib/mine/mine/starLockMine_state.dart @@ -40,6 +40,14 @@ class StarLockMineState { return loginData.value.mobile ?? '-'; } + String email() { + return loginData.value.email ?? '-'; + } + + String nickname() { + return loginData.value.nickname ?? '-'; + } + ///用户头像 String headUrl() { return loginData.value.headUrl ?? ''; diff --git a/star_lock/lib/mine/mineMultiLanguage/mineMultiLanguage_page.dart b/star_lock/lib/mine/mineMultiLanguage/mineMultiLanguage_page.dart index ffb0c30e..5a2a3ee6 100644 --- a/star_lock/lib/mine/mineMultiLanguage/mineMultiLanguage_page.dart +++ b/star_lock/lib/mine/mineMultiLanguage/mineMultiLanguage_page.dart @@ -43,7 +43,6 @@ class _MineMultiLanguagePageState extends State { CommonItem( leftTitel: '跟随系统', rightTitle: "", - allHeight: 90.h, isHaveLine: true, isHaveDirection: false, isHaveRightWidget: true, @@ -59,7 +58,6 @@ class _MineMultiLanguagePageState extends State { CommonItem( leftTitel: lanType.lanTitle, rightTitle: "", - allHeight: 90.h, isHaveLine: true, isHaveDirection: false, isHaveRightWidget: true, diff --git a/star_lock/lib/mine/minePersonInfo/minePersonInfoPage/minePersonGetUploadFileInfo_entity.dart b/star_lock/lib/mine/minePersonInfo/minePersonInfoPage/minePersonGetUploadFileInfo_entity.dart new file mode 100644 index 00000000..e6dcd75c --- /dev/null +++ b/star_lock/lib/mine/minePersonInfo/minePersonInfoPage/minePersonGetUploadFileInfo_entity.dart @@ -0,0 +1,89 @@ +class MinePersonGetUploadFileInfoEntity { + int? errorCode; + String? description; + String? errorMsg; + Data? data; + + MinePersonGetUploadFileInfoEntity( + {this.errorCode, this.description, this.errorMsg, this.data}); + + MinePersonGetUploadFileInfoEntity.fromJson(Map json) { + errorCode = json['errorCode']; + description = json['description']; + errorMsg = json['errorMsg']; + data = json['data'] != null ? Data.fromJson(json['data']) : null; + } + + Map toJson() { + final Map data = {}; + data['errorCode'] = errorCode; + data['description'] = description; + data['errorMsg'] = errorMsg; + if (this.data != null) { + data['data'] = this.data!.toJson(); + } + return data; + } +} + +class Data { + String? uploadUrl; + Map? formData; + String? fileUrl; + String? fileField; + + Data({this.uploadUrl, this.formData, this.fileUrl, this.fileField}); + + Data.fromJson(Map json) { + uploadUrl = json['uploadUrl']; + formData = json['formData']; + fileUrl = json['fileUrl']; + fileField = json['fileField']; + } + + Map toJson() { + final Map data = {}; + data['uploadUrl'] = uploadUrl; + data['formData'] = formData; + data['fileUrl'] = fileUrl; + data['fileField'] = fileField; + return data; + } +} + +// class GetFormData { +// String? oSSAccessKeyId; +// String? host; +// String? policy; +// String? signature; +// int? expire; +// String? key; +// +// GetFormData( +// {this.oSSAccessKeyId, +// this.host, +// this.policy, +// this.signature, +// this.expire, +// this.key}); +// +// GetFormData.fromJson(Map json) { +// oSSAccessKeyId = json['OSSAccessKeyId']; +// host = json['host']; +// policy = json['policy']; +// signature = json['signature']; +// expire = json['expire']; +// key = json['key']; +// } +// +// Map toJson() { +// final Map data = {}; +// data['OSSAccessKeyId'] = oSSAccessKeyId; +// data['host'] = host; +// data['policy'] = policy; +// data['signature'] = signature; +// data['expire'] = expire; +// data['key'] = key; +// return data; +// } +// } diff --git a/star_lock/lib/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_logic.dart b/star_lock/lib/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_logic.dart index 51cfaaa7..c7081a19 100644 --- a/star_lock/lib/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_logic.dart +++ b/star_lock/lib/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_logic.dart @@ -1,10 +1,14 @@ import 'dart:async'; +import 'dart:convert'; +import 'package:get/get.dart'; +import 'package:star_lock/login/login/entity/LoginEntity.dart'; import 'package:star_lock/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_state.dart'; import 'package:star_lock/tools/toast.dart'; import '../../../../network/api_repository.dart'; import '../../../../tools/baseGetXController.dart'; +import 'minePersonGetUploadFileInfo_entity.dart'; -class MinePersonInfoLogic extends BaseGetXController { +class MinePersonInfoLogic extends GetConnect{ final MinePersonInfoState state = MinePersonInfoState(); //用户信息 Future getUserInfoRequest() async { @@ -20,9 +24,57 @@ class MinePersonInfoLogic extends BaseGetXController { } //上传头像 先获取upToken 再调用updateUserInfo - Future getUpTokenRequest() async { - var entity = await ApiRepository.to.getUpToken(state.typeStr.value); - if (entity.errorCode!.codeIsSuccessful) {} + Future getUpTokenRequest(String filename, int size) async { + var entity = await ApiRepository.to.getUpToken( + module: 'avatar', + typeKey: 'userId', + type: state.mineInfoData.value.uid!, + filename: filename, + size: size + ); + if (entity.errorCode!.codeIsSuccessful) { + uploadFile(entity); + // print("aaaaa:$loginEntity"); + } + } + + // 上传头像 + void uploadFile(MinePersonGetUploadFileInfoEntity minePersonGetUploadFileInfoEntity) async { + // String json = JsonDecoder(minePersonGetUploadFileInfoEntity.data!.formData!); + + // var formData = FormData(); + // + // formData.files.add(MapEntry( + // "files", //后台接收的名字 + // MultipartFile(state.image!.path, filename: 'b'), + // )); + + Map user = minePersonGetUploadFileInfoEntity.data!.formData!; + user[minePersonGetUploadFileInfoEntity.data!.fileField!] = state.image!.path; + final form = FormData(user); + var entity = await ApiRepository.to.uploadFile( + url: minePersonGetUploadFileInfoEntity.data!.uploadUrl!, + body: form + ); + if (entity.errorCode!.codeIsSuccessful) { + + } + + // final formData = FormData.fromMap({ + // 'file': await MultipartFile.fromFile(imageFile.path, contentType: MediaType.parse(mimeType)) + // }); + + // final form = FormData(user); + // Response response= await post(minePersonGetUploadFileInfoEntity.data!.uploadUrl, form); + // print("statusText:${response.statusText} statusCode:${response.statusCode} response:$response"); + } + + void postCases(List image) async { + final form = FormData({ + 'file': MultipartFile(image, filename: 'avatar.png'), + 'otherFile': MultipartFile(image, filename: 'cover.png'), + }); + Response response= await post('http://youapi/users/upload', form); } //更新个人信息-头像 @@ -32,4 +84,27 @@ class MinePersonInfoLogic extends BaseGetXController { Toast.show(msg: '操作成功'); } } + + @override + void onReady() { + // TODO: implement onReady + super.onReady(); + + getUserInfoRequest(); + } + + @override + void onInit() { + // TODO: implement onInit + super.onInit(); + + getUserInfoRequest(); + } + + + @override + void onClose() { + // TODO: implement onClose + + } } diff --git a/star_lock/lib/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_page.dart b/star_lock/lib/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_page.dart index 2724ae70..af614314 100644 --- a/star_lock/lib/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_page.dart +++ b/star_lock/lib/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_page.dart @@ -23,12 +23,12 @@ class _MinePersonInfoPageState extends State { final logic = Get.put(MinePersonInfoLogic()); final state = Get.find().state; - @override - void initState() { - super.initState(); - - logic.getUserInfoRequest(); - } + // @override + // void initState() { + // super.initState(); + // + // logic.getUserInfoRequest(); + // } @override Widget build(BuildContext context) { @@ -198,7 +198,14 @@ class _MinePersonInfoPageState extends State { maxHeight: 250, maxWidth: 250, ); - if (image != null) state.image = image; - setState(() {}); + if (image != null) { + state.image = image; + var bytes = File(state.image!.path); + var enc = await bytes.readAsBytes(); + print(enc.length); + print("state.image!.path:${state.image!.path} state.image!.name:${state.image!.name} state.image!.length():${state.image!.length()}"); + logic.getUpTokenRequest(state.image!.name, enc.length); + setState((){}); + } } } diff --git a/star_lock/lib/mine/mineSet/mineSet/mineSet_page.dart b/star_lock/lib/mine/mineSet/mineSet/mineSet_page.dart index 12a49b33..98c9151a 100644 --- a/star_lock/lib/mine/mineSet/mineSet/mineSet_page.dart +++ b/star_lock/lib/mine/mineSet/mineSet/mineSet_page.dart @@ -198,6 +198,14 @@ class _MineSetPageState extends State { action: () { Toast.show(msg: "功能暂未开放"); }), + CommonItem( + leftTitel: "小米IoT平台", + rightTitle: "", + isHaveLine: false, + isHaveDirection: true, + action: () { + Toast.show(msg: "功能暂未开放"); + }), // CommonItem(leftTitel:TranslationLoader.lanKeys!.valueAddedServices!.tr, rightTitle:"", isHaveDirection: true, action: (){ // // }), diff --git a/star_lock/lib/network/api.dart b/star_lock/lib/network/api.dart index d0d84585..73432872 100644 --- a/star_lock/lib/network/api.dart +++ b/star_lock/lib/network/api.dart @@ -26,6 +26,8 @@ abstract class Api { final String lockRecordUploadURL = '/lockRecords/fromLock'; //操作上传 final String getLockRecordLastUploadDataTimeURL = '/lockRecords/getLastRecordTime'; //查询锁记录最后时间 + final String getLockNetTokenURL = '/lock/getLockNetToken'; //获取手机联网token + final String bindingBlueAdminURL = '/lock/bindAdmin'; //绑定蓝牙管理员 final String modifyKeyNameURL = '/key/modifyKeyName'; //修改锁名称 final String updateLockNameURL = '/lock/updateLockName'; //修改锁名(新) @@ -141,7 +143,7 @@ abstract class Api { '/safeAnswer/getOwnQuestionList'; //获取已设置的安全信息 final String setSafeAnswerURL = '/safeAnswer/set'; //设置安全信息 final String getUpTokenURL = - '/user/getUpToken'; //上传头像 先获取upToken 再调用updateUserInfo + '/file/getUploadParams'; //上传头像 先获取upToken 再调用updateUserInfo final String unbindPhoneTokenURL = '/user/unbindPhoneToken'; //获取解绑手机号Token final String unbindEmailTokenURL = '/user/unbindEmailToken'; //获取解绑邮箱Token final String pushBindAppIdURL = '/user/bindAppId'; //推送绑定APP设备 diff --git a/star_lock/lib/network/api_provider.dart b/star_lock/lib/network/api_provider.dart index 1fba9a04..c48dd407 100644 --- a/star_lock/lib/network/api_provider.dart +++ b/star_lock/lib/network/api_provider.dart @@ -260,14 +260,24 @@ class ApiProvider extends BaseProvider { jsonEncode({ 'lockId': lockId, 'records': records, - })); + }), + isUnShowLoading:true); // 查询锁记录最后时间 Future getLockRecordLastUploadDataTime(String lockId) => post( getLockRecordLastUploadDataTimeURL.toUrl, jsonEncode({ 'lockId': lockId, - })); + }), + isUnShowLoading: true); + + // 获取手机联网token + Future getLockNetToken(String lockId) => post( + getLockNetTokenURL.toUrl, + jsonEncode({ + 'lockId': lockId, + }), + isUnShowLoading: true); // 绑定蓝牙管理员 Future bindingBlueAdmin( @@ -603,6 +613,15 @@ class ApiProvider extends BaseProvider { 'attendance': resetSwitch, })); + // 设置开锁时是否需联网 + Future setOpenLockNeedOnlineData(int lockId, int appUnlockOnline) => + post( + updateLockSettingUrl.toUrl, + jsonEncode({ + 'lockId': lockId, + 'appUnlockOnline': appUnlockOnline, + })); + // 设置标记房态 Future setRoomStatusData(int lockId, int roomStatus) => post( @@ -1319,9 +1338,19 @@ class ApiProvider extends BaseProvider { setSafeAnswerURL.toUrl, jsonEncode({"questionAndAnswerList": questionAndAnswerList})); - //上传头像 先获取upToken 再调用updateUserInfo - Future getUpToken(String type) => - post(getUpTokenURL.toUrl, jsonEncode({"type": type})); + // 获取上传文件的upToken 再调用updateUserInfo + Future getUpToken(String module, String typeKey, String type, String filename, int size) => + post( + getUpTokenURL.toUrl, + jsonEncode({ + "module": module, + typeKey: type, + "filename": filename, + "size": size, + })); + + // 文件上传 + Future uploadFile(String url, dynamic boay) => post(url, boay, isUnUploadFile: false, contentType:'multipart/form-data'); //获取解绑手机号Token Future unbindPhoneToken(String verificationCode) => post( diff --git a/star_lock/lib/network/api_provider_base.dart b/star_lock/lib/network/api_provider_base.dart index e00ac289..cfd44cec 100644 --- a/star_lock/lib/network/api_provider_base.dart +++ b/star_lock/lib/network/api_provider_base.dart @@ -23,10 +23,11 @@ class BaseProvider extends GetConnect with Api { @override Future> post(String? url, body, - {String? contentType, + {String? contentType = "application/json", Map? headers, Map? query, Decoder? decoder, + bool? isUnUploadFile = true, Progress? uploadProgress, bool? isUnShowLoading = false}) async { // print("post: url:${url} body:${body} contentType:${contentType} headers:${headers} query:${query}"); diff --git a/star_lock/lib/network/api_repository.dart b/star_lock/lib/network/api_repository.dart index 311cf417..f3faf500 100644 --- a/star_lock/lib/network/api_repository.dart +++ b/star_lock/lib/network/api_repository.dart @@ -33,12 +33,14 @@ import '../main/lockDetail/lcokSet/configuringWifi/configuringWifiEntity.dart'; import '../main/lockDetail/lcokSet/lockSet/checkingInInfoData_entity.dart'; import '../main/lockDetail/lcokSet/lockSet/lockSetInfo_entity.dart'; import '../main/lockDetail/lcokSet/lockTime/getServerDatetime_entity.dart'; +import '../main/lockDetail/lockDetail/lockNetToken_entity.dart'; import '../main/lockDetail/lockOperatingRecord/lockOperatingRecordGetLastRecordTime_entity.dart'; import '../main/lockDetail/otherTypeKey/addFingerprint/addFingerprint/addFingerprint_entity.dart'; import '../main/lockDetail/otherTypeKey/addICCard/addICCard_entity.dart'; import '../main/lockDetail/otherTypeKey/otherTypeKeyList/fingerprintListData_entity.dart'; import '../main/lockMian/entity/lockListInfo_entity.dart'; import '../mine/addLock/saveLock/entity/SaveLockEntity.dart'; +import '../mine/minePersonInfo/minePersonInfoPage/minePersonGetUploadFileInfo_entity.dart'; import '../mine/mineSet/transferGateway/selectGetewayList_entity.dart'; import '../mine/mineSet/transferSmartLock/recipientInformation/recipientInformation_entity.dart'; import '../mine/mineSet/transferSmartLock/transferSmartLockList/transferSmartLock_entity.dart'; @@ -228,6 +230,12 @@ class ApiRepository { return LockOperatingRecordGetLastRecordTimeEntity.fromJson(res.body); } + // 获取手机联网token + Future getLockNetToken({required String lockId}) async { + final res = await apiProvider.getLockNetToken(lockId); + return LockNetTokenEntity.fromJson(res.body); + } + // 绑定蓝牙管理员 Future bindingBlueAdmin( { required String lockAlias, @@ -622,6 +630,15 @@ class ApiRepository { return LoginEntity.fromJson(res.body); } + // 设置开锁时是否需联网 + Future setOpenLockNeedOnlineData({ + required int lockId, + required int appUnlockOnline, + }) async { + final res = await apiProvider.setOpenLockNeedOnlineData(lockId, appUnlockOnline); + return LoginEntity.fromJson(res.body); + } + // 设置开门方向 Future setOpenDoorDirectionData({ required int lockId, @@ -1330,8 +1347,26 @@ class ApiRepository { } //上传头像 先获取upToken 再调用updateUserInfo - Future getUpToken(String type) async { - final res = await apiProvider.getUpToken(type); + Future getUpToken( + { + required String module, + required String typeKey, + required String type, + required String filename, + required int size + } + ) async { + final res = await apiProvider.getUpToken(module, typeKey, type, filename, size); + return MinePersonGetUploadFileInfoEntity.fromJson(res.body); + } + + // 文件上传 + Future uploadFile( + { + required String url, + required dynamic body, + }) async { + final res = await apiProvider.uploadFile(url, body); return LoginEntity.fromJson(res.body); } diff --git a/star_lock/lib/network/request_interceptor.dart b/star_lock/lib/network/request_interceptor.dart index f77d4faa..21a09088 100644 --- a/star_lock/lib/network/request_interceptor.dart +++ b/star_lock/lib/network/request_interceptor.dart @@ -14,7 +14,7 @@ FutureOr requestInterceptor(Request request) async { request.headers['User-Agent'] = 'StarLock/${PlatformInfoService.to.info.version}/${PlatformInfoService.to.info.buildNumber}/${GetPlatform.isAndroid ? 'Android' : 'iOS'}'; request.headers['Accept-Language'] = 'zh_CN'; - request.headers['Content-Type'] = 'application/json'; + // request.headers['Content-Type'] = 'application/json'; // request.headers['token'] = StoreService.to.userToken!; // print("11111${StoreService.to.userToken}"); String? xToken = ''; diff --git a/star_lock/lib/tools/commonItem.dart b/star_lock/lib/tools/commonItem.dart index c35d83ea..4f0790a8 100644 --- a/star_lock/lib/tools/commonItem.dart +++ b/star_lock/lib/tools/commonItem.dart @@ -17,7 +17,7 @@ class CommonItem extends StatelessWidget { {Key? key, required this.leftTitel, this.rightTitle, - this.allHeight = 45, + this.allHeight, this.isHaveDirection = false, this.isHaveLine = false, this.isHaveRightWidget = false, @@ -34,7 +34,7 @@ class CommonItem extends StatelessWidget { // mainAxisAlignment: MainAxisAlignment.center, children: [ Container( - height: allHeight ?? 60.h, + height: allHeight ?? 65.h, color: Colors.white, padding: EdgeInsets.only( left: 20.w, right: 10.w), // , top: 20.w, bottom: 20.w diff --git a/star_lock/lib/tools/eventBusEventManage.dart b/star_lock/lib/tools/eventBusEventManage.dart index 52dc945d..8f1d6546 100644 --- a/star_lock/lib/tools/eventBusEventManage.dart +++ b/star_lock/lib/tools/eventBusEventManage.dart @@ -47,4 +47,11 @@ class ChangeLanguageBlockLastLanguageEvent{ /// 锁分组添加或者删除锁之后刷新首页数据 class LockGroupEditGroupLockRefreshEvent{ LockGroupEditGroupLockRefreshEvent(); +} + +/// 锁设置里面开启关闭刷新锁详情 +class LockSetChangeSetRefreshLockDetailWithType{ + int type;// 0 考勤 1开锁时是否需联网 + int setResult; + LockSetChangeSetRefreshLockDetailWithType(this.type, this.setResult); } \ No newline at end of file diff --git a/star_lock/lib/tools/showTFView.dart b/star_lock/lib/tools/showTFView.dart index 4fc01340..c5827ae9 100644 --- a/star_lock/lib/tools/showTFView.dart +++ b/star_lock/lib/tools/showTFView.dart @@ -51,24 +51,6 @@ class ShowTFView extends StatelessWidget { hintStyle: TextStyle(fontSize: 22.sp, height: 1.0), //不需要输入框下划线 border: InputBorder.none, - //左边图标设置 - // icon: Padding( - // padding: EdgeInsets.only(top:30.w, bottom: 20.w, right: 20.w, left: 20.w), - // child: Image.asset('images/main/icon_main_search.png', width: 40.w, height: 40.w,), - // ), - // //右边图标设置 - // suffixIcon: GestureDetector( - // onTap: () { - // //addPostFrameCallback是 StatefulWidge 渲染结束的回调,只会被调用一次 - // // SchedulerBinding.instance.addPostFrameCallback((_) { - // // _controller.text = ""; - // // }); - // }, - // child: Padding( - // padding: EdgeInsets.all(8), - // child: Image.asset('images/main/icon_main_cell.png', width: 50.w, height: 50.w,), - // ), - // ) ), ), )