1、优化绑定锁流程。2、修改卡、指纹、人脸密码开锁记录不显示问题。3、优化其他已知问题
This commit is contained in:
parent
cb4a748bc0
commit
ed9cc12e36
@ -43,14 +43,14 @@ PODS:
|
|||||||
- ReachabilitySwift
|
- ReachabilitySwift
|
||||||
- device_info_plus (0.0.1):
|
- device_info_plus (0.0.1):
|
||||||
- Flutter
|
- Flutter
|
||||||
- DKImagePickerController/Core (4.3.4):
|
- DKImagePickerController/Core (4.3.7):
|
||||||
- DKImagePickerController/ImageDataManager
|
- DKImagePickerController/ImageDataManager
|
||||||
- DKImagePickerController/Resource
|
- DKImagePickerController/Resource
|
||||||
- DKImagePickerController/ImageDataManager (4.3.4)
|
- DKImagePickerController/ImageDataManager (4.3.7)
|
||||||
- DKImagePickerController/PhotoGallery (4.3.4):
|
- DKImagePickerController/PhotoGallery (4.3.7):
|
||||||
- DKImagePickerController/Core
|
- DKImagePickerController/Core
|
||||||
- DKPhotoGallery
|
- DKPhotoGallery
|
||||||
- DKImagePickerController/Resource (4.3.4)
|
- DKImagePickerController/Resource (4.3.7)
|
||||||
- DKPhotoGallery (0.0.17):
|
- DKPhotoGallery (0.0.17):
|
||||||
- DKPhotoGallery/Core (= 0.0.17)
|
- DKPhotoGallery/Core (= 0.0.17)
|
||||||
- DKPhotoGallery/Model (= 0.0.17)
|
- DKPhotoGallery/Model (= 0.0.17)
|
||||||
@ -130,7 +130,7 @@ PODS:
|
|||||||
- FlutterMacOS
|
- FlutterMacOS
|
||||||
- permission_handler_apple (9.3.0):
|
- permission_handler_apple (9.3.0):
|
||||||
- Flutter
|
- Flutter
|
||||||
- ReachabilitySwift (5.2.1)
|
- ReachabilitySwift (5.2.2)
|
||||||
- SDWebImage (5.19.1):
|
- SDWebImage (5.19.1):
|
||||||
- SDWebImage/Core (= 5.19.1)
|
- SDWebImage/Core (= 5.19.1)
|
||||||
- SDWebImage/Core (5.19.1)
|
- SDWebImage/Core (5.19.1)
|
||||||
@ -143,7 +143,7 @@ PODS:
|
|||||||
- SwiftyGif (5.4.5)
|
- SwiftyGif (5.4.5)
|
||||||
- system_settings (0.0.1):
|
- system_settings (0.0.1):
|
||||||
- Flutter
|
- Flutter
|
||||||
- Toast (4.1.0)
|
- Toast (4.1.1)
|
||||||
- url_launcher_ios (0.0.1):
|
- url_launcher_ios (0.0.1):
|
||||||
- Flutter
|
- Flutter
|
||||||
- video_player_avfoundation (0.0.1):
|
- video_player_avfoundation (0.0.1):
|
||||||
@ -312,7 +312,7 @@ SPEC CHECKSUMS:
|
|||||||
camera_avfoundation: 8b8d780bcfb6a4a02b0fbe2b4bd17b5b71946e68
|
camera_avfoundation: 8b8d780bcfb6a4a02b0fbe2b4bd17b5b71946e68
|
||||||
connectivity_plus: bf0076dd84a130856aa636df1c71ccaff908fa1d
|
connectivity_plus: bf0076dd84a130856aa636df1c71ccaff908fa1d
|
||||||
device_info_plus: e5c5da33f982a436e103237c0c85f9031142abed
|
device_info_plus: e5c5da33f982a436e103237c0c85f9031142abed
|
||||||
DKImagePickerController: b512c28220a2b8ac7419f21c491fc8534b7601ac
|
DKImagePickerController: 0a24ebfe7b48beeb74c27531540aaa2cc1dac6cf
|
||||||
DKPhotoGallery: fdfad5125a9fdda9cc57df834d49df790dbb4179
|
DKPhotoGallery: fdfad5125a9fdda9cc57df834d49df790dbb4179
|
||||||
EMASRest: 8df6f87836767a9415ad5cc4af739bc9d215b475
|
EMASRest: 8df6f87836767a9415ad5cc4af739bc9d215b475
|
||||||
file_picker: ce3938a0df3cc1ef404671531facef740d03f920
|
file_picker: ce3938a0df3cc1ef404671531facef740d03f920
|
||||||
@ -322,7 +322,7 @@ SPEC CHECKSUMS:
|
|||||||
flutter_native_contact_picker: bd430ba0fbf82768bb50c2c52a69a65759a8f907
|
flutter_native_contact_picker: bd430ba0fbf82768bb50c2c52a69a65759a8f907
|
||||||
flutter_pcm_sound: de0572ca4f99091cc2abfcc31601b8a4ddd33c0e
|
flutter_pcm_sound: de0572ca4f99091cc2abfcc31601b8a4ddd33c0e
|
||||||
flutter_voice_processor: 2b89b93d69b02227ae3fd58589ee0bcfa3ca2a82
|
flutter_voice_processor: 2b89b93d69b02227ae3fd58589ee0bcfa3ca2a82
|
||||||
fluttertoast: 31b00dabfa7fb7bacd9e7dbee580d7a2ff4bf265
|
fluttertoast: 9f2f8e81bb5ce18facb9748d7855bf5a756fe3db
|
||||||
fluwx: daa284756ce53442b3d0417ceeda66e981906811
|
fluwx: daa284756ce53442b3d0417ceeda66e981906811
|
||||||
google_maps_flutter_ios: d1318b4ff711612cab16862d7a87e31a7403d458
|
google_maps_flutter_ios: d1318b4ff711612cab16862d7a87e31a7403d458
|
||||||
GoogleMaps: 20d7b12be49a14287f797e88e0e31bc4156aaeb4
|
GoogleMaps: 20d7b12be49a14287f797e88e0e31bc4156aaeb4
|
||||||
@ -337,13 +337,13 @@ SPEC CHECKSUMS:
|
|||||||
package_info_plus: 6c92f08e1f853dc01228d6f553146438dafcd14e
|
package_info_plus: 6c92f08e1f853dc01228d6f553146438dafcd14e
|
||||||
path_provider_foundation: 3784922295ac71e43754bd15e0653ccfd36a147c
|
path_provider_foundation: 3784922295ac71e43754bd15e0653ccfd36a147c
|
||||||
permission_handler_apple: 9878588469a2b0d0fc1e048d9f43605f92e6cec2
|
permission_handler_apple: 9878588469a2b0d0fc1e048d9f43605f92e6cec2
|
||||||
ReachabilitySwift: 5ae15e16814b5f9ef568963fb2c87aeb49158c66
|
ReachabilitySwift: 2128f3a8c9107e1ad33574c6e58e8285d460b149
|
||||||
SDWebImage: 40b0b4053e36c660a764958bff99eed16610acbb
|
SDWebImage: 40b0b4053e36c660a764958bff99eed16610acbb
|
||||||
shared_preferences_foundation: b4c3b4cddf1c21f02770737f147a3f5da9d39695
|
shared_preferences_foundation: b4c3b4cddf1c21f02770737f147a3f5da9d39695
|
||||||
sqflite: 673a0e54cc04b7d6dba8d24fb8095b31c3a99eec
|
sqflite: 673a0e54cc04b7d6dba8d24fb8095b31c3a99eec
|
||||||
SwiftyGif: 706c60cf65fa2bc5ee0313beece843c8eb8194d4
|
SwiftyGif: 706c60cf65fa2bc5ee0313beece843c8eb8194d4
|
||||||
system_settings: 8f5cdbfa72c677fc8d665b863bcc20d393d87e9d
|
system_settings: 8f5cdbfa72c677fc8d665b863bcc20d393d87e9d
|
||||||
Toast: ec33c32b8688982cecc6348adeae667c1b9938da
|
Toast: 1f5ea13423a1e6674c4abdac5be53587ae481c4e
|
||||||
url_launcher_ios: bbd758c6e7f9fd7b5b1d4cde34d2b95fcce5e812
|
url_launcher_ios: bbd758c6e7f9fd7b5b1d4cde34d2b95fcce5e812
|
||||||
video_player_avfoundation: 02011213dab73ae3687df27ce441fbbcc82b5579
|
video_player_avfoundation: 02011213dab73ae3687df27ce441fbbcc82b5579
|
||||||
webview_flutter_wkwebview: 4f3e50f7273d31e5500066ed267e3ae4309c5ae4
|
webview_flutter_wkwebview: 4f3e50f7273d31e5500066ed267e3ae4309c5ae4
|
||||||
@ -351,4 +351,4 @@ SPEC CHECKSUMS:
|
|||||||
|
|
||||||
PODFILE CHECKSUM: 317f9473a5705c6fe4d79d95e81676f248048fdc
|
PODFILE CHECKSUM: 317f9473a5705c6fe4d79d95e81676f248048fdc
|
||||||
|
|
||||||
COCOAPODS: 1.14.3
|
COCOAPODS: 1.15.2
|
||||||
|
|||||||
@ -7,7 +7,6 @@ import 'package:star_lock/login/register/starLock_register_binding.dart';
|
|||||||
import 'package:star_lock/login/register/starLock_register_xhj_page.dart';
|
import 'package:star_lock/login/register/starLock_register_xhj_page.dart';
|
||||||
import 'package:star_lock/main/lockDetail/accessoriesList/accessoriesList_page.dart';
|
import 'package:star_lock/main/lockDetail/accessoriesList/accessoriesList_page.dart';
|
||||||
import 'package:star_lock/main/lockDetail/doorLockLog/doorLockLog_page.dart';
|
import 'package:star_lock/main/lockDetail/doorLockLog/doorLockLog_page.dart';
|
||||||
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecord/keyOperationRecord_page.dart';
|
|
||||||
|
|
||||||
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserList_page.dart';
|
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserList_page.dart';
|
||||||
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupList_page.dart';
|
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupList_page.dart';
|
||||||
@ -371,8 +370,6 @@ abstract class Routers {
|
|||||||
static const selectCountryRegionPage = '/SelectCountryRegionPage'; // 选择国家和地区
|
static const selectCountryRegionPage = '/SelectCountryRegionPage'; // 选择国家和地区
|
||||||
static const safetyVerificationPage = '/SafetyVerificationPage'; // 安全验证
|
static const safetyVerificationPage = '/SafetyVerificationPage'; // 安全验证
|
||||||
|
|
||||||
static const keyOperationRecordPage = '/keyOperationRecordPage'; //钥匙详情-操作记录
|
|
||||||
|
|
||||||
static const getDeviceListPage = '/getDeviceListPage'; //设备列表
|
static const getDeviceListPage = '/getDeviceListPage'; //设备列表
|
||||||
static const getNameListPage = '/getNameListPage'; //姓名列表
|
static const getNameListPage = '/getNameListPage'; //姓名列表
|
||||||
static const authorityManagementPage = '/authorityManagementPage'; //批量授权
|
static const authorityManagementPage = '/authorityManagementPage'; //批量授权
|
||||||
@ -898,9 +895,6 @@ abstract class AppRouters {
|
|||||||
),
|
),
|
||||||
GetPage(
|
GetPage(
|
||||||
name: Routers.ownedKeyListPage, page: () => const OwnedKeyListPage()),
|
name: Routers.ownedKeyListPage, page: () => const OwnedKeyListPage()),
|
||||||
GetPage(
|
|
||||||
name: Routers.keyOperationRecordPage,
|
|
||||||
page: () => const KeyOperationRecordPage()),
|
|
||||||
GetPage(
|
GetPage(
|
||||||
name: Routers.getDeviceListPage, page: () => const GetDeviceListPage()),
|
name: Routers.getDeviceListPage, page: () => const GetDeviceListPage()),
|
||||||
GetPage(name: Routers.getNameListPage, page: () => const GetNameListPage()),
|
GetPage(name: Routers.getNameListPage, page: () => const GetNameListPage()),
|
||||||
|
|||||||
@ -46,12 +46,13 @@ class SenderReferEventRecordTimeCommand extends SenderProtocol {
|
|||||||
List<int> ebcData = [];
|
List<int> ebcData = [];
|
||||||
|
|
||||||
// 指令类型
|
// 指令类型
|
||||||
int type = commandType!.typeValue;
|
// int type = commandType!.typeValue;
|
||||||
double typeDouble = type / 256;
|
// double typeDouble = type / 256;
|
||||||
int type1 = typeDouble.toInt();
|
// int type1 = typeDouble.toInt();
|
||||||
int type2 = type % 256;
|
// int type2 = type % 256;
|
||||||
data.add(type1);
|
// data.add(type1);
|
||||||
data.add(type2);
|
// data.add(type2);
|
||||||
|
data.addAll(intChangList(commandType!.typeValue));
|
||||||
|
|
||||||
// 子命令类型
|
// 子命令类型
|
||||||
data.add(41);
|
data.add(41);
|
||||||
@ -67,7 +68,7 @@ class SenderReferEventRecordTimeCommand extends SenderProtocol {
|
|||||||
subData = getFixedLengthList(subData, 20 - userIDLength);
|
subData = getFixedLengthList(subData, 20 - userIDLength);
|
||||||
|
|
||||||
// logsCount
|
// logsCount
|
||||||
subData.add(logsCount!);
|
subData.addAll(intChangList(logsCount!));
|
||||||
|
|
||||||
// time
|
// time
|
||||||
subData.add((time! & 0xff000000) >> 24);
|
subData.add((time! & 0xff000000) >> 24);
|
||||||
|
|||||||
@ -120,7 +120,7 @@ abstract class Reply{
|
|||||||
case 0x16:
|
case 0x16:
|
||||||
// 正在开锁中...
|
// 正在开锁中...
|
||||||
AppLog.log("$logTag ${commandType!.typeName}正在开锁中...");
|
AppLog.log("$logTag ${commandType!.typeName}正在开锁中...");
|
||||||
// showErrorMessage("正在开锁中...");
|
showErrorMessage("正在开锁中...");
|
||||||
break;
|
break;
|
||||||
case 0xff:
|
case 0xff:
|
||||||
// 异常,未知错误
|
// 异常,未知错误
|
||||||
|
|||||||
@ -46,8 +46,7 @@ class SenderBeforeDataManage {
|
|||||||
|
|
||||||
// 启动订阅
|
// 启动订阅
|
||||||
void _initReplySubscription() {
|
void _initReplySubscription() {
|
||||||
_replySubscription ??=
|
_replySubscription ??= EventBusManager().eventBus!.on<Reply>().listen((reply) async {
|
||||||
EventBusManager().eventBus!.on<Reply>().listen((reply) async {
|
|
||||||
// 添加用户
|
// 添加用户
|
||||||
if (reply is AddUserReply) {
|
if (reply is AddUserReply) {
|
||||||
_replyAddUserKey(reply);
|
_replyAddUserKey(reply);
|
||||||
|
|||||||
@ -148,7 +148,7 @@ class DebugConsoleController {
|
|||||||
endHour: endTime.hour,
|
endHour: endTime.hour,
|
||||||
endMin: endTime.minute,
|
endMin: endTime.minute,
|
||||||
role: CommonDataManage().currentKeyInfo.keyRight == 1 ? 1 : 0,
|
role: CommonDataManage().currentKeyInfo.keyRight == 1 ? 1 : 0,
|
||||||
password: "123456",
|
password: "0",
|
||||||
needAuthor: 1,
|
needAuthor: 1,
|
||||||
publicKey: publicKeyDataList,
|
publicKey: publicKeyDataList,
|
||||||
privateKey: getPrivateKeyList,
|
privateKey: getPrivateKeyList,
|
||||||
|
|||||||
@ -0,0 +1,10 @@
|
|||||||
|
|
||||||
|
|
||||||
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
|
|
||||||
|
import 'volumeAuthorizationLock_state.dart';
|
||||||
|
|
||||||
|
class VolumeAuthorizationLockLogic extends BaseGetXController {
|
||||||
|
final state = VolumeAuthorizationLockState();
|
||||||
|
|
||||||
|
}
|
||||||
@ -19,6 +19,7 @@ import '../../../../appRouters.dart';
|
|||||||
import '../../../../tools/commonItem.dart';
|
import '../../../../tools/commonItem.dart';
|
||||||
import '../../../../tools/submitBtn.dart';
|
import '../../../../tools/submitBtn.dart';
|
||||||
import '../../../../translations/trans_lib.dart';
|
import '../../../../translations/trans_lib.dart';
|
||||||
|
import 'volumeAuthorizationLock_logic.dart';
|
||||||
|
|
||||||
class VolumeAuthorizationLockPage extends StatefulWidget {
|
class VolumeAuthorizationLockPage extends StatefulWidget {
|
||||||
final String type;
|
final String type;
|
||||||
@ -32,8 +33,10 @@ class VolumeAuthorizationLockPage extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//批量授权锁页面
|
//批量授权锁页面
|
||||||
class _VolumeAuthorizationLockPageState
|
class _VolumeAuthorizationLockPageState extends State<VolumeAuthorizationLockPage> {
|
||||||
extends State<VolumeAuthorizationLockPage> {
|
final logic = Get.put(VolumeAuthorizationLockLogic());
|
||||||
|
final state = Get.find<VolumeAuthorizationLockLogic>().state;
|
||||||
|
|
||||||
final FlutterContactPicker _contactPicker = FlutterContactPicker();
|
final FlutterContactPicker _contactPicker = FlutterContactPicker();
|
||||||
final TextEditingController _emailOrPhoneController =
|
final TextEditingController _emailOrPhoneController =
|
||||||
TextEditingController(); //邮箱/手机号输入框
|
TextEditingController(); //邮箱/手机号输入框
|
||||||
@ -115,7 +118,6 @@ class _VolumeAuthorizationLockPageState
|
|||||||
Widget keyInfoWidget() {
|
Widget keyInfoWidget() {
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
Container(height: 10.h),
|
|
||||||
CommonItem(
|
CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.accountNumber!.tr,
|
leftTitel: TranslationLoader.lanKeys!.accountNumber!.tr,
|
||||||
rightTitle: "",
|
rightTitle: "",
|
||||||
@ -334,6 +336,11 @@ class _VolumeAuthorizationLockPageState
|
|||||||
getEffectiveDateTime =
|
getEffectiveDateTime =
|
||||||
_effectiveDateTime.millisecondsSinceEpoch.toString();
|
_effectiveDateTime.millisecondsSinceEpoch.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_lockIdList.isEmpty) {
|
||||||
|
logic.showToast("请选择锁".tr);
|
||||||
|
return;
|
||||||
|
}
|
||||||
var entity = await ApiRepository.to.addAuthorizedAdmin(
|
var entity = await ApiRepository.to.addAuthorizedAdmin(
|
||||||
createUser: _isCreateUser ? "1" : "0",
|
createUser: _isCreateUser ? "1" : "0",
|
||||||
endDate: getFailureDateTime,
|
endDate: getFailureDateTime,
|
||||||
|
|||||||
@ -0,0 +1,5 @@
|
|||||||
|
|
||||||
|
|
||||||
|
class VolumeAuthorizationLockState{
|
||||||
|
|
||||||
|
}
|
||||||
@ -175,9 +175,9 @@ class _CardDetailPageState extends State<CardDetailPage> with RouteAware {
|
|||||||
rightTitle: "",
|
rightTitle: "",
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () {
|
action: () {
|
||||||
Get.toNamed(Routers.keyOperationRecordPage, arguments: {
|
Get.toNamed(Routers.lockOperatingRecordPage, arguments: {
|
||||||
'lockId': state.fingerprintItemData.value.lockId.toString(),
|
'type': 2,
|
||||||
'cardId': state.fingerprintItemData.value.cardId.toString()
|
'id': state.fingerprintItemData.value.cardId.toString()
|
||||||
});
|
});
|
||||||
}),
|
}),
|
||||||
// SizedBox(height: 40.h),
|
// SizedBox(height: 40.h),
|
||||||
|
|||||||
@ -117,7 +117,7 @@ class OtherTypeKeyChangeDateLogic extends BaseGetXController{
|
|||||||
List<int> signKeyDataList = changeStringListToIntList(signKey!);
|
List<int> signKeyDataList = changeStringListToIntList(signKey!);
|
||||||
|
|
||||||
IoSenderManage.senderAddFaceCommand(
|
IoSenderManage.senderAddFaceCommand(
|
||||||
keyID:state.fingerprintItemData.value.cardId!.toString(),
|
keyID:state.fingerprintItemData.value.faceId!.toString(),
|
||||||
userID:await Storage.getUid(),
|
userID:await Storage.getUid(),
|
||||||
faceNo:int.parse(state.fingerprintItemData.value.faceNumber!),
|
faceNo:int.parse(state.fingerprintItemData.value.faceNumber!),
|
||||||
useCountLimit:0xffff,
|
useCountLimit:0xffff,
|
||||||
@ -411,6 +411,21 @@ class OtherTypeKeyChangeDateLogic extends BaseGetXController{
|
|||||||
|
|
||||||
// 修改人脸有效期
|
// 修改人脸有效期
|
||||||
void editFaceData() async {
|
void editFaceData() async {
|
||||||
|
// var entity = await ApiRepository.to.updateFaceValidity(
|
||||||
|
// lockId: state.faceItemData.value.lockId!,
|
||||||
|
// faceId: state.faceItemData.value.faceId!,
|
||||||
|
// startDate: int.parse(state.startDate.value),
|
||||||
|
// endDate: int.parse(state.endDate.value),
|
||||||
|
// startTime: int.parse(state.startTime.value),
|
||||||
|
// endTime: int.parse(state.endTime.value),
|
||||||
|
// faceType: state.keyType.value,
|
||||||
|
// weekDay: state.weekDay.value,
|
||||||
|
// faceName: state.changeNameController.text,
|
||||||
|
// addType: "1",
|
||||||
|
// isCoerced: state.isStressFace.value ? 2 : 1,
|
||||||
|
// faceRight: state.isAdministrator.value ? 1 : 0,
|
||||||
|
// );
|
||||||
|
|
||||||
var entity = await ApiRepository.to.updateFaceValidity(
|
var entity = await ApiRepository.to.updateFaceValidity(
|
||||||
lockId: state.fingerprintItemData.value.lockId!,
|
lockId: state.fingerprintItemData.value.lockId!,
|
||||||
faceId: state.fingerprintItemData.value.faceId!,
|
faceId: state.fingerprintItemData.value.faceId!,
|
||||||
|
|||||||
@ -5,7 +5,6 @@ import 'package:flutter_blue_plus/flutter_blue_plus.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';
|
||||||
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecord/keyOperationRecord_entity.dart';
|
|
||||||
import 'package:star_lock/main/lockDetail/lockOperatingRecord/lockOperatingRecordGetLastRecordTime_entity.dart';
|
import 'package:star_lock/main/lockDetail/lockOperatingRecord/lockOperatingRecordGetLastRecordTime_entity.dart';
|
||||||
import 'package:star_lock/tools/eventBusEventManage.dart';
|
import 'package:star_lock/tools/eventBusEventManage.dart';
|
||||||
|
|
||||||
@ -19,6 +18,7 @@ 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/storage.dart';
|
import '../../../tools/storage.dart';
|
||||||
|
import '../lockOperatingRecord/keyOperationRecord_entity.dart';
|
||||||
|
|
||||||
class DoorLockLogLogic extends BaseGetXController {
|
class DoorLockLogLogic extends BaseGetXController {
|
||||||
DoorLockLogState state = DoorLockLogState();
|
DoorLockLogState state = DoorLockLogState();
|
||||||
@ -26,40 +26,14 @@ class DoorLockLogLogic extends BaseGetXController {
|
|||||||
// 获取解析后的数据
|
// 获取解析后的数据
|
||||||
late StreamSubscription<Reply> _replySubscription;
|
late StreamSubscription<Reply> _replySubscription;
|
||||||
void _initReplySubscription() {
|
void _initReplySubscription() {
|
||||||
_replySubscription =
|
_replySubscription = EventBusManager().eventBus!.on<Reply>().listen((reply) {
|
||||||
EventBusManager().eventBus!.on<Reply>().listen((reply) {
|
|
||||||
// if(reply is SenderReferEventRecordNumberReply) {
|
|
||||||
// _replyReferEventRecordNumber(reply);
|
|
||||||
// }
|
|
||||||
|
|
||||||
if (reply is SenderReferEventRecordTimeReply) {
|
if (reply is SenderReferEventRecordTimeReply && state.ifCurrentScreen.value == true) {
|
||||||
_replyReferEventRecordTime(reply);
|
_replyReferEventRecordTime(reply);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 根据数量查解析数据
|
|
||||||
// Future<void> _replyReferEventRecordNumber(Reply reply) async {
|
|
||||||
// int status = reply.data[2];
|
|
||||||
// switch(status){
|
|
||||||
// case 0x00:
|
|
||||||
// //成功
|
|
||||||
// // _getLockStatus();
|
|
||||||
// break;
|
|
||||||
// case 0x06:
|
|
||||||
// //无权限
|
|
||||||
//
|
|
||||||
// break;
|
|
||||||
// case 0x07:
|
|
||||||
// //无权限
|
|
||||||
//
|
|
||||||
// break;
|
|
||||||
// default:
|
|
||||||
// //失败
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// 根据时间查解析数据
|
// 根据时间查解析数据
|
||||||
Future<void> _replyReferEventRecordTime(Reply reply) async {
|
Future<void> _replyReferEventRecordTime(Reply reply) async {
|
||||||
cancelBlueConnetctToastTimer();
|
cancelBlueConnetctToastTimer();
|
||||||
@ -86,7 +60,7 @@ class DoorLockLogLogic extends BaseGetXController {
|
|||||||
indexMap["type"] = indexList[0].toString();
|
indexMap["type"] = indexList[0].toString();
|
||||||
|
|
||||||
if(indexList[0] == 2){
|
if(indexList[0] == 2){
|
||||||
var passwordData = reply.data.sublist(7, 17);
|
var passwordData = indexList.sublist(7, 17);
|
||||||
var password = utf8String(passwordData);
|
var password = utf8String(passwordData);
|
||||||
indexMap["user"] = password.toString();
|
indexMap["user"] = password.toString();
|
||||||
}else{
|
}else{
|
||||||
@ -112,26 +86,7 @@ class DoorLockLogLogic extends BaseGetXController {
|
|||||||
break;
|
break;
|
||||||
case 0x06:
|
case 0x06:
|
||||||
//无权限 需要鉴权
|
//无权限 需要鉴权
|
||||||
// var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
|
||||||
// List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
|
||||||
//
|
|
||||||
// var token = await Storage.getStringList(saveBlueToken);
|
|
||||||
// List<int> getTokenList = changeStringListToIntList(token!);
|
|
||||||
//
|
|
||||||
// var publicKey = await Storage.getStringList(saveBluePublicKey);
|
|
||||||
// List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
|
|
||||||
//
|
|
||||||
// IoSenderManage.senderReferEventRecordTimeCommand(
|
|
||||||
// keyID: BlueManage().connectDeviceName,
|
|
||||||
// userID: await Storage.getUid(),
|
|
||||||
// logsCount: int.parse(pageSize),
|
|
||||||
// // time:DateTime.now().millisecondsSinceEpoch~/1000,
|
|
||||||
// time: state.operateDate,
|
|
||||||
// token: getTokenList,
|
|
||||||
// needAuthor: 1,
|
|
||||||
// publicKey: getPublicKeyList,
|
|
||||||
// privateKey: getPrivateKeyList,
|
|
||||||
// );
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
//失败
|
//失败
|
||||||
@ -139,36 +94,8 @@ class DoorLockLogLogic extends BaseGetXController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询事件记录(页数查询)
|
|
||||||
// Future<void> senderReferEventRecordNumber() async {
|
|
||||||
// BlueManage().bludSendData(BlueManage().connectDeviceMacAddress, BlueManage().connectDeviceName, (DeviceConnectionState state) async {
|
|
||||||
// if (state == DeviceConnectionState.connected) {
|
|
||||||
// var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
|
||||||
// List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
|
||||||
//
|
|
||||||
// var token = await Storage.getStringList(saveBlueToken);
|
|
||||||
// List<int> getTokenList = changeStringListToIntList(token!);
|
|
||||||
//
|
|
||||||
// var publicKey = await Storage.getStringList(saveBluePublicKey);
|
|
||||||
// List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
|
|
||||||
//
|
|
||||||
// IoSenderManage.senderReferEventRecordNumberCommand(
|
|
||||||
// keyID:BlueManage().connectDeviceName,
|
|
||||||
// userID:await Storage.getUid(),
|
|
||||||
// logsCount:20,
|
|
||||||
// logsNo:1,
|
|
||||||
// token:getTokenList,
|
|
||||||
// needAuthor:1,
|
|
||||||
// publicKey:getPublicKeyList,
|
|
||||||
// privateKey:getPrivateKeyList,
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
|
|
||||||
// 查询事件记录(时间查询)
|
// 查询事件记录(时间查询)
|
||||||
Future<void> senderReferEventRecordTime() async {
|
Future<void> senderReferEventRecordTime() async {
|
||||||
|
|
||||||
showEasyLoading();
|
showEasyLoading();
|
||||||
showBlueConnetctToastTimer(action: (){
|
showBlueConnetctToastTimer(action: (){
|
||||||
dismissEasyLoading();
|
dismissEasyLoading();
|
||||||
|
|||||||
@ -22,7 +22,7 @@ class DoorLockLogPage extends StatefulWidget {
|
|||||||
State<DoorLockLogPage> createState() => _DoorLockLogPageState();
|
State<DoorLockLogPage> createState() => _DoorLockLogPageState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _DoorLockLogPageState extends State<DoorLockLogPage> with RouteAware {
|
class _DoorLockLogPageState extends State<DoorLockLogPage> with RouteAware{
|
||||||
final logic = Get.put(DoorLockLogLogic());
|
final logic = Get.put(DoorLockLogLogic());
|
||||||
final state = Get.find<DoorLockLogLogic>().state;
|
final state = Get.find<DoorLockLogLogic>().state;
|
||||||
|
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
|
||||||
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetail/electronicKeyDetail_page.dart';
|
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetail/electronicKeyDetail_page.dart';
|
||||||
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetail/electronicKeyDetail_state.dart';
|
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetail/electronicKeyDetail_state.dart';
|
||||||
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecord/keyOperationRecord_entity.dart';
|
|
||||||
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/entity/ElectronicKeyListEntity.dart';
|
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/entity/ElectronicKeyListEntity.dart';
|
||||||
import 'package:star_lock/network/api_repository.dart';
|
import 'package:star_lock/network/api_repository.dart';
|
||||||
import 'package:star_lock/tools/baseGetXController.dart';
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
@ -13,6 +13,7 @@ import '../../../../../tools/custom_bottom_sheet.dart';
|
|||||||
import '../../../../../tools/dateTool.dart';
|
import '../../../../../tools/dateTool.dart';
|
||||||
import '../../../../../tools/eventBusEventManage.dart';
|
import '../../../../../tools/eventBusEventManage.dart';
|
||||||
import '../../../../../tools/showTipView.dart';
|
import '../../../../../tools/showTipView.dart';
|
||||||
|
import '../../../lockOperatingRecord/keyOperationRecord_entity.dart';
|
||||||
|
|
||||||
typedef BlockIsHaveAllDataCallback = void Function(bool isAllData);
|
typedef BlockIsHaveAllDataCallback = void Function(bool isAllData);
|
||||||
|
|
||||||
@ -235,17 +236,17 @@ class ElectronicKeyDetailLogic extends BaseGetXController {
|
|||||||
var textList = <String>[];
|
var textList = <String>[];
|
||||||
if(CommonDataManage().currentKeyInfo.keyRight == 1){
|
if(CommonDataManage().currentKeyInfo.keyRight == 1){
|
||||||
textList = [
|
textList = [
|
||||||
state.itemData.value.keyStatus == 110405 ? '取消冻结'.tr : "冻结".tr
|
state.itemData.value.keyStatus == XSConstantMacro.keyStatusFrozen ? '取消冻结'.tr : "冻结".tr
|
||||||
];
|
];
|
||||||
}else if(CommonDataManage().currentKeyInfo.isLockOwner == 1){
|
}else if(CommonDataManage().currentKeyInfo.isLockOwner == 1){
|
||||||
if (state.keyType.value == 1 || state.keyType.value == 2) {
|
if (state.keyType.value == 1 || state.keyType.value == 2) {
|
||||||
textList = [
|
textList = [
|
||||||
state.itemData.value.keyStatus == 110405 ? '取消冻结'.tr : "冻结".tr,
|
state.itemData.value.keyStatus == XSConstantMacro.keyStatusFrozen ? '取消冻结'.tr : "冻结".tr,
|
||||||
state.itemData.value.keyRight == 1 ? '取消授权'.tr : '授权'.tr
|
state.itemData.value.keyRight == 1 ? '取消授权'.tr : '授权'.tr
|
||||||
];
|
];
|
||||||
} else if (state.keyType.value == 4) {
|
} else if (state.keyType.value == 4) {
|
||||||
textList = [
|
textList = [
|
||||||
state.itemData.value.keyStatus == 110405 ? '取消冻结'.tr : "冻结".tr
|
state.itemData.value.keyStatus == XSConstantMacro.keyStatusFrozen ? '取消冻结'.tr : "冻结".tr
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -260,7 +261,7 @@ class ElectronicKeyDetailLogic extends BaseGetXController {
|
|||||||
chooseCallback: (value) {
|
chooseCallback: (value) {
|
||||||
int index = value;
|
int index = value;
|
||||||
if (index == 0) {
|
if (index == 0) {
|
||||||
if (state.itemData.value.keyStatus == 110405) {
|
if (state.itemData.value.keyStatus == XSConstantMacro.keyStatusFrozen) {
|
||||||
// 取消冻结
|
// 取消冻结
|
||||||
if (state.itemData.value.keyRight == 1) {
|
if (state.itemData.value.keyRight == 1) {
|
||||||
// 管理员
|
// 管理员
|
||||||
@ -340,6 +341,13 @@ class ElectronicKeyDetailLogic extends BaseGetXController {
|
|||||||
return currentController;
|
return currentController;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
noModificationAllowedDuringFreeze(){
|
||||||
|
if(state.itemData.value.keyStatus == XSConstantMacro.keyStatusFrozen){
|
||||||
|
showToast("冻结状态下不允许修改钥匙权限".tr);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void onReady() {
|
void onReady() {
|
||||||
// TODO: implement onReady
|
// TODO: implement onReady
|
||||||
|
|||||||
@ -102,8 +102,12 @@ class _ElectronicKeyDetailPageState extends State<ElectronicKeyDetailPage> {
|
|||||||
XSConstantMacro.keyStatusExpired
|
XSConstantMacro.keyStatusExpired
|
||||||
? null
|
? null
|
||||||
: () async {
|
: () async {
|
||||||
if (state.keyType.value == 2 ||
|
if(state.itemData.value.keyStatus == XSConstantMacro.keyStatusFrozen){
|
||||||
state.keyType.value == 1) {
|
logic.showToast("冻结状态下不允许修改钥匙权限".tr);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (state.keyType.value == 2 || state.keyType.value == 1) {
|
||||||
// 限时/永久
|
// 限时/永久
|
||||||
var data = await Get.toNamed(
|
var data = await Get.toNamed(
|
||||||
Routers.electronicKeyDetailChangeDate,
|
Routers.electronicKeyDetailChangeDate,
|
||||||
@ -113,10 +117,8 @@ class _ElectronicKeyDetailPageState extends State<ElectronicKeyDetailPage> {
|
|||||||
});
|
});
|
||||||
if (data != null) {
|
if (data != null) {
|
||||||
setState(() {
|
setState(() {
|
||||||
state.starDate.value =
|
state.starDate.value = data["beginTimeTimestamp"].toString();
|
||||||
data["beginTimeTimestamp"].toString();
|
state.endDate.value = data["endTimeTimestamp"].toString();
|
||||||
state.endDate.value =
|
|
||||||
data["endTimeTimestamp"].toString();
|
|
||||||
state.keyType.value = 2;
|
state.keyType.value = 2;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -147,6 +149,11 @@ class _ElectronicKeyDetailPageState extends State<ElectronicKeyDetailPage> {
|
|||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
action: () async {
|
action: () async {
|
||||||
|
if(state.itemData.value.keyStatus == XSConstantMacro.keyStatusFrozen){
|
||||||
|
logic.showToast("冻结状态下不允许修改钥匙权限".tr);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var data = await Get.toNamed(
|
var data = await Get.toNamed(
|
||||||
Routers.electronicKeyPeriodValidityPage,
|
Routers.electronicKeyPeriodValidityPage,
|
||||||
arguments: {
|
arguments: {
|
||||||
@ -171,6 +178,11 @@ class _ElectronicKeyDetailPageState extends State<ElectronicKeyDetailPage> {
|
|||||||
"${DateTool().dateToHNString(state.starTime.value)}-${DateTool().dateToHNString(state.endTime.value)}",
|
"${DateTool().dateToHNString(state.starTime.value)}-${DateTool().dateToHNString(state.endTime.value)}",
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () async {
|
action: () async {
|
||||||
|
if(state.itemData.value.keyStatus == XSConstantMacro.keyStatusFrozen){
|
||||||
|
logic.showToast("冻结状态下不允许修改钥匙权限".tr);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var data = await Get.toNamed(
|
var data = await Get.toNamed(
|
||||||
Routers.electronicKeyPeriodValidityPage,
|
Routers.electronicKeyPeriodValidityPage,
|
||||||
arguments: {
|
arguments: {
|
||||||
@ -242,9 +254,9 @@ class _ElectronicKeyDetailPageState extends State<ElectronicKeyDetailPage> {
|
|||||||
rightTitle: "",
|
rightTitle: "",
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () {
|
action: () {
|
||||||
Get.toNamed(Routers.keyOperationRecordPage, arguments: {
|
Get.toNamed(Routers.lockOperatingRecordPage, arguments: {
|
||||||
'lockId': state.itemData.value.lockId.toString(),
|
'type': 5,
|
||||||
'keyId': state.itemData.value.keyId.toString()
|
'id': state.itemData.value.keyId.toString()
|
||||||
});
|
});
|
||||||
}),
|
}),
|
||||||
Container(height: 40.h),
|
Container(height: 40.h),
|
||||||
|
|||||||
@ -1,11 +1,11 @@
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetailChangeDate/electronicKeyDetailChangeDate_state.dart';
|
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetailChangeDate/electronicKeyDetailChangeDate_state.dart';
|
||||||
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecord/keyOperationRecord_entity.dart';
|
|
||||||
import 'package:star_lock/network/api_repository.dart';
|
import 'package:star_lock/network/api_repository.dart';
|
||||||
import 'package:star_lock/tools/baseGetXController.dart';
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
|
|
||||||
import '../../../../../tools/dateTool.dart';
|
import '../../../../../tools/dateTool.dart';
|
||||||
import '../../../../../tools/eventBusEventManage.dart';
|
import '../../../../../tools/eventBusEventManage.dart';
|
||||||
|
import '../../../lockOperatingRecord/keyOperationRecord_entity.dart';
|
||||||
|
|
||||||
class ElectronicKeyDetailChangeDateLogic extends BaseGetXController {
|
class ElectronicKeyDetailChangeDateLogic extends BaseGetXController {
|
||||||
final ElectronicKeyDetailChangeDateState state =
|
final ElectronicKeyDetailChangeDateState state =
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import 'package:star_lock/tools/baseGetXController.dart';
|
|||||||
import '../../../../../network/api_repository.dart';
|
import '../../../../../network/api_repository.dart';
|
||||||
import '../../../../../tools/dateTool.dart';
|
import '../../../../../tools/dateTool.dart';
|
||||||
import '../../../../../tools/eventBusEventManage.dart';
|
import '../../../../../tools/eventBusEventManage.dart';
|
||||||
import '../keyOperationRecord/keyOperationRecord_entity.dart';
|
import '../../../lockOperatingRecord/keyOperationRecord_entity.dart';
|
||||||
import 'electronicKeyPeriodValidity_state.dart';
|
import 'electronicKeyPeriodValidity_state.dart';
|
||||||
|
|
||||||
class ElectronicKeyPeriodValidityLogic extends BaseGetXController {
|
class ElectronicKeyPeriodValidityLogic extends BaseGetXController {
|
||||||
|
|||||||
@ -81,7 +81,7 @@ class _FaceDetailPageState extends State<FaceDetailPage> with RouteAware {
|
|||||||
var data = await Get.toNamed(
|
var data = await Get.toNamed(
|
||||||
Routers.otherTypeKeyChangeDatePage,
|
Routers.otherTypeKeyChangeDatePage,
|
||||||
arguments: {
|
arguments: {
|
||||||
"pushType": 2,
|
"pushType": 3,
|
||||||
"fingerprintItemData": state.faceItemData.value,
|
"fingerprintItemData": state.faceItemData.value,
|
||||||
});
|
});
|
||||||
if (data != null) {
|
if (data != null) {
|
||||||
@ -189,9 +189,9 @@ class _FaceDetailPageState extends State<FaceDetailPage> with RouteAware {
|
|||||||
rightTitle: "",
|
rightTitle: "",
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () {
|
action: () {
|
||||||
Get.toNamed(Routers.keyOperationRecordPage, arguments: {
|
Get.toNamed(Routers.lockOperatingRecordPage, arguments: {
|
||||||
'lockId': state.faceItemData.value.lockId.toString(),
|
'type': 4,
|
||||||
'faceId': state.faceItemData.value.faceId.toString()
|
'id': state.faceItemData.value.faceId.toString()
|
||||||
});
|
});
|
||||||
}),
|
}),
|
||||||
// SizedBox(height: 40.h),
|
// SizedBox(height: 40.h),
|
||||||
|
|||||||
@ -183,9 +183,9 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage> with Rout
|
|||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () {
|
action: () {
|
||||||
// 指纹
|
// 指纹
|
||||||
Get.toNamed(Routers.keyOperationRecordPage, arguments: {
|
Get.toNamed(Routers.lockOperatingRecordPage, arguments: {
|
||||||
'lockId': state.fingerprintItemData.value.lockId.toString(),
|
'type': 3,
|
||||||
'fingerprintId': state.fingerprintItemData.value.fingerprintId.toString()
|
'id': state.fingerprintItemData.value.fingerprintId.toString()
|
||||||
});
|
});
|
||||||
}),
|
}),
|
||||||
// SizedBox(height: 40.h),
|
// SizedBox(height: 40.h),
|
||||||
|
|||||||
@ -178,10 +178,10 @@ class _CardDetailPageState extends State<CardDetailPage> with RouteAware {
|
|||||||
rightTitle: "",
|
rightTitle: "",
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () {
|
action: () {
|
||||||
Get.toNamed(Routers.keyOperationRecordPage, arguments: {
|
// Get.toNamed(Routers.keyOperationRecordPage, arguments: {
|
||||||
'lockId': state.fingerprintItemData.value.lockId.toString(),
|
// 'lockId': state.fingerprintItemData.value.lockId.toString(),
|
||||||
'cardId': state.fingerprintItemData.value.cardId.toString()
|
// 'cardId': state.fingerprintItemData.value.cardId.toString()
|
||||||
});
|
// });
|
||||||
}),
|
}),
|
||||||
// SizedBox(height: 40.h),
|
// SizedBox(height: 40.h),
|
||||||
// addControlsBtn(type),
|
// addControlsBtn(type),
|
||||||
|
|||||||
@ -6,7 +6,6 @@ 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/common/XSConstantMacro/XSConstantMacro.dart';
|
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
|
||||||
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecord/keyOperationRecord_entity.dart';
|
|
||||||
|
|
||||||
import '../../../app_settings/app_settings.dart';
|
import '../../../app_settings/app_settings.dart';
|
||||||
import '../../../blue/blue_manage.dart';
|
import '../../../blue/blue_manage.dart';
|
||||||
@ -23,6 +22,7 @@ import '../../../tools/commonDataManage.dart';
|
|||||||
import '../../../tools/eventBusEventManage.dart';
|
import '../../../tools/eventBusEventManage.dart';
|
||||||
import '../../../tools/storage.dart';
|
import '../../../tools/storage.dart';
|
||||||
import '../../../translations/trans_lib.dart';
|
import '../../../translations/trans_lib.dart';
|
||||||
|
import '../lockOperatingRecord/keyOperationRecord_entity.dart';
|
||||||
import '../lockOperatingRecord/lockOperatingRecordGetLastRecordTime_entity.dart';
|
import '../lockOperatingRecord/lockOperatingRecordGetLastRecordTime_entity.dart';
|
||||||
import 'lockDetail_state.dart';
|
import 'lockDetail_state.dart';
|
||||||
import 'lockNetToken_entity.dart';
|
import 'lockNetToken_entity.dart';
|
||||||
@ -260,7 +260,7 @@ class LockDetailLogic extends BaseGetXController {
|
|||||||
// startDate: state.keyInfos.value.startDate!~/10000,
|
// startDate: state.keyInfos.value.startDate!~/10000,
|
||||||
// expireDate: state.keyInfos.value.endDate!~/10000,
|
// expireDate: state.keyInfos.value.endDate!~/10000,
|
||||||
// role: state.keyInfos.value.keyRight == 1 ? 1 : 0,
|
// role: state.keyInfos.value.keyRight == 1 ? 1 : 0,
|
||||||
// password: "123456",
|
// password: "0",
|
||||||
// needAuthor: 1,
|
// needAuthor: 1,
|
||||||
// publicKey: publicKeyDataList,
|
// publicKey: publicKeyDataList,
|
||||||
// privateKey: getPrivateKeyList,
|
// privateKey: getPrivateKeyList,
|
||||||
@ -318,7 +318,7 @@ class LockDetailLogic extends BaseGetXController {
|
|||||||
// startDate: state.keyInfos.value.startDate!~/10000,
|
// startDate: state.keyInfos.value.startDate!~/10000,
|
||||||
// expireDate: state.keyInfos.value.endDate!~/10000,
|
// expireDate: state.keyInfos.value.endDate!~/10000,
|
||||||
// role: state.keyInfos.value.keyRight == 1 ? 1 : 0,
|
// role: state.keyInfos.value.keyRight == 1 ? 1 : 0,
|
||||||
// password: "123456",
|
// password: "0",
|
||||||
// needAuthor: 1,
|
// needAuthor: 1,
|
||||||
// publicKey: publicKeyDataList,
|
// publicKey: publicKeyDataList,
|
||||||
// privateKey: getPrivateKeyList,
|
// privateKey: getPrivateKeyList,
|
||||||
@ -445,7 +445,8 @@ class LockDetailLogic extends BaseGetXController {
|
|||||||
KeyOperationRecordEntity entity = await ApiRepository.to.uploadElectricQuantity(
|
KeyOperationRecordEntity entity = await ApiRepository.to.uploadElectricQuantity(
|
||||||
electricQuantity:state.electricQuantity.value.toString(),
|
electricQuantity:state.electricQuantity.value.toString(),
|
||||||
electricQuantityStandby: state.electricQuantityStandby.value.toString(),
|
electricQuantityStandby: state.electricQuantityStandby.value.toString(),
|
||||||
lockId: state.keyInfos.value.lockId.toString()
|
lockId: state.keyInfos.value.lockId.toString(),
|
||||||
|
isUnShowLoading: true
|
||||||
);
|
);
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
SchedulerBinding.instance.addPostFrameCallback((_) {
|
SchedulerBinding.instance.addPostFrameCallback((_) {
|
||||||
@ -475,9 +476,9 @@ class LockDetailLogic extends BaseGetXController {
|
|||||||
|
|
||||||
// 查询锁记录最后时间
|
// 查询锁记录最后时间
|
||||||
void getLockRecordLastUploadDataTime() async {
|
void getLockRecordLastUploadDataTime() async {
|
||||||
LockOperatingRecordGetLastRecordTimeEntity entity = await ApiRepository.to
|
LockOperatingRecordGetLastRecordTimeEntity entity = await ApiRepository.to.getLockRecordLastUploadDataTime(
|
||||||
.getLockRecordLastUploadDataTime(
|
lockId: state.keyInfos.value.lockId.toString()
|
||||||
lockId: state.keyInfos.value.lockId.toString());
|
);
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
state.operateDate = entity.data!.operateDate! ~/ 1000;
|
state.operateDate = entity.data!.operateDate! ~/ 1000;
|
||||||
senderReferEventRecordTime();
|
senderReferEventRecordTime();
|
||||||
@ -486,9 +487,10 @@ class LockDetailLogic extends BaseGetXController {
|
|||||||
|
|
||||||
// 操作记录上传
|
// 操作记录上传
|
||||||
void lockRecordUploadData(List list) async {
|
void lockRecordUploadData(List list) async {
|
||||||
KeyOperationRecordEntity entity = await ApiRepository.to
|
KeyOperationRecordEntity entity = await ApiRepository.to.lockRecordUploadData(
|
||||||
.lockRecordUploadData(
|
lockId: state.keyInfos.value.lockId.toString(),
|
||||||
lockId: state.keyInfos.value.lockId.toString(), records: list);
|
records: list
|
||||||
|
);
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
// mockNetworkDataRequest();
|
// mockNetworkDataRequest();
|
||||||
AppLog.log("state.keyInfos.value.keyType:${state.keyInfos.value.keyType}");
|
AppLog.log("state.keyInfos.value.keyType:${state.keyInfos.value.keyType}");
|
||||||
|
|||||||
@ -1266,9 +1266,7 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
//如果需要实名认证,需认证完成,方可开锁
|
//如果需要实名认证,需认证完成,方可开锁
|
||||||
isNeedRealNameAuthThenOpenLock() {
|
isNeedRealNameAuthThenOpenLock() {
|
||||||
state.nextAuthTime.value = state.keyInfos.value.nextFaceValidateTime ?? 0;
|
state.nextAuthTime.value = state.keyInfos.value.nextFaceValidateTime ?? 0;
|
||||||
if (state.keyInfos.value.faceAuthentication == 1 &&
|
if (state.keyInfos.value.faceAuthentication == 1 && state.nextAuthTime.value > 0 && DateTool().compareTimeIsOvertime(state.nextAuthTime.value) == true) {
|
||||||
state.nextAuthTime.value > 0 &&
|
|
||||||
DateTool().compareTimeIsOvertime(state.nextAuthTime.value) == true) {
|
|
||||||
AliyunRealNameAuthProvider(
|
AliyunRealNameAuthProvider(
|
||||||
getLockInfo: state.keyInfos.value,
|
getLockInfo: state.keyInfos.value,
|
||||||
onCertifyResultWithTime: ((bool isSuccess, int getNextAuthTime) {
|
onCertifyResultWithTime: ((bool isSuccess, int getNextAuthTime) {
|
||||||
|
|||||||
@ -0,0 +1,121 @@
|
|||||||
|
|
||||||
|
class KeyOperationRecordEntity {
|
||||||
|
int? errorCode;
|
||||||
|
String? description;
|
||||||
|
String? errorMsg;
|
||||||
|
KeyOperationRecordData? data;
|
||||||
|
|
||||||
|
KeyOperationRecordEntity(
|
||||||
|
{this.errorCode, this.description, this.errorMsg, this.data});
|
||||||
|
|
||||||
|
KeyOperationRecordEntity.fromJson(Map<String, dynamic> json) {
|
||||||
|
errorCode = json['errorCode'];
|
||||||
|
description = json['description'];
|
||||||
|
errorMsg = json['errorMsg'];
|
||||||
|
data = json['data'] != null
|
||||||
|
? KeyOperationRecordData.fromJson(json['data'])
|
||||||
|
: null;
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
data['errorCode'] = errorCode;
|
||||||
|
data['description'] = description;
|
||||||
|
data['errorMsg'] = errorMsg;
|
||||||
|
if (this.data != null) {
|
||||||
|
data['data'] = this.data!.toJson();
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class KeyOperationRecordData {
|
||||||
|
List<KeyRecordDataItem>? itemList;
|
||||||
|
int? pageNo;
|
||||||
|
int? pageSize;
|
||||||
|
int? pages;
|
||||||
|
int? total;
|
||||||
|
|
||||||
|
KeyOperationRecordData(
|
||||||
|
{this.itemList, this.pageNo, this.pageSize, this.pages, this.total});
|
||||||
|
|
||||||
|
KeyOperationRecordData.fromJson(Map<String, dynamic> json) {
|
||||||
|
if (json['list'] != null) {
|
||||||
|
itemList = <KeyRecordDataItem>[];
|
||||||
|
json['list'].forEach((v) {
|
||||||
|
itemList!.add(KeyRecordDataItem.fromJson(v));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
pageNo = json['pageNo'];
|
||||||
|
pageSize = json['pageSize'];
|
||||||
|
pages = json['pages'];
|
||||||
|
total = json['total'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
if (itemList != null) {
|
||||||
|
data['list'] = itemList!.map((v) => v.toJson()).toList();
|
||||||
|
}
|
||||||
|
data['pageNo'] = pageNo;
|
||||||
|
data['pageSize'] = pageSize;
|
||||||
|
data['pages'] = pages;
|
||||||
|
data['total'] = total;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class KeyRecordDataItem {
|
||||||
|
int? recordId;
|
||||||
|
int? lockId;
|
||||||
|
int? recordType;
|
||||||
|
String? recordTypeName;
|
||||||
|
int? success;
|
||||||
|
String? username;
|
||||||
|
int? lockDate;
|
||||||
|
int? operateDate;
|
||||||
|
String? keyboardPwd;
|
||||||
|
|
||||||
|
KeyRecordDataItem(
|
||||||
|
{this.recordId,
|
||||||
|
this.lockId,
|
||||||
|
this.recordType,
|
||||||
|
this.recordTypeName,
|
||||||
|
this.success,
|
||||||
|
this.username,
|
||||||
|
this.lockDate,
|
||||||
|
this.operateDate,
|
||||||
|
this.keyboardPwd});
|
||||||
|
|
||||||
|
KeyRecordDataItem.fromJson(Map<String, dynamic> json) {
|
||||||
|
recordId = json['recordId'];
|
||||||
|
lockId = json['lockId'];
|
||||||
|
recordType = json['recordType'];
|
||||||
|
json['recordTypeName'] != null
|
||||||
|
? recordTypeName = json['recordTypeName']
|
||||||
|
: "";
|
||||||
|
success = json['success'];
|
||||||
|
json['username'] != null ? username = json['username'] : "";
|
||||||
|
json['lockDate'] != null ? lockDate = json['lockDate'] : "";
|
||||||
|
operateDate = json['operateDate'];
|
||||||
|
json['keyboardPwd'] != null ? keyboardPwd = json['keyboardPwd'] : "";
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
data['recordId'] = recordId;
|
||||||
|
data['lockId'] = lockId;
|
||||||
|
data['recordType'] = recordType;
|
||||||
|
data['recordTypeName'] = recordTypeName;
|
||||||
|
data['success'] = success;
|
||||||
|
if (data['username'] != null) {
|
||||||
|
data['username'] = username;
|
||||||
|
}
|
||||||
|
if (data['lockDate'] != null) {
|
||||||
|
data['lockDate'] = lockDate;
|
||||||
|
}
|
||||||
|
data['operateDate'] = operateDate;
|
||||||
|
data['keyboardPwd'] = keyboardPwd;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,9 +1,8 @@
|
|||||||
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:flutter_easyloading/flutter_easyloading.dart';
|
|
||||||
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecord/keyOperationRecord_entity.dart';
|
|
||||||
|
|
||||||
|
import '../../../app_settings/app_settings.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';
|
||||||
import '../../../blue/io_reply.dart';
|
import '../../../blue/io_reply.dart';
|
||||||
@ -12,7 +11,9 @@ import '../../../blue/io_tool/manager_event_bus.dart';
|
|||||||
import '../../../blue/sender_manage.dart';
|
import '../../../blue/sender_manage.dart';
|
||||||
import '../../../network/api_repository.dart';
|
import '../../../network/api_repository.dart';
|
||||||
import '../../../tools/baseGetXController.dart';
|
import '../../../tools/baseGetXController.dart';
|
||||||
|
import '../../../tools/commonDataManage.dart';
|
||||||
import '../../../tools/storage.dart';
|
import '../../../tools/storage.dart';
|
||||||
|
import 'keyOperationRecord_entity.dart';
|
||||||
import 'lockOperatingRecordGetLastRecordTime_entity.dart';
|
import 'lockOperatingRecordGetLastRecordTime_entity.dart';
|
||||||
import 'lockOperatingRecord_state.dart';
|
import 'lockOperatingRecord_state.dart';
|
||||||
|
|
||||||
@ -22,111 +23,82 @@ class LockOperatingRecordLogic extends BaseGetXController {
|
|||||||
// 获取解析后的数据
|
// 获取解析后的数据
|
||||||
late StreamSubscription<Reply> _replySubscription;
|
late StreamSubscription<Reply> _replySubscription;
|
||||||
void _initReplySubscription() {
|
void _initReplySubscription() {
|
||||||
_replySubscription =
|
_replySubscription = EventBusManager().eventBus!.on<Reply>().listen((reply) {
|
||||||
EventBusManager().eventBus!.on<Reply>().listen((reply) {
|
|
||||||
// if(reply is SenderReferEventRecordNumberReply) {
|
|
||||||
// _replyReferEventRecordNumber(reply);
|
|
||||||
// }
|
|
||||||
|
|
||||||
if (reply is SenderReferEventRecordTimeReply) {
|
if (reply is SenderReferEventRecordTimeReply) {
|
||||||
_replyReferEventRecordTime(reply);
|
_replyReferEventRecordTime(reply);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 根据数量查解析数据
|
|
||||||
// Future<void> _replyReferEventRecordNumber(Reply reply) async {
|
|
||||||
// int status = reply.data[2];
|
|
||||||
// switch(status){
|
|
||||||
// case 0x00:
|
|
||||||
// //成功
|
|
||||||
// // _getLockStatus();
|
|
||||||
// break;
|
|
||||||
// case 0x06:
|
|
||||||
// //无权限
|
|
||||||
//
|
|
||||||
// break;
|
|
||||||
// default:
|
|
||||||
// //失败
|
|
||||||
//
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// 根据时间查解析数据
|
// 根据时间查解析数据
|
||||||
Future<void> _replyReferEventRecordTime(Reply reply) async {
|
Future<void> _replyReferEventRecordTime(Reply reply) async {
|
||||||
|
cancelBlueConnetctToastTimer();
|
||||||
int status = reply.data[2];
|
int status = reply.data[2];
|
||||||
switch (status) {
|
switch (status) {
|
||||||
case 0x00:
|
case 0x00:
|
||||||
//成功
|
//成功
|
||||||
if (reply.data[5] > 0) {
|
int dataLength = (reply.data[5] << 8) + reply.data[6];
|
||||||
reply.data.removeRange(0, 6);
|
// AppLog.log("dataLength:$dataLength");
|
||||||
|
// var dataLength = reply.data[5];
|
||||||
|
if (dataLength > 0) {
|
||||||
|
reply.data.removeRange(0, 7);
|
||||||
// 把得到的数据按8位分割成数组 然后塞进一个新的数组里面
|
// 把得到的数据按8位分割成数组 然后塞进一个新的数组里面
|
||||||
var getList = splitList(reply.data, 8);
|
if(reply.data.length < 17){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var getList = splitList(reply.data, 17);
|
||||||
|
AppLog.log("getList:$getList");
|
||||||
var uploadList = [];
|
var uploadList = [];
|
||||||
for (int i = 0; i < getList.length; i++) {
|
for (int i = 0; i < getList.length; i++) {
|
||||||
var indexList = getList[i];
|
var indexList = getList[i];
|
||||||
|
AppLog.log("indexList:$indexList");
|
||||||
var indexMap = {};
|
var indexMap = {};
|
||||||
indexMap["seq"] = indexList[0].toString();
|
indexMap["type"] = indexList[0].toString();
|
||||||
indexMap["user"] = indexList[3].toString();
|
|
||||||
indexMap["pwd"] = indexList[2].toString();
|
if(indexList[0] == 2){
|
||||||
|
var passwordData = indexList.sublist(7, 17);
|
||||||
|
var password = utf8String(passwordData);
|
||||||
|
AppLog.log("password:$password passwordData:$passwordData");
|
||||||
|
indexMap["user"] = password;
|
||||||
|
}else{
|
||||||
|
int userNo = (indexList[1]*255) + indexList[2];
|
||||||
|
indexMap["user"] = userNo.toString();
|
||||||
|
}
|
||||||
|
|
||||||
indexMap["success"] = "1";
|
indexMap["success"] = "1";
|
||||||
indexMap["type"] = indexList[1].toString();
|
|
||||||
|
|
||||||
int value = ((0xff & indexList[(4)]) << 24 |
|
int time = ((0xff & indexList[(3)]) << 24 |
|
||||||
(0xff & indexList[5]) << 16 |
|
(0xff & indexList[4]) << 16 |
|
||||||
(0xff & indexList[6]) << 8 |
|
(0xff & indexList[5]) << 8 |
|
||||||
(0xFF & indexList[7]));
|
(0xFF & indexList[6]));
|
||||||
// indexMap["date"] = DateTool().dateToYMDHNSString("$value");
|
indexMap["date"] = "${time * 1000}";
|
||||||
|
|
||||||
indexMap["date"] = "${value * 1000}";
|
|
||||||
uploadList.add(indexMap);
|
uploadList.add(indexMap);
|
||||||
}
|
}
|
||||||
lockRecordUploadData(uploadList);
|
lockRecordUploadData(uploadList);
|
||||||
|
|
||||||
|
if(dataLength == state.logCountPage){
|
||||||
|
state.ifHaveNext = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 0x06:
|
case 0x06:
|
||||||
//无权限
|
//无权限 需要鉴权
|
||||||
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
//失败
|
//失败
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询事件记录(页数查询)
|
|
||||||
// Future<void> senderReferEventRecordNumber() async {
|
|
||||||
// BlueManage().bludSendData(BlueManage().connectDeviceMacAddress, BlueManage().connectDeviceName, (DeviceConnectionState state) async {
|
|
||||||
// if (state == DeviceConnectionState.connected) {
|
|
||||||
// var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
|
||||||
// List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
|
||||||
//
|
|
||||||
// var token = await Storage.getStringList(saveBlueToken);
|
|
||||||
// List<int> getTokenList = changeStringListToIntList(token!);
|
|
||||||
//
|
|
||||||
// var publicKey = await Storage.getStringList(saveBluePublicKey);
|
|
||||||
// List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
|
|
||||||
//
|
|
||||||
// IoSenderManage.senderReferEventRecordNumberCommand(
|
|
||||||
// keyID:BlueManage().connectDeviceName,
|
|
||||||
// userID:await Storage.getUid(),
|
|
||||||
// logsCount:20,
|
|
||||||
// logsNo:1,
|
|
||||||
// token:getTokenList,
|
|
||||||
// needAuthor:1,
|
|
||||||
// publicKey:getPublicKeyList,
|
|
||||||
// privateKey:getPrivateKeyList,
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
|
|
||||||
// 查询事件记录(时间查询)
|
// 查询事件记录(时间查询)
|
||||||
Future<void> senderReferEventRecordTime(int time) async {
|
Future<void> senderReferEventRecordTime() async {
|
||||||
BlueManage().bludSendData(BlueManage().connectDeviceName,
|
showEasyLoading();
|
||||||
(BluetoothConnectionState state) async {
|
showBlueConnetctToastTimer(action: (){
|
||||||
if (state == BluetoothConnectionState.connected) {
|
dismissEasyLoading();
|
||||||
|
});
|
||||||
|
BlueManage().bludSendData(BlueManage().connectDeviceName, (BluetoothConnectionState connectionStateState) async {
|
||||||
|
if (connectionStateState == BluetoothConnectionState.connected) {
|
||||||
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||||
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||||
|
|
||||||
@ -136,61 +108,79 @@ class LockOperatingRecordLogic extends BaseGetXController {
|
|||||||
var publicKey = await Storage.getStringList(saveBluePublicKey);
|
var publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||||
List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
|
List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
|
||||||
|
|
||||||
EasyLoading.show();
|
|
||||||
IoSenderManage.senderReferEventRecordTimeCommand(
|
IoSenderManage.senderReferEventRecordTimeCommand(
|
||||||
keyID: BlueManage().connectDeviceName,
|
keyID: BlueManage().connectDeviceName,
|
||||||
userID: await Storage.getUid(),
|
userID: await Storage.getUid(),
|
||||||
logsCount: 20,
|
logsCount: state.logCountPage,
|
||||||
// time:DateTime.now().millisecondsSinceEpoch~/1000,
|
// time:DateTime.now().millisecondsSinceEpoch~/1000,
|
||||||
time: time,
|
time: state.operateDate,
|
||||||
token: getTokenList,
|
token: getTokenList,
|
||||||
needAuthor: 1,
|
needAuthor: 1,
|
||||||
publicKey: getPublicKeyList,
|
publicKey: getPublicKeyList,
|
||||||
privateKey: getPrivateKeyList,
|
privateKey: getPrivateKeyList,
|
||||||
);
|
);
|
||||||
|
} else if (connectionStateState == BluetoothConnectionState.disconnected) {
|
||||||
|
dismissEasyLoading();
|
||||||
|
cancelBlueConnetctToastTimer();
|
||||||
|
if(state.ifCurrentScreen.value == true){
|
||||||
|
showBlueConnetctToast();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
//请求操作记录列表
|
//请求操作记录列表
|
||||||
void mockNetworkDataRequest() async {
|
Future<KeyOperationRecordEntity> mockNetworkDataRequest() async {
|
||||||
KeyOperationRecordEntity entity = await ApiRepository.to.lockRecordList(
|
KeyOperationRecordEntity entity = await ApiRepository.to.lockRecordList(
|
||||||
endDate:'',
|
lockId:CommonDataManage().currentKeyInfo.lockId.toString(),
|
||||||
keyId:"",
|
pageNo:pageNo.toString(),
|
||||||
keyStatus:'0',
|
|
||||||
lockId:state.keyInfos.value.lockId.toString(),
|
|
||||||
operatorUid:'1',
|
|
||||||
pageNo:'1',
|
|
||||||
pageSize:'20',
|
|
||||||
startDate:'',
|
|
||||||
recordType:'',
|
recordType:'',
|
||||||
searchStr:'',
|
searchStr:'',
|
||||||
timezoneRawOffSet:'',
|
startDate:'',
|
||||||
keyboardPwdId:'',
|
endDate:'',
|
||||||
cardId:'',
|
keyboardPwdId: state.type == 1 ? state.idStr : '',
|
||||||
fingerprintId:'');
|
cardId: state.type == 2 ? state.idStr : '',
|
||||||
|
fingerprintId: state.type == 3 ? state.idStr : '',
|
||||||
|
keyId: state.type == 5 ? state.idStr : '',
|
||||||
|
faceId: state.type == 4 ? state.idStr : '',
|
||||||
|
pageSize:pageSize,
|
||||||
|
);
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
state.lockOperatingRecordListData.value = entity.data!.itemList!;
|
if (pageNo == 1) {
|
||||||
} else {}
|
state.lockOperatingRecordListData.value = entity.data!.itemList!;
|
||||||
|
pageNo++;
|
||||||
|
} else {
|
||||||
|
if (entity.data!.itemList!.isNotEmpty) {
|
||||||
|
state.lockOperatingRecordListData.value.addAll(entity.data!.itemList!);
|
||||||
|
pageNo++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return entity;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询锁记录最后时间
|
// 查询锁记录最后时间
|
||||||
void getLockRecordLastUploadDataTime() async {
|
void getLockRecordLastUploadDataTime() async {
|
||||||
LockOperatingRecordGetLastRecordTimeEntity entity = await ApiRepository.to
|
LockOperatingRecordGetLastRecordTimeEntity entity = await ApiRepository.to
|
||||||
.getLockRecordLastUploadDataTime(
|
.getLockRecordLastUploadDataTime(
|
||||||
lockId: state.keyInfos.value.lockId.toString());
|
lockId: CommonDataManage().currentKeyInfo.lockId.toString());
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
senderReferEventRecordTime(entity.data!.operateDate! ~/ 1000);
|
state.operateDate = entity.data!.operateDate! ~/ 1000;
|
||||||
|
senderReferEventRecordTime();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 操作记录上传
|
// 操作记录上传
|
||||||
void lockRecordUploadData(List list) async {
|
void lockRecordUploadData(List list) async {
|
||||||
KeyOperationRecordEntity entity = await ApiRepository.to
|
KeyOperationRecordEntity entity = await ApiRepository.to
|
||||||
.lockRecordUploadData(
|
.lockRecordUploadData(lockId: CommonDataManage().currentKeyInfo.lockId.toString(), records: list);
|
||||||
lockId: state.keyInfos.value.lockId.toString(), records: list);
|
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
mockNetworkDataRequest();
|
if(state.ifHaveNext == true){
|
||||||
|
getLockRecordLastUploadDataTime();
|
||||||
|
}else{
|
||||||
|
pageNo = 1;
|
||||||
|
mockNetworkDataRequest();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -211,15 +201,15 @@ class LockOperatingRecordLogic extends BaseGetXController {
|
|||||||
// 获取是否是演示模式 演示模式不获取接口
|
// 获取是否是演示模式 演示模式不获取接口
|
||||||
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||||
if (isDemoMode == false) {
|
if (isDemoMode == false) {
|
||||||
_initReplySubscription();
|
// _initReplySubscription();
|
||||||
|
|
||||||
mockNetworkDataRequest();
|
// mockNetworkDataRequest();
|
||||||
|
// _getDoorLockLogListRefreshUIAction();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<void> onInit() async {
|
Future<void> onInit() async {
|
||||||
// TODO: implement onInit
|
|
||||||
super.onInit();
|
super.onInit();
|
||||||
|
|
||||||
// 获取是否是演示模式 演示模式不获取接口
|
// 获取是否是演示模式 演示模式不获取接口
|
||||||
@ -228,6 +218,7 @@ class LockOperatingRecordLogic extends BaseGetXController {
|
|||||||
getLockRecordLastUploadDataTime();
|
getLockRecordLastUploadDataTime();
|
||||||
// senderReferEventRecordTime();
|
// senderReferEventRecordTime();
|
||||||
// senderReferEventRecordNumber();
|
// senderReferEventRecordNumber();
|
||||||
|
_initReplySubscription();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -236,10 +227,11 @@ class LockOperatingRecordLogic extends BaseGetXController {
|
|||||||
// TODO: implement onClose
|
// TODO: implement onClose
|
||||||
super.onClose();
|
super.onClose();
|
||||||
|
|
||||||
// 获取是否是演示模式 演示模式不获取接口
|
//获取是否是演示模式 演示模式不获取接口
|
||||||
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||||
if (isDemoMode == false) {
|
if (isDemoMode == false) {
|
||||||
_replySubscription.cancel();
|
_replySubscription.cancel();
|
||||||
|
// _getDoorLockLogListRefreshUIEvent?.cancel();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,14 +1,19 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecord/keyOperationRecord_entity.dart';
|
|
||||||
|
|
||||||
import '../../../app_settings/app_colors.dart';
|
import '../../../app_settings/app_colors.dart';
|
||||||
|
import '../../../tools/EasyRefreshTool.dart';
|
||||||
|
import '../../../tools/appRouteObserver.dart';
|
||||||
|
import '../../../tools/commonDataManage.dart';
|
||||||
import '../../../tools/custom_bottom_sheet.dart';
|
import '../../../tools/custom_bottom_sheet.dart';
|
||||||
|
import '../../../tools/keySearchWidget.dart';
|
||||||
import '../../../tools/noData.dart';
|
import '../../../tools/noData.dart';
|
||||||
import '../../../tools/storage.dart';
|
import '../../../tools/storage.dart';
|
||||||
import '../../../tools/titleAppBar.dart';
|
import '../../../tools/titleAppBar.dart';
|
||||||
import '../../../translations/trans_lib.dart';
|
import '../../../translations/trans_lib.dart';
|
||||||
|
import 'keyOperationRecord_entity.dart';
|
||||||
import 'lockOperatingRecord_logic.dart';
|
import 'lockOperatingRecord_logic.dart';
|
||||||
|
|
||||||
class LockOperatingRecordPage extends StatefulWidget {
|
class LockOperatingRecordPage extends StatefulWidget {
|
||||||
@ -19,10 +24,28 @@ class LockOperatingRecordPage extends StatefulWidget {
|
|||||||
_LockOperatingRecordPageState();
|
_LockOperatingRecordPageState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _LockOperatingRecordPageState extends State<LockOperatingRecordPage> {
|
class _LockOperatingRecordPageState extends State<LockOperatingRecordPage> with RouteAware{
|
||||||
final logic = Get.put(LockOperatingRecordLogic());
|
final logic = Get.put(LockOperatingRecordLogic());
|
||||||
final state = Get.find<LockOperatingRecordLogic>().state;
|
final state = Get.find<LockOperatingRecordLogic>().state;
|
||||||
|
|
||||||
|
Future<void> getHttpData() async {
|
||||||
|
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||||
|
if (isDemoMode == false) {
|
||||||
|
logic.mockNetworkDataRequest().then((KeyOperationRecordEntity value){
|
||||||
|
if (mounted) {
|
||||||
|
setState(() {});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
|
||||||
|
getHttpData();
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
@ -32,8 +55,8 @@ class _LockOperatingRecordPageState extends State<LockOperatingRecordPage> {
|
|||||||
haveBack: true,
|
haveBack: true,
|
||||||
backgroundColor: AppColors.mainColor,
|
backgroundColor: AppColors.mainColor,
|
||||||
actionsList: [
|
actionsList: [
|
||||||
(state.keyInfos.value.isLockOwner == 1 ||
|
(CommonDataManage().currentKeyInfo.isLockOwner == 1 ||
|
||||||
state.keyInfos.value.keyRight == 1)
|
CommonDataManage().currentKeyInfo.keyRight == 1)
|
||||||
? IconButton(
|
? IconButton(
|
||||||
icon: Image.asset(
|
icon: Image.asset(
|
||||||
'images/icon_bar_more.png',
|
'images/icon_bar_more.png',
|
||||||
@ -53,61 +76,41 @@ class _LockOperatingRecordPageState extends State<LockOperatingRecordPage> {
|
|||||||
: Container(),
|
: Container(),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
body: Column(
|
body: EasyRefreshTool(
|
||||||
children: [
|
onRefresh: (){
|
||||||
(state.keyInfos.value.isLockOwner == 1 ||
|
logic.pageNo = 1;
|
||||||
state.keyInfos.value.keyRight == 1)
|
getHttpData();
|
||||||
? Column(
|
},
|
||||||
children: [
|
onLoad: (){
|
||||||
Container(
|
getHttpData();
|
||||||
padding: EdgeInsets.all(20.h),
|
},
|
||||||
child: Text(
|
child: Column(
|
||||||
TranslationLoader.lanKeys!.lockOperatingRecordTip!.tr,
|
children: [
|
||||||
textAlign: TextAlign.start,
|
(CommonDataManage().currentKeyInfo.isLockOwner == 1 ||
|
||||||
style: TextStyle(fontSize: 20.sp),
|
CommonDataManage().currentKeyInfo.keyRight == 1)
|
||||||
|
? Column(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
padding: EdgeInsets.only(left:20.h, right: 20.h, top: 20.h),
|
||||||
|
child: Text(
|
||||||
|
TranslationLoader.lanKeys!.lockOperatingRecordTip!.tr,
|
||||||
|
textAlign: TextAlign.start,
|
||||||
|
style: TextStyle(fontSize: 20.sp),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
KeySearchWidget(
|
||||||
_searchWidget(),
|
editingController: state.searchController,
|
||||||
],
|
onSubmittedAction: () {
|
||||||
)
|
logic.pageNo = 1;
|
||||||
: Container(),
|
getHttpData();
|
||||||
SizedBox(height: 10.h),
|
},
|
||||||
Expanded(child: _buildMainUI()),
|
),
|
||||||
],
|
],
|
||||||
),
|
)
|
||||||
);
|
: Container(),
|
||||||
}
|
SizedBox(height: 10.h),
|
||||||
|
Expanded(child: _buildMainUI()),
|
||||||
Widget _searchWidget() {
|
],
|
||||||
return Container(
|
|
||||||
height: 60.h,
|
|
||||||
margin: EdgeInsets.only(left: 20.w, right: 10.w),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: Colors.white, borderRadius: BorderRadius.circular(5)),
|
|
||||||
child: TextField(
|
|
||||||
//输入框一行
|
|
||||||
maxLines: 1,
|
|
||||||
// controller: _controller,
|
|
||||||
autofocus: false,
|
|
||||||
|
|
||||||
decoration: InputDecoration(
|
|
||||||
//输入里面输入文字内边距设置
|
|
||||||
contentPadding: const EdgeInsets.only(
|
|
||||||
top: 12.0, left: -19.0, right: -15.0, bottom: 8.0),
|
|
||||||
hintText: TranslationLoader.lanKeys!.pleaseEnter!.tr,
|
|
||||||
hintStyle: TextStyle(fontSize: 22.sp, height: 3.0),
|
|
||||||
//不需要输入框下划线
|
|
||||||
border: InputBorder.none,
|
|
||||||
//左边图标设置
|
|
||||||
icon: Padding(
|
|
||||||
padding: EdgeInsets.only(
|
|
||||||
top: 20.h, bottom: 20.h, right: 20.w, left: 10.w),
|
|
||||||
child: Image.asset(
|
|
||||||
'images/main/icon_main_search.png',
|
|
||||||
width: 40.w,
|
|
||||||
height: 40.w,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@ -135,7 +138,7 @@ class _LockOperatingRecordPageState extends State<LockOperatingRecordPage> {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
: NoData());
|
: NoData(noDataHeight: 1.sh - ScreenUtil().statusBarHeight - ScreenUtil().bottomBarHeight));
|
||||||
}
|
}
|
||||||
|
|
||||||
String getTypeIcon(int type) {
|
String getTypeIcon(int type) {
|
||||||
@ -228,16 +231,70 @@ class _LockOperatingRecordPageState extends State<LockOperatingRecordPage> {
|
|||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
return AlertBottomWidget(
|
return AlertBottomWidget(
|
||||||
topTitle: '',
|
topTitle: '',
|
||||||
items: const ['读取记录', '清空记录', '导出记录'],
|
// items: const ['读取记录', '清空记录', '导出记录'],
|
||||||
|
items: const ['清空记录'],
|
||||||
chooseCallback: (value) {
|
chooseCallback: (value) {
|
||||||
int getSelectIndex = value;
|
int getSelectIndex = value;
|
||||||
|
// if (getSelectIndex == 0) {
|
||||||
|
// logic.mockNetworkDataRequest();
|
||||||
|
// } else if (getSelectIndex == 1) {
|
||||||
|
// logic.clearOperationRecordRequest();
|
||||||
|
// }
|
||||||
if (getSelectIndex == 0) {
|
if (getSelectIndex == 0) {
|
||||||
logic.mockNetworkDataRequest();
|
|
||||||
} else if (getSelectIndex == 1) {
|
|
||||||
logic.clearOperationRecordRequest();
|
logic.clearOperationRecordRequest();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void didChangeDependencies() {
|
||||||
|
// TODO: implement didChangeDependencies
|
||||||
|
super.didChangeDependencies();
|
||||||
|
|
||||||
|
/// 路由订阅
|
||||||
|
AppRouteObserver().routeObserver.subscribe(this, ModalRoute.of(context)!);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
// TODO: implement dispose
|
||||||
|
/// 取消路由订阅
|
||||||
|
AppRouteObserver().routeObserver.unsubscribe(this);
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 从上级界面进入 当前界面即将出现
|
||||||
|
@override
|
||||||
|
void didPush() {
|
||||||
|
super.didPush();
|
||||||
|
state.ifCurrentScreen.value = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 返回上一个界面 当前界面即将消失
|
||||||
|
@override
|
||||||
|
void didPop() {
|
||||||
|
super.didPop();
|
||||||
|
logic.cancelBlueConnetctToastTimer();
|
||||||
|
if (EasyLoading.isShow) EasyLoading.dismiss(animation: true);
|
||||||
|
state.ifCurrentScreen.value = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 从下级返回 当前界面即将出现
|
||||||
|
@override
|
||||||
|
void didPopNext() {
|
||||||
|
super.didPopNext();
|
||||||
|
state.ifCurrentScreen.value = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 进入下级界面 当前界面即将消失
|
||||||
|
@override
|
||||||
|
void didPushNext() {
|
||||||
|
super.didPushNext();
|
||||||
|
logic.cancelBlueConnetctToastTimer();
|
||||||
|
if (EasyLoading.isShow) EasyLoading.dismiss(animation: true);
|
||||||
|
state.ifCurrentScreen.value = false;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,15 +1,30 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecord/keyOperationRecord_entity.dart';
|
|
||||||
|
|
||||||
import '../../lockMian/entity/lockListInfo_entity.dart';
|
import '../../lockMian/entity/lockListInfo_entity.dart';
|
||||||
|
import 'keyOperationRecord_entity.dart';
|
||||||
|
|
||||||
class LockOperatingRecordState {
|
class LockOperatingRecordState {
|
||||||
final keyInfos = LockListInfoItemEntity().obs;
|
|
||||||
final lockOperatingRecordListData = <KeyRecordDataItem>[].obs;
|
final lockOperatingRecordListData = <KeyRecordDataItem>[].obs;
|
||||||
final TextEditingController searchController = TextEditingController();
|
final TextEditingController searchController = TextEditingController();
|
||||||
|
|
||||||
|
var ifCurrentScreen = true.obs; // 是否是当前界面,用于判断是否需要针对当前界面进行展示
|
||||||
|
var operateDate = 0; // 按日期查询消息记录的时间戳
|
||||||
|
var ifHaveNext = false; // 页码
|
||||||
|
var logCountPage = 10; // 蓝牙记录一页多少个
|
||||||
|
var idStr = ""; //
|
||||||
|
var type = 0; // 1:密码 2:卡 3:指纹 4:人脸 5:钥匙
|
||||||
|
|
||||||
LockOperatingRecordState() {
|
LockOperatingRecordState() {
|
||||||
keyInfos.value = Get.arguments["keyInfo"];
|
Map map = Get.arguments;
|
||||||
|
if(map["id"] != null){
|
||||||
|
idStr = Get.arguments["id"];
|
||||||
|
}
|
||||||
|
if(map["idStr"] != null){
|
||||||
|
idStr = Get.arguments["idStr"];
|
||||||
|
}
|
||||||
|
if(map["type"] != null){
|
||||||
|
type = Get.arguments["type"];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecord/keyOperationRecord_entity.dart';
|
|
||||||
|
|
||||||
import '../../../../../network/api_repository.dart';
|
import '../../../../../network/api_repository.dart';
|
||||||
import '../../../../../tools/baseGetXController.dart';
|
import '../../../../../tools/baseGetXController.dart';
|
||||||
import '../../../../../tools/eventBusEventManage.dart';
|
import '../../../../../tools/eventBusEventManage.dart';
|
||||||
|
import '../../../lockOperatingRecord/keyOperationRecord_entity.dart';
|
||||||
import 'editLockName_state.dart';
|
import 'editLockName_state.dart';
|
||||||
|
|
||||||
class EditLockNameLogic extends BaseGetXController {
|
class EditLockNameLogic extends BaseGetXController {
|
||||||
|
|||||||
@ -2,7 +2,6 @@ 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/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecord/keyOperationRecord_entity.dart';
|
|
||||||
|
|
||||||
import '../../../../../blue/blue_manage.dart';
|
import '../../../../../blue/blue_manage.dart';
|
||||||
import '../../../../../blue/io_protocol/io_getStarLockStatusInfo.dart';
|
import '../../../../../blue/io_protocol/io_getStarLockStatusInfo.dart';
|
||||||
@ -14,6 +13,7 @@ import '../../../../../network/api_repository.dart';
|
|||||||
import '../../../../../tools/baseGetXController.dart';
|
import '../../../../../tools/baseGetXController.dart';
|
||||||
import '../../../../../tools/eventBusEventManage.dart';
|
import '../../../../../tools/eventBusEventManage.dart';
|
||||||
import '../../../../../tools/storage.dart';
|
import '../../../../../tools/storage.dart';
|
||||||
|
import '../../../lockOperatingRecord/keyOperationRecord_entity.dart';
|
||||||
import 'uploadElectricQuantity_state.dart';
|
import 'uploadElectricQuantity_state.dart';
|
||||||
|
|
||||||
class UploadElectricQuantityLogic extends BaseGetXController {
|
class UploadElectricQuantityLogic extends BaseGetXController {
|
||||||
@ -24,7 +24,8 @@ class UploadElectricQuantityLogic extends BaseGetXController {
|
|||||||
KeyOperationRecordEntity entity = await ApiRepository.to.uploadElectricQuantity(
|
KeyOperationRecordEntity entity = await ApiRepository.to.uploadElectricQuantity(
|
||||||
electricQuantity:electricQuantity,
|
electricQuantity:electricQuantity,
|
||||||
electricQuantityStandby: electricQuantityStandby,
|
electricQuantityStandby: electricQuantityStandby,
|
||||||
lockId: state.lockSetInfoData.value.lockId.toString()
|
lockId: state.lockSetInfoData.value.lockId.toString(),
|
||||||
|
isUnShowLoading: false
|
||||||
);
|
);
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
showToast("锁电量更新成功".tr, something: () {
|
showToast("锁电量更新成功".tr, something: () {
|
||||||
|
|||||||
@ -195,7 +195,7 @@ class LockTimeLogic extends BaseGetXController{
|
|||||||
|
|
||||||
// getStarLockStatus();
|
// getStarLockStatus();
|
||||||
// getLockTimeFromGateway();
|
// getLockTimeFromGateway();
|
||||||
// getServerDatetime(false);
|
getServerDatetime();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
@ -57,7 +57,7 @@ class _LockTimePageState extends State<LockTimePage> with RouteAware{
|
|||||||
onClick: () {
|
onClick: () {
|
||||||
// logic.sendTiming();
|
// logic.sendTiming();
|
||||||
// logic.getServerDatetime();
|
// logic.getServerDatetime();
|
||||||
logic.getServerDatetime();
|
logic.sendTiming();
|
||||||
}),
|
}),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 40.h,
|
height: 40.h,
|
||||||
|
|||||||
@ -169,10 +169,10 @@ class _PalmDetailPageState extends State<PalmDetailPage> with RouteAware {
|
|||||||
rightTitle: "",
|
rightTitle: "",
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () {
|
action: () {
|
||||||
Get.toNamed(Routers.keyOperationRecordPage, arguments: {
|
// Get.toNamed(Routers.keyOperationRecordPage, arguments: {
|
||||||
'lockId': state.fingerprintItemData.value.lockId.toString(),
|
// 'lockId': state.fingerprintItemData.value.lockId.toString(),
|
||||||
'cardId': state.fingerprintItemData.value.cardId.toString()
|
// 'cardId': state.fingerprintItemData.value.cardId.toString()
|
||||||
});
|
// });
|
||||||
}),
|
}),
|
||||||
// SizedBox(height: 40.h),
|
// SizedBox(height: 40.h),
|
||||||
// addControlsBtn(type),
|
// addControlsBtn(type),
|
||||||
|
|||||||
@ -2,7 +2,6 @@ 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/main/lockDetail/passwordKey/passwordKeyDetail/passwordKeyDetail_state.dart';
|
import 'package:star_lock/main/lockDetail/passwordKey/passwordKeyDetail/passwordKeyDetail_state.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/network/api_repository.dart';
|
import 'package:star_lock/network/api_repository.dart';
|
||||||
@ -84,7 +83,7 @@ class PasswordKeyDetailLogic extends BaseGetXController {
|
|||||||
deleteType:1);
|
deleteType:1);
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
showToast("删除成功".tr, something: (){
|
showToast("删除成功".tr, something: (){
|
||||||
eventBus.fire(GetPasswordListRefreshUI());
|
// eventBus.fire(GetPasswordListRefreshUI());
|
||||||
Get.back(result: "deletScuess");
|
Get.back(result: "deletScuess");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -219,7 +218,7 @@ class PasswordKeyDetailLogic extends BaseGetXController {
|
|||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
//每日循环 6 每天开始和结束时间指定时间段内有效
|
//每日循环 6 每天开始和结束时间指定时间段内有效
|
||||||
useDateStr = '周日 $starHour:00-$endHour:00';
|
useDateStr = '每日 $starHour:00-$endHour:00';
|
||||||
state.isCirculation.value = true;
|
state.isCirculation.value = true;
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
@ -302,7 +301,7 @@ class PasswordKeyDetailLogic extends BaseGetXController {
|
|||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
//每日循环 6 每天开始和结束时间指定时间段内有效
|
//每日循环 6 每天开始和结束时间指定时间段内有效
|
||||||
useDateStr = '类型:循环\n周日 $starHour:00-$endHour:00';
|
useDateStr = '类型:循环\n每日 $starHour:00-$endHour:00';
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
//工作日循环 7 工作日开始和结束时间指定的时间段内有效
|
//工作日循环 7 工作日开始和结束时间指定的时间段内有效
|
||||||
|
|||||||
@ -53,6 +53,14 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage> with Rout
|
|||||||
body: SingleChildScrollView(
|
body: SingleChildScrollView(
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
|
Obx(() => Visibility(
|
||||||
|
visible: state.itemData.value.isCustom! == 1,
|
||||||
|
child: CommonItem(
|
||||||
|
leftTitel: "${"密码".tr}${TranslationLoader.lanKeys!.number!.tr}",
|
||||||
|
rightTitle: state.itemData.value.pwdUserNo.toString(),
|
||||||
|
isHaveDirection: false,
|
||||||
|
isHaveLine: true),
|
||||||
|
)),
|
||||||
Obx(() => CommonItem(
|
Obx(() => CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.password!.tr,
|
leftTitel: TranslationLoader.lanKeys!.password!.tr,
|
||||||
rightTitle: state.keyboardPwd.value,
|
rightTitle: state.keyboardPwd.value,
|
||||||
@ -133,10 +141,10 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage> with Rout
|
|||||||
rightTitle: "",
|
rightTitle: "",
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () {
|
action: () {
|
||||||
Navigator.pushNamed(context, Routers.keyOperationRecordPage,
|
Navigator.pushNamed(context, Routers.lockOperatingRecordPage,
|
||||||
arguments: {
|
arguments: {
|
||||||
'lockId': state.itemData.value.lockId.toString(),
|
'type': 1,
|
||||||
'keyId': state.itemData.value.keyboardPwdId.toString()
|
'id': state.itemData.value.keyboardPwdId.toString()
|
||||||
});
|
});
|
||||||
}),
|
}),
|
||||||
Container(height: 40.h),
|
Container(height: 40.h),
|
||||||
|
|||||||
@ -31,7 +31,7 @@ class PasswordKeyListLogic extends BaseGetXController {
|
|||||||
_replyAddPassword(reply);
|
_replyAddPassword(reply);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(reply is SenderResetPasswordsReply){
|
if((reply is SenderResetPasswordsReply) && (state.ifCurrentScreen.value == true)){
|
||||||
_replyResetPassword(reply);
|
_replyResetPassword(reply);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -62,9 +62,9 @@ class PasswordKeyListLogic extends BaseGetXController {
|
|||||||
IoSenderManage.senderCustomPasswordsCommand(
|
IoSenderManage.senderCustomPasswordsCommand(
|
||||||
keyID:"0",
|
keyID:"0",
|
||||||
userID:(await Storage.getUid())!,
|
userID:(await Storage.getUid())!,
|
||||||
pwdNo:state.pwdNo,
|
pwdNo:state.itemData.isCustom == 1 ? state.pwdNo : 0,
|
||||||
pwd:"0",//state.deletPWD,
|
pwd:state.pwd,//state.deletPWD,
|
||||||
operate: 2,
|
operate: state.itemData.isCustom == 1 ? 2 : 3,
|
||||||
isAdmin: 0,
|
isAdmin: 0,
|
||||||
useCountLimit: 0xffff,
|
useCountLimit: 0xffff,
|
||||||
startTime:0x11223344,
|
startTime:0x11223344,
|
||||||
@ -142,9 +142,9 @@ class PasswordKeyListLogic extends BaseGetXController {
|
|||||||
IoSenderManage.senderCustomPasswordsCommand(
|
IoSenderManage.senderCustomPasswordsCommand(
|
||||||
keyID:"0",
|
keyID:"0",
|
||||||
userID:(await Storage.getUid())!,
|
userID:(await Storage.getUid())!,
|
||||||
pwdNo:state.pwdNo,
|
pwdNo:state.itemData.isCustom == 1 ? state.pwdNo : 0,
|
||||||
pwd:"0",//state.deletPWD,
|
pwd:state.pwd,//state.deletPWD,
|
||||||
operate: 2,
|
operate: state.itemData.isCustom == 1 ? 2 : 3,
|
||||||
isAdmin: 0,
|
isAdmin: 0,
|
||||||
useCountLimit: 0xffff,
|
useCountLimit: 0xffff,
|
||||||
startTime:0x11223344,
|
startTime:0x11223344,
|
||||||
@ -217,6 +217,7 @@ class PasswordKeyListLogic extends BaseGetXController {
|
|||||||
state.searchController.text);
|
state.searchController.text);
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
if (pageNo == 1) {
|
if (pageNo == 1) {
|
||||||
|
state.itemDataList.value.clear();
|
||||||
state.itemDataList.value = entity.data!.itemList!;
|
state.itemDataList.value = entity.data!.itemList!;
|
||||||
pageNo++;
|
pageNo++;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -141,6 +141,7 @@ class _PasswordKeyListPageState extends State<PasswordKeyListPage> with RouteAwa
|
|||||||
ShowTipView().showIosTipWithContentDialog("确定要删除吗?".tr, () async {
|
ShowTipView().showIosTipWithContentDialog("确定要删除吗?".tr, () async {
|
||||||
state.itemData = passwordKeyListItem;
|
state.itemData = passwordKeyListItem;
|
||||||
state.pwdNo = passwordKeyListItem.pwdUserNo!;
|
state.pwdNo = passwordKeyListItem.pwdUserNo!;
|
||||||
|
state.pwd = passwordKeyListItem.keyboardPwd!;
|
||||||
logic.senderCustomPasswords();
|
logic.senderCustomPasswords();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|||||||
@ -14,6 +14,7 @@ class PasswordKeyListState {
|
|||||||
var sureBtnState = 0.obs;// 0普通状态(可用) 1连接中(不可用)
|
var sureBtnState = 0.obs;// 0普通状态(可用) 1连接中(不可用)
|
||||||
|
|
||||||
var pwdNo = 0;
|
var pwdNo = 0;
|
||||||
|
var pwd = "0";
|
||||||
var encrpyKey = <int>[];
|
var encrpyKey = <int>[];
|
||||||
PasswordKeyListState() {
|
PasswordKeyListState() {
|
||||||
Map map = Get.arguments;
|
Map map = Get.arguments;
|
||||||
|
|||||||
@ -130,9 +130,10 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
|
|||||||
state.getPwdStr.value = entity.data!.keyboardPwd!;
|
state.getPwdStr.value = entity.data!.keyboardPwd!;
|
||||||
}
|
}
|
||||||
eventBus.fire(GetPasswordListRefreshUI());
|
eventBus.fire(GetPasswordListRefreshUI());
|
||||||
} else {
|
|
||||||
showToast('${entity.errorMsg}');
|
|
||||||
}
|
}
|
||||||
|
// else {
|
||||||
|
// showToast('${entity.errorMsg}');
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
//自定义密码请求
|
//自定义密码请求
|
||||||
@ -266,6 +267,13 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
|
|||||||
var signKey = await Storage.getStringList(saveBlueSignKey);
|
var signKey = await Storage.getStringList(saveBlueSignKey);
|
||||||
List<int> signKeyDataList = changeStringListToIntList(signKey!);
|
List<int> signKeyDataList = changeStringListToIntList(signKey!);
|
||||||
|
|
||||||
|
var startDate = DateTool().dateToTimestamp(state.customBeginTime.value, 1);
|
||||||
|
var endDate = DateTool().dateToTimestamp(state.customEndTime.value, 1);
|
||||||
|
//非永久 须有时限
|
||||||
|
if (state.isPermanent.value == true) {
|
||||||
|
startDate = 0;
|
||||||
|
endDate = 0;
|
||||||
|
}
|
||||||
IoSenderManage.senderCustomPasswordsCommand(
|
IoSenderManage.senderCustomPasswordsCommand(
|
||||||
keyID: "1",
|
keyID: "1",
|
||||||
userID: await Storage.getUid(),
|
userID: await Storage.getUid(),
|
||||||
@ -274,8 +282,8 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
|
|||||||
operate: 0,
|
operate: 0,
|
||||||
isAdmin: state.isAdministrator.value == true ? 1 : 0,
|
isAdmin: state.isAdministrator.value == true ? 1 : 0,
|
||||||
useCountLimit: 0xffff,
|
useCountLimit: 0xffff,
|
||||||
startTime: DateTool().dateToTimestamp(state.customBeginTime.value, 1)~/1000,
|
startTime: startDate ~/1000,
|
||||||
endTime: DateTool().dateToTimestamp(state.customEndTime.value, 1)~/1000,
|
endTime: endDate ~/1000,
|
||||||
needAuthor: 1,
|
needAuthor: 1,
|
||||||
isBeforeAddUser: false,
|
isBeforeAddUser: false,
|
||||||
signKey: signKeyDataList,
|
signKey: signKeyDataList,
|
||||||
@ -357,8 +365,8 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
|
|||||||
operate: 0,
|
operate: 0,
|
||||||
isAdmin: state.isAdministrator.value == true ? 1 : 0,
|
isAdmin: state.isAdministrator.value == true ? 1 : 0,
|
||||||
useCountLimit: 0xffff,
|
useCountLimit: 0xffff,
|
||||||
startTime: DateTool().dateToTimestamp(state.customBeginTime.value, 1)~/1000,
|
startTime: startDate ~/1000,
|
||||||
endTime: DateTool().dateToTimestamp(state.customEndTime.value, 1)~/1000,
|
endTime: endDate ~/1000,
|
||||||
needAuthor: 1,
|
needAuthor: 1,
|
||||||
isBeforeAddUser: false,
|
isBeforeAddUser: false,
|
||||||
signKey: signKeyDataList,
|
signKey: signKeyDataList,
|
||||||
|
|||||||
@ -12,6 +12,7 @@ import 'package:star_lock/blue/io_type.dart';
|
|||||||
import 'package:star_lock/main/lockMian/entity/lockListInfo_entity.dart';
|
import 'package:star_lock/main/lockMian/entity/lockListInfo_entity.dart';
|
||||||
import 'package:star_lock/tools/commonDataManage.dart';
|
import 'package:star_lock/tools/commonDataManage.dart';
|
||||||
|
|
||||||
|
import '../../../app_settings/app_settings.dart';
|
||||||
import '../../../blue/blue_manage.dart';
|
import '../../../blue/blue_manage.dart';
|
||||||
import '../../../blue/io_protocol/io_addUser.dart';
|
import '../../../blue/io_protocol/io_addUser.dart';
|
||||||
import '../../../blue/io_reply.dart';
|
import '../../../blue/io_reply.dart';
|
||||||
@ -36,9 +37,9 @@ class SaveLockLogic extends BaseGetXController {
|
|||||||
_replyAddUserKey(reply);
|
_replyAddUserKey(reply);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (reply is SenderCustomPasswordsReply) {
|
// if (reply is SenderCustomPasswordsReply) {
|
||||||
_replySenderCustomPasswords(reply);
|
// _replySenderCustomPasswords(reply);
|
||||||
}
|
// }
|
||||||
|
|
||||||
// if (reply is ChangeAdministratorPasswordReply) {
|
// if (reply is ChangeAdministratorPasswordReply) {
|
||||||
// _replyChangeAdministratorPassword(reply);
|
// _replyChangeAdministratorPassword(reply);
|
||||||
@ -48,8 +49,6 @@ class SaveLockLogic extends BaseGetXController {
|
|||||||
|
|
||||||
// 添加用户
|
// 添加用户
|
||||||
Future<void> _replyAddUserKey(Reply reply) async {
|
Future<void> _replyAddUserKey(Reply reply) async {
|
||||||
// var lockId = reply.data.sublist(2, 42);
|
|
||||||
|
|
||||||
var token = reply.data.sublist(42, 46);
|
var token = reply.data.sublist(42, 46);
|
||||||
List<String> strTokenList = changeIntListToStringList(token);
|
List<String> strTokenList = changeIntListToStringList(token);
|
||||||
Storage.setStringList(saveBlueToken, strTokenList);
|
Storage.setStringList(saveBlueToken, strTokenList);
|
||||||
@ -57,9 +56,10 @@ class SaveLockLogic extends BaseGetXController {
|
|||||||
int status = reply.data[46];
|
int status = reply.data[46];
|
||||||
switch (status) {
|
switch (status) {
|
||||||
case 0x00:
|
case 0x00:
|
||||||
//成功
|
//成功 如果成功保存用户编号
|
||||||
state.lockUserNo = listChangInt(reply.data.sublist(47, 49));
|
state.lockUserNo = listChangInt(reply.data.sublist(47, 49));
|
||||||
|
|
||||||
|
// 关闭超时
|
||||||
cancelBlueConnetctToastTimer();
|
cancelBlueConnetctToastTimer();
|
||||||
bindBlueAdmin();
|
bindBlueAdmin();
|
||||||
break;
|
break;
|
||||||
@ -88,7 +88,7 @@ class SaveLockLogic extends BaseGetXController {
|
|||||||
endHour: 0,
|
endHour: 0,
|
||||||
endMin: 0,
|
endMin: 0,
|
||||||
role: 255,
|
role: 255,
|
||||||
password: "123456",
|
password: state.adminPassword,
|
||||||
needAuthor: 1,
|
needAuthor: 1,
|
||||||
publicKey: publicKeyDataList,
|
publicKey: publicKeyDataList,
|
||||||
privateKey: getPrivateKeyList,
|
privateKey: getPrivateKeyList,
|
||||||
@ -96,7 +96,7 @@ class SaveLockLogic extends BaseGetXController {
|
|||||||
isBeforeAddUser: true);
|
isBeforeAddUser: true);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
//失败
|
//失败 关闭loading
|
||||||
state.sureBtnState.value = 0;
|
state.sureBtnState.value = 0;
|
||||||
dismissEasyLoading();
|
dismissEasyLoading();
|
||||||
break;
|
break;
|
||||||
@ -104,49 +104,52 @@ class SaveLockLogic extends BaseGetXController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 添加管理员密码
|
// 添加管理员密码
|
||||||
Future<void> _replySenderCustomPasswords(Reply reply) async {
|
// Future<void> _replySenderCustomPasswords(Reply reply) async {
|
||||||
int status = reply.data[2];
|
// int status = reply.data[2];
|
||||||
|
//
|
||||||
switch (status) {
|
// switch (status) {
|
||||||
case 0x00:
|
// case 0x00:
|
||||||
//成功
|
// //成功
|
||||||
state.sureBtnState.value = 0;
|
// state.sureBtnState.value = 0;
|
||||||
addLockAdminPassword(true);
|
// dismissEasyLoading();
|
||||||
break;
|
// addLockAdminPassword(true);
|
||||||
case 0x06:
|
// break;
|
||||||
//无权限
|
// case 0x06:
|
||||||
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
// //无权限
|
||||||
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
// var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||||
|
// List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||||
var signKey = await Storage.getStringList(saveBlueSignKey);
|
//
|
||||||
List<int> signKeyDataList = changeStringListToIntList(signKey!);
|
// var signKey = await Storage.getStringList(saveBlueSignKey);
|
||||||
|
// List<int> signKeyDataList = changeStringListToIntList(signKey!);
|
||||||
var token = reply.data.sublist(5, 9);
|
//
|
||||||
var saveStrList = changeIntListToStringList(token);
|
// var token = reply.data.sublist(5, 9);
|
||||||
Storage.setStringList(saveBlueToken, saveStrList);
|
// var saveStrList = changeIntListToStringList(token);
|
||||||
|
// Storage.setStringList(saveBlueToken, saveStrList);
|
||||||
IoSenderManage.senderCustomPasswordsCommand(
|
//
|
||||||
keyID: "1",
|
// IoSenderManage.senderCustomPasswordsCommand(
|
||||||
userID: await Storage.getUid(),
|
// keyID: "1",
|
||||||
pwdNo: 0,
|
// userID: await Storage.getUid(),
|
||||||
pwd: state.adminPasswordTF.text,
|
// pwdNo: 0,
|
||||||
operate: 0,
|
// pwd: state.adminPassword,
|
||||||
isAdmin: 1,
|
// operate: 0,
|
||||||
useCountLimit: 0xffff,
|
// isAdmin: 1,
|
||||||
startTime: 0x11223344,
|
// useCountLimit: 0xffff,
|
||||||
endTime: 0x11223344,
|
// startTime: 0x11223344,
|
||||||
needAuthor: 1,
|
// endTime: 0x11223344,
|
||||||
isBeforeAddUser: true,
|
// needAuthor: 1,
|
||||||
signKey: signKeyDataList,
|
// isBeforeAddUser: true,
|
||||||
privateKey: getPrivateKeyList,
|
// signKey: signKeyDataList,
|
||||||
token: token);
|
// privateKey: getPrivateKeyList,
|
||||||
break;
|
// token: token);
|
||||||
default:
|
// break;
|
||||||
state.sureBtnState.value = 0;
|
// default:
|
||||||
dismissEasyLoading();
|
// state.sureBtnState.value = 0;
|
||||||
break;
|
// dismissEasyLoading();
|
||||||
}
|
// backAction();
|
||||||
}
|
// // AppLog.log("添加管理员密码失败 消失");
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
// 修改管理员密码
|
// 修改管理员密码
|
||||||
// Future<void> _replyChangeAdministratorPassword(Reply reply) async {
|
// Future<void> _replyChangeAdministratorPassword(Reply reply) async {
|
||||||
@ -197,10 +200,15 @@ class SaveLockLogic extends BaseGetXController {
|
|||||||
}
|
}
|
||||||
state.sureBtnState.value = 1;
|
state.sureBtnState.value = 1;
|
||||||
|
|
||||||
showTitleEasyLoading("添加锁进行中 1/2");
|
// showTitleEasyLoading("添加锁进行中 1/2");
|
||||||
|
showEasyLoading();
|
||||||
|
// 判断超时
|
||||||
showBlueConnetctToastTimer(action: (){
|
showBlueConnetctToastTimer(action: (){
|
||||||
dismissEasyLoading();
|
dismissEasyLoading();
|
||||||
state.sureBtnState.value = 0;
|
state.sureBtnState.value = 0;
|
||||||
|
if(state.ifCurrentScreen.value == true){
|
||||||
|
showBlueConnetctToast();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
BlueManage().bludSendData(BlueManage().connectDeviceName, (BluetoothConnectionState deviceConnectionState) async {
|
BlueManage().bludSendData(BlueManage().connectDeviceName, (BluetoothConnectionState deviceConnectionState) async {
|
||||||
if (deviceConnectionState == BluetoothConnectionState.connected){
|
if (deviceConnectionState == BluetoothConnectionState.connected){
|
||||||
@ -233,7 +241,7 @@ class SaveLockLogic extends BaseGetXController {
|
|||||||
endHour: 0,
|
endHour: 0,
|
||||||
endMin: 0,
|
endMin: 0,
|
||||||
role:255,
|
role:255,
|
||||||
password:"123456",
|
password:state.adminPassword,
|
||||||
needAuthor:1,
|
needAuthor:1,
|
||||||
publicKey:publicKeyDataList,
|
publicKey:publicKeyDataList,
|
||||||
privateKey:getPrivateKeyList,
|
privateKey:getPrivateKeyList,
|
||||||
@ -252,48 +260,56 @@ class SaveLockLogic extends BaseGetXController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 设置管理员密码(同添加自定义开锁密码,指纹/密码/卡片前5个是管理员)
|
// 设置管理员密码(同添加自定义开锁密码,指纹/密码/卡片前5个是管理员)
|
||||||
Future<void> senderCustomPasswords() async {
|
// Future<void> senderCustomPasswords() async {
|
||||||
var rng = Random();
|
//
|
||||||
var number = rng.nextInt(900000) + 100000; // 生成 100000 到 999999 之间的随机整数
|
// showTitleEasyLoading("添加锁进行中 2/2");
|
||||||
state.adminPassword = number.toString();
|
// // showEasyLoading();
|
||||||
state.adminPasswordTF.text = number.toString();
|
// showBlueConnetctToastTimer(isShowBlueConnetctToast: false, action: (){
|
||||||
|
// // AppLog.log("添加管理员密码超时");
|
||||||
showTitleEasyLoading("添加锁进行中 2/2");
|
// dismissEasyLoading();
|
||||||
BlueManage().bludSendData(BlueManage().connectDeviceName, (BluetoothConnectionState deviceConnectionState) async {
|
// state.sureBtnState.value = 0;
|
||||||
if (deviceConnectionState == BluetoothConnectionState.connected) {
|
// if(state.ifCurrentScreen.value == true){
|
||||||
var signKey = await Storage.getStringList(saveBlueSignKey);
|
// showBlueConnetctToast();
|
||||||
List<int> signKeyDataList = changeStringListToIntList(signKey!);
|
// }
|
||||||
|
// // backAction();
|
||||||
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
// });
|
||||||
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
// BlueManage().bludSendData(BlueManage().connectDeviceName, (BluetoothConnectionState deviceConnectionState) async {
|
||||||
|
// if (deviceConnectionState == BluetoothConnectionState.connected) {
|
||||||
var token = await Storage.getStringList(saveBlueToken);
|
// var signKey = await Storage.getStringList(saveBlueSignKey);
|
||||||
List<int> getTokenList = changeStringListToIntList(token!);
|
// List<int> signKeyDataList = changeStringListToIntList(signKey!);
|
||||||
|
//
|
||||||
IoSenderManage.senderCustomPasswordsCommand(
|
// var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||||
keyID: "1",
|
// List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||||
userID: await Storage.getUid(),
|
//
|
||||||
pwdNo: 0,
|
// var token = await Storage.getStringList(saveBlueToken);
|
||||||
pwd: state.adminPasswordTF.text,
|
// List<int> getTokenList = changeStringListToIntList(token!);
|
||||||
operate: 0,
|
//
|
||||||
isAdmin: 1,
|
// IoSenderManage.senderCustomPasswordsCommand(
|
||||||
useCountLimit: 0xffff,
|
// keyID: "1",
|
||||||
startTime: 0x11223344,
|
// // userID: await Storage.getUid(),
|
||||||
endTime: 0x11223344,
|
// userID: "0",
|
||||||
needAuthor: 1,
|
// pwdNo: 0,
|
||||||
isBeforeAddUser: true,
|
// pwd: state.adminPassword,
|
||||||
signKey: signKeyDataList,
|
// operate: 0,
|
||||||
privateKey: getPrivateKeyList,
|
// isAdmin: 1,
|
||||||
token: getTokenList);
|
// useCountLimit: 0xffff,
|
||||||
} else if (deviceConnectionState == BluetoothConnectionState.disconnected) {
|
// startTime: 0x11223344,
|
||||||
dismissEasyLoading();
|
// endTime: 0x11223344,
|
||||||
state.sureBtnState.value = 0;
|
// needAuthor: 1,
|
||||||
if(state.ifCurrentScreen.value == true){
|
// isBeforeAddUser: true,
|
||||||
showBlueConnetctToast();
|
// signKey: signKeyDataList,
|
||||||
}
|
// privateKey: getPrivateKeyList,
|
||||||
}
|
// token: getTokenList);
|
||||||
}, isAddEquipment: true);
|
// } else if (deviceConnectionState == BluetoothConnectionState.disconnected) {
|
||||||
}
|
// dismissEasyLoading();
|
||||||
|
// state.sureBtnState.value = 0;
|
||||||
|
// if(state.ifCurrentScreen.value == true){
|
||||||
|
// showBlueConnetctToast();
|
||||||
|
// }
|
||||||
|
// // backAction();
|
||||||
|
// }
|
||||||
|
// }, isAddEquipment: true);
|
||||||
|
// }
|
||||||
|
|
||||||
// 修改管理员密码(同添加自定义开锁密码,指纹/密码/卡片前5个是管理员)
|
// 修改管理员密码(同添加自定义开锁密码,指纹/密码/卡片前5个是管理员)
|
||||||
// Future<void> changeAdministratorPasswordCommand() async {
|
// Future<void> changeAdministratorPasswordCommand() async {
|
||||||
@ -337,6 +353,7 @@ class SaveLockLogic extends BaseGetXController {
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
void bindBlueAdmin() async{
|
void bindBlueAdmin() async{
|
||||||
|
state.lockInfo["adminPwd"] = state.adminPassword;
|
||||||
|
|
||||||
var positionMap = {};
|
var positionMap = {};
|
||||||
positionMap['longitude'] = state.addressInfo["longitude"];
|
positionMap['longitude'] = state.addressInfo["longitude"];
|
||||||
@ -377,8 +394,10 @@ class SaveLockLogic extends BaseGetXController {
|
|||||||
);
|
);
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
state.lockId = entity.data!.lockId!;
|
state.lockId = entity.data!.lockId!;
|
||||||
// eventBus.fire(RefreshLockListInfoDataEvent());
|
|
||||||
await senderCustomPasswords();
|
backAction();
|
||||||
|
|
||||||
|
// await senderCustomPasswords();
|
||||||
|
|
||||||
// BlueManage().disconnect(BlueManage().connectDeviceMacAddress);
|
// BlueManage().disconnect(BlueManage().connectDeviceMacAddress);
|
||||||
// eventBus.fire(RefreshLockListInfoDataEvent());
|
// eventBus.fire(RefreshLockListInfoDataEvent());
|
||||||
@ -389,20 +408,19 @@ class SaveLockLogic extends BaseGetXController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 更新管理员密码
|
// 更新管理员密码
|
||||||
void addLockAdminPassword(bool isAddLockAdminPassword) async {
|
// void addLockAdminPassword(bool isAddLockAdminPassword) async {
|
||||||
var entity = await ApiRepository.to.setAdminPasswordData(
|
// var entity = await ApiRepository.to.setAdminPasswordData(
|
||||||
lockId: state.lockId,
|
// lockId: state.lockId,
|
||||||
adminPwd: state.adminPasswordTF.text,
|
// adminPwd: state.adminPassword,
|
||||||
);
|
// );
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
// // if (entity.errorCode!.codeIsSuccessful) {
|
||||||
// if(isAddLockAdminPassword == true){
|
// // if(isAddLockAdminPassword == true){
|
||||||
// showDeletPasswordAlertDialog();
|
// // showDeletPasswordAlertDialog();
|
||||||
// }else{
|
// // }else{
|
||||||
eventBus.fire(RefreshLockListInfoDataEvent());
|
// backAction();
|
||||||
backAction();
|
// // }
|
||||||
// }
|
// // }
|
||||||
}
|
// }
|
||||||
}
|
|
||||||
|
|
||||||
// void showDeletPasswordAlertDialog() {
|
// void showDeletPasswordAlertDialog() {
|
||||||
// showDialog(
|
// showDialog(
|
||||||
@ -440,6 +458,7 @@ class SaveLockLogic extends BaseGetXController {
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
void backAction(){
|
void backAction(){
|
||||||
|
eventBus.fire(RefreshLockListInfoDataEvent());
|
||||||
BlueManage().disconnect();
|
BlueManage().disconnect();
|
||||||
Get.close(state.isFromMap == 1 ? 5 : 6);
|
Get.close(state.isFromMap == 1 ? 5 : 6);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,6 @@
|
|||||||
|
|
||||||
|
import 'dart:math';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
@ -23,13 +25,14 @@ class SaveLockState {
|
|||||||
var sureBtnState = 0.obs;// 0可点击 1 不可点击
|
var sureBtnState = 0.obs;// 0可点击 1 不可点击
|
||||||
|
|
||||||
// 管理员密码
|
// 管理员密码
|
||||||
var adminPasswordTF = TextEditingController();
|
// var adminPasswordTF = TextEditingController();
|
||||||
var adminPassword = '';
|
var adminPassword = '';
|
||||||
var lockId = 0;
|
var lockId = 0;
|
||||||
|
|
||||||
SaveLockState() {
|
SaveLockState() {
|
||||||
aliName.value = BlueManage().connectDeviceName;
|
aliName.value = BlueManage().connectDeviceName;
|
||||||
aliNameController.text = aliName.value;
|
aliNameController.text = aliName.value;
|
||||||
|
adminPassword = getAdminPassword();
|
||||||
|
|
||||||
Map map = Get.arguments;
|
Map map = Get.arguments;
|
||||||
pwdTimestamp.value = map["pwdTimestamp"];
|
pwdTimestamp.value = map["pwdTimestamp"];
|
||||||
@ -44,4 +47,10 @@ class SaveLockState {
|
|||||||
void onClose() {
|
void onClose() {
|
||||||
aliNameController.dispose();
|
aliNameController.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String getAdminPassword(){
|
||||||
|
var rng = Random();
|
||||||
|
var number = rng.nextInt(900000) + 100000; // 生成 100000 到 999999 之间的随机整数
|
||||||
|
return number.toString();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -175,6 +175,7 @@ class ApiProvider extends BaseProvider {
|
|||||||
String electricQuantity,
|
String electricQuantity,
|
||||||
String electricQuantityStandby,
|
String electricQuantityStandby,
|
||||||
String lockId,
|
String lockId,
|
||||||
|
bool isUnShowLoading,
|
||||||
) =>
|
) =>
|
||||||
post(
|
post(
|
||||||
uploadElectricQuantityURL.toUrl,
|
uploadElectricQuantityURL.toUrl,
|
||||||
@ -182,7 +183,9 @@ class ApiProvider extends BaseProvider {
|
|||||||
'electricQuantity': electricQuantity,
|
'electricQuantity': electricQuantity,
|
||||||
'electricQuantityStandby': electricQuantityStandby,
|
'electricQuantityStandby': electricQuantityStandby,
|
||||||
'lockId': lockId,
|
'lockId': lockId,
|
||||||
}));
|
}),
|
||||||
|
isUnShowLoading: isUnShowLoading
|
||||||
|
);
|
||||||
|
|
||||||
Future<Response> modifyKeyName(
|
Future<Response> modifyKeyName(
|
||||||
String keyId,
|
String keyId,
|
||||||
@ -261,37 +264,33 @@ class ApiProvider extends BaseProvider {
|
|||||||
jsonEncode({'lockId': lockId, 'operatorUid': operatorUid}));
|
jsonEncode({'lockId': lockId, 'operatorUid': operatorUid}));
|
||||||
|
|
||||||
Future<Response> lockRecordList(
|
Future<Response> lockRecordList(
|
||||||
{required String endDate,
|
{required String lockId,
|
||||||
required String keyId,
|
required String pageNo,
|
||||||
required String keyStatus,
|
required String recordType,
|
||||||
required String lockId,
|
required String searchStr,
|
||||||
required String operatorUid,
|
required String startDate,
|
||||||
required String pageNo,
|
required String endDate,
|
||||||
required String pageSize,
|
required String keyboardPwdId,
|
||||||
required String startDate,
|
required String cardId,
|
||||||
required String recordType,
|
required String fingerprintId,
|
||||||
required String searchStr,
|
required String keyId,
|
||||||
required String timezoneRawOffSet,
|
required String faceId,
|
||||||
required String keyboardPwdId,
|
required String pageSize}) =>
|
||||||
required String cardId,
|
|
||||||
required String fingerprintId}) =>
|
|
||||||
post(
|
post(
|
||||||
keyOperationRecordURL.toUrl,
|
keyOperationRecordURL.toUrl,
|
||||||
jsonEncode({
|
jsonEncode({
|
||||||
'endDate': endDate,
|
|
||||||
'keyId': keyId,
|
|
||||||
"keyStatus": keyStatus,
|
|
||||||
'lockId': lockId,
|
'lockId': lockId,
|
||||||
"operatorUid": operatorUid,
|
|
||||||
'pageNo': pageNo,
|
'pageNo': pageNo,
|
||||||
'pageSize': pageSize,
|
|
||||||
'startDate': startDate,
|
|
||||||
'recordType': recordType,
|
'recordType': recordType,
|
||||||
'searchStr': searchStr,
|
'searchStr': searchStr,
|
||||||
'timezoneRawOffSet': timezoneRawOffSet,
|
'startDate': startDate,
|
||||||
|
'endDate': endDate,
|
||||||
'keyboardPwdId': keyboardPwdId,
|
'keyboardPwdId': keyboardPwdId,
|
||||||
'cardId': cardId,
|
'cardId': cardId,
|
||||||
'fingerprintId': fingerprintId
|
'fingerprintId': fingerprintId,
|
||||||
|
'keyId': keyId,
|
||||||
|
'faceId': faceId,
|
||||||
|
'pageSize': pageSize
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// 门锁事件日志
|
// 门锁事件日志
|
||||||
|
|||||||
@ -36,7 +36,10 @@ class BaseProvider extends GetConnect with Api {
|
|||||||
bool? isUserBaseUrl = true, // 文件上传不使用baseUrl
|
bool? isUserBaseUrl = true, // 文件上传不使用baseUrl
|
||||||
}) async {
|
}) async {
|
||||||
AppLog.log("post: url:$url body:$body contentType:$contentType");
|
AppLog.log("post: url:$url body:$body contentType:$contentType");
|
||||||
if (isUnShowLoading == false) EasyLoading.show();
|
if (isUnShowLoading == false){
|
||||||
|
AppLog.log("post: url:$url show loading");
|
||||||
|
EasyLoading.show();
|
||||||
|
}
|
||||||
if (isUserBaseUrl == false) {
|
if (isUserBaseUrl == false) {
|
||||||
httpClient.baseUrl = '';
|
httpClient.baseUrl = '';
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -2,7 +2,6 @@ import 'package:get/get.dart';
|
|||||||
import 'package:star_lock/blue/entity/lock_user_no_list_entity.dart';
|
import 'package:star_lock/blue/entity/lock_user_no_list_entity.dart';
|
||||||
import 'package:star_lock/login/selectCountryRegion/common/countryRegionEntity.dart';
|
import 'package:star_lock/login/selectCountryRegion/common/countryRegionEntity.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/electronicKey/electronicKeyDetail/keyOperationRecord/keyOperationRecord_entity.dart';
|
|
||||||
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/entity/ElectronicKeyListEntity.dart';
|
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/entity/ElectronicKeyListEntity.dart';
|
||||||
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserList_entity.dart';
|
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserList_entity.dart';
|
||||||
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupListEntity.dart';
|
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupListEntity.dart';
|
||||||
@ -50,6 +49,7 @@ import '../main/lockDetail/checkingIn/checkingInStaff/checkingInSetAddStaff/chec
|
|||||||
import '../main/lockDetail/checkingIn/checkingInStaff/checkingInSetStaffList/checkingInStaffList_entity.dart';
|
import '../main/lockDetail/checkingIn/checkingInStaff/checkingInSetStaffList/checkingInStaffList_entity.dart';
|
||||||
import '../main/lockDetail/fingerprint/addFingerprint/addFingerprint_entity.dart';
|
import '../main/lockDetail/fingerprint/addFingerprint/addFingerprint_entity.dart';
|
||||||
import '../main/lockDetail/fingerprint/fingerprintList/fingerprintListData_entity.dart';
|
import '../main/lockDetail/fingerprint/fingerprintList/fingerprintListData_entity.dart';
|
||||||
|
import '../main/lockDetail/lockOperatingRecord/keyOperationRecord_entity.dart';
|
||||||
import '../main/lockDetail/lockSet/configuringWifi/configuringWifi/configuringWifiEntity.dart';
|
import '../main/lockDetail/lockSet/configuringWifi/configuringWifi/configuringWifiEntity.dart';
|
||||||
import '../main/lockDetail/lockSet/lockSet/checkingInInfoData_entity.dart';
|
import '../main/lockDetail/lockSet/lockSet/checkingInInfoData_entity.dart';
|
||||||
import '../main/lockDetail/lockSet/lockSet/lockSetInfo_entity.dart';
|
import '../main/lockDetail/lockSet/lockSet/lockSetInfo_entity.dart';
|
||||||
@ -218,36 +218,34 @@ class ApiRepository {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//钥匙详情-操作记录
|
//钥匙详情-操作记录
|
||||||
Future<KeyOperationRecordEntity> lockRecordList(
|
Future<KeyOperationRecordEntity> lockRecordList({
|
||||||
{required String endDate,
|
required String lockId,
|
||||||
required String keyId,
|
required String pageNo,
|
||||||
required String keyStatus,
|
required String recordType,
|
||||||
required String lockId,
|
required String searchStr,
|
||||||
required String operatorUid,
|
required String startDate,
|
||||||
required String pageNo,
|
required String endDate,
|
||||||
required String pageSize,
|
required String keyboardPwdId,
|
||||||
required String startDate,
|
required String cardId,
|
||||||
required String recordType,
|
required String fingerprintId,
|
||||||
required String searchStr,
|
required String keyId,
|
||||||
required String timezoneRawOffSet,
|
required String faceId,
|
||||||
required String keyboardPwdId,
|
required String pageSize,
|
||||||
required String cardId,
|
}) async {
|
||||||
required String fingerprintId}) async {
|
|
||||||
final res = await apiProvider.lockRecordList(
|
final res = await apiProvider.lockRecordList(
|
||||||
endDate: endDate,
|
lockId: lockId,
|
||||||
keyId: keyId,
|
pageNo: pageNo,
|
||||||
keyStatus: keyStatus,
|
recordType: recordType,
|
||||||
lockId: lockId,
|
searchStr: searchStr,
|
||||||
operatorUid: operatorUid,
|
startDate: startDate,
|
||||||
pageNo: pageNo,
|
endDate: endDate,
|
||||||
pageSize: pageSize,
|
keyboardPwdId: keyboardPwdId,
|
||||||
startDate: startDate,
|
cardId: cardId,
|
||||||
recordType: recordType,
|
fingerprintId: fingerprintId,
|
||||||
searchStr: searchStr,
|
keyId: keyId,
|
||||||
timezoneRawOffSet: timezoneRawOffSet,
|
faceId: faceId,
|
||||||
keyboardPwdId: keyboardPwdId,
|
pageSize: pageSize,
|
||||||
cardId: cardId,
|
);
|
||||||
fingerprintId: fingerprintId);
|
|
||||||
return KeyOperationRecordEntity.fromJson(res.body);
|
return KeyOperationRecordEntity.fromJson(res.body);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -324,11 +322,12 @@ class ApiRepository {
|
|||||||
|
|
||||||
//锁电量更新
|
//锁电量更新
|
||||||
Future<KeyOperationRecordEntity> uploadElectricQuantity(
|
Future<KeyOperationRecordEntity> uploadElectricQuantity(
|
||||||
{String? electricQuantity,
|
{required String? electricQuantity,
|
||||||
String? electricQuantityStandby,
|
required String? electricQuantityStandby,
|
||||||
String? lockId}) async {
|
required String? lockId,
|
||||||
|
required bool? isUnShowLoading}) async {
|
||||||
final res = await apiProvider.uploadElectricQuantity(
|
final res = await apiProvider.uploadElectricQuantity(
|
||||||
electricQuantity!, electricQuantityStandby!, lockId!);
|
electricQuantity!, electricQuantityStandby!, lockId!, isUnShowLoading!);
|
||||||
return KeyOperationRecordEntity.fromJson(res.body);
|
return KeyOperationRecordEntity.fromJson(res.body);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -55,7 +55,9 @@ class BaseGetXController extends GetxController {
|
|||||||
|
|
||||||
void showEasyLoading() => EasyLoading.show();
|
void showEasyLoading() => EasyLoading.show();
|
||||||
|
|
||||||
void dismissEasyLoading() => EasyLoading.dismiss();
|
void dismissEasyLoading() {
|
||||||
|
if(EasyLoading.isShow) EasyLoading.dismiss();
|
||||||
|
}
|
||||||
|
|
||||||
void showTitleEasyLoading(String showContent) => EasyLoading.show(status: showContent);
|
void showTitleEasyLoading(String showContent) => EasyLoading.show(status: showContent);
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
|
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:star_lock/app_settings/app_colors.dart';
|
import 'package:star_lock/app_settings/app_colors.dart';
|
||||||
@ -17,6 +18,7 @@ class NoData extends StatelessWidget {
|
|||||||
width: 1.sw,
|
width: 1.sw,
|
||||||
height: noDataHeight ?? 1.sh - ScreenUtil().statusBarHeight,
|
height: noDataHeight ?? 1.sh - ScreenUtil().statusBarHeight,
|
||||||
// height: 1.sw,
|
// height: 1.sw,
|
||||||
|
// color: Colors.red,
|
||||||
child: Center(
|
child: Center(
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user