feat:firebase统计和事件上报接入
This commit is contained in:
parent
b908abd89d
commit
3bccec750b
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"
|
||||
}
|
||||
@ -80,7 +80,6 @@
|
||||
E0B3E9EF2D04B36D00907A95 /* info_pre.plist in Resources */ = {isa = PBXBuildFile; fileRef = E0B3E9EB2D04B36C00907A95 /* info_pre.plist */; };
|
||||
E0B3E9F02D04B36D00907A95 /* info_dev.plist in Resources */ = {isa = PBXBuildFile; fileRef = E0B3E9EC2D04B36C00907A95 /* info_dev.plist */; };
|
||||
E2FF5D00DFF6E2BF9DA36649 /* devLaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D627D69970E6DA2D33F770E3 /* devLaunchScreen.storyboard */; };
|
||||
E80F3DA84683DCDC3B037333 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = A4AD0C691210DA25B27DE592 /* GoogleService-Info.plist */; };
|
||||
EE0A7A61CF36BC83ACA6EE3E /* xhjProfile.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = DC2FBF181C8D9880E24845E6 /* xhjProfile.xcconfig */; };
|
||||
F0A7A6EF7D83CA92324D9C20 /* preDebug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 383F65C3166F78B1A1470A4E /* preDebug.xcconfig */; };
|
||||
F3C801D06AA86FB3BB32A1DA /* skyLaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9A03C622761920C324D80733 /* skyLaunchScreen.storyboard */; };
|
||||
@ -192,7 +191,6 @@
|
||||
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||
9A03C622761920C324D80733 /* skyLaunchScreen.storyboard */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = file.storyboard; name = skyLaunchScreen.storyboard; path = Runner/skyLaunchScreen.storyboard; sourceTree = "<group>"; };
|
||||
9AA145F8B894E5E4F14249DB /* devProfile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = devProfile.xcconfig; path = Flutter/devProfile.xcconfig; sourceTree = "<group>"; };
|
||||
A4AD0C691210DA25B27DE592 /* GoogleService-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; name = "GoogleService-Info.plist"; path = "Runner/GoogleService-Info.plist"; sourceTree = "<group>"; };
|
||||
A728CF82D2CACE8B399AACAB /* Pods-Runner.debug-pre-xhj.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug-pre-xhj.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug-pre-xhj.xcconfig"; sourceTree = "<group>"; };
|
||||
B7AA7A6DD927B38E32E2C889 /* preProfile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = preProfile.xcconfig; path = Flutter/preProfile.xcconfig; sourceTree = "<group>"; };
|
||||
CA9024705F732C9C000EA53E /* xhjRelease.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = xhjRelease.xcconfig; path = Flutter/xhjRelease.xcconfig; sourceTree = "<group>"; };
|
||||
@ -338,7 +336,6 @@
|
||||
7EA577AFEEE10224BA96C569 /* preLaunchScreen.storyboard */,
|
||||
9A03C622761920C324D80733 /* skyLaunchScreen.storyboard */,
|
||||
6A6F5C86239927252C06A16A /* xhjLaunchScreen.storyboard */,
|
||||
A4AD0C691210DA25B27DE592 /* GoogleService-Info.plist */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
@ -536,7 +533,6 @@
|
||||
99FEBCD8A8244C3EE22C5A18 /* preLaunchScreen.storyboard in Resources */,
|
||||
F3C801D06AA86FB3BB32A1DA /* skyLaunchScreen.storyboard in Resources */,
|
||||
370C09E26790814FD1F6465F /* xhjLaunchScreen.storyboard in Resources */,
|
||||
E80F3DA84683DCDC3B037333 /* GoogleService-Info.plist in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
||||
@ -1,30 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>API_KEY</key>
|
||||
<string>AIzaSyACbp5aUKhLU1SMg8iIdm9WmNX7wxI7fVc</string>
|
||||
<key>GCM_SENDER_ID</key>
|
||||
<string>281500445726</string>
|
||||
<key>PLIST_VERSION</key>
|
||||
<string>1</string>
|
||||
<key>BUNDLE_ID</key>
|
||||
<string>com.starlock.lock.local</string>
|
||||
<key>PROJECT_ID</key>
|
||||
<string>skychip2023-ecdff</string>
|
||||
<key>STORAGE_BUCKET</key>
|
||||
<string>skychip2023-ecdff.firebasestorage.app</string>
|
||||
<key>IS_ADS_ENABLED</key>
|
||||
<false></false>
|
||||
<key>IS_ANALYTICS_ENABLED</key>
|
||||
<false></false>
|
||||
<key>IS_APPINVITE_ENABLED</key>
|
||||
<true></true>
|
||||
<key>IS_GCM_ENABLED</key>
|
||||
<true></true>
|
||||
<key>IS_SIGNIN_ENABLED</key>
|
||||
<true></true>
|
||||
<key>GOOGLE_APP_ID</key>
|
||||
<string>1:281500445726:ios:b194ccffb92fb86cc4d20f</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@ -2,6 +2,7 @@
|
||||
import 'firebase/firebase_helper.dart';
|
||||
|
||||
//</com>
|
||||
|
||||
//<cn>
|
||||
import 'umeng/umeng_helper.dart';
|
||||
//</cn>
|
||||
@ -22,6 +23,15 @@ class ApmHelper {
|
||||
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();
|
||||
@ -31,16 +41,31 @@ class ApmHelper {
|
||||
//</com>
|
||||
}
|
||||
|
||||
Future<void> trackEvent(String eventName,
|
||||
{String? title,
|
||||
String? screenName,
|
||||
String? elementContent,
|
||||
String? operation}) async {
|
||||
Future<void> login(String userId) async {
|
||||
//<cn>
|
||||
UmengHelper.instance.trackEvent(eventName);
|
||||
UmengHelper.instance.login(userId);
|
||||
//</cn>
|
||||
//<com>
|
||||
FirebaseHelper.instance.trackEvent(eventName);
|
||||
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>
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,9 +1,47 @@
|
||||
//<com>
|
||||
class FirebaseHelper {
|
||||
FirebaseHelper._internal();
|
||||
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;
|
||||
|
||||
@ -12,12 +50,28 @@ class FirebaseHelper {
|
||||
return _instance!;
|
||||
}
|
||||
|
||||
Future<void> initSdk() async {}
|
||||
Future<void> initApp() async {
|
||||
await Firebase.initializeApp(
|
||||
options: DefaultFirebaseOptions.currentPlatform,
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> trackEvent(String eventName,
|
||||
{String? title,
|
||||
String? screenName,
|
||||
String? elementContent,
|
||||
String? operation}) async {}
|
||||
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>
|
||||
|
||||
@ -15,16 +15,27 @@ class UmengHelper {
|
||||
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> trackEvent(String eventName,
|
||||
{String? title,
|
||||
String? screenName,
|
||||
String? elementContent,
|
||||
String? operation}) async {}
|
||||
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>
|
||||
|
||||
@ -1,68 +0,0 @@
|
||||
// File generated by FlutterFire CLI.
|
||||
// ignore_for_file: type=lint
|
||||
import 'package:firebase_core/firebase_core.dart' show FirebaseOptions;
|
||||
import 'package:flutter/foundation.dart'
|
||||
show defaultTargetPlatform, kIsWeb, TargetPlatform;
|
||||
|
||||
/// Default [FirebaseOptions] for use with your Firebase apps.
|
||||
///
|
||||
/// Example:
|
||||
/// ```dart
|
||||
/// import 'firebase_options.dart';
|
||||
/// // ...
|
||||
/// await Firebase.initializeApp(
|
||||
/// options: DefaultFirebaseOptions.currentPlatform,
|
||||
/// );
|
||||
/// ```
|
||||
class DefaultFirebaseOptions {
|
||||
static FirebaseOptions get currentPlatform {
|
||||
if (kIsWeb) {
|
||||
throw UnsupportedError(
|
||||
'DefaultFirebaseOptions have not been configured for web - '
|
||||
'you can reconfigure this by running the FlutterFire CLI again.',
|
||||
);
|
||||
}
|
||||
switch (defaultTargetPlatform) {
|
||||
case TargetPlatform.android:
|
||||
return android;
|
||||
case TargetPlatform.iOS:
|
||||
return ios;
|
||||
case TargetPlatform.macOS:
|
||||
throw UnsupportedError(
|
||||
'DefaultFirebaseOptions have not been configured for macos - '
|
||||
'you can reconfigure this by running the FlutterFire CLI again.',
|
||||
);
|
||||
case TargetPlatform.windows:
|
||||
throw UnsupportedError(
|
||||
'DefaultFirebaseOptions have not been configured for windows - '
|
||||
'you can reconfigure this by running the FlutterFire CLI again.',
|
||||
);
|
||||
case TargetPlatform.linux:
|
||||
throw UnsupportedError(
|
||||
'DefaultFirebaseOptions have not been configured for linux - '
|
||||
'you can reconfigure this by running the FlutterFire CLI again.',
|
||||
);
|
||||
default:
|
||||
throw UnsupportedError(
|
||||
'DefaultFirebaseOptions are not supported for this platform.',
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
static const FirebaseOptions android = FirebaseOptions(
|
||||
apiKey: 'AIzaSyC-3-ABWuy9LrYyAw_KxDRto4DanQ0sq9g',
|
||||
appId: '1:281500445726:android:468195b9cc68dd6cc4d20f',
|
||||
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',
|
||||
);
|
||||
}
|
||||
@ -2,11 +2,11 @@ import 'dart:async';
|
||||
|
||||
import 'package:flutter/material.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/login/forgetPassword/starLock_forgetPassword_state.dart';
|
||||
import 'package:star_lock/login/login/entity/LoginEntity.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 '../../tools/baseGetXController.dart';
|
||||
@ -55,7 +55,7 @@ class StarLockForgetPasswordLogic extends BaseGetXController {
|
||||
'B748F838-94EE-4BDB-A0E6-7B2D16849792',
|
||||
state.verificationCode.value);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
UmengCommonSdk.onEvent('resetPassword_result', {
|
||||
ApmHelper.instance.trackEvent('resetPassword_result', {
|
||||
'account':state.phoneStr.value,
|
||||
'date':DateTool().getNowDateWithType(1),
|
||||
'resetPassword_res':'成功',
|
||||
@ -64,7 +64,7 @@ class StarLockForgetPasswordLogic extends BaseGetXController {
|
||||
showToast('重置成功'.tr);
|
||||
Get.back();
|
||||
}else{
|
||||
UmengCommonSdk.onEvent('resetPassword_result', {
|
||||
ApmHelper.instance.trackEvent('resetPassword_result', {
|
||||
'account':state.phoneStr.value,
|
||||
'date':DateTool().getNowDateWithType(1),
|
||||
'resetPassword_res':'${entity.errorCode}--${entity.errorMsg}',
|
||||
|
||||
@ -25,6 +25,7 @@ class LoginData {
|
||||
uid = json['uid'];
|
||||
isVip = json['isVip'];
|
||||
}
|
||||
|
||||
String? accessToken;
|
||||
int? userid;
|
||||
int? expiresAt;
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/apm/apm_helper.dart';
|
||||
import 'package:star_lock/appRouters.dart';
|
||||
import 'package:star_lock/app_settings/app_settings.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/mine/mine/starLockMine_state.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 '../../mine/mine/starLockMine_logic.dart';
|
||||
@ -50,7 +50,7 @@ class StarLockLoginLogic extends BaseGetXController {
|
||||
username: state.emailOrPhone.value,
|
||||
deviceInfo: state.deviceInfoMap);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
UmengCommonSdk.onEvent('login_result', {
|
||||
ApmHelper.instance.trackEvent('login_result', {
|
||||
'account': state.emailOrPhone.value,
|
||||
'date': DateTool().getNowDateWithType(1),
|
||||
'login_res': '成功',
|
||||
@ -65,7 +65,7 @@ class StarLockLoginLogic extends BaseGetXController {
|
||||
Get.offNamedUntil(Routers.starLockMain, (Route route) => false);
|
||||
BlueManage().scanDevices.clear(); //清除设备缓存
|
||||
} else {
|
||||
UmengCommonSdk.onEvent('login_result', {
|
||||
ApmHelper.instance.trackEvent('login_result', {
|
||||
'account': state.emailOrPhone.value,
|
||||
'date': DateTool().getNowDateWithType(1),
|
||||
'login_res': '${entity.errorCode}--${entity.errorMsg}',
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/apm/apm_helper.dart';
|
||||
import 'package:star_lock/appRouters.dart';
|
||||
import 'package:star_lock/app_settings/app_settings.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/push/xs_jPhush.dart';
|
||||
import 'package:star_lock/tools/storage.dart';
|
||||
import 'package:umeng_common_sdk/umeng_common_sdk.dart';
|
||||
|
||||
import '../../network/api_repository.dart';
|
||||
import '../../tools/baseGetXController.dart';
|
||||
@ -26,6 +25,7 @@ class StarLockRegisterLogic extends BaseGetXController {
|
||||
final StarLockRegisterState state = StarLockRegisterState();
|
||||
|
||||
late Timer _timer;
|
||||
|
||||
void _startTimer() {
|
||||
_timer = Timer.periodic(1.seconds, (Timer timer) {
|
||||
if (state.currentSecond > 1) {
|
||||
@ -49,7 +49,7 @@ class StarLockRegisterLogic extends BaseGetXController {
|
||||
return;
|
||||
}
|
||||
|
||||
if(!RegularExpression().validateString(state.pwd.value)){
|
||||
if (!RegularExpression().validateString(state.pwd.value)) {
|
||||
showToast('密码需至少包含数字/字母/字符中的2种组合'.tr);
|
||||
return;
|
||||
}
|
||||
@ -61,10 +61,10 @@ class StarLockRegisterLogic extends BaseGetXController {
|
||||
verificationCode: state.verificationCode.value,
|
||||
deviceInfo: state.deviceInfoMap.value);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
UmengCommonSdk.onEvent('register_result', {
|
||||
'account':state.phoneOrEmailStr.value,
|
||||
'date':DateTool().getNowDateWithType(1),
|
||||
'register_res':'成功',
|
||||
ApmHelper.instance.trackEvent('register_result', {
|
||||
'account': state.phoneOrEmailStr.value,
|
||||
'date': DateTool().getNowDateWithType(1),
|
||||
'register_res': '成功',
|
||||
});
|
||||
|
||||
Storage.saveLoginData(entity.data);
|
||||
@ -73,11 +73,11 @@ class StarLockRegisterLogic extends BaseGetXController {
|
||||
XSJPushProvider().initLocalNotification(isCancelLocalPush: false);
|
||||
Get.offNamedUntil(Routers.starLockMain, (Route route) => false);
|
||||
BlueManage().scanDevices.clear(); //清除设备缓存
|
||||
}else{
|
||||
UmengCommonSdk.onEvent('register_result', {
|
||||
'account':state.phoneOrEmailStr.value,
|
||||
'date':DateTool().getNowDateWithType(1),
|
||||
'register_res':'${entity.errorCode}--${entity.errorMsg}',
|
||||
} else {
|
||||
ApmHelper.instance.trackEvent('register_result', {
|
||||
'account': state.phoneOrEmailStr.value,
|
||||
'date': DateTool().getNowDateWithType(1),
|
||||
'register_res': '${entity.errorCode}--${entity.errorMsg}',
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -135,12 +135,15 @@ class StarLockRegisterLogic extends BaseGetXController {
|
||||
|
||||
// 重置是否能提交
|
||||
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() {
|
||||
state.canSendCode.value = state.pwdIsOK && state.phoneOrEmailStr.value.isNotEmpty;
|
||||
state.canSendCode.value =
|
||||
state.pwdIsOK && state.phoneOrEmailStr.value.isNotEmpty;
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@ -28,7 +28,7 @@ import 'tools/store_service.dart';
|
||||
FutureOr<void> main() async {
|
||||
FlutterBugly.postCatchedException(() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
await ApmHelper.instance.initApp();
|
||||
await _setCommonServices();
|
||||
|
||||
// 设置国际化信息
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/apm/apm_helper.dart';
|
||||
import 'package:star_lock/appRouters.dart';
|
||||
import 'package:star_lock/app_settings/app_settings.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/dateTool.dart';
|
||||
import 'package:star_lock/tools/showCupertinoAlertView.dart';
|
||||
import 'package:umeng_common_sdk/umeng_common_sdk.dart';
|
||||
|
||||
import '../../../../blue/blue_manage.dart';
|
||||
import '../../../../blue/io_reply.dart';
|
||||
import '../../../../blue/io_tool/io_tool.dart';
|
||||
import '../../../../blue/io_tool/manager_event_bus.dart';
|
||||
import '../../../../blue/sender_manage.dart';
|
||||
import '../../../../network/api_repository.dart';
|
||||
import '../../../../tools/baseGetXController.dart';
|
||||
import '../../../../tools/commonDataManage.dart';
|
||||
@ -222,7 +217,7 @@ class AuthorizedAdminLogic extends BaseGetXController {
|
||||
: '');
|
||||
final String getMobile = (await Storage.getMobile())!;
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
UmengCommonSdk.onEvent('add_authorizedAdmin', {
|
||||
ApmHelper.instance.trackEvent('add_authorizedAdmin', {
|
||||
'lock_name': BlueManage().connectDeviceName,
|
||||
'account':
|
||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
@ -245,7 +240,7 @@ class AuthorizedAdminLogic extends BaseGetXController {
|
||||
sendElectronicKeyRequest();
|
||||
});
|
||||
} else {
|
||||
UmengCommonSdk.onEvent('add_authorizedAdmin', {
|
||||
ApmHelper.instance.trackEvent('add_authorizedAdmin', {
|
||||
'lock_name': BlueManage().connectDeviceName,
|
||||
'account':
|
||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
|
||||
@ -1,14 +1,12 @@
|
||||
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter_blue_plus/flutter_blue_plus.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/main/lockDetail/card/addICCard/addICCard_entity.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/io_protocol/io_addICCardWithTimeCycleCoercion.dart';
|
||||
import '../../../../blue/io_reply.dart';
|
||||
@ -22,20 +20,23 @@ import '../../../../tools/eventBusEventManage.dart';
|
||||
import '../../../../tools/storage.dart';
|
||||
import 'addICCard_state.dart';
|
||||
|
||||
class AddICCardLogic extends BaseGetXController{
|
||||
class AddICCardLogic extends BaseGetXController {
|
||||
AddICCardState state = AddICCardState();
|
||||
|
||||
// 监听设备返回的数据
|
||||
late StreamSubscription<Reply> _replySubscription;
|
||||
|
||||
void _initReplySubscription() {
|
||||
_replySubscription = EventBusManager().eventBus!.on<Reply>().listen((Reply reply) async {
|
||||
_replySubscription =
|
||||
EventBusManager().eventBus!.on<Reply>().listen((Reply reply) async {
|
||||
// 添加IC卡开始
|
||||
if((reply is SenderAddICCardWithTimeCycleCoercionReply) && (state.ifCurrentScreen.value == true)) {
|
||||
if ((reply is SenderAddICCardWithTimeCycleCoercionReply) &&
|
||||
(state.ifCurrentScreen.value == true)) {
|
||||
_replyAddICCardBegin(reply);
|
||||
}
|
||||
|
||||
// 添加卡确认
|
||||
if(reply is SenderAddICCardConfirmationReply) {
|
||||
if (reply is SenderAddICCardConfirmationReply) {
|
||||
_replyAddICCardConfirmation(reply);
|
||||
}
|
||||
});
|
||||
@ -46,13 +47,13 @@ class AddICCardLogic extends BaseGetXController{
|
||||
BuglyTool.uploadException(
|
||||
message: '添加卡开始,解析数据',
|
||||
detail: '添加卡开始,解析数据 _replyAddICCardBegin:${reply.data}',
|
||||
upload: false
|
||||
);
|
||||
upload: false);
|
||||
|
||||
switch(status){
|
||||
switch (status) {
|
||||
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();
|
||||
// AppLog.log("添加卡号:$cardNumberList cardNumber:$cardNumber");
|
||||
state.cardNumber.value = cardNumber.toString();
|
||||
@ -63,10 +64,13 @@ class AddICCardLogic extends BaseGetXController{
|
||||
break;
|
||||
case 0x06:
|
||||
//无权限
|
||||
final List<String>? privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
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!);
|
||||
|
||||
// var publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||
@ -78,25 +82,29 @@ class AddICCardLogic extends BaseGetXController{
|
||||
// AppLog.log('添加卡token:$token');
|
||||
|
||||
IoSenderManage.senderAddCardWithTimeCycleCoercionCommand(
|
||||
keyID:'1',
|
||||
userID:await Storage.getUid(),
|
||||
cardNo:0,
|
||||
useCountLimit:0xffff,
|
||||
operate:0, // 0:注册 1:修改 2:删除 3:删除全部
|
||||
isAdmin:state.isAdministrator.value == '2' ? 1 : 0,
|
||||
isForce:state.isCoerced.value == '1' ? 1 : 0, // 是否是胁迫
|
||||
isRound:state.selectType.value == '2' ? 1: 0, // 是否是循环
|
||||
weekRound:DateTool().accordingTheCycleIntoTheCorrespondingNumber(state.weekDay.value), // 周循环
|
||||
startDate: int.parse(state.startDate.value)~/1000,
|
||||
endDate: int.parse(state.endDate.value)~/1000,
|
||||
startTime:DateTool().dateToHNString(state.effectiveDateTime.value),
|
||||
endTime:DateTool().dateToHNString(state.failureDateTime.value),
|
||||
needAuthor:1,
|
||||
signKey:signKeyDataList,
|
||||
privateKey:getPrivateKeyList,
|
||||
token: token,
|
||||
isBeforeAddUser: false
|
||||
);
|
||||
keyID: '1',
|
||||
userID: await Storage.getUid(),
|
||||
cardNo: 0,
|
||||
useCountLimit: 0xffff,
|
||||
operate: 0,
|
||||
// 0:注册 1:修改 2:删除 3:删除全部
|
||||
isAdmin: state.isAdministrator.value == '2' ? 1 : 0,
|
||||
isForce: state.isCoerced.value == '1' ? 1 : 0,
|
||||
// 是否是胁迫
|
||||
isRound: state.selectType.value == '2' ? 1 : 0,
|
||||
// 是否是循环
|
||||
weekRound: DateTool().accordingTheCycleIntoTheCorrespondingNumber(
|
||||
state.weekDay.value),
|
||||
// 周循环
|
||||
startDate: int.parse(state.startDate.value) ~/ 1000,
|
||||
endDate: int.parse(state.endDate.value) ~/ 1000,
|
||||
startTime: DateTool().dateToHNString(state.effectiveDateTime.value),
|
||||
endTime: DateTool().dateToHNString(state.failureDateTime.value),
|
||||
needAuthor: 1,
|
||||
signKey: signKeyDataList,
|
||||
privateKey: getPrivateKeyList,
|
||||
token: token,
|
||||
isBeforeAddUser: false);
|
||||
break;
|
||||
default:
|
||||
//失败
|
||||
@ -113,58 +121,59 @@ class AddICCardLogic extends BaseGetXController{
|
||||
message: '添加卡结果,解析数据',
|
||||
detail: '添加卡结果,解析数据 _replyAddICCardConfirmation:${reply.data}',
|
||||
eventStr: '添加卡事件结果',
|
||||
upload: true
|
||||
);
|
||||
upload: true);
|
||||
|
||||
final String getMobile = (await Storage.getMobile())!;
|
||||
switch(status){
|
||||
switch (status) {
|
||||
case 0x00:
|
||||
//成功
|
||||
UmengCommonSdk.onEvent('add_card', {
|
||||
'lock_name':BlueManage().connectDeviceName,
|
||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
'date':DateTool().getNowDateWithType(1),
|
||||
'add_card_result':'成功',
|
||||
ApmHelper.instance.trackEvent('add_card', {
|
||||
'lock_name': BlueManage().connectDeviceName,
|
||||
'account':
|
||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
'date': DateTool().getNowDateWithType(1),
|
||||
'add_card_result': '成功',
|
||||
});
|
||||
switch(reply.data[5]){
|
||||
switch (reply.data[5]) {
|
||||
case 0xff:
|
||||
// 注册指纹失败
|
||||
// 注册指纹失败
|
||||
showToast('退出添加'.tr);
|
||||
Get.close(1);
|
||||
break;
|
||||
case 0xFE:
|
||||
// 管理员已满
|
||||
// 管理员已满
|
||||
showToast('管理员已满'.tr);
|
||||
Get.close(1);
|
||||
break;
|
||||
case 0xFD:
|
||||
// 用户已满
|
||||
// 用户已满
|
||||
showToast('用户已满'.tr);
|
||||
Get.close(1);
|
||||
break;
|
||||
case 0xFC:
|
||||
// 指纹已满
|
||||
// 指纹已满
|
||||
showToast('锁上面添加卡已满'.tr);
|
||||
Get.close(1);
|
||||
break;
|
||||
case 0xFB:
|
||||
// 指纹已存在
|
||||
// 指纹已存在
|
||||
showToast('卡已存在'.tr);
|
||||
break;
|
||||
default:
|
||||
// 添加指纹中
|
||||
// 当前注册数
|
||||
// 添加指纹中
|
||||
// 当前注册数
|
||||
addICCardData();
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
//失败
|
||||
UmengCommonSdk.onEvent('add_card', {
|
||||
'lock_name':BlueManage().connectDeviceName,
|
||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
'date':DateTool().getNowDateWithType(1),
|
||||
'add_card_result':reply.data[2],
|
||||
ApmHelper.instance.trackEvent('add_card', {
|
||||
'lock_name': BlueManage().connectDeviceName,
|
||||
'account':
|
||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
'date': DateTool().getNowDateWithType(1),
|
||||
'add_card_result': reply.data[2],
|
||||
});
|
||||
break;
|
||||
}
|
||||
@ -175,91 +184,105 @@ class AddICCardLogic extends BaseGetXController{
|
||||
final List<String>? signKey = await Storage.getStringList(saveBlueSignKey);
|
||||
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<String>? token = await Storage.getStringList(saveBlueToken);
|
||||
final List<int> getTokenList = changeStringListToIntList(token!);
|
||||
|
||||
final String command = SenderAddICCardWithTimeCycleCoercionCommand(
|
||||
keyID:'1',
|
||||
userID:await Storage.getUid(),
|
||||
cardNo:0,
|
||||
useCountLimit:0xffff,
|
||||
operate:0, // 0:注册 1:修改 2:删除 3:删除全部
|
||||
isAdmin:state.isAdministrator.value == '2' ? 1 : 0,
|
||||
isForce:state.isCoerced.value == '1' ? 1 : 0, // 是否是胁迫
|
||||
isRound:state.selectType.value == '2' ? 1: 0, // 是否是循环
|
||||
weekRound:DateTool().accordingTheCycleIntoTheCorrespondingNumber(state.weekDay.value), // 周循环
|
||||
startDate: int.parse(state.startDate.value)~/1000,
|
||||
endDate: int.parse(state.endDate.value)~/1000,
|
||||
startTime:DateTool().dateToHNString(state.effectiveDateTime.value),
|
||||
endTime:DateTool().dateToHNString(state.failureDateTime.value),
|
||||
needAuthor:1,
|
||||
signKey:signKeyDataList,
|
||||
privateKey:getPrivateKeyList,
|
||||
token: getTokenList,
|
||||
keyID: '1',
|
||||
userID: await Storage.getUid(),
|
||||
cardNo: 0,
|
||||
useCountLimit: 0xffff,
|
||||
operate: 0,
|
||||
// 0:注册 1:修改 2:删除 3:删除全部
|
||||
isAdmin: state.isAdministrator.value == '2' ? 1 : 0,
|
||||
isForce: state.isCoerced.value == '1' ? 1 : 0,
|
||||
// 是否是胁迫
|
||||
isRound: state.selectType.value == '2' ? 1 : 0,
|
||||
// 是否是循环
|
||||
weekRound: DateTool()
|
||||
.accordingTheCycleIntoTheCorrespondingNumber(state.weekDay.value),
|
||||
// 周循环
|
||||
startDate: int.parse(state.startDate.value) ~/ 1000,
|
||||
endDate: int.parse(state.endDate.value) ~/ 1000,
|
||||
startTime: DateTool().dateToHNString(state.effectiveDateTime.value),
|
||||
endTime: DateTool().dateToHNString(state.failureDateTime.value),
|
||||
needAuthor: 1,
|
||||
signKey: signKeyDataList,
|
||||
privateKey: getPrivateKeyList,
|
||||
token: getTokenList,
|
||||
).toString();
|
||||
|
||||
showBlueConnetctToastTimer(action: () async {
|
||||
final String getMobile = (await Storage.getMobile())!;
|
||||
UmengCommonSdk.onEvent('add_card', {
|
||||
'lock_name':BlueManage().connectDeviceName,
|
||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
'date':DateTool().getNowDateWithType(1),
|
||||
'add_card_result':'添加卡超时',
|
||||
ApmHelper.instance.trackEvent('add_card', {
|
||||
'lock_name': BlueManage().connectDeviceName,
|
||||
'account':
|
||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
'date': DateTool().getNowDateWithType(1),
|
||||
'add_card_result': '添加卡超时',
|
||||
});
|
||||
|
||||
BuglyTool.uploadException(
|
||||
message: '添加卡超时处理-添加卡失败',
|
||||
detail: '添加卡超时处理,断开连接,添加卡失败--SenderAddICCardWithTimeCycleCoercionCommand:$command',
|
||||
detail:
|
||||
'添加卡超时处理,断开连接,添加卡失败--SenderAddICCardWithTimeCycleCoercionCommand:$command',
|
||||
eventStr: '添加卡事件超时',
|
||||
upload: true
|
||||
);
|
||||
upload: true);
|
||||
|
||||
Get.close(1);
|
||||
});
|
||||
BlueManage().blueSendData(BlueManage().connectDeviceName, (BluetoothConnectionState deviceConnectionState) async {
|
||||
if (deviceConnectionState == BluetoothConnectionState.connected){
|
||||
BlueManage().blueSendData(BlueManage().connectDeviceName,
|
||||
(BluetoothConnectionState deviceConnectionState) async {
|
||||
if (deviceConnectionState == BluetoothConnectionState.connected) {
|
||||
cancelBlueConnetctToastTimer();
|
||||
|
||||
IoSenderManage.senderAddCardWithTimeCycleCoercionCommand(
|
||||
keyID:'1',
|
||||
userID:await Storage.getUid(),
|
||||
cardNo:0,
|
||||
useCountLimit:0xffff,
|
||||
operate:0, // 0:注册 1:修改 2:删除 3:删除全部
|
||||
isAdmin:state.isAdministrator.value == '2' ? 1 : 0,
|
||||
isForce:state.isCoerced.value == '1' ? 1 : 0, // 是否是胁迫
|
||||
isRound:state.selectType.value == '2' ? 1: 0, // 是否是循环
|
||||
weekRound:DateTool().accordingTheCycleIntoTheCorrespondingNumber(state.weekDay.value), // 周循环
|
||||
startDate: int.parse(state.startDate.value)~/1000,
|
||||
endDate: int.parse(state.endDate.value)~/1000,
|
||||
startTime:DateTool().dateToHNString(state.effectiveDateTime.value),
|
||||
endTime:DateTool().dateToHNString(state.failureDateTime.value),
|
||||
needAuthor:1,
|
||||
signKey:signKeyDataList,
|
||||
privateKey:getPrivateKeyList,
|
||||
token: getTokenList,
|
||||
isBeforeAddUser: false
|
||||
);
|
||||
} else if (deviceConnectionState == BluetoothConnectionState.disconnected){
|
||||
keyID: '1',
|
||||
userID: await Storage.getUid(),
|
||||
cardNo: 0,
|
||||
useCountLimit: 0xffff,
|
||||
operate: 0,
|
||||
// 0:注册 1:修改 2:删除 3:删除全部
|
||||
isAdmin: state.isAdministrator.value == '2' ? 1 : 0,
|
||||
isForce: state.isCoerced.value == '1' ? 1 : 0,
|
||||
// 是否是胁迫
|
||||
isRound: state.selectType.value == '2' ? 1 : 0,
|
||||
// 是否是循环
|
||||
weekRound: DateTool().accordingTheCycleIntoTheCorrespondingNumber(
|
||||
state.weekDay.value),
|
||||
// 周循环
|
||||
startDate: int.parse(state.startDate.value) ~/ 1000,
|
||||
endDate: int.parse(state.endDate.value) ~/ 1000,
|
||||
startTime: DateTool().dateToHNString(state.effectiveDateTime.value),
|
||||
endTime: DateTool().dateToHNString(state.failureDateTime.value),
|
||||
needAuthor: 1,
|
||||
signKey: signKeyDataList,
|
||||
privateKey: getPrivateKeyList,
|
||||
token: getTokenList,
|
||||
isBeforeAddUser: false);
|
||||
} else if (deviceConnectionState ==
|
||||
BluetoothConnectionState.disconnected) {
|
||||
final String getMobile = (await Storage.getMobile())!;
|
||||
UmengCommonSdk.onEvent('add_card', {
|
||||
'lock_name':BlueManage().connectDeviceName,
|
||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
'date':DateTool().getNowDateWithType(1),
|
||||
'add_card_result':'添加卡断开连接',
|
||||
ApmHelper.instance.trackEvent('add_card', {
|
||||
'lock_name': BlueManage().connectDeviceName,
|
||||
'account':
|
||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
'date': DateTool().getNowDateWithType(1),
|
||||
'add_card_result': '添加卡断开连接',
|
||||
});
|
||||
|
||||
BuglyTool.uploadException(
|
||||
message: '添加卡超时处理-添加卡失败',
|
||||
detail: '添加卡超时处理,断开连接,添加卡失败--SenderAddICCardWithTimeCycleCoercionCommand:$command',
|
||||
detail:
|
||||
'添加卡超时处理,断开连接,添加卡失败--SenderAddICCardWithTimeCycleCoercionCommand:$command',
|
||||
eventStr: '添加卡事件断开连接',
|
||||
upload: true
|
||||
);
|
||||
upload: true);
|
||||
|
||||
if(state.ifCurrentScreen.value == true){
|
||||
if (state.ifCurrentScreen.value == true) {
|
||||
showBlueConnetctToast();
|
||||
}
|
||||
cancelBlueConnetctToastTimer();
|
||||
@ -270,27 +293,32 @@ class AddICCardLogic extends BaseGetXController{
|
||||
|
||||
// 取消添加指纹
|
||||
Future<void> senderCancelAddCardCommand() async {
|
||||
BlueManage().blueSendData(BlueManage().connectDeviceName, (BluetoothConnectionState deviceConnectionState) async {
|
||||
if (deviceConnectionState == BluetoothConnectionState.connected){
|
||||
final List<String>? privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||
final List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||
BlueManage().blueSendData(BlueManage().connectDeviceName,
|
||||
(BluetoothConnectionState deviceConnectionState) async {
|
||||
if (deviceConnectionState == BluetoothConnectionState.connected) {
|
||||
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<String>? token = await Storage.getStringList(saveBlueToken);
|
||||
final List<int> getTokenList = changeStringListToIntList(token!);
|
||||
|
||||
IoSenderManage.senderCancelAddCardCommand(
|
||||
keyID:'1',
|
||||
userID:await Storage.getUid(),
|
||||
needAuthor:1,
|
||||
signKey:signKeyDataList,
|
||||
privateKey:getPrivateKeyList,
|
||||
keyID: '1',
|
||||
userID: await Storage.getUid(),
|
||||
needAuthor: 1,
|
||||
signKey: signKeyDataList,
|
||||
privateKey: getPrivateKeyList,
|
||||
token: getTokenList,
|
||||
);
|
||||
}else if (deviceConnectionState == BluetoothConnectionState.disconnected){
|
||||
if(state.ifCurrentScreen.value == true){
|
||||
} else if (deviceConnectionState ==
|
||||
BluetoothConnectionState.disconnected) {
|
||||
if (state.ifCurrentScreen.value == true) {
|
||||
showBlueConnetctToast();
|
||||
}
|
||||
cancelBlueConnetctToastTimer();
|
||||
@ -319,18 +347,20 @@ class AddICCardLogic extends BaseGetXController{
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> updateIdCardUserNoLoadData(String cardId) async{
|
||||
final LoginEntity entity = await ApiRepository.to.updateIdCardUserNoLoadData(
|
||||
Future<void> updateIdCardUserNoLoadData(String cardId) async {
|
||||
final LoginEntity entity =
|
||||
await ApiRepository.to.updateIdCardUserNoLoadData(
|
||||
lockId: state.lockId.value.toString(),
|
||||
cardId: cardId,
|
||||
cardUserNo: state.cardNumber.value,
|
||||
);
|
||||
if(entity.errorCode!.codeIsSuccessful){
|
||||
showToast('添加成功'.tr, something:(){
|
||||
if(state.fromType.value == 2){
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
showToast('添加成功'.tr, something: () {
|
||||
if (state.fromType.value == 2) {
|
||||
// 回调指纹号
|
||||
eventBus.fire(ChickInAddStaffCardAndFingerprintBlockNumberEvent(state.cardNumber.value));
|
||||
}else if(state.fromType.value == 1){
|
||||
eventBus.fire(ChickInAddStaffCardAndFingerprintBlockNumberEvent(
|
||||
state.cardNumber.value));
|
||||
} else if (state.fromType.value == 1) {
|
||||
eventBus.fire(OtherTypeRefreshListEvent());
|
||||
}
|
||||
Get.close(2);
|
||||
@ -356,5 +386,4 @@ class AddICCardLogic extends BaseGetXController{
|
||||
void onClose() {
|
||||
_replySubscription.cancel();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,8 +2,7 @@ import 'dart:async';
|
||||
|
||||
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||
import 'package:star_lock/app_settings/app_settings.dart';
|
||||
import 'package:star_lock/apm/apm_helper.dart';
|
||||
|
||||
import 'package:star_lock/main/lockDetail/doorLockLog/doorLockLog_entity.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/dateTool.dart';
|
||||
import 'package:star_lock/tools/eventBusEventManage.dart';
|
||||
import 'package:umeng_common_sdk/umeng_common_sdk.dart';
|
||||
|
||||
import '../../../blue/blue_manage.dart';
|
||||
import '../../../blue/io_protocol/io_referEventRecordTime.dart';
|
||||
@ -151,7 +149,7 @@ class DoorLockLogLogic extends BaseGetXController {
|
||||
cancelBlueConnetctToastTimer();
|
||||
|
||||
final String getMobile = (await Storage.getMobile())!;
|
||||
UmengCommonSdk.onEvent('check_doorLockLog', {
|
||||
ApmHelper.instance.trackEvent('check_doorLockLog', {
|
||||
'lockName': state.keyInfos.value.lockName!,
|
||||
'account':
|
||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
@ -205,7 +203,7 @@ class DoorLockLogLogic extends BaseGetXController {
|
||||
cancelBlueConnetctToastTimer();
|
||||
|
||||
final String getMobile = (await Storage.getMobile())!;
|
||||
UmengCommonSdk.onEvent('check_doorLockLog', {
|
||||
ApmHelper.instance.trackEvent('check_doorLockLog', {
|
||||
'lockName': state.keyInfos.value.lockName!,
|
||||
'account':
|
||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
@ -303,7 +301,7 @@ class DoorLockLogLogic extends BaseGetXController {
|
||||
showEasyLoading();
|
||||
getLockRecordLastUploadDataTime();
|
||||
} else {
|
||||
UmengCommonSdk.onEvent('check_doorLockLog', {
|
||||
ApmHelper.instance.trackEvent('check_doorLockLog', {
|
||||
'lockName': state.keyInfos.value.lockName!,
|
||||
'account':
|
||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
@ -314,7 +312,7 @@ class DoorLockLogLogic extends BaseGetXController {
|
||||
}
|
||||
dismissEasyLoading();
|
||||
} else {
|
||||
UmengCommonSdk.onEvent('check_doorLockLog', {
|
||||
ApmHelper.instance.trackEvent('check_doorLockLog', {
|
||||
'lockName': state.keyInfos.value.lockName!,
|
||||
'account':
|
||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/apm/apm_helper.dart';
|
||||
import 'package:star_lock/appRouters.dart';
|
||||
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.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/showTipView.dart';
|
||||
import 'package:star_lock/tools/storage.dart';
|
||||
import 'package:umeng_common_sdk/umeng_common_sdk.dart';
|
||||
|
||||
import '../../../../../../blue/blue_manage.dart';
|
||||
|
||||
@ -185,7 +185,7 @@ class SendElectronicKeyViewLogic extends BaseGetXController {
|
||||
: '');
|
||||
final String getMobile = (await Storage.getMobile())!;
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
UmengCommonSdk.onEvent('add_electronic_key', {
|
||||
ApmHelper.instance.trackEvent('add_electronic_key', {
|
||||
'lock_name':BlueManage().connectDeviceName,
|
||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
'date':DateTool().getNowDateWithType(1),
|
||||
@ -201,7 +201,7 @@ class SendElectronicKeyViewLogic extends BaseGetXController {
|
||||
update();
|
||||
eventBus.fire(ElectronicKeyListRefreshUI());
|
||||
} else {
|
||||
UmengCommonSdk.onEvent('add_electronic_key', {
|
||||
ApmHelper.instance.trackEvent('add_electronic_key', {
|
||||
'lock_name':BlueManage().connectDeviceName,
|
||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
'date':DateTool().getNowDateWithType(1),
|
||||
|
||||
@ -3,11 +3,10 @@ import 'dart:async';
|
||||
|
||||
import 'package:flutter_blue_plus/flutter_blue_plus.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/main/lockDetail/fingerprint/addFingerprint/addFingerprint_entity.dart';
|
||||
import 'package:star_lock/tools/dateTool.dart';
|
||||
import 'package:umeng_common_sdk/umeng_common_sdk.dart';
|
||||
|
||||
import '../../../../../blue/blue_manage.dart';
|
||||
import '../../../../../blue/io_reply.dart';
|
||||
@ -171,7 +170,7 @@ class AddFingerprintLogic extends BaseGetXController {
|
||||
case 0x00:
|
||||
//成功
|
||||
// var fingerprintNum = listChangInt(reply.data.sublist(9, 11)).toString();
|
||||
UmengCommonSdk.onEvent('add_fingerprint', {
|
||||
ApmHelper.instance.trackEvent('add_fingerprint', {
|
||||
'lock_name':BlueManage().connectDeviceName,
|
||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
'date':DateTool().getNowDateWithType(1),
|
||||
@ -203,7 +202,7 @@ class AddFingerprintLogic extends BaseGetXController {
|
||||
break;
|
||||
default:
|
||||
//失败
|
||||
UmengCommonSdk.onEvent('add_fingerprint', {
|
||||
ApmHelper.instance.trackEvent('add_fingerprint', {
|
||||
'lock_name':BlueManage().connectDeviceName,
|
||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
'date':DateTool().getNowDateWithType(1),
|
||||
@ -254,7 +253,7 @@ class AddFingerprintLogic extends BaseGetXController {
|
||||
|
||||
showBlueConnetctToastTimer(action: () async {
|
||||
final String getMobile = (await Storage.getMobile())!;
|
||||
UmengCommonSdk.onEvent('add_fingerprint', {
|
||||
ApmHelper.instance.trackEvent('add_fingerprint', {
|
||||
'lock_name':BlueManage().connectDeviceName,
|
||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
'date':DateTool().getNowDateWithType(1),
|
||||
@ -302,7 +301,7 @@ class AddFingerprintLogic extends BaseGetXController {
|
||||
);
|
||||
}else if (deviceConnectionState == BluetoothConnectionState.disconnected){
|
||||
final String getMobile = (await Storage.getMobile())!;
|
||||
UmengCommonSdk.onEvent('add_fingerprint', {
|
||||
ApmHelper.instance.trackEvent('add_fingerprint', {
|
||||
'lock_name':BlueManage().connectDeviceName,
|
||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
'date':DateTool().getNowDateWithType(1),
|
||||
|
||||
@ -6,6 +6,7 @@ import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:intl/intl.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/login/login/entity/LoginEntity.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/throttler.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 '../../../blue/blue_manage.dart';
|
||||
@ -71,7 +71,7 @@ class LockDetailLogic extends BaseGetXController {
|
||||
|
||||
if (status != 6) {
|
||||
final String getMobile = (await Storage.getMobile())!;
|
||||
UmengCommonSdk.onEvent('open_lock', {
|
||||
ApmHelper.instance.trackEvent('open_lock', {
|
||||
'lock_name': state.keyInfos.value.lockName!,
|
||||
'account':
|
||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
@ -378,7 +378,7 @@ class LockDetailLogic extends BaseGetXController {
|
||||
outTimer: 20,
|
||||
action: () async {
|
||||
final String getMobile = (await Storage.getMobile())!;
|
||||
UmengCommonSdk.onEvent('open_lock', {
|
||||
ApmHelper.instance.trackEvent('open_lock', {
|
||||
'lock_name': state.keyInfos.value.lockName!,
|
||||
'account':
|
||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
@ -422,7 +422,7 @@ class LockDetailLogic extends BaseGetXController {
|
||||
detail: '蓝牙连接失败,断开连接, 开锁失败--OpenLockCommand:$command',
|
||||
upload: true);
|
||||
final String getMobile = (await Storage.getMobile())!;
|
||||
UmengCommonSdk.onEvent('open_lock', {
|
||||
ApmHelper.instance.trackEvent('open_lock', {
|
||||
'lock_name': state.keyInfos.value.lockName!,
|
||||
'account':
|
||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
|
||||
@ -3,9 +3,9 @@ import 'dart:async';
|
||||
import 'package:flutter/scheduler.dart';
|
||||
import 'package:flutter_blue_plus/flutter_blue_plus.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/main/lockMian/entity/lockListInfo_entity.dart';
|
||||
import 'package:umeng_common_sdk/umeng_common_sdk.dart';
|
||||
|
||||
import '../../../../blue/blue_manage.dart';
|
||||
import '../../../../blue/io_protocol/io_factoryDataReset.dart';
|
||||
@ -294,7 +294,7 @@ class LockSetLogic extends BaseGetXController {
|
||||
isShowBlueConnetctToast: false,
|
||||
action: () async {
|
||||
final String getMobile = (await Storage.getMobile())!;
|
||||
UmengCommonSdk.onEvent('delet_lock', {
|
||||
ApmHelper.instance.trackEvent('delet_lock', {
|
||||
'lock_name': BlueManage().connectDeviceName,
|
||||
'account':
|
||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
@ -332,7 +332,7 @@ class LockSetLogic extends BaseGetXController {
|
||||
token: getTokenList);
|
||||
} else if (connectionState == BluetoothConnectionState.disconnected) {
|
||||
final String getMobile = (await Storage.getMobile())!;
|
||||
UmengCommonSdk.onEvent('delet_lock', {
|
||||
ApmHelper.instance.trackEvent('delet_lock', {
|
||||
'lock_name': BlueManage().connectDeviceName,
|
||||
'account':
|
||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
@ -538,6 +538,7 @@ class LockSetLogic extends BaseGetXController {
|
||||
|
||||
// 下级界面修改成功后传递数据
|
||||
StreamSubscription? _passCurrentLockInformationEvent;
|
||||
|
||||
void initLoadDataAction(BlockSetStateCallback blockSetStateCallback) {
|
||||
// 蓝牙协议通知传输跟蓝牙之外的数据传输类不一样 eventBus
|
||||
_passCurrentLockInformationEvent = eventBus
|
||||
@ -597,7 +598,7 @@ class LockSetLogic extends BaseGetXController {
|
||||
);
|
||||
final String getMobile = (await Storage.getMobile())!;
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
UmengCommonSdk.onEvent('delet_lock', {
|
||||
ApmHelper.instance.trackEvent('delet_lock', {
|
||||
'lock_name': BlueManage().connectDeviceName,
|
||||
'account':
|
||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
@ -616,7 +617,7 @@ class LockSetLogic extends BaseGetXController {
|
||||
eventBus.fire(RefreshLockListInfoDataEvent());
|
||||
});
|
||||
} else {
|
||||
UmengCommonSdk.onEvent('delet_lock', {
|
||||
ApmHelper.instance.trackEvent('delet_lock', {
|
||||
'lock_name': BlueManage().connectDeviceName,
|
||||
'account':
|
||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
@ -636,7 +637,7 @@ class LockSetLogic extends BaseGetXController {
|
||||
state.deleteAdministratorIsHaveAllData.value == true ? 1 : 0);
|
||||
final String getMobile = (await Storage.getMobile())!;
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
UmengCommonSdk.onEvent('delet_lock', {
|
||||
ApmHelper.instance.trackEvent('delet_lock', {
|
||||
'lock_name': BlueManage().connectDeviceName,
|
||||
'account':
|
||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
@ -655,7 +656,7 @@ class LockSetLogic extends BaseGetXController {
|
||||
eventBus.fire(RefreshLockListInfoDataEvent());
|
||||
});
|
||||
} else {
|
||||
UmengCommonSdk.onEvent('delet_lock', {
|
||||
ApmHelper.instance.trackEvent('delet_lock', {
|
||||
'lock_name': BlueManage().connectDeviceName,
|
||||
'account':
|
||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
|
||||
@ -2,11 +2,11 @@ import 'dart:async';
|
||||
|
||||
import 'package:flutter_blue_plus/flutter_blue_plus.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/passwordKey_perpetual_state.dart';
|
||||
import 'package:star_lock/network/api_repository.dart';
|
||||
import 'package:star_lock/tools/eventBusEventManage.dart';
|
||||
import 'package:umeng_common_sdk/umeng_common_sdk.dart';
|
||||
|
||||
import '../../../../blue/blue_manage.dart';
|
||||
import '../../../../blue/io_modelVendor.dart';
|
||||
@ -182,7 +182,7 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
|
||||
pwdRight: state.isAdministrator.value == true ? 1 : 0);
|
||||
final String getMobile = (await Storage.getMobile())!;
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
UmengCommonSdk.onEvent('add_password', {
|
||||
ApmHelper.instance.trackEvent('add_password', {
|
||||
'lock_name':BlueManage().connectDeviceName,
|
||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
'date':DateTool().getNowDateWithType(1),
|
||||
@ -199,7 +199,7 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
|
||||
updatePWDNumberRequest(entity.data!.keyboardPwdId.toString());
|
||||
}
|
||||
} else {
|
||||
UmengCommonSdk.onEvent('add_password', {
|
||||
ApmHelper.instance.trackEvent('add_password', {
|
||||
'lock_name':BlueManage().connectDeviceName,
|
||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
'date':DateTool().getNowDateWithType(1),
|
||||
@ -419,7 +419,7 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
|
||||
showEasyLoading();
|
||||
showBlueConnetctToastTimer(action: () async {
|
||||
final String getMobile = (await Storage.getMobile())!;
|
||||
UmengCommonSdk.onEvent('add_password', {
|
||||
ApmHelper.instance.trackEvent('add_password', {
|
||||
'lock_name':BlueManage().connectDeviceName,
|
||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
'date':DateTool().getNowDateWithType(1),
|
||||
@ -465,7 +465,7 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
|
||||
token: getTokenList);
|
||||
} else if (deviceConnectionState == BluetoothConnectionState.disconnected) {
|
||||
final String getMobile = (await Storage.getMobile())!;
|
||||
UmengCommonSdk.onEvent('add_password', {
|
||||
ApmHelper.instance.trackEvent('add_password', {
|
||||
'lock_name':BlueManage().connectDeviceName,
|
||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
'date':DateTool().getNowDateWithType(1),
|
||||
|
||||
@ -3,10 +3,10 @@ import 'dart:async';
|
||||
|
||||
import 'package:flutter_blue_plus/flutter_blue_plus.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/mine/addLock/saveLock/entity/SaveLockEntity.dart';
|
||||
import 'package:umeng_common_sdk/umeng_common_sdk.dart';
|
||||
|
||||
import '../../../app_settings/app_settings.dart';
|
||||
import '../../../blue/blue_manage.dart';
|
||||
@ -407,7 +407,7 @@ class SaveLockLogic extends BaseGetXController {
|
||||
state.lockId = entity.data!.lockId!;
|
||||
|
||||
final String getMobile = (await Storage.getMobile())!;
|
||||
UmengCommonSdk.onEvent('save_lock_result', {
|
||||
ApmHelper.instance.trackEvent('save_lock_result', {
|
||||
'lock_name':BlueManage().connectDeviceName,
|
||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
'date':DateTool().getNowDateWithType(1),
|
||||
@ -423,7 +423,7 @@ class SaveLockLogic extends BaseGetXController {
|
||||
state.sureBtnState.value = 0;
|
||||
|
||||
final String getMobile = (await Storage.getMobile())!;
|
||||
UmengCommonSdk.onEvent('save_lock_result', {
|
||||
ApmHelper.instance.trackEvent('save_lock_result', {
|
||||
'lock_name':BlueManage().connectDeviceName,
|
||||
'account':getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
'date':DateTool().getNowDateWithType(1),
|
||||
|
||||
@ -2,6 +2,7 @@ import 'dart:async';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/apm/apm_helper.dart';
|
||||
import 'package:star_lock/appRouters.dart';
|
||||
import 'package:star_lock/login/login/entity/LoginEntity.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/storage.dart';
|
||||
import 'package:star_lock/versionUndate/versionUndate_entity.dart';
|
||||
import 'package:umeng_common_sdk/umeng_common_sdk.dart';
|
||||
|
||||
import '../../../../network/api_repository.dart';
|
||||
import '../../../../tools/baseGetXController.dart';
|
||||
@ -131,7 +131,7 @@ class MineSetLogic extends BaseGetXController {
|
||||
await ApiRepository.to.userLogout(deviceld: getPushDeviceID);
|
||||
final String getMobile = (await Storage.getMobile())!;
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
UmengCommonSdk.onEvent('logout', {
|
||||
ApmHelper.instance.trackEvent('logout', {
|
||||
'lock_name': BlueManage().connectDeviceName,
|
||||
'account':
|
||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
@ -149,7 +149,7 @@ class MineSetLogic extends BaseGetXController {
|
||||
XSJPushProvider().initLocalNotification(isCancelLocalPush: true);
|
||||
Get.offNamedUntil(Routers.starLockLoginPage, (Route route) => false);
|
||||
} else {
|
||||
UmengCommonSdk.onEvent('logout', {
|
||||
ApmHelper.instance.trackEvent('logout', {
|
||||
'lock_name': BlueManage().connectDeviceName,
|
||||
'account':
|
||||
getMobile.isNotEmpty ? getMobile : (await Storage.getEmail())!,
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:star_lock/apm/apm_helper.dart';
|
||||
|
||||
import '../login/login/entity/LoginData.dart';
|
||||
import '../main/lockMian/entity/lockListInfo_entity.dart';
|
||||
@ -192,12 +193,14 @@ class Storage {
|
||||
final String? data = await Storage.getString(saveUserLoginData);
|
||||
if (data != null && data.isNotEmpty) {
|
||||
loginData = LoginData.fromJson(jsonDecode(data));
|
||||
ApmHelper.instance.login(loginData.userid!.toString());
|
||||
}
|
||||
// AppLog.log("loginData:$loginData");
|
||||
return loginData;
|
||||
}
|
||||
|
||||
static Future<void> saveLoginData(LoginData? data) async {
|
||||
ApmHelper.instance.login(data!.userid!.toString());
|
||||
await Storage.setString(saveUserLoginData, jsonEncode(data));
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user