Merge branch 'develop_liuyf' into feat_devops
This commit is contained in:
commit
0d9d608289
@ -23,6 +23,9 @@ if (flutterVersionName == null) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
apply plugin: 'com.android.application'
|
apply plugin: 'com.android.application'
|
||||||
|
// START: FlutterFire Configuration
|
||||||
|
apply plugin: 'com.google.gms.google-services'
|
||||||
|
// END: FlutterFire Configuration
|
||||||
apply plugin: 'kotlin-android'
|
apply plugin: 'kotlin-android'
|
||||||
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
|
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
|
||||||
apply plugin: 'com.android.application'
|
apply plugin: 'com.android.application'
|
||||||
@ -304,6 +307,6 @@ dependencies {
|
|||||||
implementation 'cn.jiguang.sdk.plugin:vivo:5.2.3'
|
implementation 'cn.jiguang.sdk.plugin:vivo:5.2.3'
|
||||||
|
|
||||||
// Umeng统计
|
// Umeng统计
|
||||||
implementation 'com.umeng.umsdk:common:9.3.7'
|
implementation 'com.umeng.umsdk:common:9.7.9'
|
||||||
implementation 'com.umeng.umsdk:asms:1.4.1'
|
implementation 'com.umeng.umsdk:asms:1.8.5'
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,14 +2,14 @@
|
|||||||
"project_info": {
|
"project_info": {
|
||||||
"project_number": "281500445726",
|
"project_number": "281500445726",
|
||||||
"project_id": "skychip2023-ecdff",
|
"project_id": "skychip2023-ecdff",
|
||||||
"storage_bucket": "skychip2023-ecdff.appspot.com"
|
"storage_bucket": "skychip2023-ecdff.firebasestorage.app"
|
||||||
},
|
},
|
||||||
"client": [
|
"client": [
|
||||||
{
|
{
|
||||||
"client_info": {
|
"client_info": {
|
||||||
"mobilesdk_app_id": "1:281500445726:android:ddf52ac7b7f83cf5c4d20f",
|
"mobilesdk_app_id": "1:281500445726:android:468195b9cc68dd6cc4d20f",
|
||||||
"android_client_info": {
|
"android_client_info": {
|
||||||
"package_name": "com.skychip.lock"
|
"package_name": "com.starlock.lock.local"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"oauth_client": [],
|
"oauth_client": [],
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
package="com.example.star_lock">
|
package="com.skychip.lock">
|
||||||
|
|
||||||
<uses-permission
|
<uses-permission
|
||||||
android:name="android.permission.BLUETOOTH_SCAN"
|
android:name="android.permission.BLUETOOTH_SCAN"
|
||||||
@ -8,8 +8,6 @@
|
|||||||
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
|
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
|
||||||
<uses-permission android:name="android.permission.BLUETOOTH" />
|
<uses-permission android:name="android.permission.BLUETOOTH" />
|
||||||
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
|
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
|
||||||
<!-- <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" android:maxSdkVersion="30" />-->
|
|
||||||
<!-- <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" android:maxSdkVersion="30" />-->
|
|
||||||
<!--允许访问网络,必选权限-->
|
<!--允许访问网络,必选权限-->
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
<!--允许获取精确位置,精准定位必选-->
|
<!--允许获取精确位置,精准定位必选-->
|
||||||
@ -58,14 +56,8 @@
|
|||||||
|
|
||||||
<uses-permission android:name="com.hihonor.permission.sec.SDK_LAUNCHER" />
|
<uses-permission android:name="com.hihonor.permission.sec.SDK_LAUNCHER" />
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
|
|
||||||
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
|
|
||||||
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
|
|
||||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
|
||||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
|
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:name="android.app.Application"
|
android:name=".App"
|
||||||
android:icon="@mipmap/ic_launcher"
|
android:icon="@mipmap/ic_launcher"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:requestLegacyExternalStorage="true"
|
android:requestLegacyExternalStorage="true"
|
||||||
@ -149,7 +141,7 @@
|
|||||||
</intent-filter>
|
</intent-filter>
|
||||||
</service> <!--兼容Q版本-->
|
</service> <!--兼容Q版本-->
|
||||||
<activity
|
<activity
|
||||||
android:name="com.skychip.lock.MainActivity"
|
android:name=".MainActivity"
|
||||||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
|
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:hardwareAccelerated="true"
|
android:hardwareAccelerated="true"
|
||||||
|
|||||||
16
android/app/src/main/kotlin/com/skychip/lock/App.kt
Executable file
16
android/app/src/main/kotlin/com/skychip/lock/App.kt
Executable file
@ -0,0 +1,16 @@
|
|||||||
|
package com.skychip.lock
|
||||||
|
|
||||||
|
import io.flutter.app.FlutterApplication
|
||||||
|
import android.util.Log
|
||||||
|
//import com.umeng.commonsdk.UMConfigure;
|
||||||
|
|
||||||
|
class App : FlutterApplication() {
|
||||||
|
|
||||||
|
override fun onCreate() {
|
||||||
|
super.onCreate()
|
||||||
|
// UMConfigure.setLogEnabled(true);
|
||||||
|
//友盟预初始化
|
||||||
|
// UMConfigure.preInit(getApplicationContext(), "671244cf80464b33f6df9648", "Product");
|
||||||
|
Log.d("MyApplication", "Application has started")
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -20,9 +20,12 @@ class MainActivity : FlutterActivity() {
|
|||||||
GeneratedPluginRegistrant.registerWith(flutterEngine!!)
|
GeneratedPluginRegistrant.registerWith(flutterEngine!!)
|
||||||
|
|
||||||
// 初始化 Umeng SDK
|
// 初始化 Umeng SDK
|
||||||
UMConfigure.init(this, "671244cf80464b33f6df9648", "Product", UMConfigure.DEVICE_TYPE_PHONE, null)
|
// UMConfigure.init(this, "671244cf80464b33f6df9648", "Product", UMConfigure.DEVICE_TYPE_PHONE, null)
|
||||||
|
|
||||||
MethodChannel(flutterEngine?.dartExecutor!!.binaryMessenger, "starLockFlutterSend").setMethodCallHandler { call, result ->
|
MethodChannel(
|
||||||
|
flutterEngine?.dartExecutor!!.binaryMessenger,
|
||||||
|
"starLockFlutterSend"
|
||||||
|
).setMethodCallHandler { call, result ->
|
||||||
if (call.method == "loadNativeShare") {
|
if (call.method == "loadNativeShare") {
|
||||||
val map = call.arguments as Map<String, String>
|
val map = call.arguments as Map<String, String>
|
||||||
val shareText = map["shareText"]
|
val shareText = map["shareText"]
|
||||||
@ -32,7 +35,7 @@ class MainActivity : FlutterActivity() {
|
|||||||
} else {
|
} else {
|
||||||
shareText(shareText, "分享")
|
shareText(shareText, "分享")
|
||||||
}
|
}
|
||||||
} else if (call.method == "sendGetBlueStatus") {
|
} else if (call.method == "sendGetBlueStatus") {
|
||||||
// 蓝牙是否开启
|
// 蓝牙是否开启
|
||||||
// println("收到原生的信息了 methodmethodmethod: ${call.method}")
|
// println("收到原生的信息了 methodmethodmethod: ${call.method}")
|
||||||
val bluetoothAdapter: BluetoothAdapter? = BluetoothAdapter.getDefaultAdapter()
|
val bluetoothAdapter: BluetoothAdapter? = BluetoothAdapter.getDefaultAdapter()
|
||||||
@ -50,7 +53,10 @@ class MainActivity : FlutterActivity() {
|
|||||||
status = "-1"
|
status = "-1"
|
||||||
}
|
}
|
||||||
val flutterEngine: FlutterEngine? = this.flutterEngine // 获取你的 FlutterEngine 实例
|
val flutterEngine: FlutterEngine? = this.flutterEngine // 获取你的 FlutterEngine 实例
|
||||||
MethodChannel(flutterEngine?.dartExecutor!!.binaryMessenger, "starLockFlutterReceive").invokeMethod("getBlueStatus", status)
|
MethodChannel(
|
||||||
|
flutterEngine?.dartExecutor!!.binaryMessenger,
|
||||||
|
"starLockFlutterReceive"
|
||||||
|
).invokeMethod("getBlueStatus", status)
|
||||||
} else {
|
} else {
|
||||||
result.notImplemented() // 没有实现的方法
|
result.notImplemented() // 没有实现的方法
|
||||||
}
|
}
|
||||||
@ -96,7 +102,10 @@ class MainActivity : FlutterActivity() {
|
|||||||
|
|
||||||
override fun configureFlutterEngine(flutterEngine: FlutterEngine) {
|
override fun configureFlutterEngine(flutterEngine: FlutterEngine) {
|
||||||
GeneratedPluginRegistrant.registerWith(flutterEngine)
|
GeneratedPluginRegistrant.registerWith(flutterEngine)
|
||||||
MethodChannel(flutterEngine.dartExecutor.binaryMessenger, "starLockFlutterSend").setMethodCallHandler { call, result ->
|
MethodChannel(
|
||||||
|
flutterEngine.dartExecutor.binaryMessenger,
|
||||||
|
"starLockFlutterSend"
|
||||||
|
).setMethodCallHandler { call, result ->
|
||||||
if (call.method == "loadNativeShare") {
|
if (call.method == "loadNativeShare") {
|
||||||
val map = call.arguments as Map<String, String>
|
val map = call.arguments as Map<String, String>
|
||||||
val shareText = map["shareText"]
|
val shareText = map["shareText"]
|
||||||
|
|||||||
48
android/app/src/sky/google-services.json
Normal file
48
android/app/src/sky/google-services.json
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
{
|
||||||
|
"project_info": {
|
||||||
|
"project_number": "281500445726",
|
||||||
|
"project_id": "skychip2023-ecdff",
|
||||||
|
"storage_bucket": "skychip2023-ecdff.firebasestorage.app"
|
||||||
|
},
|
||||||
|
"client": [
|
||||||
|
{
|
||||||
|
"client_info": {
|
||||||
|
"mobilesdk_app_id": "1:281500445726:android:ddf52ac7b7f83cf5c4d20f",
|
||||||
|
"android_client_info": {
|
||||||
|
"package_name": "com.skychip.lock"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"oauth_client": [],
|
||||||
|
"api_key": [
|
||||||
|
{
|
||||||
|
"current_key": "AIzaSyC-3-ABWuy9LrYyAw_KxDRto4DanQ0sq9g"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"services": {
|
||||||
|
"appinvite_service": {
|
||||||
|
"other_platform_oauth_client": []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"client_info": {
|
||||||
|
"mobilesdk_app_id": "1:281500445726:android:468195b9cc68dd6cc4d20f",
|
||||||
|
"android_client_info": {
|
||||||
|
"package_name": "com.starlock.lock.local"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"oauth_client": [],
|
||||||
|
"api_key": [
|
||||||
|
{
|
||||||
|
"current_key": "AIzaSyC-3-ABWuy9LrYyAw_KxDRto4DanQ0sq9g"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"services": {
|
||||||
|
"appinvite_service": {
|
||||||
|
"other_platform_oauth_client": []
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"configuration_version": "1"
|
||||||
|
}
|
||||||
1
firebase.json
Normal file
1
firebase.json
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"flutter":{"platforms":{"android":{"default":{"projectId":"skychip2023-ecdff","appId":"1:281500445726:android:468195b9cc68dd6cc4d20f","fileOutput":"android/app/google-services.json"}},"ios":{"default":{"projectId":"skychip2023-ecdff","appId":"1:281500445726:ios:b194ccffb92fb86cc4d20f","uploadDebugSymbols":false,"fileOutput":"ios/Runner/GoogleService-Info.plist"}},"dart":{"lib/firebase_options.dart":{"projectId":"skychip2023-ecdff","configurations":{"android":"1:281500445726:android:468195b9cc68dd6cc4d20f","ios":"1:281500445726:ios:b194ccffb92fb86cc4d20f"}}}}}}
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 214 KiB After Width: | Height: | Size: 45 KiB |
@ -5,7 +5,7 @@
|
|||||||
#import "XSFlutterManager.h"
|
#import "XSFlutterManager.h"
|
||||||
|
|
||||||
#import <UserNotifications/UserNotifications.h>
|
#import <UserNotifications/UserNotifications.h>
|
||||||
#import <UMCommon/UMCommon.h>
|
// #import <UMCommon/UMCommon.h>
|
||||||
|
|
||||||
|
|
||||||
@interface AppDelegate()
|
@interface AppDelegate()
|
||||||
@ -19,7 +19,7 @@
|
|||||||
- (BOOL)application:(UIApplication *)application
|
- (BOOL)application:(UIApplication *)application
|
||||||
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
|
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
|
||||||
|
|
||||||
[UMConfigure initWithAppkey:@"671244ae80464b33f6df9646" channel:@"Product"];
|
// [UMConfigure initWithAppkey:@"671244ae80464b33f6df9646" channel:@"Product"];
|
||||||
|
|
||||||
XSFlutterManager *VC = [[XSFlutterManager alloc] init];
|
XSFlutterManager *VC = [[XSFlutterManager alloc] init];
|
||||||
self.window.rootViewController = VC;
|
self.window.rootViewController = VC;
|
||||||
|
|||||||
@ -87,11 +87,11 @@
|
|||||||
<key>NSFileProtectionKey</key>
|
<key>NSFileProtectionKey</key>
|
||||||
<string>NSFileProtectionCompleteUntilFirstUserAuthentication</string>
|
<string>NSFileProtectionCompleteUntilFirstUserAuthentication</string>
|
||||||
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
|
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
|
||||||
<string>应用在前台和后台的时候可以搜到更新的位置信息</string>
|
<string>我们需要访问您的位置信息,以便更加精准的扫描到所在位置的蓝牙锁设备</string>
|
||||||
<key>NSLocationAlwaysUsageDescription</key>
|
<key>NSLocationAlwaysUsageDescription</key>
|
||||||
<string>应用在后台的时候可以搜到更新的位置信息</string>
|
<string>我们需要访问您的位置信息,以便更加精准的扫描到所在位置的蓝牙锁设备</string>
|
||||||
<key>NSLocationWhenInUseUsageDescription</key>
|
<key>NSLocationWhenInUseUsageDescription</key>
|
||||||
<string>应用在前台的时候可以搜到更新的位置信息</string>
|
<string>我们需要访问您的位置信息,以便更加精准的扫描到所在位置的蓝牙锁设备</string>
|
||||||
<key>NSMicrophoneUsageDescription</key>
|
<key>NSMicrophoneUsageDescription</key>
|
||||||
<string>应用请求麦克风用来通话</string>
|
<string>应用请求麦克风用来通话</string>
|
||||||
<key>NSPhotoLibraryUsageDescription</key>
|
<key>NSPhotoLibraryUsageDescription</key>
|
||||||
|
|||||||
@ -11,8 +11,8 @@ NSBluetoothAlwaysUsageDescription="The app uses bluetooth to find, connect and t
|
|||||||
NSBluetoothPeripheralUsageDescription="The app uses bluetooth to find, connect and transfer data between different devices";
|
NSBluetoothPeripheralUsageDescription="The app uses bluetooth to find, connect and transfer data between different devices";
|
||||||
NSCameraUsageDescription="The application requests the camera to take photos for avatar upload and face authentication";
|
NSCameraUsageDescription="The application requests the camera to take photos for avatar upload and face authentication";
|
||||||
NSContactsUsageDescription="Access the address book to send electronic keys to contacts in the address book";
|
NSContactsUsageDescription="Access the address book to send electronic keys to contacts in the address book";
|
||||||
NSLocationAlwaysAndWhenInUseUsageDescription="updated location information when applying in the front and backend";
|
NSLocationAlwaysAndWhenInUseUsageDescription="We need to access your location information in order to more accurately scan the Bluetooth lock device at your location.";
|
||||||
NSLocationAlwaysUsageDescription="updated location information when the app is in the background";
|
NSLocationAlwaysUsageDescription="We need to access your location information in order to more accurately scan the Bluetooth lock device at your location.";
|
||||||
NSLocationWhenInUseUsageDescription="updated location information when the app is in the foreground";
|
NSLocationWhenInUseUsageDescription="We need to access your location information in order to more accurately scan the Bluetooth lock device at your location.";
|
||||||
NSMicrophoneUsageDescription="request microphone for calls";
|
NSMicrophoneUsageDescription="request microphone for calls";
|
||||||
NSPhotoLibraryUsageDescription="request photo album for avatar upload";
|
NSPhotoLibraryUsageDescription="request photo album for avatar upload";
|
||||||
|
|||||||
@ -11,8 +11,8 @@ NSBluetoothAlwaysUsageDescription="The app uses bluetooth to find, connect and t
|
|||||||
NSBluetoothPeripheralUsageDescription="The app uses bluetooth to find, connect and transfer data between different devices";
|
NSBluetoothPeripheralUsageDescription="The app uses bluetooth to find, connect and transfer data between different devices";
|
||||||
NSCameraUsageDescription="The application requests the camera to take photos for avatar upload and face authentication";
|
NSCameraUsageDescription="The application requests the camera to take photos for avatar upload and face authentication";
|
||||||
NSContactsUsageDescription="Access the address book to send electronic keys to contacts in the address book";
|
NSContactsUsageDescription="Access the address book to send electronic keys to contacts in the address book";
|
||||||
NSLocationAlwaysAndWhenInUseUsageDescription="updated location information when applying in the front and backend";
|
NSLocationAlwaysAndWhenInUseUsageDescription="We need to access your location information in order to more accurately scan the Bluetooth lock device at your location.";
|
||||||
NSLocationAlwaysUsageDescription="updated location information when the app is in the background";
|
NSLocationAlwaysUsageDescription="We need to access your location information in order to more accurately scan the Bluetooth lock device at your location.";
|
||||||
NSLocationWhenInUseUsageDescription="updated location information when the app is in the foreground";
|
NSLocationWhenInUseUsageDescription="We need to access your location information in order to more accurately scan the Bluetooth lock device at your location.";
|
||||||
NSMicrophoneUsageDescription="request microphone for calls";
|
NSMicrophoneUsageDescription="request microphone for calls";
|
||||||
NSPhotoLibraryUsageDescription="request photo album for avatar upload";
|
NSPhotoLibraryUsageDescription="request photo album for avatar upload";
|
||||||
|
|||||||
@ -87,11 +87,11 @@
|
|||||||
<key>NSFileProtectionKey</key>
|
<key>NSFileProtectionKey</key>
|
||||||
<string>NSFileProtectionCompleteUntilFirstUserAuthentication</string>
|
<string>NSFileProtectionCompleteUntilFirstUserAuthentication</string>
|
||||||
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
|
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
|
||||||
<string>应用在前台和后台的时候可以搜到更新的位置信息</string>
|
<string>我们需要访问您的位置信息,以便更加精准的扫描到所在位置的蓝牙锁设备</string>
|
||||||
<key>NSLocationAlwaysUsageDescription</key>
|
<key>NSLocationAlwaysUsageDescription</key>
|
||||||
<string>应用在后台的时候可以搜到更新的位置信息</string>
|
<string>我们需要访问您的位置信息,以便更加精准的扫描到所在位置的蓝牙锁设备</string>
|
||||||
<key>NSLocationWhenInUseUsageDescription</key>
|
<key>NSLocationWhenInUseUsageDescription</key>
|
||||||
<string>应用在前台的时候可以搜到更新的位置信息</string>
|
<string>我们需要访问您的位置信息,以便更加精准的扫描到所在位置的蓝牙锁设备</string>
|
||||||
<key>NSMicrophoneUsageDescription</key>
|
<key>NSMicrophoneUsageDescription</key>
|
||||||
<string>应用请求麦克风用来通话</string>
|
<string>应用请求麦克风用来通话</string>
|
||||||
<key>NSPhotoLibraryUsageDescription</key>
|
<key>NSPhotoLibraryUsageDescription</key>
|
||||||
|
|||||||
@ -85,11 +85,11 @@
|
|||||||
<key>NSContactsUsageDescription</key>
|
<key>NSContactsUsageDescription</key>
|
||||||
<string>Reason we need access to the contact list</string>
|
<string>Reason we need access to the contact list</string>
|
||||||
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
|
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
|
||||||
<string>应用在前台和后台的时候可以搜到更新的位置信息</string>
|
<string>我们需要访问您的位置信息,以便更加精准的扫描到所在位置的蓝牙锁设备</string>
|
||||||
<key>NSLocationAlwaysUsageDescription</key>
|
<key>NSLocationAlwaysUsageDescription</key>
|
||||||
<string>应用在后台的时候可以搜到更新的位置信息</string>
|
<string>我们需要访问您的位置信息,以便更加精准的扫描到所在位置的蓝牙锁设备</string>
|
||||||
<key>NSLocationWhenInUseUsageDescription</key>
|
<key>NSLocationWhenInUseUsageDescription</key>
|
||||||
<string>应用在前台的时候可以搜到更新的位置信息</string>
|
<string>我们需要访问您的位置信息,以便更加精准的扫描到所在位置的蓝牙锁设备</string>
|
||||||
<key>NSMicrophoneUsageDescription</key>
|
<key>NSMicrophoneUsageDescription</key>
|
||||||
<string>应用请求麦克风用来通话</string>
|
<string>应用请求麦克风用来通话</string>
|
||||||
<key>NSPhotoLibraryUsageDescription</key>
|
<key>NSPhotoLibraryUsageDescription</key>
|
||||||
|
|||||||
@ -85,11 +85,11 @@
|
|||||||
<key>NSContactsUsageDescription</key>
|
<key>NSContactsUsageDescription</key>
|
||||||
<string>Reason we need access to the contact list</string>
|
<string>Reason we need access to the contact list</string>
|
||||||
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
|
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
|
||||||
<string>应用在前台和后台的时候可以搜到更新的位置信息</string>
|
<string>我们需要访问您的位置信息,以便更加精准的扫描到所在位置的蓝牙锁设备</string>
|
||||||
<key>NSLocationAlwaysUsageDescription</key>
|
<key>NSLocationAlwaysUsageDescription</key>
|
||||||
<string>应用在后台的时候可以搜到更新的位置信息</string>
|
<string>我们需要访问您的位置信息,以便更加精准的扫描到所在位置的蓝牙锁设备</string>
|
||||||
<key>NSLocationWhenInUseUsageDescription</key>
|
<key>NSLocationWhenInUseUsageDescription</key>
|
||||||
<string>应用在前台的时候可以搜到更新的位置信息</string>
|
<string>我们需要访问您的位置信息,以便更加精准的扫描到所在位置的蓝牙锁设备</string>
|
||||||
<key>NSMicrophoneUsageDescription</key>
|
<key>NSMicrophoneUsageDescription</key>
|
||||||
<string>应用请求麦克风用来通话</string>
|
<string>应用请求麦克风用来通话</string>
|
||||||
<key>NSPhotoLibraryUsageDescription</key>
|
<key>NSPhotoLibraryUsageDescription</key>
|
||||||
|
|||||||
@ -87,11 +87,11 @@
|
|||||||
<key>NSFileProtectionKey</key>
|
<key>NSFileProtectionKey</key>
|
||||||
<string>NSFileProtectionCompleteUntilFirstUserAuthentication</string>
|
<string>NSFileProtectionCompleteUntilFirstUserAuthentication</string>
|
||||||
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
|
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
|
||||||
<string>应用在前台和后台的时候可以搜到更新的位置信息</string>
|
<string>我们需要访问您的位置信息,以便更加精准的扫描到所在位置的蓝牙锁设备</string>
|
||||||
<key>NSLocationAlwaysUsageDescription</key>
|
<key>NSLocationAlwaysUsageDescription</key>
|
||||||
<string>应用在后台的时候可以搜到更新的位置信息</string>
|
<string>我们需要访问您的位置信息,以便更加精准的扫描到所在位置的蓝牙锁设备</string>
|
||||||
<key>NSLocationWhenInUseUsageDescription</key>
|
<key>NSLocationWhenInUseUsageDescription</key>
|
||||||
<string>应用在前台的时候可以搜到更新的位置信息</string>
|
<string>我们需要访问您的位置信息,以便更加精准的扫描到所在位置的蓝牙锁设备</string>
|
||||||
<key>NSMicrophoneUsageDescription</key>
|
<key>NSMicrophoneUsageDescription</key>
|
||||||
<string>应用请求麦克风用来通话</string>
|
<string>应用请求麦克风用来通话</string>
|
||||||
<key>NSPhotoLibraryUsageDescription</key>
|
<key>NSPhotoLibraryUsageDescription</key>
|
||||||
|
|||||||
@ -11,8 +11,8 @@ NSBluetoothAlwaysUsageDescription="该应用程序使用蓝牙在不同设备之
|
|||||||
NSBluetoothPeripheralUsageDescription="该应用程序使用蓝牙在不同设备之间查找、连接和传输数据";
|
NSBluetoothPeripheralUsageDescription="该应用程序使用蓝牙在不同设备之间查找、连接和传输数据";
|
||||||
NSCameraUsageDescription="应用请求相机,以便于拍摄照片,用于头像上传及人脸认证";
|
NSCameraUsageDescription="应用请求相机,以便于拍摄照片,用于头像上传及人脸认证";
|
||||||
NSContactsUsageDescription="应用访问通讯录,用于给通讯录中的联系人发送电子钥匙";
|
NSContactsUsageDescription="应用访问通讯录,用于给通讯录中的联系人发送电子钥匙";
|
||||||
NSLocationAlwaysAndWhenInUseUsageDescription="应用在前台和后台的时候可以搜到更新的位置信息";
|
NSLocationAlwaysAndWhenInUseUsageDescription="我们需要访问您的位置信息,以便更加精准的扫描到所在位置的蓝牙锁设备";
|
||||||
NSLocationAlwaysUsageDescription="应用在后台的时候可以搜到更新的位置信息";
|
NSLocationAlwaysUsageDescription="我们需要访问您的位置信息,以便更加精准的扫描到所在位置的蓝牙锁设备";
|
||||||
NSLocationWhenInUseUsageDescription="应用在前台的时候可以搜到更新的位置信息";
|
NSLocationWhenInUseUsageDescription="我们需要访问您的位置信息,以便更加精准的扫描到所在位置的蓝牙锁设备";
|
||||||
NSMicrophoneUsageDescription="应用请求麦克风用来通话";
|
NSMicrophoneUsageDescription="应用请求麦克风用来通话";
|
||||||
NSPhotoLibraryUsageDescription="应用请求相册用于头像上传";
|
NSPhotoLibraryUsageDescription="应用请求相册用于头像上传";
|
||||||
|
|||||||
@ -11,8 +11,8 @@ NSBluetoothAlwaysUsageDescription="该应用程序使用蓝牙在不同设备之
|
|||||||
NSBluetoothPeripheralUsageDescription="该应用程序使用蓝牙在不同设备之间查找、连接和传输数据";
|
NSBluetoothPeripheralUsageDescription="该应用程序使用蓝牙在不同设备之间查找、连接和传输数据";
|
||||||
NSCameraUsageDescription="应用请求相机,以便于拍摄照片,用于头像上传及人脸认证";
|
NSCameraUsageDescription="应用请求相机,以便于拍摄照片,用于头像上传及人脸认证";
|
||||||
NSContactsUsageDescription="应用访问通讯录,用于给通讯录中的联系人发送电子钥匙";
|
NSContactsUsageDescription="应用访问通讯录,用于给通讯录中的联系人发送电子钥匙";
|
||||||
NSLocationAlwaysAndWhenInUseUsageDescription="应用在前台和后台的时候可以搜到更新的位置信息";
|
NSLocationAlwaysAndWhenInUseUsageDescription="我们需要访问您的位置信息,以便更加精准的扫描到所在位置的蓝牙锁设备";
|
||||||
NSLocationAlwaysUsageDescription="应用在后台的时候可以搜到更新的位置信息";
|
NSLocationAlwaysUsageDescription="我们需要访问您的位置信息,以便更加精准的扫描到所在位置的蓝牙锁设备";
|
||||||
NSLocationWhenInUseUsageDescription="应用在前台的时候可以搜到更新的位置信息";
|
NSLocationWhenInUseUsageDescription="我们需要访问您的位置信息,以便更加精准的扫描到所在位置的蓝牙锁设备";
|
||||||
NSMicrophoneUsageDescription="应用请求麦克风用来通话";
|
NSMicrophoneUsageDescription="应用请求麦克风用来通话";
|
||||||
NSPhotoLibraryUsageDescription="应用请求相册用于头像上传";
|
NSPhotoLibraryUsageDescription="应用请求相册用于头像上传";
|
||||||
|
|||||||
@ -11,8 +11,8 @@ NSBluetoothAlwaysUsageDescription="该应用程序使用蓝牙在不同设备之
|
|||||||
NSBluetoothPeripheralUsageDescription="该应用程序使用蓝牙在不同设备之间查找、连接和传输数据";
|
NSBluetoothPeripheralUsageDescription="该应用程序使用蓝牙在不同设备之间查找、连接和传输数据";
|
||||||
NSCameraUsageDescription="应用请求相机,以便于拍摄照片,用于头像上传及人脸认证";
|
NSCameraUsageDescription="应用请求相机,以便于拍摄照片,用于头像上传及人脸认证";
|
||||||
NSContactsUsageDescription="应用访问通讯录,用于给通讯录中的联系人发送电子钥匙";
|
NSContactsUsageDescription="应用访问通讯录,用于给通讯录中的联系人发送电子钥匙";
|
||||||
NSLocationAlwaysAndWhenInUseUsageDescription="应用在前台和后台的时候可以搜到更新的位置信息";
|
NSLocationAlwaysAndWhenInUseUsageDescription="我们需要访问您的位置信息,以便更加精准的扫描到所在位置的蓝牙锁设备";
|
||||||
NSLocationAlwaysUsageDescription="应用在后台的时候可以搜到更新的位置信息";
|
NSLocationAlwaysUsageDescription="我们需要访问您的位置信息,以便更加精准的扫描到所在位置的蓝牙锁设备";
|
||||||
NSLocationWhenInUseUsageDescription="应用在前台的时候可以搜到更新的位置信息";
|
NSLocationWhenInUseUsageDescription="我们需要访问您的位置信息,以便更加精准的扫描到所在位置的蓝牙锁设备";
|
||||||
NSMicrophoneUsageDescription="应用请求麦克风用来通话";
|
NSMicrophoneUsageDescription="应用请求麦克风用来通话";
|
||||||
NSPhotoLibraryUsageDescription="应用请求相册用于头像上传";
|
NSPhotoLibraryUsageDescription="应用请求相册用于头像上传";
|
||||||
|
|||||||
1996
lan/lan_hk.json
1996
lan/lan_hk.json
File diff suppressed because it is too large
Load Diff
71
lib/apm/apm_helper.dart
Normal file
71
lib/apm/apm_helper.dart
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
//<com>
|
||||||
|
import 'firebase/firebase_helper.dart';
|
||||||
|
|
||||||
|
//</com>
|
||||||
|
|
||||||
|
//<cn>
|
||||||
|
import 'umeng/umeng_helper.dart';
|
||||||
|
//</cn>
|
||||||
|
|
||||||
|
class ApmHelper {
|
||||||
|
ApmHelper._internal();
|
||||||
|
|
||||||
|
factory ApmHelper() => _getInstance();
|
||||||
|
|
||||||
|
static ApmHelper get instance => _getInstance();
|
||||||
|
static ApmHelper? _instance;
|
||||||
|
|
||||||
|
// 增加开关
|
||||||
|
static bool enabled = false;
|
||||||
|
|
||||||
|
static ApmHelper _getInstance() {
|
||||||
|
_instance ??= ApmHelper._internal();
|
||||||
|
return _instance!;
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> initApp() async {
|
||||||
|
//<cn>
|
||||||
|
await UmengHelper.instance.initApp();
|
||||||
|
//</cn>
|
||||||
|
//<com>
|
||||||
|
await FirebaseHelper.instance.initApp();
|
||||||
|
//</com>
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> initSdk() async {
|
||||||
|
//<cn>
|
||||||
|
UmengHelper.instance.initSdk();
|
||||||
|
//</cn>
|
||||||
|
//<com>
|
||||||
|
FirebaseHelper.instance.initSdk();
|
||||||
|
//</com>
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> login(String userId) async {
|
||||||
|
//<cn>
|
||||||
|
UmengHelper.instance.login(userId);
|
||||||
|
//</cn>
|
||||||
|
//<com>
|
||||||
|
FirebaseHelper.instance.login(userId);
|
||||||
|
//</com>
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> trackEvent(
|
||||||
|
String eventName, Map<String, Object> parameters) async {
|
||||||
|
//<cn>
|
||||||
|
UmengHelper.instance.trackEvent(eventName, parameters);
|
||||||
|
//</cn>
|
||||||
|
//<com>
|
||||||
|
FirebaseHelper.instance.trackEvent(eventName, parameters);
|
||||||
|
//</com>
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> logout() async {
|
||||||
|
//<cn>
|
||||||
|
UmengHelper.instance.logout();
|
||||||
|
//</cn>
|
||||||
|
//<com>
|
||||||
|
FirebaseHelper.instance.logout();
|
||||||
|
//</com>
|
||||||
|
}
|
||||||
|
}
|
||||||
77
lib/apm/firebase/firebase_helper.dart
Normal file
77
lib/apm/firebase/firebase_helper.dart
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
//<com>
|
||||||
|
import 'package:firebase_analytics/firebase_analytics.dart';
|
||||||
|
import 'package:firebase_core/firebase_core.dart'
|
||||||
|
show Firebase, FirebaseOptions;
|
||||||
|
import 'package:flutter/foundation.dart'
|
||||||
|
show defaultTargetPlatform, kIsWeb, TargetPlatform;
|
||||||
|
|
||||||
|
class DefaultFirebaseOptions {
|
||||||
|
static FirebaseOptions get currentPlatform {
|
||||||
|
switch (defaultTargetPlatform) {
|
||||||
|
case TargetPlatform.android:
|
||||||
|
return android;
|
||||||
|
case TargetPlatform.iOS:
|
||||||
|
return ios;
|
||||||
|
default:
|
||||||
|
throw UnsupportedError(
|
||||||
|
'DefaultFirebaseOptions are not supported for this platform.',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static const FirebaseOptions android = FirebaseOptions(
|
||||||
|
apiKey: 'AIzaSyC-3-ABWuy9LrYyAw_KxDRto4DanQ0sq9g',
|
||||||
|
appId: '1:281500445726:android:ddf52ac7b7f83cf5c4d20f',
|
||||||
|
messagingSenderId: '281500445726',
|
||||||
|
projectId: 'skychip2023-ecdff',
|
||||||
|
storageBucket: 'skychip2023-ecdff.firebasestorage.app',
|
||||||
|
);
|
||||||
|
|
||||||
|
static const FirebaseOptions ios = FirebaseOptions(
|
||||||
|
apiKey: 'AIzaSyACbp5aUKhLU1SMg8iIdm9WmNX7wxI7fVc',
|
||||||
|
appId: '1:281500445726:ios:b194ccffb92fb86cc4d20f',
|
||||||
|
messagingSenderId: '281500445726',
|
||||||
|
projectId: 'skychip2023-ecdff',
|
||||||
|
storageBucket: 'skychip2023-ecdff.firebasestorage.app',
|
||||||
|
iosBundleId: 'com.starlock.lock.local',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
class FirebaseHelper {
|
||||||
|
factory FirebaseHelper() => _getInstance();
|
||||||
|
|
||||||
|
FirebaseHelper._internal();
|
||||||
|
|
||||||
|
static FirebaseHelper get instance => _getInstance();
|
||||||
|
static FirebaseHelper? _instance;
|
||||||
|
|
||||||
|
static FirebaseHelper _getInstance() {
|
||||||
|
_instance ??= FirebaseHelper._internal();
|
||||||
|
return _instance!;
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> initApp() async {
|
||||||
|
await Firebase.initializeApp(
|
||||||
|
options: DefaultFirebaseOptions.currentPlatform,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> initSdk() async {
|
||||||
|
FirebaseAnalytics.instance.setAnalyticsCollectionEnabled(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> login(String userId) async {
|
||||||
|
FirebaseAnalytics.instance.setUserId(id: userId);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> trackEvent(
|
||||||
|
String eventName, Map<String, Object>? parameters) async {
|
||||||
|
FirebaseAnalytics.instance
|
||||||
|
.logEvent(name: eventName, parameters: parameters);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> logout() async {
|
||||||
|
FirebaseAnalytics.instance.setUserId(id: '');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//</com>
|
||||||
41
lib/apm/umeng/umeng_helper.dart
Normal file
41
lib/apm/umeng/umeng_helper.dart
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
//<cn>
|
||||||
|
import 'package:umeng_common_sdk/umeng_common_sdk.dart';
|
||||||
|
import '../../flavors.dart';
|
||||||
|
|
||||||
|
class UmengHelper {
|
||||||
|
UmengHelper._internal();
|
||||||
|
|
||||||
|
factory UmengHelper() => _getInstance();
|
||||||
|
|
||||||
|
static UmengHelper get instance => _getInstance();
|
||||||
|
static UmengHelper? _instance;
|
||||||
|
|
||||||
|
static UmengHelper _getInstance() {
|
||||||
|
_instance ??= UmengHelper._internal();
|
||||||
|
return _instance!;
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> initApp() async {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> initSdk() async {
|
||||||
|
UmengCommonSdk.initCommon(
|
||||||
|
F.umengKey.androidKey, F.umengKey.iosKey, F.umengKey.channel);
|
||||||
|
UmengCommonSdk.setPageCollectionModeManual();
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> login(String userId) async {
|
||||||
|
UmengCommonSdk.onProfileSignIn(userId);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> trackEvent(
|
||||||
|
String eventName, Map<String, Object> parameters) async {
|
||||||
|
UmengCommonSdk.onEvent(eventName, parameters);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> logout() async {
|
||||||
|
UmengCommonSdk.onProfileSignOff();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//</cn>
|
||||||
@ -22,6 +22,20 @@ class StarLockAMapKey {
|
|||||||
const StarLockAMapKey({required this.iosKey, required this.androidKey});
|
const StarLockAMapKey({required this.iosKey, required this.androidKey});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class UmengKey {
|
||||||
|
//iOS平台的key
|
||||||
|
final String iosKey;
|
||||||
|
|
||||||
|
//Android平台的key
|
||||||
|
final String androidKey;
|
||||||
|
|
||||||
|
//channle
|
||||||
|
final String channel;
|
||||||
|
|
||||||
|
const UmengKey(
|
||||||
|
{required this.iosKey, required this.androidKey, required this.channel});
|
||||||
|
}
|
||||||
|
|
||||||
typedef dynamic fCallFunction();
|
typedef dynamic fCallFunction();
|
||||||
|
|
||||||
class F {
|
class F {
|
||||||
@ -180,6 +194,62 @@ class F {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// StarLockAMapKey
|
||||||
|
static UmengKey get umengKey {
|
||||||
|
switch (appFlavor) {
|
||||||
|
case Flavor.local:
|
||||||
|
return const UmengKey(
|
||||||
|
androidKey: '671244cf80464b33f6df9648',
|
||||||
|
iosKey: '671244ae80464b33f6df9646',
|
||||||
|
channel: 'Product');
|
||||||
|
case Flavor.dev:
|
||||||
|
return const UmengKey(
|
||||||
|
androidKey: '671244cf80464b33f6df9648',
|
||||||
|
iosKey: '671244ae80464b33f6df9646',
|
||||||
|
channel: 'Product');
|
||||||
|
case Flavor.pre:
|
||||||
|
return const UmengKey(
|
||||||
|
androidKey: '671244cf80464b33f6df9648',
|
||||||
|
iosKey: '671244ae80464b33f6df9646',
|
||||||
|
channel: 'Product');
|
||||||
|
case Flavor.sky_dev:
|
||||||
|
return const UmengKey(
|
||||||
|
androidKey: '671244cf80464b33f6df9648',
|
||||||
|
iosKey: '671244ae80464b33f6df9646',
|
||||||
|
channel: 'Product');
|
||||||
|
case Flavor.sky_pre:
|
||||||
|
return const UmengKey(
|
||||||
|
androidKey: '671244cf80464b33f6df9648',
|
||||||
|
iosKey: '671244ae80464b33f6df9646',
|
||||||
|
channel: 'Product');
|
||||||
|
case Flavor.sky:
|
||||||
|
return const UmengKey(
|
||||||
|
androidKey: '671244cf80464b33f6df9648',
|
||||||
|
iosKey: '671244ae80464b33f6df9646',
|
||||||
|
channel: 'Product');
|
||||||
|
case Flavor.xhj_dev:
|
||||||
|
return const UmengKey(
|
||||||
|
androidKey: '671244cf80464b33f6df9648',
|
||||||
|
iosKey: '671244ae80464b33f6df9646',
|
||||||
|
channel: 'Product');
|
||||||
|
case Flavor.xhj_pre:
|
||||||
|
return const UmengKey(
|
||||||
|
androidKey: '671244cf80464b33f6df9648',
|
||||||
|
iosKey: '671244ae80464b33f6df9646',
|
||||||
|
channel: 'Product');
|
||||||
|
case Flavor.xhj:
|
||||||
|
return const UmengKey(
|
||||||
|
androidKey: '671244cf80464b33f6df9648',
|
||||||
|
iosKey: '671244ae80464b33f6df9646',
|
||||||
|
channel: 'Product');
|
||||||
|
default:
|
||||||
|
return const UmengKey(
|
||||||
|
androidKey: '671244cf80464b33f6df9648',
|
||||||
|
iosKey: '671244ae80464b33f6df9646',
|
||||||
|
channel: 'Product');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 是否是生产环境
|
// 是否是生产环境
|
||||||
static bool get isProductionEnv {
|
static bool get isProductionEnv {
|
||||||
switch (appFlavor) {
|
switch (appFlavor) {
|
||||||
|
|||||||
@ -2,11 +2,11 @@ import 'dart:async';
|
|||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:star_lock/apm/apm_helper.dart';
|
||||||
import 'package:star_lock/app_settings/app_settings.dart';
|
import 'package:star_lock/app_settings/app_settings.dart';
|
||||||
import 'package:star_lock/login/forgetPassword/starLock_forgetPassword_state.dart';
|
import 'package:star_lock/login/forgetPassword/starLock_forgetPassword_state.dart';
|
||||||
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
||||||
import 'package:star_lock/login/register/entity/SendValidationCodeEntity.dart';
|
import 'package:star_lock/login/register/entity/SendValidationCodeEntity.dart';
|
||||||
import 'package:umeng_common_sdk/umeng_common_sdk.dart';
|
|
||||||
|
|
||||||
import '../../network/api_repository.dart';
|
import '../../network/api_repository.dart';
|
||||||
import '../../tools/baseGetXController.dart';
|
import '../../tools/baseGetXController.dart';
|
||||||
@ -55,7 +55,7 @@ class StarLockForgetPasswordLogic extends BaseGetXController {
|
|||||||
'B748F838-94EE-4BDB-A0E6-7B2D16849792',
|
'B748F838-94EE-4BDB-A0E6-7B2D16849792',
|
||||||
state.verificationCode.value);
|
state.verificationCode.value);
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
UmengCommonSdk.onEvent('resetPassword_result', {
|
ApmHelper.instance.trackEvent('resetPassword_result', {
|
||||||
'account':state.phoneStr.value,
|
'account':state.phoneStr.value,
|
||||||
'date':DateTool().getNowDateWithType(1),
|
'date':DateTool().getNowDateWithType(1),
|
||||||
'resetPassword_res':'成功',
|
'resetPassword_res':'成功',
|
||||||
@ -64,7 +64,7 @@ class StarLockForgetPasswordLogic extends BaseGetXController {
|
|||||||
showToast('重置成功'.tr);
|
showToast('重置成功'.tr);
|
||||||
Get.back();
|
Get.back();
|
||||||
}else{
|
}else{
|
||||||
UmengCommonSdk.onEvent('resetPassword_result', {
|
ApmHelper.instance.trackEvent('resetPassword_result', {
|
||||||
'account':state.phoneStr.value,
|
'account':state.phoneStr.value,
|
||||||
'date':DateTool().getNowDateWithType(1),
|
'date':DateTool().getNowDateWithType(1),
|
||||||
'resetPassword_res':'${entity.errorCode}--${entity.errorMsg}',
|
'resetPassword_res':'${entity.errorCode}--${entity.errorMsg}',
|
||||||
|
|||||||
@ -25,6 +25,7 @@ class LoginData {
|
|||||||
uid = json['uid'];
|
uid = json['uid'];
|
||||||
isVip = json['isVip'];
|
isVip = json['isVip'];
|
||||||
}
|
}
|
||||||
|
|
||||||
String? accessToken;
|
String? accessToken;
|
||||||
int? userid;
|
int? userid;
|
||||||
int? expiresAt;
|
int? expiresAt;
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:star_lock/apm/apm_helper.dart';
|
||||||
import 'package:star_lock/appRouters.dart';
|
import 'package:star_lock/appRouters.dart';
|
||||||
import 'package:star_lock/app_settings/app_settings.dart';
|
import 'package:star_lock/app_settings/app_settings.dart';
|
||||||
import 'package:star_lock/blue/blue_manage.dart';
|
import 'package:star_lock/blue/blue_manage.dart';
|
||||||
@ -7,7 +8,6 @@ import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
|
|||||||
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
||||||
import 'package:star_lock/mine/mine/starLockMine_state.dart';
|
import 'package:star_lock/mine/mine/starLockMine_state.dart';
|
||||||
import 'package:star_lock/tools/baseGetXController.dart';
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
import 'package:umeng_common_sdk/umeng_common_sdk.dart';
|
|
||||||
|
|
||||||
import '../../main/lockMian/lockMain/lockMain_logic.dart';
|
import '../../main/lockMian/lockMain/lockMain_logic.dart';
|
||||||
import '../../mine/mine/starLockMine_logic.dart';
|
import '../../mine/mine/starLockMine_logic.dart';
|
||||||
@ -50,7 +50,7 @@ class StarLockLoginLogic extends BaseGetXController {
|
|||||||
username: state.emailOrPhone.value,
|
username: state.emailOrPhone.value,
|
||||||
deviceInfo: state.deviceInfoMap);
|
deviceInfo: state.deviceInfoMap);
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
UmengCommonSdk.onEvent('login_result', {
|
ApmHelper.instance.trackEvent('login_result', {
|
||||||
'account': state.emailOrPhone.value,
|
'account': state.emailOrPhone.value,
|
||||||
'date': DateTool().getNowDateWithType(1),
|
'date': DateTool().getNowDateWithType(1),
|
||||||
'login_res': '成功',
|
'login_res': '成功',
|
||||||
@ -65,7 +65,7 @@ class StarLockLoginLogic extends BaseGetXController {
|
|||||||
Get.offNamedUntil(Routers.starLockMain, (Route route) => false);
|
Get.offNamedUntil(Routers.starLockMain, (Route route) => false);
|
||||||
BlueManage().scanDevices.clear(); //清除设备缓存
|
BlueManage().scanDevices.clear(); //清除设备缓存
|
||||||
} else {
|
} else {
|
||||||
UmengCommonSdk.onEvent('login_result', {
|
ApmHelper.instance.trackEvent('login_result', {
|
||||||
'account': state.emailOrPhone.value,
|
'account': state.emailOrPhone.value,
|
||||||
'date': DateTool().getNowDateWithType(1),
|
'date': DateTool().getNowDateWithType(1),
|
||||||
'login_res': '${entity.errorCode}--${entity.errorMsg}',
|
'login_res': '${entity.errorCode}--${entity.errorMsg}',
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
|
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:star_lock/apm/apm_helper.dart';
|
||||||
import 'package:star_lock/appRouters.dart';
|
import 'package:star_lock/appRouters.dart';
|
||||||
import 'package:star_lock/app_settings/app_settings.dart';
|
import 'package:star_lock/app_settings/app_settings.dart';
|
||||||
import 'package:star_lock/blue/blue_manage.dart';
|
import 'package:star_lock/blue/blue_manage.dart';
|
||||||
@ -12,7 +12,6 @@ import 'package:star_lock/login/register/entity/SendValidationCodeEntity.dart';
|
|||||||
import 'package:star_lock/tools/eventBusEventManage.dart';
|
import 'package:star_lock/tools/eventBusEventManage.dart';
|
||||||
import 'package:star_lock/tools/push/xs_jPhush.dart';
|
import 'package:star_lock/tools/push/xs_jPhush.dart';
|
||||||
import 'package:star_lock/tools/storage.dart';
|
import 'package:star_lock/tools/storage.dart';
|
||||||
import 'package:umeng_common_sdk/umeng_common_sdk.dart';
|
|
||||||
|
|
||||||
import '../../network/api_repository.dart';
|
import '../../network/api_repository.dart';
|
||||||
import '../../tools/baseGetXController.dart';
|
import '../../tools/baseGetXController.dart';
|
||||||
@ -26,6 +25,7 @@ class StarLockRegisterLogic extends BaseGetXController {
|
|||||||
final StarLockRegisterState state = StarLockRegisterState();
|
final StarLockRegisterState state = StarLockRegisterState();
|
||||||
|
|
||||||
late Timer _timer;
|
late Timer _timer;
|
||||||
|
|
||||||
void _startTimer() {
|
void _startTimer() {
|
||||||
_timer = Timer.periodic(1.seconds, (Timer timer) {
|
_timer = Timer.periodic(1.seconds, (Timer timer) {
|
||||||
if (state.currentSecond > 1) {
|
if (state.currentSecond > 1) {
|
||||||
@ -49,7 +49,7 @@ class StarLockRegisterLogic extends BaseGetXController {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!RegularExpression().validateString(state.pwd.value)){
|
if (!RegularExpression().validateString(state.pwd.value)) {
|
||||||
showToast('密码需至少包含数字/字母/字符中的2种组合'.tr);
|
showToast('密码需至少包含数字/字母/字符中的2种组合'.tr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -61,10 +61,10 @@ class StarLockRegisterLogic extends BaseGetXController {
|
|||||||
verificationCode: state.verificationCode.value,
|
verificationCode: state.verificationCode.value,
|
||||||
deviceInfo: state.deviceInfoMap.value);
|
deviceInfo: state.deviceInfoMap.value);
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
UmengCommonSdk.onEvent('register_result', {
|
ApmHelper.instance.trackEvent('register_result', {
|
||||||
'account':state.phoneOrEmailStr.value,
|
'account': state.phoneOrEmailStr.value,
|
||||||
'date':DateTool().getNowDateWithType(1),
|
'date': DateTool().getNowDateWithType(1),
|
||||||
'register_res':'成功',
|
'register_res': '成功',
|
||||||
});
|
});
|
||||||
|
|
||||||
Storage.saveLoginData(entity.data);
|
Storage.saveLoginData(entity.data);
|
||||||
@ -73,11 +73,11 @@ class StarLockRegisterLogic extends BaseGetXController {
|
|||||||
XSJPushProvider().initLocalNotification(isCancelLocalPush: false);
|
XSJPushProvider().initLocalNotification(isCancelLocalPush: false);
|
||||||
Get.offNamedUntil(Routers.starLockMain, (Route route) => false);
|
Get.offNamedUntil(Routers.starLockMain, (Route route) => false);
|
||||||
BlueManage().scanDevices.clear(); //清除设备缓存
|
BlueManage().scanDevices.clear(); //清除设备缓存
|
||||||
}else{
|
} else {
|
||||||
UmengCommonSdk.onEvent('register_result', {
|
ApmHelper.instance.trackEvent('register_result', {
|
||||||
'account':state.phoneOrEmailStr.value,
|
'account': state.phoneOrEmailStr.value,
|
||||||
'date':DateTool().getNowDateWithType(1),
|
'date': DateTool().getNowDateWithType(1),
|
||||||
'register_res':'${entity.errorCode}--${entity.errorMsg}',
|
'register_res': '${entity.errorCode}--${entity.errorMsg}',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -135,12 +135,15 @@ class StarLockRegisterLogic extends BaseGetXController {
|
|||||||
|
|
||||||
// 重置是否能提交
|
// 重置是否能提交
|
||||||
void _resetCanSub() {
|
void _resetCanSub() {
|
||||||
state.canSub.value = state.pwdIsOK && state.codeIsOK && state.phoneOrEmailStr.value.isNotEmpty;
|
state.canSub.value = state.pwdIsOK &&
|
||||||
|
state.codeIsOK &&
|
||||||
|
state.phoneOrEmailStr.value.isNotEmpty;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 重置是否能发送验证码
|
// 重置是否能发送验证码
|
||||||
void _resetCanSendCode() {
|
void _resetCanSendCode() {
|
||||||
state.canSendCode.value = state.pwdIsOK && state.phoneOrEmailStr.value.isNotEmpty;
|
state.canSendCode.value =
|
||||||
|
state.pwdIsOK && state.phoneOrEmailStr.value.isNotEmpty;
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
@ -19,6 +19,7 @@ import 'package:star_lock/tools/storage.dart';
|
|||||||
import 'package:star_lock/translations/trans_lib.dart';
|
import 'package:star_lock/translations/trans_lib.dart';
|
||||||
import 'package:umeng_common_sdk/umeng_common_sdk.dart';
|
import 'package:umeng_common_sdk/umeng_common_sdk.dart';
|
||||||
|
|
||||||
|
import 'apm/apm_helper.dart';
|
||||||
import 'app.dart';
|
import 'app.dart';
|
||||||
import 'app_settings/app_settings.dart';
|
import 'app_settings/app_settings.dart';
|
||||||
import 'tools/store_service.dart';
|
import 'tools/store_service.dart';
|
||||||
@ -27,7 +28,7 @@ import 'tools/store_service.dart';
|
|||||||
FutureOr<void> main() async {
|
FutureOr<void> main() async {
|
||||||
FlutterBugly.postCatchedException(() async {
|
FlutterBugly.postCatchedException(() async {
|
||||||
WidgetsFlutterBinding.ensureInitialized();
|
WidgetsFlutterBinding.ensureInitialized();
|
||||||
|
await ApmHelper.instance.initApp();
|
||||||
await _setCommonServices();
|
await _setCommonServices();
|
||||||
|
|
||||||
// 设置国际化信息
|
// 设置国际化信息
|
||||||
@ -74,10 +75,7 @@ Future<void> _setCommonServices() async {
|
|||||||
|
|
||||||
//关于隐私协议的初始化
|
//关于隐私协议的初始化
|
||||||
Future<void> privacySDKInitialization() async {
|
Future<void> privacySDKInitialization() async {
|
||||||
UmengCommonSdk.initCommon(
|
ApmHelper.instance.initSdk();
|
||||||
'671244cf80464b33f6df9648', '671244ae80464b33f6df9646', 'Product');
|
|
||||||
UmengCommonSdk.setPageCollectionModeManual();
|
|
||||||
|
|
||||||
await Get.putAsync(() => PlatformInfoService().init());
|
await Get.putAsync(() => PlatformInfoService().init());
|
||||||
await BuglyTool.init();
|
await BuglyTool.init();
|
||||||
// 初始化JPush服务
|
// 初始化JPush服务
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:star_lock/apm/apm_helper.dart';
|
||||||
import 'package:star_lock/appRouters.dart';
|
import 'package:star_lock/appRouters.dart';
|
||||||
import 'package:star_lock/app_settings/app_settings.dart';
|
import 'package:star_lock/app_settings/app_settings.dart';
|
||||||
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
||||||
@ -12,13 +12,8 @@ import 'package:star_lock/mine/valueAddedServices/valueAddedServicesHighFunction
|
|||||||
import 'package:star_lock/tools/NativeInteractionTool.dart';
|
import 'package:star_lock/tools/NativeInteractionTool.dart';
|
||||||
import 'package:star_lock/tools/dateTool.dart';
|
import 'package:star_lock/tools/dateTool.dart';
|
||||||
import 'package:star_lock/tools/showCupertinoAlertView.dart';
|
import 'package:star_lock/tools/showCupertinoAlertView.dart';
|
||||||
import 'package:umeng_common_sdk/umeng_common_sdk.dart';
|
|
||||||
|
|
||||||
import '../../../../blue/blue_manage.dart';
|
import '../../../../blue/blue_manage.dart';
|
||||||
import '../../../../blue/io_reply.dart';
|
|
||||||
import '../../../../blue/io_tool/io_tool.dart';
|
|
||||||
import '../../../../blue/io_tool/manager_event_bus.dart';
|
|
||||||
import '../../../../blue/sender_manage.dart';
|
|
||||||
import '../../../../network/api_repository.dart';
|
import '../../../../network/api_repository.dart';
|
||||||
import '../../../../tools/baseGetXController.dart';
|
import '../../../../tools/baseGetXController.dart';
|
||||||
import '../../../../tools/commonDataManage.dart';
|
import '../../../../tools/commonDataManage.dart';
|
||||||
@ -222,7 +217,7 @@ class AuthorizedAdminLogic extends BaseGetXController {
|
|||||||
: '');
|
: '');
|
||||||
final String getMobile = (await Storage.getMobile())!;
|
final String getMobile = (await Storage.getMobile())!;
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
UmengCommonSdk.onEvent('add_authorizedAdmin', {
|
ApmHelper.instance.trackEvent('add_authorizedAdmin', {
|
||||||
'lock_name': BlueManage().connectDeviceName,
|
'lock_name': BlueManage().connectDeviceName,
|
||||||
'account':
|
'account':
|
||||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||||
@ -245,7 +240,7 @@ class AuthorizedAdminLogic extends BaseGetXController {
|
|||||||
sendElectronicKeyRequest();
|
sendElectronicKeyRequest();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
UmengCommonSdk.onEvent('add_authorizedAdmin', {
|
ApmHelper.instance.trackEvent('add_authorizedAdmin', {
|
||||||
'lock_name': BlueManage().connectDeviceName,
|
'lock_name': BlueManage().connectDeviceName,
|
||||||
'account':
|
'account':
|
||||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||||
|
|||||||
@ -1,14 +1,12 @@
|
|||||||
|
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:star_lock/app_settings/app_settings.dart';
|
|
||||||
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
||||||
import 'package:star_lock/main/lockDetail/card/addICCard/addICCard_entity.dart';
|
import 'package:star_lock/main/lockDetail/card/addICCard/addICCard_entity.dart';
|
||||||
import 'package:star_lock/tools/baseGetXController.dart';
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
import 'package:umeng_common_sdk/umeng_common_sdk.dart';
|
|
||||||
|
|
||||||
|
import '../../../../apm/apm_helper.dart';
|
||||||
import '../../../../blue/blue_manage.dart';
|
import '../../../../blue/blue_manage.dart';
|
||||||
import '../../../../blue/io_protocol/io_addICCardWithTimeCycleCoercion.dart';
|
import '../../../../blue/io_protocol/io_addICCardWithTimeCycleCoercion.dart';
|
||||||
import '../../../../blue/io_reply.dart';
|
import '../../../../blue/io_reply.dart';
|
||||||
@ -22,20 +20,23 @@ import '../../../../tools/eventBusEventManage.dart';
|
|||||||
import '../../../../tools/storage.dart';
|
import '../../../../tools/storage.dart';
|
||||||
import 'addICCard_state.dart';
|
import 'addICCard_state.dart';
|
||||||
|
|
||||||
class AddICCardLogic extends BaseGetXController{
|
class AddICCardLogic extends BaseGetXController {
|
||||||
AddICCardState state = AddICCardState();
|
AddICCardState state = AddICCardState();
|
||||||
|
|
||||||
// 监听设备返回的数据
|
// 监听设备返回的数据
|
||||||
late StreamSubscription<Reply> _replySubscription;
|
late StreamSubscription<Reply> _replySubscription;
|
||||||
|
|
||||||
void _initReplySubscription() {
|
void _initReplySubscription() {
|
||||||
_replySubscription = EventBusManager().eventBus!.on<Reply>().listen((Reply reply) async {
|
_replySubscription =
|
||||||
|
EventBusManager().eventBus!.on<Reply>().listen((Reply reply) async {
|
||||||
// 添加IC卡开始
|
// 添加IC卡开始
|
||||||
if((reply is SenderAddICCardWithTimeCycleCoercionReply) && (state.ifCurrentScreen.value == true)) {
|
if ((reply is SenderAddICCardWithTimeCycleCoercionReply) &&
|
||||||
|
(state.ifCurrentScreen.value == true)) {
|
||||||
_replyAddICCardBegin(reply);
|
_replyAddICCardBegin(reply);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 添加卡确认
|
// 添加卡确认
|
||||||
if(reply is SenderAddICCardConfirmationReply) {
|
if (reply is SenderAddICCardConfirmationReply) {
|
||||||
_replyAddICCardConfirmation(reply);
|
_replyAddICCardConfirmation(reply);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -46,13 +47,13 @@ class AddICCardLogic extends BaseGetXController{
|
|||||||
BuglyTool.uploadException(
|
BuglyTool.uploadException(
|
||||||
message: '添加卡开始,解析数据',
|
message: '添加卡开始,解析数据',
|
||||||
detail: '添加卡开始,解析数据 _replyAddICCardBegin:${reply.data}',
|
detail: '添加卡开始,解析数据 _replyAddICCardBegin:${reply.data}',
|
||||||
upload: false
|
upload: false);
|
||||||
);
|
|
||||||
|
|
||||||
switch(status){
|
switch (status) {
|
||||||
case 0x00:
|
case 0x00:
|
||||||
//成功
|
//成功
|
||||||
final List<int> cardNumberList = reply.data.sublist(reply.data.length - 2);
|
final List<int> cardNumberList =
|
||||||
|
reply.data.sublist(reply.data.length - 2);
|
||||||
final String cardNumber = listChangInt(cardNumberList).toString();
|
final String cardNumber = listChangInt(cardNumberList).toString();
|
||||||
// AppLog.log("添加卡号:$cardNumberList cardNumber:$cardNumber");
|
// AppLog.log("添加卡号:$cardNumberList cardNumber:$cardNumber");
|
||||||
state.cardNumber.value = cardNumber.toString();
|
state.cardNumber.value = cardNumber.toString();
|
||||||
@ -63,10 +64,13 @@ class AddICCardLogic extends BaseGetXController{
|
|||||||
break;
|
break;
|
||||||
case 0x06:
|
case 0x06:
|
||||||
//无权限
|
//无权限
|
||||||
final List<String>? privateKey = await Storage.getStringList(saveBluePrivateKey);
|
final List<String>? privateKey =
|
||||||
final List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
await Storage.getStringList(saveBluePrivateKey);
|
||||||
|
final List<int> getPrivateKeyList =
|
||||||
|
changeStringListToIntList(privateKey!);
|
||||||
|
|
||||||
final List<String>? signKey = await Storage.getStringList(saveBlueSignKey);
|
final List<String>? signKey =
|
||||||
|
await Storage.getStringList(saveBlueSignKey);
|
||||||
final List<int> signKeyDataList = changeStringListToIntList(signKey!);
|
final List<int> signKeyDataList = changeStringListToIntList(signKey!);
|
||||||
|
|
||||||
// var publicKey = await Storage.getStringList(saveBluePublicKey);
|
// var publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||||
@ -78,25 +82,29 @@ class AddICCardLogic extends BaseGetXController{
|
|||||||
// AppLog.log('添加卡token:$token');
|
// AppLog.log('添加卡token:$token');
|
||||||
|
|
||||||
IoSenderManage.senderAddCardWithTimeCycleCoercionCommand(
|
IoSenderManage.senderAddCardWithTimeCycleCoercionCommand(
|
||||||
keyID:'1',
|
keyID: '1',
|
||||||
userID:await Storage.getUid(),
|
userID: await Storage.getUid(),
|
||||||
cardNo:0,
|
cardNo: 0,
|
||||||
useCountLimit:0xffff,
|
useCountLimit: 0xffff,
|
||||||
operate:0, // 0:注册 1:修改 2:删除 3:删除全部
|
operate: 0,
|
||||||
isAdmin:state.isAdministrator.value == '2' ? 1 : 0,
|
// 0:注册 1:修改 2:删除 3:删除全部
|
||||||
isForce:state.isCoerced.value == '1' ? 1 : 0, // 是否是胁迫
|
isAdmin: state.isAdministrator.value == '2' ? 1 : 0,
|
||||||
isRound:state.selectType.value == '2' ? 1: 0, // 是否是循环
|
isForce: state.isCoerced.value == '1' ? 1 : 0,
|
||||||
weekRound:DateTool().accordingTheCycleIntoTheCorrespondingNumber(state.weekDay.value), // 周循环
|
// 是否是胁迫
|
||||||
startDate: int.parse(state.startDate.value)~/1000,
|
isRound: state.selectType.value == '2' ? 1 : 0,
|
||||||
endDate: int.parse(state.endDate.value)~/1000,
|
// 是否是循环
|
||||||
startTime:DateTool().dateToHNString(state.effectiveDateTime.value),
|
weekRound: DateTool().accordingTheCycleIntoTheCorrespondingNumber(
|
||||||
endTime:DateTool().dateToHNString(state.failureDateTime.value),
|
state.weekDay.value),
|
||||||
needAuthor:1,
|
// 周循环
|
||||||
signKey:signKeyDataList,
|
startDate: int.parse(state.startDate.value) ~/ 1000,
|
||||||
privateKey:getPrivateKeyList,
|
endDate: int.parse(state.endDate.value) ~/ 1000,
|
||||||
token: token,
|
startTime: DateTool().dateToHNString(state.effectiveDateTime.value),
|
||||||
isBeforeAddUser: false
|
endTime: DateTool().dateToHNString(state.failureDateTime.value),
|
||||||
);
|
needAuthor: 1,
|
||||||
|
signKey: signKeyDataList,
|
||||||
|
privateKey: getPrivateKeyList,
|
||||||
|
token: token,
|
||||||
|
isBeforeAddUser: false);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
//失败
|
//失败
|
||||||
@ -113,58 +121,59 @@ class AddICCardLogic extends BaseGetXController{
|
|||||||
message: '添加卡结果,解析数据',
|
message: '添加卡结果,解析数据',
|
||||||
detail: '添加卡结果,解析数据 _replyAddICCardConfirmation:${reply.data}',
|
detail: '添加卡结果,解析数据 _replyAddICCardConfirmation:${reply.data}',
|
||||||
eventStr: '添加卡事件结果',
|
eventStr: '添加卡事件结果',
|
||||||
upload: true
|
upload: true);
|
||||||
);
|
|
||||||
|
|
||||||
final String getMobile = (await Storage.getMobile())!;
|
final String getMobile = (await Storage.getMobile())!;
|
||||||
switch(status){
|
switch (status) {
|
||||||
case 0x00:
|
case 0x00:
|
||||||
//成功
|
//成功
|
||||||
UmengCommonSdk.onEvent('add_card', {
|
ApmHelper.instance.trackEvent('add_card', {
|
||||||
'lock_name':BlueManage().connectDeviceName,
|
'lock_name': BlueManage().connectDeviceName,
|
||||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
'account':
|
||||||
'date':DateTool().getNowDateWithType(1),
|
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||||
'add_card_result':'成功',
|
'date': DateTool().getNowDateWithType(1),
|
||||||
|
'add_card_result': '成功',
|
||||||
});
|
});
|
||||||
switch(reply.data[5]){
|
switch (reply.data[5]) {
|
||||||
case 0xff:
|
case 0xff:
|
||||||
// 注册指纹失败
|
// 注册指纹失败
|
||||||
showToast('退出添加'.tr);
|
showToast('退出添加'.tr);
|
||||||
Get.close(1);
|
Get.close(1);
|
||||||
break;
|
break;
|
||||||
case 0xFE:
|
case 0xFE:
|
||||||
// 管理员已满
|
// 管理员已满
|
||||||
showToast('管理员已满'.tr);
|
showToast('管理员已满'.tr);
|
||||||
Get.close(1);
|
Get.close(1);
|
||||||
break;
|
break;
|
||||||
case 0xFD:
|
case 0xFD:
|
||||||
// 用户已满
|
// 用户已满
|
||||||
showToast('用户已满'.tr);
|
showToast('用户已满'.tr);
|
||||||
Get.close(1);
|
Get.close(1);
|
||||||
break;
|
break;
|
||||||
case 0xFC:
|
case 0xFC:
|
||||||
// 指纹已满
|
// 指纹已满
|
||||||
showToast('锁上面添加卡已满'.tr);
|
showToast('锁上面添加卡已满'.tr);
|
||||||
Get.close(1);
|
Get.close(1);
|
||||||
break;
|
break;
|
||||||
case 0xFB:
|
case 0xFB:
|
||||||
// 指纹已存在
|
// 指纹已存在
|
||||||
showToast('卡已存在'.tr);
|
showToast('卡已存在'.tr);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
// 添加指纹中
|
// 添加指纹中
|
||||||
// 当前注册数
|
// 当前注册数
|
||||||
addICCardData();
|
addICCardData();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
//失败
|
//失败
|
||||||
UmengCommonSdk.onEvent('add_card', {
|
ApmHelper.instance.trackEvent('add_card', {
|
||||||
'lock_name':BlueManage().connectDeviceName,
|
'lock_name': BlueManage().connectDeviceName,
|
||||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
'account':
|
||||||
'date':DateTool().getNowDateWithType(1),
|
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||||
'add_card_result':reply.data[2],
|
'date': DateTool().getNowDateWithType(1),
|
||||||
|
'add_card_result': reply.data[2],
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -175,91 +184,105 @@ class AddICCardLogic extends BaseGetXController{
|
|||||||
final List<String>? signKey = await Storage.getStringList(saveBlueSignKey);
|
final List<String>? signKey = await Storage.getStringList(saveBlueSignKey);
|
||||||
final List<int> signKeyDataList = changeStringListToIntList(signKey!);
|
final List<int> signKeyDataList = changeStringListToIntList(signKey!);
|
||||||
|
|
||||||
final List<String>? privateKey = await Storage.getStringList(saveBluePrivateKey);
|
final List<String>? privateKey =
|
||||||
|
await Storage.getStringList(saveBluePrivateKey);
|
||||||
final List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
final List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||||
|
|
||||||
final List<String>? token = await Storage.getStringList(saveBlueToken);
|
final List<String>? token = await Storage.getStringList(saveBlueToken);
|
||||||
final List<int> getTokenList = changeStringListToIntList(token!);
|
final List<int> getTokenList = changeStringListToIntList(token!);
|
||||||
|
|
||||||
final String command = SenderAddICCardWithTimeCycleCoercionCommand(
|
final String command = SenderAddICCardWithTimeCycleCoercionCommand(
|
||||||
keyID:'1',
|
keyID: '1',
|
||||||
userID:await Storage.getUid(),
|
userID: await Storage.getUid(),
|
||||||
cardNo:0,
|
cardNo: 0,
|
||||||
useCountLimit:0xffff,
|
useCountLimit: 0xffff,
|
||||||
operate:0, // 0:注册 1:修改 2:删除 3:删除全部
|
operate: 0,
|
||||||
isAdmin:state.isAdministrator.value == '2' ? 1 : 0,
|
// 0:注册 1:修改 2:删除 3:删除全部
|
||||||
isForce:state.isCoerced.value == '1' ? 1 : 0, // 是否是胁迫
|
isAdmin: state.isAdministrator.value == '2' ? 1 : 0,
|
||||||
isRound:state.selectType.value == '2' ? 1: 0, // 是否是循环
|
isForce: state.isCoerced.value == '1' ? 1 : 0,
|
||||||
weekRound:DateTool().accordingTheCycleIntoTheCorrespondingNumber(state.weekDay.value), // 周循环
|
// 是否是胁迫
|
||||||
startDate: int.parse(state.startDate.value)~/1000,
|
isRound: state.selectType.value == '2' ? 1 : 0,
|
||||||
endDate: int.parse(state.endDate.value)~/1000,
|
// 是否是循环
|
||||||
startTime:DateTool().dateToHNString(state.effectiveDateTime.value),
|
weekRound: DateTool()
|
||||||
endTime:DateTool().dateToHNString(state.failureDateTime.value),
|
.accordingTheCycleIntoTheCorrespondingNumber(state.weekDay.value),
|
||||||
needAuthor:1,
|
// 周循环
|
||||||
signKey:signKeyDataList,
|
startDate: int.parse(state.startDate.value) ~/ 1000,
|
||||||
privateKey:getPrivateKeyList,
|
endDate: int.parse(state.endDate.value) ~/ 1000,
|
||||||
token: getTokenList,
|
startTime: DateTool().dateToHNString(state.effectiveDateTime.value),
|
||||||
|
endTime: DateTool().dateToHNString(state.failureDateTime.value),
|
||||||
|
needAuthor: 1,
|
||||||
|
signKey: signKeyDataList,
|
||||||
|
privateKey: getPrivateKeyList,
|
||||||
|
token: getTokenList,
|
||||||
).toString();
|
).toString();
|
||||||
|
|
||||||
showBlueConnetctToastTimer(action: () async {
|
showBlueConnetctToastTimer(action: () async {
|
||||||
final String getMobile = (await Storage.getMobile())!;
|
final String getMobile = (await Storage.getMobile())!;
|
||||||
UmengCommonSdk.onEvent('add_card', {
|
ApmHelper.instance.trackEvent('add_card', {
|
||||||
'lock_name':BlueManage().connectDeviceName,
|
'lock_name': BlueManage().connectDeviceName,
|
||||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
'account':
|
||||||
'date':DateTool().getNowDateWithType(1),
|
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||||
'add_card_result':'添加卡超时',
|
'date': DateTool().getNowDateWithType(1),
|
||||||
|
'add_card_result': '添加卡超时',
|
||||||
});
|
});
|
||||||
|
|
||||||
BuglyTool.uploadException(
|
BuglyTool.uploadException(
|
||||||
message: '添加卡超时处理-添加卡失败',
|
message: '添加卡超时处理-添加卡失败',
|
||||||
detail: '添加卡超时处理,断开连接,添加卡失败--SenderAddICCardWithTimeCycleCoercionCommand:$command',
|
detail:
|
||||||
|
'添加卡超时处理,断开连接,添加卡失败--SenderAddICCardWithTimeCycleCoercionCommand:$command',
|
||||||
eventStr: '添加卡事件超时',
|
eventStr: '添加卡事件超时',
|
||||||
upload: true
|
upload: true);
|
||||||
);
|
|
||||||
|
|
||||||
Get.close(1);
|
Get.close(1);
|
||||||
});
|
});
|
||||||
BlueManage().blueSendData(BlueManage().connectDeviceName, (BluetoothConnectionState deviceConnectionState) async {
|
BlueManage().blueSendData(BlueManage().connectDeviceName,
|
||||||
if (deviceConnectionState == BluetoothConnectionState.connected){
|
(BluetoothConnectionState deviceConnectionState) async {
|
||||||
|
if (deviceConnectionState == BluetoothConnectionState.connected) {
|
||||||
cancelBlueConnetctToastTimer();
|
cancelBlueConnetctToastTimer();
|
||||||
|
|
||||||
IoSenderManage.senderAddCardWithTimeCycleCoercionCommand(
|
IoSenderManage.senderAddCardWithTimeCycleCoercionCommand(
|
||||||
keyID:'1',
|
keyID: '1',
|
||||||
userID:await Storage.getUid(),
|
userID: await Storage.getUid(),
|
||||||
cardNo:0,
|
cardNo: 0,
|
||||||
useCountLimit:0xffff,
|
useCountLimit: 0xffff,
|
||||||
operate:0, // 0:注册 1:修改 2:删除 3:删除全部
|
operate: 0,
|
||||||
isAdmin:state.isAdministrator.value == '2' ? 1 : 0,
|
// 0:注册 1:修改 2:删除 3:删除全部
|
||||||
isForce:state.isCoerced.value == '1' ? 1 : 0, // 是否是胁迫
|
isAdmin: state.isAdministrator.value == '2' ? 1 : 0,
|
||||||
isRound:state.selectType.value == '2' ? 1: 0, // 是否是循环
|
isForce: state.isCoerced.value == '1' ? 1 : 0,
|
||||||
weekRound:DateTool().accordingTheCycleIntoTheCorrespondingNumber(state.weekDay.value), // 周循环
|
// 是否是胁迫
|
||||||
startDate: int.parse(state.startDate.value)~/1000,
|
isRound: state.selectType.value == '2' ? 1 : 0,
|
||||||
endDate: int.parse(state.endDate.value)~/1000,
|
// 是否是循环
|
||||||
startTime:DateTool().dateToHNString(state.effectiveDateTime.value),
|
weekRound: DateTool().accordingTheCycleIntoTheCorrespondingNumber(
|
||||||
endTime:DateTool().dateToHNString(state.failureDateTime.value),
|
state.weekDay.value),
|
||||||
needAuthor:1,
|
// 周循环
|
||||||
signKey:signKeyDataList,
|
startDate: int.parse(state.startDate.value) ~/ 1000,
|
||||||
privateKey:getPrivateKeyList,
|
endDate: int.parse(state.endDate.value) ~/ 1000,
|
||||||
token: getTokenList,
|
startTime: DateTool().dateToHNString(state.effectiveDateTime.value),
|
||||||
isBeforeAddUser: false
|
endTime: DateTool().dateToHNString(state.failureDateTime.value),
|
||||||
);
|
needAuthor: 1,
|
||||||
} else if (deviceConnectionState == BluetoothConnectionState.disconnected){
|
signKey: signKeyDataList,
|
||||||
|
privateKey: getPrivateKeyList,
|
||||||
|
token: getTokenList,
|
||||||
|
isBeforeAddUser: false);
|
||||||
|
} else if (deviceConnectionState ==
|
||||||
|
BluetoothConnectionState.disconnected) {
|
||||||
final String getMobile = (await Storage.getMobile())!;
|
final String getMobile = (await Storage.getMobile())!;
|
||||||
UmengCommonSdk.onEvent('add_card', {
|
ApmHelper.instance.trackEvent('add_card', {
|
||||||
'lock_name':BlueManage().connectDeviceName,
|
'lock_name': BlueManage().connectDeviceName,
|
||||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
'account':
|
||||||
'date':DateTool().getNowDateWithType(1),
|
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||||
'add_card_result':'添加卡断开连接',
|
'date': DateTool().getNowDateWithType(1),
|
||||||
|
'add_card_result': '添加卡断开连接',
|
||||||
});
|
});
|
||||||
|
|
||||||
BuglyTool.uploadException(
|
BuglyTool.uploadException(
|
||||||
message: '添加卡超时处理-添加卡失败',
|
message: '添加卡超时处理-添加卡失败',
|
||||||
detail: '添加卡超时处理,断开连接,添加卡失败--SenderAddICCardWithTimeCycleCoercionCommand:$command',
|
detail:
|
||||||
|
'添加卡超时处理,断开连接,添加卡失败--SenderAddICCardWithTimeCycleCoercionCommand:$command',
|
||||||
eventStr: '添加卡事件断开连接',
|
eventStr: '添加卡事件断开连接',
|
||||||
upload: true
|
upload: true);
|
||||||
);
|
|
||||||
|
|
||||||
if(state.ifCurrentScreen.value == true){
|
if (state.ifCurrentScreen.value == true) {
|
||||||
showBlueConnetctToast();
|
showBlueConnetctToast();
|
||||||
}
|
}
|
||||||
cancelBlueConnetctToastTimer();
|
cancelBlueConnetctToastTimer();
|
||||||
@ -270,27 +293,32 @@ class AddICCardLogic extends BaseGetXController{
|
|||||||
|
|
||||||
// 取消添加指纹
|
// 取消添加指纹
|
||||||
Future<void> senderCancelAddCardCommand() async {
|
Future<void> senderCancelAddCardCommand() async {
|
||||||
BlueManage().blueSendData(BlueManage().connectDeviceName, (BluetoothConnectionState deviceConnectionState) async {
|
BlueManage().blueSendData(BlueManage().connectDeviceName,
|
||||||
if (deviceConnectionState == BluetoothConnectionState.connected){
|
(BluetoothConnectionState deviceConnectionState) async {
|
||||||
final List<String>? privateKey = await Storage.getStringList(saveBluePrivateKey);
|
if (deviceConnectionState == BluetoothConnectionState.connected) {
|
||||||
final List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
final List<String>? privateKey =
|
||||||
|
await Storage.getStringList(saveBluePrivateKey);
|
||||||
|
final List<int> getPrivateKeyList =
|
||||||
|
changeStringListToIntList(privateKey!);
|
||||||
|
|
||||||
final List<String>? signKey = await Storage.getStringList(saveBlueSignKey);
|
final List<String>? signKey =
|
||||||
|
await Storage.getStringList(saveBlueSignKey);
|
||||||
final List<int> signKeyDataList = changeStringListToIntList(signKey!);
|
final List<int> signKeyDataList = changeStringListToIntList(signKey!);
|
||||||
|
|
||||||
final List<String>? token = await Storage.getStringList(saveBlueToken);
|
final List<String>? token = await Storage.getStringList(saveBlueToken);
|
||||||
final List<int> getTokenList = changeStringListToIntList(token!);
|
final List<int> getTokenList = changeStringListToIntList(token!);
|
||||||
|
|
||||||
IoSenderManage.senderCancelAddCardCommand(
|
IoSenderManage.senderCancelAddCardCommand(
|
||||||
keyID:'1',
|
keyID: '1',
|
||||||
userID:await Storage.getUid(),
|
userID: await Storage.getUid(),
|
||||||
needAuthor:1,
|
needAuthor: 1,
|
||||||
signKey:signKeyDataList,
|
signKey: signKeyDataList,
|
||||||
privateKey:getPrivateKeyList,
|
privateKey: getPrivateKeyList,
|
||||||
token: getTokenList,
|
token: getTokenList,
|
||||||
);
|
);
|
||||||
}else if (deviceConnectionState == BluetoothConnectionState.disconnected){
|
} else if (deviceConnectionState ==
|
||||||
if(state.ifCurrentScreen.value == true){
|
BluetoothConnectionState.disconnected) {
|
||||||
|
if (state.ifCurrentScreen.value == true) {
|
||||||
showBlueConnetctToast();
|
showBlueConnetctToast();
|
||||||
}
|
}
|
||||||
cancelBlueConnetctToastTimer();
|
cancelBlueConnetctToastTimer();
|
||||||
@ -319,18 +347,20 @@ class AddICCardLogic extends BaseGetXController{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> updateIdCardUserNoLoadData(String cardId) async{
|
Future<void> updateIdCardUserNoLoadData(String cardId) async {
|
||||||
final LoginEntity entity = await ApiRepository.to.updateIdCardUserNoLoadData(
|
final LoginEntity entity =
|
||||||
|
await ApiRepository.to.updateIdCardUserNoLoadData(
|
||||||
lockId: state.lockId.value.toString(),
|
lockId: state.lockId.value.toString(),
|
||||||
cardId: cardId,
|
cardId: cardId,
|
||||||
cardUserNo: state.cardNumber.value,
|
cardUserNo: state.cardNumber.value,
|
||||||
);
|
);
|
||||||
if(entity.errorCode!.codeIsSuccessful){
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
showToast('添加成功'.tr, something:(){
|
showToast('添加成功'.tr, something: () {
|
||||||
if(state.fromType.value == 2){
|
if (state.fromType.value == 2) {
|
||||||
// 回调指纹号
|
// 回调指纹号
|
||||||
eventBus.fire(ChickInAddStaffCardAndFingerprintBlockNumberEvent(state.cardNumber.value));
|
eventBus.fire(ChickInAddStaffCardAndFingerprintBlockNumberEvent(
|
||||||
}else if(state.fromType.value == 1){
|
state.cardNumber.value));
|
||||||
|
} else if (state.fromType.value == 1) {
|
||||||
eventBus.fire(OtherTypeRefreshListEvent());
|
eventBus.fire(OtherTypeRefreshListEvent());
|
||||||
}
|
}
|
||||||
Get.close(2);
|
Get.close(2);
|
||||||
@ -356,5 +386,4 @@ class AddICCardLogic extends BaseGetXController{
|
|||||||
void onClose() {
|
void onClose() {
|
||||||
_replySubscription.cancel();
|
_replySubscription.cancel();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
|
||||||
|
|||||||
@ -2,8 +2,7 @@ import 'dart:async';
|
|||||||
|
|
||||||
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
import 'package:star_lock/apm/apm_helper.dart';
|
||||||
import 'package:star_lock/app_settings/app_settings.dart';
|
|
||||||
|
|
||||||
import 'package:star_lock/main/lockDetail/doorLockLog/doorLockLog_entity.dart';
|
import 'package:star_lock/main/lockDetail/doorLockLog/doorLockLog_entity.dart';
|
||||||
import 'package:star_lock/main/lockDetail/doorLockLog/doorLockLog_state.dart';
|
import 'package:star_lock/main/lockDetail/doorLockLog/doorLockLog_state.dart';
|
||||||
@ -11,7 +10,6 @@ import 'package:star_lock/main/lockDetail/lockOperatingRecord/lockOperatingRecor
|
|||||||
import 'package:star_lock/tools/commonDataManage.dart';
|
import 'package:star_lock/tools/commonDataManage.dart';
|
||||||
import 'package:star_lock/tools/dateTool.dart';
|
import 'package:star_lock/tools/dateTool.dart';
|
||||||
import 'package:star_lock/tools/eventBusEventManage.dart';
|
import 'package:star_lock/tools/eventBusEventManage.dart';
|
||||||
import 'package:umeng_common_sdk/umeng_common_sdk.dart';
|
|
||||||
|
|
||||||
import '../../../blue/blue_manage.dart';
|
import '../../../blue/blue_manage.dart';
|
||||||
import '../../../blue/io_protocol/io_referEventRecordTime.dart';
|
import '../../../blue/io_protocol/io_referEventRecordTime.dart';
|
||||||
@ -151,7 +149,7 @@ class DoorLockLogLogic extends BaseGetXController {
|
|||||||
cancelBlueConnetctToastTimer();
|
cancelBlueConnetctToastTimer();
|
||||||
|
|
||||||
final String getMobile = (await Storage.getMobile())!;
|
final String getMobile = (await Storage.getMobile())!;
|
||||||
UmengCommonSdk.onEvent('check_doorLockLog', {
|
ApmHelper.instance.trackEvent('check_doorLockLog', {
|
||||||
'lockName': state.keyInfos.value.lockName!,
|
'lockName': state.keyInfos.value.lockName!,
|
||||||
'account':
|
'account':
|
||||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||||
@ -205,7 +203,7 @@ class DoorLockLogLogic extends BaseGetXController {
|
|||||||
cancelBlueConnetctToastTimer();
|
cancelBlueConnetctToastTimer();
|
||||||
|
|
||||||
final String getMobile = (await Storage.getMobile())!;
|
final String getMobile = (await Storage.getMobile())!;
|
||||||
UmengCommonSdk.onEvent('check_doorLockLog', {
|
ApmHelper.instance.trackEvent('check_doorLockLog', {
|
||||||
'lockName': state.keyInfos.value.lockName!,
|
'lockName': state.keyInfos.value.lockName!,
|
||||||
'account':
|
'account':
|
||||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||||
@ -303,7 +301,7 @@ class DoorLockLogLogic extends BaseGetXController {
|
|||||||
showEasyLoading();
|
showEasyLoading();
|
||||||
getLockRecordLastUploadDataTime();
|
getLockRecordLastUploadDataTime();
|
||||||
} else {
|
} else {
|
||||||
UmengCommonSdk.onEvent('check_doorLockLog', {
|
ApmHelper.instance.trackEvent('check_doorLockLog', {
|
||||||
'lockName': state.keyInfos.value.lockName!,
|
'lockName': state.keyInfos.value.lockName!,
|
||||||
'account':
|
'account':
|
||||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||||
@ -314,7 +312,7 @@ class DoorLockLogLogic extends BaseGetXController {
|
|||||||
}
|
}
|
||||||
dismissEasyLoading();
|
dismissEasyLoading();
|
||||||
} else {
|
} else {
|
||||||
UmengCommonSdk.onEvent('check_doorLockLog', {
|
ApmHelper.instance.trackEvent('check_doorLockLog', {
|
||||||
'lockName': state.keyInfos.value.lockName!,
|
'lockName': state.keyInfos.value.lockName!,
|
||||||
'account':
|
'account':
|
||||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:star_lock/apm/apm_helper.dart';
|
||||||
import 'package:star_lock/appRouters.dart';
|
import 'package:star_lock/appRouters.dart';
|
||||||
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
|
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
|
||||||
import 'package:star_lock/main/lockDetail/authorizedAdmin/authorizedAdmin/authorizedAdmin_entity.dart';
|
import 'package:star_lock/main/lockDetail/authorizedAdmin/authorizedAdmin/authorizedAdmin_entity.dart';
|
||||||
@ -17,7 +18,6 @@ import 'package:star_lock/tools/regularExpression.dart';
|
|||||||
import 'package:star_lock/tools/showCupertinoAlertView.dart';
|
import 'package:star_lock/tools/showCupertinoAlertView.dart';
|
||||||
import 'package:star_lock/tools/showTipView.dart';
|
import 'package:star_lock/tools/showTipView.dart';
|
||||||
import 'package:star_lock/tools/storage.dart';
|
import 'package:star_lock/tools/storage.dart';
|
||||||
import 'package:umeng_common_sdk/umeng_common_sdk.dart';
|
|
||||||
|
|
||||||
import '../../../../../../blue/blue_manage.dart';
|
import '../../../../../../blue/blue_manage.dart';
|
||||||
|
|
||||||
@ -185,7 +185,7 @@ class SendElectronicKeyViewLogic extends BaseGetXController {
|
|||||||
: '');
|
: '');
|
||||||
final String getMobile = (await Storage.getMobile())!;
|
final String getMobile = (await Storage.getMobile())!;
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
UmengCommonSdk.onEvent('add_electronic_key', {
|
ApmHelper.instance.trackEvent('add_electronic_key', {
|
||||||
'lock_name':BlueManage().connectDeviceName,
|
'lock_name':BlueManage().connectDeviceName,
|
||||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||||
'date':DateTool().getNowDateWithType(1),
|
'date':DateTool().getNowDateWithType(1),
|
||||||
@ -201,7 +201,7 @@ class SendElectronicKeyViewLogic extends BaseGetXController {
|
|||||||
update();
|
update();
|
||||||
eventBus.fire(ElectronicKeyListRefreshUI());
|
eventBus.fire(ElectronicKeyListRefreshUI());
|
||||||
} else {
|
} else {
|
||||||
UmengCommonSdk.onEvent('add_electronic_key', {
|
ApmHelper.instance.trackEvent('add_electronic_key', {
|
||||||
'lock_name':BlueManage().connectDeviceName,
|
'lock_name':BlueManage().connectDeviceName,
|
||||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||||
'date':DateTool().getNowDateWithType(1),
|
'date':DateTool().getNowDateWithType(1),
|
||||||
|
|||||||
@ -3,11 +3,10 @@ import 'dart:async';
|
|||||||
|
|
||||||
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:star_lock/app_settings/app_settings.dart';
|
import 'package:star_lock/apm/apm_helper.dart';
|
||||||
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
||||||
import 'package:star_lock/main/lockDetail/fingerprint/addFingerprint/addFingerprint_entity.dart';
|
import 'package:star_lock/main/lockDetail/fingerprint/addFingerprint/addFingerprint_entity.dart';
|
||||||
import 'package:star_lock/tools/dateTool.dart';
|
import 'package:star_lock/tools/dateTool.dart';
|
||||||
import 'package:umeng_common_sdk/umeng_common_sdk.dart';
|
|
||||||
|
|
||||||
import '../../../../../blue/blue_manage.dart';
|
import '../../../../../blue/blue_manage.dart';
|
||||||
import '../../../../../blue/io_reply.dart';
|
import '../../../../../blue/io_reply.dart';
|
||||||
@ -171,7 +170,7 @@ class AddFingerprintLogic extends BaseGetXController {
|
|||||||
case 0x00:
|
case 0x00:
|
||||||
//成功
|
//成功
|
||||||
// var fingerprintNum = listChangInt(reply.data.sublist(9, 11)).toString();
|
// var fingerprintNum = listChangInt(reply.data.sublist(9, 11)).toString();
|
||||||
UmengCommonSdk.onEvent('add_fingerprint', {
|
ApmHelper.instance.trackEvent('add_fingerprint', {
|
||||||
'lock_name':BlueManage().connectDeviceName,
|
'lock_name':BlueManage().connectDeviceName,
|
||||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||||
'date':DateTool().getNowDateWithType(1),
|
'date':DateTool().getNowDateWithType(1),
|
||||||
@ -203,7 +202,7 @@ class AddFingerprintLogic extends BaseGetXController {
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
//失败
|
//失败
|
||||||
UmengCommonSdk.onEvent('add_fingerprint', {
|
ApmHelper.instance.trackEvent('add_fingerprint', {
|
||||||
'lock_name':BlueManage().connectDeviceName,
|
'lock_name':BlueManage().connectDeviceName,
|
||||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||||
'date':DateTool().getNowDateWithType(1),
|
'date':DateTool().getNowDateWithType(1),
|
||||||
@ -254,7 +253,7 @@ class AddFingerprintLogic extends BaseGetXController {
|
|||||||
|
|
||||||
showBlueConnetctToastTimer(action: () async {
|
showBlueConnetctToastTimer(action: () async {
|
||||||
final String getMobile = (await Storage.getMobile())!;
|
final String getMobile = (await Storage.getMobile())!;
|
||||||
UmengCommonSdk.onEvent('add_fingerprint', {
|
ApmHelper.instance.trackEvent('add_fingerprint', {
|
||||||
'lock_name':BlueManage().connectDeviceName,
|
'lock_name':BlueManage().connectDeviceName,
|
||||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||||
'date':DateTool().getNowDateWithType(1),
|
'date':DateTool().getNowDateWithType(1),
|
||||||
@ -302,7 +301,7 @@ class AddFingerprintLogic extends BaseGetXController {
|
|||||||
);
|
);
|
||||||
}else if (deviceConnectionState == BluetoothConnectionState.disconnected){
|
}else if (deviceConnectionState == BluetoothConnectionState.disconnected){
|
||||||
final String getMobile = (await Storage.getMobile())!;
|
final String getMobile = (await Storage.getMobile())!;
|
||||||
UmengCommonSdk.onEvent('add_fingerprint', {
|
ApmHelper.instance.trackEvent('add_fingerprint', {
|
||||||
'lock_name':BlueManage().connectDeviceName,
|
'lock_name':BlueManage().connectDeviceName,
|
||||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||||
'date':DateTool().getNowDateWithType(1),
|
'date':DateTool().getNowDateWithType(1),
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import 'package:flutter_easyloading/flutter_easyloading.dart';
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:intl/intl.dart';
|
import 'package:intl/intl.dart';
|
||||||
import 'package:permission_handler/permission_handler.dart';
|
import 'package:permission_handler/permission_handler.dart';
|
||||||
|
import 'package:star_lock/apm/apm_helper.dart';
|
||||||
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
|
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
|
||||||
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
||||||
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/entity/ElectronicKeyListEntity.dart';
|
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/entity/ElectronicKeyListEntity.dart';
|
||||||
@ -14,7 +15,6 @@ import 'package:star_lock/main/lockMian/entity/lockListInfo_entity.dart';
|
|||||||
import 'package:star_lock/tools/bugly/bugly_tool.dart';
|
import 'package:star_lock/tools/bugly/bugly_tool.dart';
|
||||||
import 'package:star_lock/tools/throttler.dart';
|
import 'package:star_lock/tools/throttler.dart';
|
||||||
import 'package:star_lock/widget/permission/permission_dialog.dart';
|
import 'package:star_lock/widget/permission/permission_dialog.dart';
|
||||||
import 'package:umeng_common_sdk/umeng_common_sdk.dart';
|
|
||||||
|
|
||||||
import '../../../app_settings/app_settings.dart';
|
import '../../../app_settings/app_settings.dart';
|
||||||
import '../../../blue/blue_manage.dart';
|
import '../../../blue/blue_manage.dart';
|
||||||
@ -71,7 +71,7 @@ class LockDetailLogic extends BaseGetXController {
|
|||||||
|
|
||||||
if (status != 6) {
|
if (status != 6) {
|
||||||
final String getMobile = (await Storage.getMobile())!;
|
final String getMobile = (await Storage.getMobile())!;
|
||||||
UmengCommonSdk.onEvent('open_lock', {
|
ApmHelper.instance.trackEvent('open_lock', {
|
||||||
'lock_name': state.keyInfos.value.lockName!,
|
'lock_name': state.keyInfos.value.lockName!,
|
||||||
'account':
|
'account':
|
||||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||||
@ -378,7 +378,7 @@ class LockDetailLogic extends BaseGetXController {
|
|||||||
outTimer: 20,
|
outTimer: 20,
|
||||||
action: () async {
|
action: () async {
|
||||||
final String getMobile = (await Storage.getMobile())!;
|
final String getMobile = (await Storage.getMobile())!;
|
||||||
UmengCommonSdk.onEvent('open_lock', {
|
ApmHelper.instance.trackEvent('open_lock', {
|
||||||
'lock_name': state.keyInfos.value.lockName!,
|
'lock_name': state.keyInfos.value.lockName!,
|
||||||
'account':
|
'account':
|
||||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||||
@ -422,7 +422,7 @@ class LockDetailLogic extends BaseGetXController {
|
|||||||
detail: '蓝牙连接失败,断开连接, 开锁失败--OpenLockCommand:$command',
|
detail: '蓝牙连接失败,断开连接, 开锁失败--OpenLockCommand:$command',
|
||||||
upload: true);
|
upload: true);
|
||||||
final String getMobile = (await Storage.getMobile())!;
|
final String getMobile = (await Storage.getMobile())!;
|
||||||
UmengCommonSdk.onEvent('open_lock', {
|
ApmHelper.instance.trackEvent('open_lock', {
|
||||||
'lock_name': state.keyInfos.value.lockName!,
|
'lock_name': state.keyInfos.value.lockName!,
|
||||||
'account':
|
'account':
|
||||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||||
|
|||||||
@ -3,9 +3,9 @@ import 'dart:async';
|
|||||||
import 'package:flutter/scheduler.dart';
|
import 'package:flutter/scheduler.dart';
|
||||||
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:star_lock/apm/apm_helper.dart';
|
||||||
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
||||||
import 'package:star_lock/main/lockMian/entity/lockListInfo_entity.dart';
|
import 'package:star_lock/main/lockMian/entity/lockListInfo_entity.dart';
|
||||||
import 'package:umeng_common_sdk/umeng_common_sdk.dart';
|
|
||||||
|
|
||||||
import '../../../../blue/blue_manage.dart';
|
import '../../../../blue/blue_manage.dart';
|
||||||
import '../../../../blue/io_protocol/io_factoryDataReset.dart';
|
import '../../../../blue/io_protocol/io_factoryDataReset.dart';
|
||||||
@ -294,7 +294,7 @@ class LockSetLogic extends BaseGetXController {
|
|||||||
isShowBlueConnetctToast: false,
|
isShowBlueConnetctToast: false,
|
||||||
action: () async {
|
action: () async {
|
||||||
final String getMobile = (await Storage.getMobile())!;
|
final String getMobile = (await Storage.getMobile())!;
|
||||||
UmengCommonSdk.onEvent('delet_lock', {
|
ApmHelper.instance.trackEvent('delet_lock', {
|
||||||
'lock_name': BlueManage().connectDeviceName,
|
'lock_name': BlueManage().connectDeviceName,
|
||||||
'account':
|
'account':
|
||||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||||
@ -332,7 +332,7 @@ class LockSetLogic extends BaseGetXController {
|
|||||||
token: getTokenList);
|
token: getTokenList);
|
||||||
} else if (connectionState == BluetoothConnectionState.disconnected) {
|
} else if (connectionState == BluetoothConnectionState.disconnected) {
|
||||||
final String getMobile = (await Storage.getMobile())!;
|
final String getMobile = (await Storage.getMobile())!;
|
||||||
UmengCommonSdk.onEvent('delet_lock', {
|
ApmHelper.instance.trackEvent('delet_lock', {
|
||||||
'lock_name': BlueManage().connectDeviceName,
|
'lock_name': BlueManage().connectDeviceName,
|
||||||
'account':
|
'account':
|
||||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||||
@ -538,6 +538,7 @@ class LockSetLogic extends BaseGetXController {
|
|||||||
|
|
||||||
// 下级界面修改成功后传递数据
|
// 下级界面修改成功后传递数据
|
||||||
StreamSubscription? _passCurrentLockInformationEvent;
|
StreamSubscription? _passCurrentLockInformationEvent;
|
||||||
|
|
||||||
void initLoadDataAction(BlockSetStateCallback blockSetStateCallback) {
|
void initLoadDataAction(BlockSetStateCallback blockSetStateCallback) {
|
||||||
// 蓝牙协议通知传输跟蓝牙之外的数据传输类不一样 eventBus
|
// 蓝牙协议通知传输跟蓝牙之外的数据传输类不一样 eventBus
|
||||||
_passCurrentLockInformationEvent = eventBus
|
_passCurrentLockInformationEvent = eventBus
|
||||||
@ -597,7 +598,7 @@ class LockSetLogic extends BaseGetXController {
|
|||||||
);
|
);
|
||||||
final String getMobile = (await Storage.getMobile())!;
|
final String getMobile = (await Storage.getMobile())!;
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
UmengCommonSdk.onEvent('delet_lock', {
|
ApmHelper.instance.trackEvent('delet_lock', {
|
||||||
'lock_name': BlueManage().connectDeviceName,
|
'lock_name': BlueManage().connectDeviceName,
|
||||||
'account':
|
'account':
|
||||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||||
@ -616,7 +617,7 @@ class LockSetLogic extends BaseGetXController {
|
|||||||
eventBus.fire(RefreshLockListInfoDataEvent());
|
eventBus.fire(RefreshLockListInfoDataEvent());
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
UmengCommonSdk.onEvent('delet_lock', {
|
ApmHelper.instance.trackEvent('delet_lock', {
|
||||||
'lock_name': BlueManage().connectDeviceName,
|
'lock_name': BlueManage().connectDeviceName,
|
||||||
'account':
|
'account':
|
||||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||||
@ -636,7 +637,7 @@ class LockSetLogic extends BaseGetXController {
|
|||||||
state.deleteAdministratorIsHaveAllData.value == true ? 1 : 0);
|
state.deleteAdministratorIsHaveAllData.value == true ? 1 : 0);
|
||||||
final String getMobile = (await Storage.getMobile())!;
|
final String getMobile = (await Storage.getMobile())!;
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
UmengCommonSdk.onEvent('delet_lock', {
|
ApmHelper.instance.trackEvent('delet_lock', {
|
||||||
'lock_name': BlueManage().connectDeviceName,
|
'lock_name': BlueManage().connectDeviceName,
|
||||||
'account':
|
'account':
|
||||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||||
@ -655,7 +656,7 @@ class LockSetLogic extends BaseGetXController {
|
|||||||
eventBus.fire(RefreshLockListInfoDataEvent());
|
eventBus.fire(RefreshLockListInfoDataEvent());
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
UmengCommonSdk.onEvent('delet_lock', {
|
ApmHelper.instance.trackEvent('delet_lock', {
|
||||||
'lock_name': BlueManage().connectDeviceName,
|
'lock_name': BlueManage().connectDeviceName,
|
||||||
'account':
|
'account':
|
||||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||||
|
|||||||
@ -2,11 +2,11 @@ import 'dart:async';
|
|||||||
|
|
||||||
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:star_lock/apm/apm_helper.dart';
|
||||||
import 'package:star_lock/main/lockDetail/passwordKey/passwordKey_perpetual/passwordKeyEntity.dart';
|
import 'package:star_lock/main/lockDetail/passwordKey/passwordKey_perpetual/passwordKeyEntity.dart';
|
||||||
import 'package:star_lock/main/lockDetail/passwordKey/passwordKey_perpetual/passwordKey_perpetual_state.dart';
|
import 'package:star_lock/main/lockDetail/passwordKey/passwordKey_perpetual/passwordKey_perpetual_state.dart';
|
||||||
import 'package:star_lock/network/api_repository.dart';
|
import 'package:star_lock/network/api_repository.dart';
|
||||||
import 'package:star_lock/tools/eventBusEventManage.dart';
|
import 'package:star_lock/tools/eventBusEventManage.dart';
|
||||||
import 'package:umeng_common_sdk/umeng_common_sdk.dart';
|
|
||||||
|
|
||||||
import '../../../../blue/blue_manage.dart';
|
import '../../../../blue/blue_manage.dart';
|
||||||
import '../../../../blue/io_modelVendor.dart';
|
import '../../../../blue/io_modelVendor.dart';
|
||||||
@ -182,7 +182,7 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
|
|||||||
pwdRight: state.isAdministrator.value == true ? 1 : 0);
|
pwdRight: state.isAdministrator.value == true ? 1 : 0);
|
||||||
final String getMobile = (await Storage.getMobile())!;
|
final String getMobile = (await Storage.getMobile())!;
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
UmengCommonSdk.onEvent('add_password', {
|
ApmHelper.instance.trackEvent('add_password', {
|
||||||
'lock_name':BlueManage().connectDeviceName,
|
'lock_name':BlueManage().connectDeviceName,
|
||||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||||
'date':DateTool().getNowDateWithType(1),
|
'date':DateTool().getNowDateWithType(1),
|
||||||
@ -199,7 +199,7 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
|
|||||||
updatePWDNumberRequest(entity.data!.keyboardPwdId.toString());
|
updatePWDNumberRequest(entity.data!.keyboardPwdId.toString());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
UmengCommonSdk.onEvent('add_password', {
|
ApmHelper.instance.trackEvent('add_password', {
|
||||||
'lock_name':BlueManage().connectDeviceName,
|
'lock_name':BlueManage().connectDeviceName,
|
||||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||||
'date':DateTool().getNowDateWithType(1),
|
'date':DateTool().getNowDateWithType(1),
|
||||||
@ -419,7 +419,7 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
|
|||||||
showEasyLoading();
|
showEasyLoading();
|
||||||
showBlueConnetctToastTimer(action: () async {
|
showBlueConnetctToastTimer(action: () async {
|
||||||
final String getMobile = (await Storage.getMobile())!;
|
final String getMobile = (await Storage.getMobile())!;
|
||||||
UmengCommonSdk.onEvent('add_password', {
|
ApmHelper.instance.trackEvent('add_password', {
|
||||||
'lock_name':BlueManage().connectDeviceName,
|
'lock_name':BlueManage().connectDeviceName,
|
||||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||||
'date':DateTool().getNowDateWithType(1),
|
'date':DateTool().getNowDateWithType(1),
|
||||||
@ -465,7 +465,7 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
|
|||||||
token: getTokenList);
|
token: getTokenList);
|
||||||
} else if (deviceConnectionState == BluetoothConnectionState.disconnected) {
|
} else if (deviceConnectionState == BluetoothConnectionState.disconnected) {
|
||||||
final String getMobile = (await Storage.getMobile())!;
|
final String getMobile = (await Storage.getMobile())!;
|
||||||
UmengCommonSdk.onEvent('add_password', {
|
ApmHelper.instance.trackEvent('add_password', {
|
||||||
'lock_name':BlueManage().connectDeviceName,
|
'lock_name':BlueManage().connectDeviceName,
|
||||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||||
'date':DateTool().getNowDateWithType(1),
|
'date':DateTool().getNowDateWithType(1),
|
||||||
|
|||||||
@ -3,10 +3,10 @@ import 'dart:async';
|
|||||||
|
|
||||||
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:star_lock/apm/apm_helper.dart';
|
||||||
|
|
||||||
import 'package:star_lock/main/lockDetail/lockDetail/lockDetail_logic.dart';
|
import 'package:star_lock/main/lockDetail/lockDetail/lockDetail_logic.dart';
|
||||||
import 'package:star_lock/mine/addLock/saveLock/entity/SaveLockEntity.dart';
|
import 'package:star_lock/mine/addLock/saveLock/entity/SaveLockEntity.dart';
|
||||||
import 'package:umeng_common_sdk/umeng_common_sdk.dart';
|
|
||||||
|
|
||||||
import '../../../app_settings/app_settings.dart';
|
import '../../../app_settings/app_settings.dart';
|
||||||
import '../../../blue/blue_manage.dart';
|
import '../../../blue/blue_manage.dart';
|
||||||
@ -407,7 +407,7 @@ class SaveLockLogic extends BaseGetXController {
|
|||||||
state.lockId = entity.data!.lockId!;
|
state.lockId = entity.data!.lockId!;
|
||||||
|
|
||||||
final String getMobile = (await Storage.getMobile())!;
|
final String getMobile = (await Storage.getMobile())!;
|
||||||
UmengCommonSdk.onEvent('save_lock_result', {
|
ApmHelper.instance.trackEvent('save_lock_result', {
|
||||||
'lock_name':BlueManage().connectDeviceName,
|
'lock_name':BlueManage().connectDeviceName,
|
||||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||||
'date':DateTool().getNowDateWithType(1),
|
'date':DateTool().getNowDateWithType(1),
|
||||||
@ -423,7 +423,7 @@ class SaveLockLogic extends BaseGetXController {
|
|||||||
state.sureBtnState.value = 0;
|
state.sureBtnState.value = 0;
|
||||||
|
|
||||||
final String getMobile = (await Storage.getMobile())!;
|
final String getMobile = (await Storage.getMobile())!;
|
||||||
UmengCommonSdk.onEvent('save_lock_result', {
|
ApmHelper.instance.trackEvent('save_lock_result', {
|
||||||
'lock_name':BlueManage().connectDeviceName,
|
'lock_name':BlueManage().connectDeviceName,
|
||||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||||
'date':DateTool().getNowDateWithType(1),
|
'date':DateTool().getNowDateWithType(1),
|
||||||
|
|||||||
@ -2,6 +2,7 @@ import 'dart:async';
|
|||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:star_lock/apm/apm_helper.dart';
|
||||||
import 'package:star_lock/appRouters.dart';
|
import 'package:star_lock/appRouters.dart';
|
||||||
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
||||||
import 'package:star_lock/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_entity.dart';
|
import 'package:star_lock/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_entity.dart';
|
||||||
@ -13,7 +14,6 @@ import 'package:star_lock/tools/push/xs_jPhush.dart';
|
|||||||
import 'package:star_lock/tools/showCupertinoAlertView.dart';
|
import 'package:star_lock/tools/showCupertinoAlertView.dart';
|
||||||
import 'package:star_lock/tools/storage.dart';
|
import 'package:star_lock/tools/storage.dart';
|
||||||
import 'package:star_lock/versionUndate/versionUndate_entity.dart';
|
import 'package:star_lock/versionUndate/versionUndate_entity.dart';
|
||||||
import 'package:umeng_common_sdk/umeng_common_sdk.dart';
|
|
||||||
|
|
||||||
import '../../../../network/api_repository.dart';
|
import '../../../../network/api_repository.dart';
|
||||||
import '../../../../tools/baseGetXController.dart';
|
import '../../../../tools/baseGetXController.dart';
|
||||||
@ -131,7 +131,8 @@ class MineSetLogic extends BaseGetXController {
|
|||||||
await ApiRepository.to.userLogout(deviceld: getPushDeviceID);
|
await ApiRepository.to.userLogout(deviceld: getPushDeviceID);
|
||||||
final String getMobile = (await Storage.getMobile())!;
|
final String getMobile = (await Storage.getMobile())!;
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
UmengCommonSdk.onEvent('logout', {
|
ApmHelper.instance.logout();
|
||||||
|
ApmHelper.instance.trackEvent('logout', {
|
||||||
'lock_name': BlueManage().connectDeviceName,
|
'lock_name': BlueManage().connectDeviceName,
|
||||||
'account':
|
'account':
|
||||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||||
@ -149,7 +150,8 @@ class MineSetLogic extends BaseGetXController {
|
|||||||
XSJPushProvider().initLocalNotification(isCancelLocalPush: true);
|
XSJPushProvider().initLocalNotification(isCancelLocalPush: true);
|
||||||
Get.offNamedUntil(Routers.starLockLoginPage, (Route route) => false);
|
Get.offNamedUntil(Routers.starLockLoginPage, (Route route) => false);
|
||||||
} else {
|
} else {
|
||||||
UmengCommonSdk.onEvent('logout', {
|
ApmHelper.instance.logout();
|
||||||
|
ApmHelper.instance.trackEvent('logout', {
|
||||||
'lock_name': BlueManage().connectDeviceName,
|
'lock_name': BlueManage().connectDeviceName,
|
||||||
'account':
|
'account':
|
||||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||||
|
|||||||
@ -23,9 +23,12 @@ class AppFirstEnterHandle {
|
|||||||
switch (flagStr) {
|
switch (flagStr) {
|
||||||
case isAgreePrivacy: // 隐私协议
|
case isAgreePrivacy: // 隐私协议
|
||||||
if (getFlag != isAgreePrivacy) {
|
if (getFlag != isAgreePrivacy) {
|
||||||
await showPrivacyAgreementAlert();
|
final bool? isAgree = await showPrivacyAgreementAlert();
|
||||||
|
if (isAgree ?? false) {
|
||||||
|
await privacySDKInitialization();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
await privacySDKInitialization();
|
|
||||||
if (Get.isRegistered<StarLockLoginLogic>()) {
|
if (Get.isRegistered<StarLockLoginLogic>()) {
|
||||||
Get.find<StarLockLoginLogic>().flushedDeviceInfo();
|
Get.find<StarLockLoginLogic>().flushedDeviceInfo();
|
||||||
}
|
}
|
||||||
@ -51,8 +54,8 @@ class AppFirstEnterHandle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//隐私协议弹窗
|
//隐私协议弹窗
|
||||||
Future<void> showPrivacyAgreementAlert() async {
|
Future<bool?> showPrivacyAgreementAlert() async {
|
||||||
await showCupertinoDialog(
|
return await showCupertinoDialog(
|
||||||
context: Get.context!,
|
context: Get.context!,
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
return PopScope(
|
return PopScope(
|
||||||
@ -103,7 +106,8 @@ class AppFirstEnterHandle {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
TextSpan(
|
TextSpan(
|
||||||
text: '的全部内容。点击“同意”即表示您同意并接受全部条款。若选择不同意,将无法使用我们的产品和服务,并会退出应用。'.tr
|
text: '的全部内容。点击“同意”即表示您同意并接受全部条款。若选择不同意,将无法使用我们的产品和服务,并会退出应用。'
|
||||||
|
.tr
|
||||||
.tr),
|
.tr),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@ -123,7 +127,7 @@ class AppFirstEnterHandle {
|
|||||||
),
|
),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Storage.setString(isAgreePrivacy, isAgreePrivacy);
|
Storage.setString(isAgreePrivacy, isAgreePrivacy);
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop(true);
|
||||||
getAppFirstEnter(isShowUpdateVersion);
|
getAppFirstEnter(isShowUpdateVersion);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@ -173,7 +177,8 @@ class AppFirstEnterHandle {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
TextSpan(
|
TextSpan(
|
||||||
text: '的全部内容。点击“同意”即表示您同意并接受全部条款。若选择不同意,将无法使用我们的产品和服务,并会退出应用。'.tr
|
text: '的全部内容。点击“同意”即表示您同意并接受全部条款。若选择不同意,将无法使用我们的产品和服务,并会退出应用。'
|
||||||
|
.tr
|
||||||
.tr),
|
.tr),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@ -193,7 +198,7 @@ class AppFirstEnterHandle {
|
|||||||
),
|
),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Storage.setString(isAgreePrivacy, isAgreePrivacy);
|
Storage.setString(isAgreePrivacy, isAgreePrivacy);
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop(true);
|
||||||
getAppFirstEnter(isShowUpdateVersion);
|
getAppFirstEnter(isShowUpdateVersion);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|||||||
@ -4,6 +4,7 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
import 'package:shared_preferences/shared_preferences.dart';
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
|
import 'package:star_lock/apm/apm_helper.dart';
|
||||||
|
|
||||||
import '../login/login/entity/LoginData.dart';
|
import '../login/login/entity/LoginData.dart';
|
||||||
import '../main/lockMian/entity/lockListInfo_entity.dart';
|
import '../main/lockMian/entity/lockListInfo_entity.dart';
|
||||||
@ -192,12 +193,14 @@ class Storage {
|
|||||||
final String? data = await Storage.getString(saveUserLoginData);
|
final String? data = await Storage.getString(saveUserLoginData);
|
||||||
if (data != null && data.isNotEmpty) {
|
if (data != null && data.isNotEmpty) {
|
||||||
loginData = LoginData.fromJson(jsonDecode(data));
|
loginData = LoginData.fromJson(jsonDecode(data));
|
||||||
|
ApmHelper.instance.login(loginData.userid!.toString());
|
||||||
}
|
}
|
||||||
// AppLog.log("loginData:$loginData");
|
// AppLog.log("loginData:$loginData");
|
||||||
return loginData;
|
return loginData;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<void> saveLoginData(LoginData? data) async {
|
static Future<void> saveLoginData(LoginData? data) async {
|
||||||
|
ApmHelper.instance.login(data!.userid!.toString());
|
||||||
await Storage.setString(saveUserLoginData, jsonEncode(data));
|
await Storage.setString(saveUserLoginData, jsonEncode(data));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
11
pubspec.yaml
11
pubspec.yaml
@ -236,7 +236,7 @@ dependencies:
|
|||||||
timelines: ^0.1.0
|
timelines: ^0.1.0
|
||||||
#侧滑删除
|
#侧滑删除
|
||||||
flutter_slidable: ^3.0.1
|
flutter_slidable: ^3.0.1
|
||||||
# audio_service: ^0.18.12
|
# audio_service: ^0.18.12
|
||||||
app_settings: ^5.1.1
|
app_settings: ^5.1.1
|
||||||
flutter_local_notifications: ^17.0.0
|
flutter_local_notifications: ^17.0.0
|
||||||
fluwx: 4.5.5
|
fluwx: 4.5.5
|
||||||
@ -245,11 +245,16 @@ dependencies:
|
|||||||
colorfilter_generator: ^0.0.8
|
colorfilter_generator: ^0.0.8
|
||||||
file_picker: ^5.3.1
|
file_picker: ^5.3.1
|
||||||
# 错误日志监控
|
# 错误日志监控
|
||||||
# flutter_bugly_plugin: ^0.0.9
|
# flutter_bugly_plugin: ^0.0.9
|
||||||
flutter_bugly: ^1.0.2
|
flutter_bugly: ^1.0.2
|
||||||
open_filex: ^4.4.0
|
open_filex: ^4.4.0
|
||||||
|
|
||||||
umeng_common_sdk: 1.2.7
|
#<cn>
|
||||||
|
umeng_common_sdk: 1.2.8
|
||||||
|
#</cn>
|
||||||
|
#<com>
|
||||||
|
firebase_analytics: 11.3.0
|
||||||
|
#</com>
|
||||||
|
|
||||||
dependency_overrides:
|
dependency_overrides:
|
||||||
#强制设置google_maps_flutter_ios 为 2.5.2
|
#强制设置google_maps_flutter_ios 为 2.5.2
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user