Merge branches 'master' and 'master' of https://gitee.com/weishaoyang/star_lock
# Conflicts: # star_lock/lib/network/api_repository.dart
This commit is contained in:
commit
6ac102422d
@ -55,12 +55,26 @@ android {
|
|||||||
versionName flutterVersionName
|
versionName flutterVersionName
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// signingConfigs {
|
||||||
|
// release {
|
||||||
|
// storeFile file("key/keystore.jks")
|
||||||
|
// storePassword '123456'
|
||||||
|
// keyAlias = 'key0'
|
||||||
|
// keyPassword '123456'
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
// TODO: Add your own signing config for the release build.
|
// TODO: Add your own signing config for the release build.
|
||||||
// Signing with the debug keys for now, so `flutter run --release` works.
|
// Signing with the debug keys for now, so `flutter run --release` works.
|
||||||
signingConfig signingConfigs.debug
|
signingConfig signingConfigs.debug
|
||||||
}
|
}
|
||||||
|
// debug {
|
||||||
|
// // TODO: Add your own signing config for the release build.
|
||||||
|
// // Signing with the debug keys for now, so `flutter run --release` works.
|
||||||
|
// signingConfig signingConfigs.release
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -3,8 +3,8 @@
|
|||||||
|
|
||||||
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" android:usesPermissionFlags="neverForLocation" />
|
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" android:usesPermissionFlags="neverForLocation" />
|
||||||
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
|
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
|
||||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" android:maxSdkVersion="30" />
|
<!-- <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" android:maxSdkVersion="30" />-->
|
||||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" android:maxSdkVersion="30" />
|
<!-- <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" android:maxSdkVersion="30" />-->
|
||||||
|
|
||||||
<!--允许访问网络,必选权限-->
|
<!--允许访问网络,必选权限-->
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
buildscript {
|
buildscript {
|
||||||
ext.kotlin_version = '1.9.0'
|
ext.kotlin_version = '1.8.20'
|
||||||
repositories {
|
repositories {
|
||||||
google()
|
google()
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
|
|||||||
@ -23,8 +23,6 @@ PODS:
|
|||||||
- FMDB (2.7.5):
|
- FMDB (2.7.5):
|
||||||
- FMDB/standard (= 2.7.5)
|
- FMDB/standard (= 2.7.5)
|
||||||
- FMDB/standard (2.7.5)
|
- FMDB/standard (2.7.5)
|
||||||
- geocoding_ios (1.0.5):
|
|
||||||
- Flutter
|
|
||||||
- google_maps_flutter_ios (0.0.1):
|
- google_maps_flutter_ios (0.0.1):
|
||||||
- Flutter
|
- Flutter
|
||||||
- GoogleMaps (< 8.0)
|
- GoogleMaps (< 8.0)
|
||||||
@ -68,7 +66,6 @@ DEPENDENCIES:
|
|||||||
- Flutter (from `Flutter`)
|
- Flutter (from `Flutter`)
|
||||||
- flutter_native_contact_picker (from `.symlinks/plugins/flutter_native_contact_picker/ios`)
|
- flutter_native_contact_picker (from `.symlinks/plugins/flutter_native_contact_picker/ios`)
|
||||||
- fluttertoast (from `.symlinks/plugins/fluttertoast/ios`)
|
- fluttertoast (from `.symlinks/plugins/fluttertoast/ios`)
|
||||||
- geocoding_ios (from `.symlinks/plugins/geocoding_ios/ios`)
|
|
||||||
- google_maps_flutter_ios (from `.symlinks/plugins/google_maps_flutter_ios/ios`)
|
- google_maps_flutter_ios (from `.symlinks/plugins/google_maps_flutter_ios/ios`)
|
||||||
- image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`)
|
- image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`)
|
||||||
- network_info_plus (from `.symlinks/plugins/network_info_plus/ios`)
|
- network_info_plus (from `.symlinks/plugins/network_info_plus/ios`)
|
||||||
@ -106,8 +103,6 @@ EXTERNAL SOURCES:
|
|||||||
:path: ".symlinks/plugins/flutter_native_contact_picker/ios"
|
:path: ".symlinks/plugins/flutter_native_contact_picker/ios"
|
||||||
fluttertoast:
|
fluttertoast:
|
||||||
:path: ".symlinks/plugins/fluttertoast/ios"
|
:path: ".symlinks/plugins/fluttertoast/ios"
|
||||||
geocoding_ios:
|
|
||||||
:path: ".symlinks/plugins/geocoding_ios/ios"
|
|
||||||
google_maps_flutter_ios:
|
google_maps_flutter_ios:
|
||||||
:path: ".symlinks/plugins/google_maps_flutter_ios/ios"
|
:path: ".symlinks/plugins/google_maps_flutter_ios/ios"
|
||||||
image_picker_ios:
|
image_picker_ios:
|
||||||
@ -141,7 +136,6 @@ SPEC CHECKSUMS:
|
|||||||
flutter_native_contact_picker: bd430ba0fbf82768bb50c2c52a69a65759a8f907
|
flutter_native_contact_picker: bd430ba0fbf82768bb50c2c52a69a65759a8f907
|
||||||
fluttertoast: fafc4fa4d01a6a9e4f772ecd190ffa525e9e2d9c
|
fluttertoast: fafc4fa4d01a6a9e4f772ecd190ffa525e9e2d9c
|
||||||
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
|
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
|
||||||
geocoding_ios: a389ea40f6f548de6e63006a2e31bf66ff80769a
|
|
||||||
google_maps_flutter_ios: abdac20d6ce8931f6ebc5f46616df241bfaa2cfd
|
google_maps_flutter_ios: abdac20d6ce8931f6ebc5f46616df241bfaa2cfd
|
||||||
GoogleMaps: 025272d5876d3b32604e5c080dc25eaf68764693
|
GoogleMaps: 025272d5876d3b32604e5c080dc25eaf68764693
|
||||||
image_picker_ios: 4a8aadfbb6dc30ad5141a2ce3832af9214a705b5
|
image_picker_ios: 4a8aadfbb6dc30ad5141a2ce3832af9214a705b5
|
||||||
|
|||||||
@ -375,14 +375,14 @@
|
|||||||
CODE_SIGN_IDENTITY = "Apple Development";
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||||
DEVELOPMENT_TEAM = 7NLFRKNVY3;
|
DEVELOPMENT_TEAM = ZJ29NYHTV5;
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
INFOPLIST_FILE = Runner/Info.plist;
|
INFOPLIST_FILE = Runner/Info.plist;
|
||||||
LD_RUNPATH_SEARCH_PATHS = (
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = "cn.star-lock.lock123";
|
PRODUCT_BUNDLE_IDENTIFIER = "cn.star-lock.lock";
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
VERSIONING_SYSTEM = "apple-generic";
|
VERSIONING_SYSTEM = "apple-generic";
|
||||||
@ -506,14 +506,14 @@
|
|||||||
CODE_SIGN_IDENTITY = "Apple Development";
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||||
DEVELOPMENT_TEAM = 7NLFRKNVY3;
|
DEVELOPMENT_TEAM = ZJ29NYHTV5;
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
INFOPLIST_FILE = Runner/Info.plist;
|
INFOPLIST_FILE = Runner/Info.plist;
|
||||||
LD_RUNPATH_SEARCH_PATHS = (
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = "cn.star-lock.lock123";
|
PRODUCT_BUNDLE_IDENTIFIER = "cn.star-lock.lock";
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
VERSIONING_SYSTEM = "apple-generic";
|
VERSIONING_SYSTEM = "apple-generic";
|
||||||
@ -530,14 +530,14 @@
|
|||||||
CODE_SIGN_IDENTITY = "Apple Development";
|
CODE_SIGN_IDENTITY = "Apple Development";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||||
DEVELOPMENT_TEAM = 7NLFRKNVY3;
|
DEVELOPMENT_TEAM = ZJ29NYHTV5;
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
INFOPLIST_FILE = Runner/Info.plist;
|
INFOPLIST_FILE = Runner/Info.plist;
|
||||||
LD_RUNPATH_SEARCH_PATHS = (
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = "cn.star-lock.lock123";
|
PRODUCT_BUNDLE_IDENTIFIER = "cn.star-lock.lock";
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
VERSIONING_SYSTEM = "apple-generic";
|
VERSIONING_SYSTEM = "apple-generic";
|
||||||
|
|||||||
@ -12,11 +12,12 @@ import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/ma
|
|||||||
import 'package:star_lock/main/lockDetail/lockDetail/lockDetail_main_page.dart';
|
import 'package:star_lock/main/lockDetail/lockDetail/lockDetail_main_page.dart';
|
||||||
import 'package:star_lock/mine/minePersonInfo/minePersonInfoEmail/minePersonInfoEmail_page.dart';
|
import 'package:star_lock/mine/minePersonInfo/minePersonInfoEmail/minePersonInfoEmail_page.dart';
|
||||||
import 'package:star_lock/mine/mineSet/authorizedAdministrator/addAuthorizedAdministrator_page.dart';
|
import 'package:star_lock/mine/mineSet/authorizedAdministrator/addAuthorizedAdministrator_page.dart';
|
||||||
|
import 'package:star_lock/mine/mineSet/authorizedAdministrator/administratorDetails/adminDetailChangeDate_page.dart';
|
||||||
import 'package:star_lock/mine/mineSet/authorizedAdministrator/administratorDetails/administratorDetails_page.dart';
|
import 'package:star_lock/mine/mineSet/authorizedAdministrator/administratorDetails/administratorDetails_page.dart';
|
||||||
import 'package:star_lock/mine/mineSet/lockGroup/lockGroupList_page.dart';
|
import 'package:star_lock/mine/mineSet/lockGroup/lockGroupList_page.dart';
|
||||||
import 'package:star_lock/mine/mineSet/lockUserManage/expireLockList/expireLockList_page.dart';
|
import 'package:star_lock/mine/mineSet/lockUserManage/expireLockList/expireLockList_page.dart';
|
||||||
import 'package:star_lock/mine/mineSet/lockUserManage/lockUserManageList_Page.dart';
|
import 'package:star_lock/mine/mineSet/lockUserManage/lockUserManageList_Page.dart';
|
||||||
import 'package:star_lock/mine/mineSet/mineSet_page.dart';
|
import 'package:star_lock/mine/mineSet/mineSet/mineSet_page.dart';
|
||||||
import 'package:star_lock/mine/mineSet/transferGateway/selectGetewayList_page.dart';
|
import 'package:star_lock/mine/mineSet/transferGateway/selectGetewayList_page.dart';
|
||||||
import 'package:star_lock/mine/mineSet/transferSmartLock/recipientInformation/recipientInformation_page.dart';
|
import 'package:star_lock/mine/mineSet/transferSmartLock/recipientInformation/recipientInformation_page.dart';
|
||||||
import 'package:star_lock/mine/mineSet/transferSmartLock/selectBranch/selectBranch_page.dart';
|
import 'package:star_lock/mine/mineSet/transferSmartLock/selectBranch/selectBranch_page.dart';
|
||||||
@ -313,6 +314,9 @@ abstract class Routers {
|
|||||||
static const lockUserListPage = '/lockUserListPage'; //锁用户列表
|
static const lockUserListPage = '/lockUserListPage'; //锁用户列表
|
||||||
static const administratorDetailsPage = '/administratorDetailsPage'; //管理员详情
|
static const administratorDetailsPage = '/administratorDetailsPage'; //管理员详情
|
||||||
static const expireLockListPage = '/expireLockListPage'; //即将到期
|
static const expireLockListPage = '/expireLockListPage'; //即将到期
|
||||||
|
static const adminDetailChangeDatePage =
|
||||||
|
'/adminDetailChangeDatePage'; //管理员详情修改生效时间
|
||||||
|
static const adminLockListPage = '/adminLockListPage'; //管理员详情的锁列表
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract class AppRouters {
|
abstract class AppRouters {
|
||||||
@ -774,9 +778,11 @@ abstract class AppRouters {
|
|||||||
GetPage(
|
GetPage(
|
||||||
name: Routers.lockUserListPage, page: () => const LockUserListPage()),
|
name: Routers.lockUserListPage, page: () => const LockUserListPage()),
|
||||||
GetPage(
|
GetPage(
|
||||||
name: Routers.checkInCreatCompanyPage, page: () => const CheckInCreatCompanyPage()),
|
name: Routers.checkInCreatCompanyPage,
|
||||||
|
page: () => const CheckInCreatCompanyPage()),
|
||||||
GetPage(
|
GetPage(
|
||||||
name: Routers.checkingInStaffDetailPage, page: () => const CheckingInStaffDetailPage()),
|
name: Routers.checkingInStaffDetailPage,
|
||||||
|
page: () => const CheckingInStaffDetailPage()),
|
||||||
GetPage(
|
GetPage(
|
||||||
name: Routers.administratorDetailsPage,
|
name: Routers.administratorDetailsPage,
|
||||||
page: () => const AdministratorDetailsPage()),
|
page: () => const AdministratorDetailsPage()),
|
||||||
@ -789,8 +795,9 @@ abstract class AppRouters {
|
|||||||
GetPage(
|
GetPage(
|
||||||
name: Routers.otherTypeKeyChangeValidityDatePage,
|
name: Routers.otherTypeKeyChangeValidityDatePage,
|
||||||
page: () => const OtherTypeKeyChangeValidityDatePage()),
|
page: () => const OtherTypeKeyChangeValidityDatePage()),
|
||||||
|
GetPage(name: Routers.addICCardPage, page: () => const AddICCardPage()),
|
||||||
GetPage(
|
GetPage(
|
||||||
name: Routers.addICCardPage,
|
name: Routers.adminDetailChangeDatePage,
|
||||||
page: () => const AddICCardPage())
|
page: () => const AdminDetailChangeDatePage())
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import 'package:flutter_reactive_ble/flutter_reactive_ble.dart';
|
|||||||
import 'package:star_lock/blue/io_type.dart';
|
import 'package:star_lock/blue/io_type.dart';
|
||||||
|
|
||||||
import '../../../../blue/blue_manage.dart';
|
import '../../../../blue/blue_manage.dart';
|
||||||
|
import '../../../../blue/io_protocol/io_addUser.dart';
|
||||||
import '../../../../blue/io_reply.dart';
|
import '../../../../blue/io_reply.dart';
|
||||||
import '../../../../blue/io_protocol/io_transferPermissions.dart';
|
import '../../../../blue/io_protocol/io_transferPermissions.dart';
|
||||||
import '../../../../blue/io_tool/io_manager.dart';
|
import '../../../../blue/io_tool/io_manager.dart';
|
||||||
@ -20,8 +21,7 @@ class AuthorizedAdminLogic extends BaseGetXController {
|
|||||||
// 监听设备返回的数据
|
// 监听设备返回的数据
|
||||||
late StreamSubscription<Reply> _replySubscription;
|
late StreamSubscription<Reply> _replySubscription;
|
||||||
void _initReplySubscription() {
|
void _initReplySubscription() {
|
||||||
_replySubscription =
|
_replySubscription = EventBusManager().eventBus!.on<Reply>().listen((reply) async {
|
||||||
EventBusManager().eventBus!.on<Reply>().listen((reply) async {
|
|
||||||
// 开门
|
// 开门
|
||||||
if (reply is TransferPermissionsReply) {
|
if (reply is TransferPermissionsReply) {
|
||||||
var token = reply.data.sublist(2, 6);
|
var token = reply.data.sublist(2, 6);
|
||||||
@ -77,9 +77,77 @@ class AuthorizedAdminLogic extends BaseGetXController {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(reply is AddUserReply) {
|
||||||
|
_replyAddUserKey(reply);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> _replyAddUserKey(Reply reply) async {
|
||||||
|
var lockId = reply.data.sublist(2, 42);
|
||||||
|
print("lockId:$lockId");
|
||||||
|
|
||||||
|
var token = reply.data.sublist(42, 46);
|
||||||
|
List<String> strTokenList = changeIntListToStringList(token);
|
||||||
|
Storage.setStringList(saveBlueToken, strTokenList);
|
||||||
|
print("token:$token");
|
||||||
|
|
||||||
|
int status = reply.data[46];
|
||||||
|
print("status:$status");
|
||||||
|
|
||||||
|
// userNo = reply.data[46];
|
||||||
|
print("status:$status");
|
||||||
|
switch(status){
|
||||||
|
case 0x00:
|
||||||
|
//成功
|
||||||
|
print("添加用户数据解析成功");
|
||||||
|
// bindBlueAdmin();
|
||||||
|
break;
|
||||||
|
case 0x06:
|
||||||
|
//无权限
|
||||||
|
print("需要鉴权");
|
||||||
|
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||||
|
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||||
|
|
||||||
|
var publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||||
|
List<int> publicKeyDataList = changeStringListToIntList(publicKey!);
|
||||||
|
|
||||||
|
IoSenderManage.senderAddUser(
|
||||||
|
lockID:BlueManage().connectDeviceName,
|
||||||
|
authUserID:await Storage.getUid(),
|
||||||
|
keyID:"1",
|
||||||
|
userID:await Storage.getUid(),
|
||||||
|
openMode:1,
|
||||||
|
keyType:1,
|
||||||
|
startDate:0x11223344,
|
||||||
|
expireDate:0x11223344,
|
||||||
|
role:255,
|
||||||
|
password:"123456",
|
||||||
|
needAuthor:1,
|
||||||
|
publicKey:publicKeyDataList,
|
||||||
|
privateKey:getPrivateKeyList,
|
||||||
|
token: token
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
case 0x07:
|
||||||
|
//无权限
|
||||||
|
print("用户无权限");
|
||||||
|
|
||||||
|
break;
|
||||||
|
case 0x09:
|
||||||
|
// 权限校验错误
|
||||||
|
print("添加用户权限校验错误");
|
||||||
|
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
//失败
|
||||||
|
print("领锁失败");
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 转移权限
|
// 转移权限
|
||||||
Future<void> transferPermissionsAction() async {
|
Future<void> transferPermissionsAction() async {
|
||||||
BlueManage().judgeReconnect(
|
BlueManage().judgeReconnect(
|
||||||
@ -110,6 +178,44 @@ class AuthorizedAdminLogic extends BaseGetXController {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 添加用户
|
||||||
|
Future<void> addUserConnectBlue() async {
|
||||||
|
// 进来之后首先连接
|
||||||
|
BlueManage().judgeReconnect(BlueManage().connectDeviceMacAddress, BlueManage().connectDeviceName, (DeviceConnectionState state) async {
|
||||||
|
if (state == DeviceConnectionState.connected){
|
||||||
|
// 私钥
|
||||||
|
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||||
|
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||||
|
|
||||||
|
var publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||||
|
List<int> publicKeyDataList = changeStringListToIntList(publicKey!);
|
||||||
|
|
||||||
|
var token = await Storage.getStringList(saveBlueToken);
|
||||||
|
List<int> getTokenList = [0,0,0,0];
|
||||||
|
if(token != null){
|
||||||
|
getTokenList = changeStringListToIntList(token);
|
||||||
|
}
|
||||||
|
|
||||||
|
IoSenderManage.senderAddUser(
|
||||||
|
lockID: BlueManage().connectDeviceName,
|
||||||
|
authUserID:await Storage.getUid(),
|
||||||
|
keyID:"1",
|
||||||
|
userID:await Storage.getUid(),
|
||||||
|
openMode:1,
|
||||||
|
keyType:1,
|
||||||
|
startDate:DateTime.now().millisecondsSinceEpoch,
|
||||||
|
expireDate:0x11223344,
|
||||||
|
role:255,
|
||||||
|
password:"123456",
|
||||||
|
needAuthor:1,
|
||||||
|
publicKey:publicKeyDataList,
|
||||||
|
privateKey:getPrivateKeyList,
|
||||||
|
token: getTokenList
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void onReady() {
|
void onReady() {
|
||||||
// TODO: implement onReady
|
// TODO: implement onReady
|
||||||
|
|||||||
@ -82,7 +82,7 @@ class LockDetailLogic extends BaseGetXController{
|
|||||||
String? userId = '';
|
String? userId = '';
|
||||||
final data = await Storage.getString('userLoginData');
|
final data = await Storage.getString('userLoginData');
|
||||||
if (data != null && data.isNotEmpty) {
|
if (data != null && data.isNotEmpty) {
|
||||||
userId = LoginEntity.fromJson(jsonDecode(data)).data!.userid.toString();
|
userId = LoginData.fromJson(jsonDecode(data)).userid.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
IoSenderManage.senderOpenLock(
|
IoSenderManage.senderOpenLock(
|
||||||
|
|||||||
@ -0,0 +1,43 @@
|
|||||||
|
class AddFingerprintEntity {
|
||||||
|
int? errorCode;
|
||||||
|
String? description;
|
||||||
|
String? errorMsg;
|
||||||
|
Data? data;
|
||||||
|
|
||||||
|
AddFingerprintEntity(
|
||||||
|
{this.errorCode, this.description, this.errorMsg, this.data});
|
||||||
|
|
||||||
|
AddFingerprintEntity.fromJson(Map<String, dynamic> json) {
|
||||||
|
errorCode = json['errorCode'];
|
||||||
|
description = json['description'];
|
||||||
|
errorMsg = json['errorMsg'];
|
||||||
|
data = json['data'] != null ? Data.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 Data {
|
||||||
|
int? fingerprintId;
|
||||||
|
|
||||||
|
Data({this.fingerprintId});
|
||||||
|
|
||||||
|
Data.fromJson(Map<String, dynamic> json) {
|
||||||
|
fingerprintId = json['fingerprintId'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
data['fingerprintId'] = fingerprintId;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -57,6 +57,7 @@ class AddFingerprintLogic extends BaseGetXController {
|
|||||||
//成功
|
//成功
|
||||||
print("${reply.commandType!.typeValue} 数据解析成功");
|
print("${reply.commandType!.typeValue} 数据解析成功");
|
||||||
state.ifConnectScuess.value = true;
|
state.ifConnectScuess.value = true;
|
||||||
|
state.fingerprintNumber.value = reply.data.last.toString();
|
||||||
break;
|
break;
|
||||||
case 0x06:
|
case 0x06:
|
||||||
//无权限
|
//无权限
|
||||||
@ -219,7 +220,7 @@ class AddFingerprintLogic extends BaseGetXController {
|
|||||||
);
|
);
|
||||||
if(entity.errorCode!.codeIsSuccessful){
|
if(entity.errorCode!.codeIsSuccessful){
|
||||||
Toast.show(msg: "添加成功");
|
Toast.show(msg: "添加成功");
|
||||||
updateFingerprintUserNoLoadData("");
|
updateFingerprintUserNoLoadData(entity.data!.fingerprintId.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -234,7 +235,9 @@ class AddFingerprintLogic extends BaseGetXController {
|
|||||||
Toast.show(msg: "添加成功");
|
Toast.show(msg: "添加成功");
|
||||||
if(state.fromType.value == 2){
|
if(state.fromType.value == 2){
|
||||||
// 回调指纹号
|
// 回调指纹号
|
||||||
eventBus.fire(ChickInAddStaffCardAndFingerprintBlockNumberEvent(""));
|
eventBus.fire(ChickInAddStaffCardAndFingerprintBlockNumberEvent(fingerprintId));
|
||||||
|
}else if(state.fromType.value == 1){
|
||||||
|
eventBus.fire(OtherTypeRefreshListEvent());
|
||||||
}
|
}
|
||||||
Get.close(3);
|
Get.close(3);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,7 +13,7 @@ class AddFingerprintState{
|
|||||||
final isCoerced = "".obs;
|
final isCoerced = "".obs;
|
||||||
final startDate = "".obs;
|
final startDate = "".obs;
|
||||||
final weekDay = [].obs;
|
final weekDay = [].obs;
|
||||||
final fromType = 0.obs;
|
final fromType = 1.obs;
|
||||||
|
|
||||||
AddFingerprintState() {
|
AddFingerprintState() {
|
||||||
Map map = Get.arguments;
|
Map map = Get.arguments;
|
||||||
|
|||||||
@ -80,6 +80,7 @@ class _AddFingerprintTipPageState extends State<AddFingerprintTipPage> {
|
|||||||
"isCoerced": state.isCoerced.value,
|
"isCoerced": state.isCoerced.value,
|
||||||
"startDate": state.startDate.value,
|
"startDate": state.startDate.value,
|
||||||
"weekDay": state.weekDay.value,
|
"weekDay": state.weekDay.value,
|
||||||
|
"fromType": state.fromType.value,
|
||||||
});
|
});
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
|
|||||||
@ -11,7 +11,7 @@ class AddFingerprintTipState{
|
|||||||
final isCoerced = "".obs;
|
final isCoerced = "".obs;
|
||||||
final startDate = "".obs;
|
final startDate = "".obs;
|
||||||
final weekDay = [].obs;
|
final weekDay = [].obs;
|
||||||
final fromType = 0.obs;
|
final fromType = 1.obs;
|
||||||
|
|
||||||
AddFingerprintTipState() {
|
AddFingerprintTipState() {
|
||||||
Map map = Get.arguments;
|
Map map = Get.arguments;
|
||||||
|
|||||||
@ -0,0 +1,43 @@
|
|||||||
|
class AddICCardEntity {
|
||||||
|
int? errorCode;
|
||||||
|
String? description;
|
||||||
|
String? errorMsg;
|
||||||
|
Data? data;
|
||||||
|
|
||||||
|
AddICCardEntity(
|
||||||
|
{this.errorCode, this.description, this.errorMsg, this.data});
|
||||||
|
|
||||||
|
AddICCardEntity.fromJson(Map<String, dynamic> json) {
|
||||||
|
errorCode = json['errorCode'];
|
||||||
|
description = json['description'];
|
||||||
|
errorMsg = json['errorMsg'];
|
||||||
|
data = json['data'] != null ? Data.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 Data {
|
||||||
|
int? cardId;
|
||||||
|
|
||||||
|
Data({this.cardId});
|
||||||
|
|
||||||
|
Data.fromJson(Map<String, dynamic> json) {
|
||||||
|
cardId = json['cardId'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
data['cardId'] = cardId;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -45,12 +45,13 @@ class AddICCardLogic extends BaseGetXController{
|
|||||||
Storage.setStringList(saveBlueToken, saveStrList);
|
Storage.setStringList(saveBlueToken, saveStrList);
|
||||||
|
|
||||||
int status = reply.data[2];
|
int status = reply.data[2];
|
||||||
print("status:$status");
|
print("_replyAddFingerprintStatus:$status");
|
||||||
|
|
||||||
switch(status){
|
switch(status){
|
||||||
case 0x00:
|
case 0x00:
|
||||||
//成功
|
//成功
|
||||||
print("${reply.commandType!.typeValue} 数据解析成功");
|
print("${reply.commandType!.typeValue} 数据解析成功");
|
||||||
|
state.cardNumber.value = reply.data.last.toString();
|
||||||
state.ifConnectScuess.value = true;
|
state.ifConnectScuess.value = true;
|
||||||
break;
|
break;
|
||||||
case 0x06:
|
case 0x06:
|
||||||
@ -96,11 +97,11 @@ class AddICCardLogic extends BaseGetXController{
|
|||||||
Future<void> _replyAddICCardConfirmation(Reply reply) async {
|
Future<void> _replyAddICCardConfirmation(Reply reply) async {
|
||||||
var token = reply.data.sublist(2, 6);
|
var token = reply.data.sublist(2, 6);
|
||||||
var saveStrList = changeIntListToStringList(token);
|
var saveStrList = changeIntListToStringList(token);
|
||||||
print("_replyAddFingerprintReplyToken:$token");
|
print("_replyAddICCardConfirmationReplyToken:$token");
|
||||||
Storage.setStringList(saveBlueToken, saveStrList);
|
Storage.setStringList(saveBlueToken, saveStrList);
|
||||||
|
|
||||||
int status = reply.data[2];
|
int status = reply.data[2];
|
||||||
print("status:$status");
|
print("_replyAddFingerprintstatus:$status");
|
||||||
|
|
||||||
switch(status){
|
switch(status){
|
||||||
case 0x00:
|
case 0x00:
|
||||||
@ -175,7 +176,7 @@ class AddICCardLogic extends BaseGetXController{
|
|||||||
);
|
);
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
Toast.show(msg: "添加成功");
|
Toast.show(msg: "添加成功");
|
||||||
updateIdCardUserNoLoadData("0");
|
updateIdCardUserNoLoadData(entity.data!.cardId.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -188,8 +189,10 @@ class AddICCardLogic extends BaseGetXController{
|
|||||||
if(entity.errorCode!.codeIsSuccessful){
|
if(entity.errorCode!.codeIsSuccessful){
|
||||||
Toast.show(msg: "添加成功");
|
Toast.show(msg: "添加成功");
|
||||||
if(state.fromType.value == 2){
|
if(state.fromType.value == 2){
|
||||||
// 回调卡号
|
// 回调指纹号
|
||||||
eventBus.fire(ChickInAddStaffCardAndFingerprintBlockNumberEvent(""));
|
eventBus.fire(ChickInAddStaffCardAndFingerprintBlockNumberEvent(cardId));
|
||||||
|
}else if(state.fromType.value == 1){
|
||||||
|
eventBus.fire(OtherTypeRefreshListEvent());
|
||||||
}
|
}
|
||||||
Get.close(2);
|
Get.close(2);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -45,7 +45,9 @@ class _AddICCardPageState extends State<AddICCardPage> {
|
|||||||
color: AppColors.blackColor,
|
color: AppColors.blackColor,
|
||||||
borderRadius: BorderRadius.circular(10.w),
|
borderRadius: BorderRadius.circular(10.w),
|
||||||
),
|
),
|
||||||
child: Center(child: Text("尝试连接设备...", style:TextStyle(color: Colors.white, fontSize: 24.sp))),
|
child: Center(
|
||||||
|
child: Obx(() => Text(state.ifConnectScuess.value ? "已连接到锁,请将卡靠近锁的读卡区" : "尝试连接设备...", style:TextStyle(color: Colors.white, fontSize: 24.sp)))
|
||||||
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@ -7,7 +7,7 @@ class OtherTypeAddKeyState{
|
|||||||
final lockId = 0.obs;
|
final lockId = 0.obs;
|
||||||
final seletType = "0".obs;// 0永久 1显示 2循环
|
final seletType = "0".obs;// 0永久 1显示 2循环
|
||||||
final lockType = 0.obs;// 0卡 1指纹 2钥匙
|
final lockType = 0.obs;// 0卡 1指纹 2钥匙
|
||||||
final fromType = 0.obs; // // 1从添加钥匙列表进入 2从考勤添加员工入口进入
|
final fromType = 1.obs; // // 1从添加钥匙列表进入 2从考勤添加员工入口进入
|
||||||
final isStressFingerprint = false.obs;
|
final isStressFingerprint = false.obs;
|
||||||
|
|
||||||
var beginTime = "".obs;// 开始时间
|
var beginTime = "".obs;// 开始时间
|
||||||
|
|||||||
@ -321,7 +321,22 @@ class OtherTypeKeyListLogic extends BaseGetXController{
|
|||||||
late StreamSubscription _teamEvent;
|
late StreamSubscription _teamEvent;
|
||||||
void _initRefreshAction() {
|
void _initRefreshAction() {
|
||||||
_teamEvent = eventBus.on<OtherTypeRefreshListEvent>().listen((event) {
|
_teamEvent = eventBus.on<OtherTypeRefreshListEvent>().listen((event) {
|
||||||
getFingerprintsListData();
|
switch (state.fromType.value) {
|
||||||
|
case 0:
|
||||||
|
// 卡
|
||||||
|
getICCardListData();
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
// 指纹
|
||||||
|
getFingerprintsListData();
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
// 遥控
|
||||||
|
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
|
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
|||||||
@ -62,49 +62,52 @@ class _StarLockMinePageState extends State<StarLockMinePage> with BaseWidget {
|
|||||||
fit: BoxFit.fill,
|
fit: BoxFit.fill,
|
||||||
),
|
),
|
||||||
Obx(() => Center(
|
Obx(() => Center(
|
||||||
child: Column(
|
child: Column(
|
||||||
// crossAxisAlignment: CrossAxisAlignment.center,
|
// crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 120.h,
|
height: 120.h,
|
||||||
|
),
|
||||||
|
GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
// Navigator.pushNamed(context, Routers.starLockLoginPage);
|
||||||
|
Navigator.pushNamed(
|
||||||
|
context, Routers.minePersonInfoPage);
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
width: 105.w,
|
||||||
|
height: 105.w,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius:
|
||||||
|
BorderRadius.all(Radius.circular(52.5.w)),
|
||||||
|
),
|
||||||
|
child:
|
||||||
|
// state.headUrl().isNotEmpty ?
|
||||||
|
// Image(image: NetworkImage(state.loginData.value.data!.headUrl!)) :
|
||||||
|
Image.asset(
|
||||||
|
'images/mine/icon_mine_main_defaultAvatar.png',
|
||||||
|
width: 60.w,
|
||||||
|
height: 60.w)),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 20.h,
|
||||||
|
),
|
||||||
|
Text(state.mobile(),
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 22.sp,
|
||||||
|
color: Colors.white,
|
||||||
|
)),
|
||||||
|
SizedBox(
|
||||||
|
height: 10.h,
|
||||||
|
),
|
||||||
|
Text("${TranslationLoader.lanKeys!.accountNumber!.tr}:-",
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 18.sp,
|
||||||
|
color: Colors.white,
|
||||||
|
fontWeight: FontWeight.w500)),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
GestureDetector(
|
)),
|
||||||
onTap: () {
|
|
||||||
// Navigator.pushNamed(context, Routers.starLockLoginPage);
|
|
||||||
Navigator.pushNamed(context, Routers.minePersonInfoPage);
|
|
||||||
},
|
|
||||||
child: Container(
|
|
||||||
width: 105.w,
|
|
||||||
height: 105.w,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
borderRadius: BorderRadius.all(Radius.circular(52.5.w)),
|
|
||||||
),
|
|
||||||
child:
|
|
||||||
// state.headUrl().isNotEmpty ?
|
|
||||||
// Image(image: NetworkImage(state.loginData.value.data!.headUrl!)) :
|
|
||||||
Image.asset('images/mine/icon_mine_main_defaultAvatar.png', width: 60.w, height: 60.w)
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
height: 20.h,
|
|
||||||
),
|
|
||||||
Text(state.mobile(),
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 22.sp,
|
|
||||||
color: Colors.white,
|
|
||||||
)),
|
|
||||||
SizedBox(
|
|
||||||
height: 10.h,
|
|
||||||
),
|
|
||||||
Text(
|
|
||||||
"${TranslationLoader.lanKeys!.accountNumber!.tr}:-",
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 18.sp,
|
|
||||||
color: Colors.white,
|
|
||||||
fontWeight: FontWeight.w500)),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
)),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@ -78,7 +78,7 @@ class _AddAuthorizedAdministratorPageState
|
|||||||
elevation: 0,
|
elevation: 0,
|
||||||
leading: IconButton(
|
leading: IconButton(
|
||||||
icon: const Icon(Icons.arrow_back_ios, color: Colors.white),
|
icon: const Icon(Icons.arrow_back_ios, color: Colors.white),
|
||||||
onPressed: () => Navigator.of(context).pop(),
|
onPressed: () => Navigator.pop(context, true),
|
||||||
),
|
),
|
||||||
bottom: PreferredSize(
|
bottom: PreferredSize(
|
||||||
preferredSize: const Size.fromHeight(45),
|
preferredSize: const Size.fromHeight(45),
|
||||||
|
|||||||
@ -0,0 +1,159 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_pickers/pickers.dart';
|
||||||
|
import 'package:flutter_pickers/time_picker/model/date_mode.dart';
|
||||||
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/entity/ElectronicKeyListEntity.dart';
|
||||||
|
import 'package:star_lock/mine/mineSet/authorizedAdministrator/authorizedAdminListEntity.dart';
|
||||||
|
import 'package:star_lock/network/api_repository.dart';
|
||||||
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
|
import 'package:star_lock/tools/toast.dart';
|
||||||
|
|
||||||
|
import '../../../../../app_settings/app_colors.dart';
|
||||||
|
import '../../../../../tools/commonItem.dart';
|
||||||
|
import '../../../../../tools/titleAppBar.dart';
|
||||||
|
import '../../../../../translations/trans_lib.dart';
|
||||||
|
|
||||||
|
class AdminDetailChangeDatePage extends StatefulWidget {
|
||||||
|
const AdminDetailChangeDatePage({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<AdminDetailChangeDatePage> createState() =>
|
||||||
|
_AdminDetailChangeDatePage();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _AdminDetailChangeDatePage extends State<AdminDetailChangeDatePage> {
|
||||||
|
AuthorizedAdminListItem itemData = AuthorizedAdminListItem();
|
||||||
|
|
||||||
|
String _selectEffectiveDate = ''; //生效时间
|
||||||
|
String _selectFailureDate = ''; //失效时间
|
||||||
|
late DateTime _effectiveDateTime;
|
||||||
|
late DateTime _failureDateTime;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
dynamic obj = ModalRoute.of(context)?.settings.arguments;
|
||||||
|
if (obj != null && (obj["itemData"] != null)) {
|
||||||
|
itemData = obj["itemData"];
|
||||||
|
}
|
||||||
|
|
||||||
|
return Scaffold(
|
||||||
|
backgroundColor: AppColors.mainBackgroundColor,
|
||||||
|
appBar: TitleAppBar(
|
||||||
|
barTitle:
|
||||||
|
"${TranslationLoader.lanKeys!.amend!.tr}${TranslationLoader.lanKeys!.periodValidity!.tr}",
|
||||||
|
haveBack: true,
|
||||||
|
backgroundColor: AppColors.mainColor,
|
||||||
|
actionsList: [
|
||||||
|
TextButton(
|
||||||
|
child: Text(
|
||||||
|
TranslationLoader.lanKeys!.sure!.tr,
|
||||||
|
style: TextStyle(color: Colors.white, fontSize: 24.sp),
|
||||||
|
),
|
||||||
|
onPressed: () {
|
||||||
|
updateAdministratorRequest();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
body: buildMainUI(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget buildMainUI() {
|
||||||
|
return Column(
|
||||||
|
children: [
|
||||||
|
CommonItem(
|
||||||
|
leftTitel: TranslationLoader.lanKeys!.effectiveTime!.tr,
|
||||||
|
rightTitle: _selectEffectiveDate,
|
||||||
|
isHaveLine: true,
|
||||||
|
isHaveDirection: true,
|
||||||
|
action: () {
|
||||||
|
Pickers.showDatePicker(context, mode: DateMode.YMDHM,
|
||||||
|
onConfirm: (p) {
|
||||||
|
setState(() {
|
||||||
|
_selectEffectiveDate =
|
||||||
|
'${p.year}-${intToStr(p.month!)}-${intToStr(p.day!)} ${intToStr(p.hour!)}:${intToStr(p.minute!)}';
|
||||||
|
_effectiveDateTime = DateTime.parse(_selectEffectiveDate);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}),
|
||||||
|
CommonItem(
|
||||||
|
leftTitel: TranslationLoader.lanKeys!.failureTime!.tr,
|
||||||
|
rightTitle: _selectFailureDate,
|
||||||
|
isHaveDirection: true,
|
||||||
|
action: () {
|
||||||
|
Pickers.showDatePicker(context, mode: DateMode.YMDHM,
|
||||||
|
onConfirm: (p) {
|
||||||
|
setState(() {
|
||||||
|
_selectFailureDate =
|
||||||
|
'${p.year}-${intToStr(p.month!)}-${intToStr(p.day!)} ${intToStr(p.hour!)}:${intToStr(p.minute!)}';
|
||||||
|
_failureDateTime = DateTime.parse(_selectFailureDate);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
//更新管理员信息请求
|
||||||
|
Future<void> updateAdministratorRequest() async {
|
||||||
|
ElectronicKeyListEntity entity = await ApiRepository.to.updateAdministrator(
|
||||||
|
itemData.uid.toString(),
|
||||||
|
'',
|
||||||
|
_failureDateTime.millisecondsSinceEpoch.toString(),
|
||||||
|
_effectiveDateTime.millisecondsSinceEpoch.toString(),
|
||||||
|
'');
|
||||||
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
|
print("修改管理员信息成功啦啦啦啦啦");
|
||||||
|
Toast.show(msg: "修改成功");
|
||||||
|
setState(() {
|
||||||
|
Navigator.pop(context);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
//修改钥匙名称请求
|
||||||
|
Future<void> updateKeyDateRequest() async {
|
||||||
|
KeyOperationRecordEntity entity = await ApiRepository.to.updateKeyDate(
|
||||||
|
itemData.keyId.toString(),
|
||||||
|
itemData.lockId.toString(),
|
||||||
|
_failureDateTime.millisecondsSinceEpoch.toString(),
|
||||||
|
endDay,
|
||||||
|
'',
|
||||||
|
_effectiveDateTime.millisecondsSinceEpoch.toString(),
|
||||||
|
startDay,
|
||||||
|
weekDays);
|
||||||
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
|
print("修改要是名称成功啦啦啦啦啦");
|
||||||
|
Toast.show(msg: "修改成功");
|
||||||
|
setState(() {
|
||||||
|
Navigator.pop(context);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//更新密码请求
|
||||||
|
Future<void> updatePwdRequest() async {
|
||||||
|
PasswordKeyEntity entity = await ApiRepository.to.updatePasswordKey(
|
||||||
|
lockId,
|
||||||
|
pwdId,
|
||||||
|
'',
|
||||||
|
'',
|
||||||
|
_effectiveDateTime.millisecondsSinceEpoch.toString(),
|
||||||
|
_failureDateTime.millisecondsSinceEpoch.toString(),
|
||||||
|
'');
|
||||||
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
|
Toast.show(msg: "修改成功");
|
||||||
|
setState(() {
|
||||||
|
Navigator.pop(context);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
String intToStr(int v) {
|
||||||
|
return (v < 10) ? "0$v" : "$v";
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,197 @@
|
|||||||
|
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupListEntity.dart';
|
||||||
|
|
||||||
|
class AdministratorDetailEntity {
|
||||||
|
int? errorCode;
|
||||||
|
String? description;
|
||||||
|
String? errorMsg;
|
||||||
|
Data? data;
|
||||||
|
|
||||||
|
AdministratorDetailEntity(
|
||||||
|
{this.errorCode, this.description, this.errorMsg, this.data});
|
||||||
|
|
||||||
|
AdministratorDetailEntity.fromJson(Map<String, dynamic> json) {
|
||||||
|
errorCode = json['errorCode'];
|
||||||
|
description = json['description'];
|
||||||
|
errorMsg = json['errorMsg'];
|
||||||
|
data = json['data'] != null ? Data.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 Data {
|
||||||
|
int? uid;
|
||||||
|
int? keyStatus;
|
||||||
|
int? lockNum;
|
||||||
|
int? endDate;
|
||||||
|
int? startDate;
|
||||||
|
int? isRemoteUnlock;
|
||||||
|
String? name;
|
||||||
|
String? userid;
|
||||||
|
List<LockListItem>? lockList;
|
||||||
|
|
||||||
|
Data(
|
||||||
|
{this.uid,
|
||||||
|
this.keyStatus,
|
||||||
|
this.lockNum,
|
||||||
|
this.endDate,
|
||||||
|
this.startDate,
|
||||||
|
this.isRemoteUnlock,
|
||||||
|
this.name,
|
||||||
|
this.userid,
|
||||||
|
this.lockList});
|
||||||
|
|
||||||
|
Data.fromJson(Map<String, dynamic> json) {
|
||||||
|
uid = json['uid'];
|
||||||
|
keyStatus = json['keyStatus'];
|
||||||
|
lockNum = json['lockNum'];
|
||||||
|
endDate = json['endDate'];
|
||||||
|
startDate = json['startDate'];
|
||||||
|
isRemoteUnlock = json['isRemoteUnlock'];
|
||||||
|
name = json['name'];
|
||||||
|
userid = json['userid'];
|
||||||
|
if (json['lockList'] != null) {
|
||||||
|
lockList = <LockListItem>[];
|
||||||
|
json['lockList'].forEach((v) {
|
||||||
|
lockList!.add(LockListItem.fromJson(v));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
data['uid'] = uid;
|
||||||
|
data['keyStatus'] = keyStatus;
|
||||||
|
data['lockNum'] = lockNum;
|
||||||
|
data['endDate'] = endDate;
|
||||||
|
data['startDate'] = startDate;
|
||||||
|
data['isRemoteUnlock'] = isRemoteUnlock;
|
||||||
|
data['name'] = name;
|
||||||
|
data['userid'] = userid;
|
||||||
|
if (lockList != null) {
|
||||||
|
data['lockList'] = lockList!.map((v) => v.toJson()).toList();
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class LockItem {
|
||||||
|
int? id;
|
||||||
|
String? clientId;
|
||||||
|
int? lockOwnerId;
|
||||||
|
int? apiUserId;
|
||||||
|
int? lockId;
|
||||||
|
int? senderUserId;
|
||||||
|
String? keyName;
|
||||||
|
int? keyType;
|
||||||
|
int? startDate;
|
||||||
|
int? endDate;
|
||||||
|
List? weekDays;
|
||||||
|
String? remarks;
|
||||||
|
int? remoteEnable;
|
||||||
|
int? isCameraEnable;
|
||||||
|
int? faceAuthentication;
|
||||||
|
int? keyRight;
|
||||||
|
int? userType;
|
||||||
|
int? keyStatus;
|
||||||
|
int? groupId;
|
||||||
|
int? lockUserNo;
|
||||||
|
int? date;
|
||||||
|
String? createdAt;
|
||||||
|
String? updatedAt;
|
||||||
|
|
||||||
|
LockItem(
|
||||||
|
{this.id,
|
||||||
|
this.clientId,
|
||||||
|
this.lockOwnerId,
|
||||||
|
this.apiUserId,
|
||||||
|
this.lockId,
|
||||||
|
this.senderUserId,
|
||||||
|
this.keyName,
|
||||||
|
this.keyType,
|
||||||
|
this.startDate,
|
||||||
|
this.endDate,
|
||||||
|
this.weekDays,
|
||||||
|
this.remarks,
|
||||||
|
this.remoteEnable,
|
||||||
|
this.isCameraEnable,
|
||||||
|
this.faceAuthentication,
|
||||||
|
this.keyRight,
|
||||||
|
this.userType,
|
||||||
|
this.keyStatus,
|
||||||
|
this.groupId,
|
||||||
|
this.lockUserNo,
|
||||||
|
this.date,
|
||||||
|
this.createdAt,
|
||||||
|
this.updatedAt});
|
||||||
|
|
||||||
|
LockItem.fromJson(Map<String, dynamic> json) {
|
||||||
|
id = json['id'];
|
||||||
|
clientId = json['clientId'];
|
||||||
|
lockOwnerId = json['lockOwnerId'];
|
||||||
|
apiUserId = json['apiUserId'];
|
||||||
|
lockId = json['lockId'];
|
||||||
|
senderUserId = json['senderUserId'];
|
||||||
|
keyName = json['keyName'];
|
||||||
|
keyType = json['keyType'];
|
||||||
|
startDate = json['startDate'];
|
||||||
|
endDate = json['endDate'];
|
||||||
|
if (json['weekDays'] != null) {
|
||||||
|
weekDays = [];
|
||||||
|
json['weekDays'].forEach((v) {
|
||||||
|
weekDays!.add(v);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
remarks = json['remarks'];
|
||||||
|
remoteEnable = json['remoteEnable'];
|
||||||
|
isCameraEnable = json['isCameraEnable'];
|
||||||
|
faceAuthentication = json['faceAuthentication'];
|
||||||
|
keyRight = json['keyRight'];
|
||||||
|
userType = json['userType'];
|
||||||
|
keyStatus = json['keyStatus'];
|
||||||
|
groupId = json['groupId'];
|
||||||
|
lockUserNo = json['lockUserNo'];
|
||||||
|
date = json['date'];
|
||||||
|
createdAt = json['created_at'];
|
||||||
|
updatedAt = json['updated_at'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
data['id'] = id;
|
||||||
|
data['clientId'] = clientId;
|
||||||
|
data['lockOwnerId'] = lockOwnerId;
|
||||||
|
data['apiUserId'] = apiUserId;
|
||||||
|
data['lockId'] = lockId;
|
||||||
|
data['senderUserId'] = senderUserId;
|
||||||
|
data['keyName'] = keyName;
|
||||||
|
data['keyType'] = keyType;
|
||||||
|
data['startDate'] = startDate;
|
||||||
|
data['endDate'] = endDate;
|
||||||
|
if (weekDays != null) {
|
||||||
|
data['weekDays'] = weekDays!.map((v) => v).toList();
|
||||||
|
}
|
||||||
|
data['remarks'] = remarks;
|
||||||
|
data['remoteEnable'] = remoteEnable;
|
||||||
|
data['isCameraEnable'] = isCameraEnable;
|
||||||
|
data['faceAuthentication'] = faceAuthentication;
|
||||||
|
data['keyRight'] = keyRight;
|
||||||
|
data['userType'] = userType;
|
||||||
|
data['keyStatus'] = keyStatus;
|
||||||
|
data['groupId'] = groupId;
|
||||||
|
data['lockUserNo'] = lockUserNo;
|
||||||
|
data['date'] = date;
|
||||||
|
data['created_at'] = createdAt;
|
||||||
|
data['updated_at'] = updatedAt;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -3,6 +3,7 @@ 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/main/lockDetail/electronicKey/electronicKeyList/entity/ElectronicKeyListEntity.dart';
|
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/entity/ElectronicKeyListEntity.dart';
|
||||||
|
import 'package:star_lock/mine/mineSet/authorizedAdministrator/administratorDetails/administratorDetailEntity.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 'package:star_lock/tools/jh_pop_menus.dart';
|
import 'package:star_lock/tools/jh_pop_menus.dart';
|
||||||
@ -28,12 +29,25 @@ class AdministratorDetailsPage extends StatefulWidget {
|
|||||||
class _AdministratorDetailsPageState extends State<AdministratorDetailsPage> {
|
class _AdministratorDetailsPageState extends State<AdministratorDetailsPage> {
|
||||||
final TextEditingController _changeNameController = TextEditingController();
|
final TextEditingController _changeNameController = TextEditingController();
|
||||||
AuthorizedAdminListItem itemData = AuthorizedAdminListItem();
|
AuthorizedAdminListItem itemData = AuthorizedAdminListItem();
|
||||||
|
bool _isOnRemote = false;
|
||||||
|
List lockItemList = [];
|
||||||
|
bool _isFirst = true;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
dynamic obj = ModalRoute.of(context)?.settings.arguments;
|
if (_isFirst == true) {
|
||||||
if (obj != null && (obj["itemData"] != null)) {
|
dynamic obj = ModalRoute.of(context)?.settings.arguments;
|
||||||
itemData = obj["itemData"];
|
if (obj != null && (obj["itemData"] != null)) {
|
||||||
|
itemData = obj["itemData"];
|
||||||
|
}
|
||||||
|
administratorDetailRequest();
|
||||||
|
|
||||||
|
_isOnRemote = itemData.isRemoteUnlock == 1 ? true : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
@ -80,8 +94,7 @@ class _AdministratorDetailsPageState extends State<AdministratorDetailsPage> {
|
|||||||
rightTitle: getUseDateStr(itemData),
|
rightTitle: getUseDateStr(itemData),
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () {
|
action: () {
|
||||||
Navigator.pushNamed(
|
Navigator.pushNamed(context, Routers.adminDetailChangeDatePage,
|
||||||
context, Routers.electronicKeyDetailChangeDate,
|
|
||||||
arguments: {"itemData": itemData});
|
arguments: {"itemData": itemData});
|
||||||
}),
|
}),
|
||||||
Container(height: 10.h),
|
Container(height: 10.h),
|
||||||
@ -90,16 +103,16 @@ class _AdministratorDetailsPageState extends State<AdministratorDetailsPage> {
|
|||||||
rightTitle: itemData.lockNum.toString(),
|
rightTitle: itemData.lockNum.toString(),
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () {
|
action: () {
|
||||||
//锁列表
|
//锁列表页面
|
||||||
|
Navigator.pushNamed(context, Routers.lockItemListPage,
|
||||||
|
arguments: {'lockList': lockItemList});
|
||||||
}),
|
}),
|
||||||
Container(height: 10.h),
|
Container(height: 10.h),
|
||||||
CommonItem(
|
CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.remoteUnlocking!.tr,
|
leftTitel: TranslationLoader.lanKeys!.remoteUnlocking!.tr,
|
||||||
rightTitle: "",
|
rightTitle: "",
|
||||||
isHaveRightWidget: true,
|
isHaveRightWidget: true,
|
||||||
rightWidget: SizedBox(
|
rightWidget: SizedBox(width: 60.w, child: _switch()),
|
||||||
width: 60.w,
|
|
||||||
child: _switch(itemData.isRemoteUnlock == 1 ? true : false)),
|
|
||||||
action: () {}),
|
action: () {}),
|
||||||
Container(height: 40.h),
|
Container(height: 40.h),
|
||||||
SubmitBtn(
|
SubmitBtn(
|
||||||
@ -207,24 +220,41 @@ class _AdministratorDetailsPageState extends State<AdministratorDetailsPage> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
CupertinoSwitch _switch(isOn) {
|
CupertinoSwitch _switch() {
|
||||||
return CupertinoSwitch(
|
return CupertinoSwitch(
|
||||||
activeColor: CupertinoColors.activeBlue,
|
activeColor: CupertinoColors.activeBlue,
|
||||||
trackColor: CupertinoColors.systemGrey5,
|
trackColor: CupertinoColors.systemGrey5,
|
||||||
thumbColor: CupertinoColors.white,
|
thumbColor: CupertinoColors.white,
|
||||||
value: isOn,
|
value: _isOnRemote,
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
setState(() {
|
setState(() {
|
||||||
isOn = value;
|
_isOnRemote = !_isOnRemote;
|
||||||
|
updateAdministratorRequest();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//管理员详情请求
|
||||||
|
Future<void> administratorDetailRequest() async {
|
||||||
|
_isFirst = false;
|
||||||
|
AdministratorDetailEntity entity =
|
||||||
|
await ApiRepository.to.authorizedAdminDetail(itemData.uid ?? 0);
|
||||||
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
|
print("管理员详情请求成功啦啦啦啦啦");
|
||||||
|
lockItemList = entity.data!.lockList!;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//更新管理员信息请求
|
//更新管理员信息请求
|
||||||
Future<void> updateAdministratorRequest() async {
|
Future<void> updateAdministratorRequest() async {
|
||||||
|
String isRemoteUnlock = _isOnRemote == true ? '1' : '2';
|
||||||
ElectronicKeyListEntity entity = await ApiRepository.to.updateAdministrator(
|
ElectronicKeyListEntity entity = await ApiRepository.to.updateAdministrator(
|
||||||
itemData.uid.toString(), _changeNameController.text, '', '', '');
|
itemData.uid.toString(),
|
||||||
|
_changeNameController.text,
|
||||||
|
'',
|
||||||
|
'',
|
||||||
|
isRemoteUnlock);
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
print("修改管理员信息成功啦啦啦啦啦");
|
print("修改管理员信息成功啦啦啦啦啦");
|
||||||
Toast.show(msg: "修改成功");
|
Toast.show(msg: "修改成功");
|
||||||
@ -234,15 +264,15 @@ class _AdministratorDetailsPageState extends State<AdministratorDetailsPage> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//删除授权管理员请求
|
//删除授权管理员请求 是否删除授权管理员发送的钥匙。 1是,0否
|
||||||
Future<void> deleteAdministratorRequest() async {
|
Future<void> deleteAdministratorRequest() async {
|
||||||
ElectronicKeyListEntity entity =
|
AuthorizedAdminListEntity entity = await ApiRepository.to
|
||||||
await ApiRepository.to.deleteAdministrator(itemData.uid.toString(), '');
|
.deleteAuthorizedAdmin(itemData.uid.toString(), '0');
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
print("删除电子钥匙成功");
|
print("删除电子钥匙成功");
|
||||||
Toast.show(msg: "删除成功");
|
Toast.show(msg: "删除成功");
|
||||||
setState(() {
|
setState(() {
|
||||||
Navigator.pop(context);
|
Navigator.pop(context, true);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,8 +23,6 @@ class _AuthorizedAdministratorListPageState
|
|||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
|
|
||||||
mockNetworkDataRequest();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -45,7 +43,12 @@ class _AuthorizedAdministratorListPageState
|
|||||||
onPressed: () {
|
onPressed: () {
|
||||||
// 处理操作按钮的点击事件
|
// 处理操作按钮的点击事件
|
||||||
Navigator.pushNamed(
|
Navigator.pushNamed(
|
||||||
context, Routers.addAuthorizedAdministratorPage);
|
context, Routers.addAuthorizedAdministratorPage)
|
||||||
|
.then((value) {
|
||||||
|
setState(() {
|
||||||
|
mockNetworkDataRequest();
|
||||||
|
});
|
||||||
|
});
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@ -82,15 +85,14 @@ class _AuthorizedAdministratorListPageState
|
|||||||
Future<List<AuthorizedAdminListItem>> mockNetworkDataRequest() async {
|
Future<List<AuthorizedAdminListItem>> mockNetworkDataRequest() async {
|
||||||
AuthorizedAdminListEntity entity =
|
AuthorizedAdminListEntity entity =
|
||||||
await ApiRepository.to.authorizedAdminList('1', '20');
|
await ApiRepository.to.authorizedAdminList('1', '20');
|
||||||
|
List<AuthorizedAdminListItem> dataList = [];
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
print("授权管理员列表成功:${entity.data?.itemList}");
|
print("授权管理员列表成功:${entity.data?.itemList}");
|
||||||
|
if (entity.data != null) {
|
||||||
|
dataList = entity.data!.itemList!;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (entity.data != null) {
|
return dataList;
|
||||||
return entity.data!.itemList!;
|
|
||||||
} else {
|
|
||||||
List<AuthorizedAdminListItem> dataList = [];
|
|
||||||
return dataList;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _searchWidget() {
|
Widget _searchWidget() {
|
||||||
@ -141,7 +143,11 @@ class _AuthorizedAdministratorListPageState
|
|||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
Navigator.pushNamed(context, Routers.administratorDetailsPage,
|
Navigator.pushNamed(context, Routers.administratorDetailsPage,
|
||||||
arguments: {'itemData': itemData});
|
arguments: {'itemData': itemData}).then((value) {
|
||||||
|
setState(() {
|
||||||
|
mockNetworkDataRequest();
|
||||||
|
});
|
||||||
|
});
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
height: 100.h,
|
height: 100.h,
|
||||||
|
|||||||
@ -1,6 +1,10 @@
|
|||||||
import 'package:flutter/material.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/mine/mineSet/lockUserManage/expireLockList/expireLockListEntity.dart';
|
||||||
|
import 'package:star_lock/network/api_repository.dart';
|
||||||
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
|
import 'package:star_lock/tools/toast.dart';
|
||||||
|
|
||||||
import '../../../app_settings/app_colors.dart';
|
import '../../../app_settings/app_colors.dart';
|
||||||
import '../../../tools/submitBtn.dart';
|
import '../../../tools/submitBtn.dart';
|
||||||
@ -17,8 +21,30 @@ class HideInvalidUnlockPermissionsPage extends StatefulWidget {
|
|||||||
|
|
||||||
class _HideInvalidUnlockPermissionsPageState
|
class _HideInvalidUnlockPermissionsPageState
|
||||||
extends State<HideInvalidUnlockPermissionsPage> {
|
extends State<HideInvalidUnlockPermissionsPage> {
|
||||||
|
bool _isOn = true;
|
||||||
|
bool _isFirst = false;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
|
||||||
|
_isFirst = true;
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
if (_isFirst) {
|
||||||
|
dynamic obj = ModalRoute.of(context)?.settings.arguments;
|
||||||
|
if (obj != null && (obj["isOn"] != null)) {
|
||||||
|
int getValue = obj["isOn"];
|
||||||
|
if (getValue == 1) {
|
||||||
|
_isOn = true;
|
||||||
|
} else {
|
||||||
|
_isOn = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: AppColors.mainBackgroundColor,
|
backgroundColor: AppColors.mainBackgroundColor,
|
||||||
appBar: TitleAppBar(
|
appBar: TitleAppBar(
|
||||||
@ -50,7 +76,7 @@ class _HideInvalidUnlockPermissionsPageState
|
|||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
"${TranslationLoader.lanKeys!.currentMode!.tr} : ${TranslationLoader.lanKeys!.opened!.tr}",
|
"${TranslationLoader.lanKeys!.currentMode!.tr} : ${_isOn == true ? TranslationLoader.lanKeys!.opened!.tr : TranslationLoader.lanKeys!.closed!.tr}",
|
||||||
style:
|
style:
|
||||||
TextStyle(fontWeight: FontWeight.w600, fontSize: 22.sp),
|
TextStyle(fontWeight: FontWeight.w600, fontSize: 22.sp),
|
||||||
)),
|
)),
|
||||||
@ -60,14 +86,31 @@ class _HideInvalidUnlockPermissionsPageState
|
|||||||
height: 40.h,
|
height: 40.h,
|
||||||
),
|
),
|
||||||
SubmitBtn(
|
SubmitBtn(
|
||||||
btnName: TranslationLoader.lanKeys!.closed!.tr,
|
btnName: _isOn == true
|
||||||
|
? TranslationLoader.lanKeys!.close!.tr
|
||||||
|
: TranslationLoader.lanKeys!.open!.tr,
|
||||||
borderRadius: 20.w,
|
borderRadius: 20.w,
|
||||||
fontSize: 32.sp,
|
fontSize: 32.sp,
|
||||||
// margin: EdgeInsets.only(left: 03.w, right: 30.w, top: 20.w),
|
// margin: EdgeInsets.only(left: 03.w, right: 30.w, top: 20.w),
|
||||||
padding: EdgeInsets.only(top: 20.w, bottom: 20.w),
|
padding: EdgeInsets.only(top: 20.w, bottom: 20.w),
|
||||||
onClick: () {}),
|
onClick: () {
|
||||||
|
_isFirst = false;
|
||||||
|
setState(() {
|
||||||
|
_isOn = !_isOn;
|
||||||
|
});
|
||||||
|
changeSettingsRequest();
|
||||||
|
}),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//锁屏/隐藏无效开锁权限 1:锁屏 2:隐藏无效开锁权限
|
||||||
|
Future<void> changeSettingsRequest() async {
|
||||||
|
ExpireLockListEntity entity =
|
||||||
|
await ApiRepository.to.changeSettings(_isOn == true ? '1' : '2', '2');
|
||||||
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
|
Toast.show(msg: '操作成功');
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -47,6 +47,14 @@ class _LockScreenPageState extends State<LockScreenPage> {
|
|||||||
backgroundColor: AppColors.mainBackgroundColor,
|
backgroundColor: AppColors.mainBackgroundColor,
|
||||||
appBar: TitleAppBar(
|
appBar: TitleAppBar(
|
||||||
barTitle: TranslationLoader.lanKeys!.lockScreen!.tr,
|
barTitle: TranslationLoader.lanKeys!.lockScreen!.tr,
|
||||||
|
// backAction: () {
|
||||||
|
// Navigator.pop(context, true);
|
||||||
|
// },
|
||||||
|
// haveOtherLeftWidget: true,
|
||||||
|
// leftWidget: IconButton(
|
||||||
|
// icon: const Icon(Icons.arrow_back_ios, color: Colors.white),
|
||||||
|
// onPressed: () => Navigator.of(context).pop(true),
|
||||||
|
// ),
|
||||||
haveBack: true,
|
haveBack: true,
|
||||||
backgroundColor: AppColors.mainColor),
|
backgroundColor: AppColors.mainColor),
|
||||||
body: Container(
|
body: Container(
|
||||||
@ -83,8 +91,8 @@ class _LockScreenPageState extends State<LockScreenPage> {
|
|||||||
),
|
),
|
||||||
SubmitBtn(
|
SubmitBtn(
|
||||||
btnName: _isOn == true
|
btnName: _isOn == true
|
||||||
? TranslationLoader.lanKeys!.open!.tr
|
? TranslationLoader.lanKeys!.close!.tr
|
||||||
: TranslationLoader.lanKeys!.closed!.tr,
|
: TranslationLoader.lanKeys!.open!.tr,
|
||||||
onClick: () {
|
onClick: () {
|
||||||
_isFirst = false;
|
_isFirst = false;
|
||||||
setState(() {
|
setState(() {
|
||||||
|
|||||||
@ -63,7 +63,10 @@ class _LockUserManageListPageState extends State<LockUserManageListPage> {
|
|||||||
),
|
),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Navigator.pushNamed(
|
Navigator.pushNamed(
|
||||||
context, Routers.massSendElectronicKeyManagePage);
|
context, Routers.massSendElectronicKeyManagePage)
|
||||||
|
.then((value) {
|
||||||
|
lockUserListRequest();
|
||||||
|
});
|
||||||
},
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
TranslationLoader.lanKeys!.sendGroupKey!.tr,
|
TranslationLoader.lanKeys!.sendGroupKey!.tr,
|
||||||
|
|||||||
@ -2,17 +2,17 @@ import 'package:flutter/cupertino.dart';
|
|||||||
import 'package:flutter/material.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/mine/mineSet/entity/userSettingInfoEntity.dart';
|
|
||||||
import 'package:star_lock/mine/mineSet/lockUserManage/expireLockList/expireLockListEntity.dart';
|
import 'package:star_lock/mine/mineSet/lockUserManage/expireLockList/expireLockListEntity.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 '../../appRouters.dart';
|
import '../../../appRouters.dart';
|
||||||
import '../../app_settings/app_colors.dart';
|
import '../../../app_settings/app_colors.dart';
|
||||||
import '../../tools/commonItem.dart';
|
import '../../../tools/commonItem.dart';
|
||||||
import '../../tools/submitBtn.dart';
|
import '../../../tools/submitBtn.dart';
|
||||||
import '../../tools/titleAppBar.dart';
|
import '../../../tools/titleAppBar.dart';
|
||||||
import '../../translations/trans_lib.dart';
|
import '../../../translations/trans_lib.dart';
|
||||||
|
import 'entity/userSettingInfoEntity.dart';
|
||||||
|
|
||||||
class MineSetPage extends StatefulWidget {
|
class MineSetPage extends StatefulWidget {
|
||||||
const MineSetPage({Key? key}) : super(key: key);
|
const MineSetPage({Key? key}) : super(key: key);
|
||||||
@ -142,7 +142,11 @@ class _MineSetPageState extends State<MineSetPage> {
|
|||||||
}),
|
}),
|
||||||
CommonItem(
|
CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.lockScreen!.tr,
|
leftTitel: TranslationLoader.lanKeys!.lockScreen!.tr,
|
||||||
rightTitle: TranslationLoader.lanKeys!.opened!.tr,
|
rightTitle: _userInfoData.userSettings != null
|
||||||
|
? (_userInfoData.userSettings!.lockScreen == 1
|
||||||
|
? TranslationLoader.lanKeys!.opened!.tr
|
||||||
|
: TranslationLoader.lanKeys!.closed!.tr)
|
||||||
|
: TranslationLoader.lanKeys!.closed!.tr,
|
||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () {
|
action: () {
|
||||||
@ -156,12 +160,24 @@ class _MineSetPageState extends State<MineSetPage> {
|
|||||||
CommonItem(
|
CommonItem(
|
||||||
leftTitel: TranslationLoader
|
leftTitel: TranslationLoader
|
||||||
.lanKeys!.hideInvalidUnlockPermissions!.tr,
|
.lanKeys!.hideInvalidUnlockPermissions!.tr,
|
||||||
rightTitle: TranslationLoader.lanKeys!.closed!.tr,
|
rightTitle: _userInfoData.userSettings != null
|
||||||
|
? (_userInfoData
|
||||||
|
.userSettings!.hideExpiredAccessFlag ==
|
||||||
|
1
|
||||||
|
? TranslationLoader.lanKeys!.opened!.tr
|
||||||
|
: TranslationLoader.lanKeys!.closed!.tr)
|
||||||
|
: TranslationLoader.lanKeys!.closed!.tr,
|
||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () {
|
action: () {
|
||||||
Navigator.pushNamed(
|
Navigator.pushNamed(
|
||||||
context, Routers.hideInvalidUnlockPermissionsPage);
|
context, Routers.hideInvalidUnlockPermissionsPage,
|
||||||
|
arguments: {
|
||||||
|
'isOn': _userInfoData
|
||||||
|
.userSettings!.hideExpiredAccessFlag
|
||||||
|
}).then((value) {
|
||||||
|
userSettingsInfoRequest();
|
||||||
|
});
|
||||||
}),
|
}),
|
||||||
CommonItem(
|
CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!
|
leftTitel: TranslationLoader.lanKeys!
|
||||||
@ -152,7 +152,7 @@ class _SelectGetewayListPageState extends State<SelectGetewayListPage> {
|
|||||||
}
|
}
|
||||||
var data = await Get.toNamed(Routers.recipientInformationPage, arguments: {
|
var data = await Get.toNamed(Routers.recipientInformationPage, arguments: {
|
||||||
"idList":idList,
|
"idList":idList,
|
||||||
"isFromType":1,
|
"isFromType":2,
|
||||||
});
|
});
|
||||||
if(data != null) {
|
if(data != null) {
|
||||||
logic.getGetewayListData();
|
logic.getGetewayListData();
|
||||||
|
|||||||
@ -23,7 +23,7 @@ class RecipientInformationLogic extends BaseGetXController{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 转移智能锁确认
|
// 转移智能锁
|
||||||
Future<void> transferLockInfoData() async{
|
Future<void> transferLockInfoData() async{
|
||||||
var entity = await ApiRepository.to.transferLockInfoData(
|
var entity = await ApiRepository.to.transferLockInfoData(
|
||||||
receiverUserid: state.numberController.text,
|
receiverUserid: state.numberController.text,
|
||||||
@ -35,6 +35,30 @@ class RecipientInformationLogic extends BaseGetXController{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 转移网关确认
|
||||||
|
Future<void> transferGateWayConfirmInfoData(void Function(RecipientInformationData recipientInformationData) action) async{
|
||||||
|
var entity = await ApiRepository.to.transferGatewayConfirmInfoData(
|
||||||
|
receiverUserid: state.numberController.text,
|
||||||
|
type: state.type.value.toString(),
|
||||||
|
countryCode: state.countryCode.value
|
||||||
|
);
|
||||||
|
if(entity.errorCode!.codeIsSuccessful){
|
||||||
|
action(entity.data!);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 转移网关
|
||||||
|
Future<void> transferGatewayInfoData() async{
|
||||||
|
var entity = await ApiRepository.to.transferGatewayInfoData(
|
||||||
|
receiverUserid: state.numberController.text,
|
||||||
|
plugIdList: state.idList.value,
|
||||||
|
countryCode: state.countryCode.value
|
||||||
|
);
|
||||||
|
if(entity.errorCode!.codeIsSuccessful){
|
||||||
|
Get.back(result: "scuess");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void onReady() {
|
void onReady() {
|
||||||
// TODO: implement onReady
|
// TODO: implement onReady
|
||||||
|
|||||||
@ -59,7 +59,7 @@ class _RecipientInformationPageState extends State<RecipientInformationPage> {
|
|||||||
state.type.value = 1;
|
state.type.value = 1;
|
||||||
});
|
});
|
||||||
}),
|
}),
|
||||||
_electronicKeyItem(state.type.value == 2 ? 'images/select_circle.png' : 'images/normal_circle.png', "好房管家", () {
|
_electronicKeyItem(state.type.value == 2 ? 'images/select_circle.png' : 'images/normal_circle.png', "星寓", () {
|
||||||
setState(() {
|
setState(() {
|
||||||
state.type.value = 2;
|
state.type.value = 2;
|
||||||
});
|
});
|
||||||
@ -120,7 +120,7 @@ class _RecipientInformationPageState extends State<RecipientInformationPage> {
|
|||||||
onChanged: (value) {},
|
onChanged: (value) {},
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
border: InputBorder.none,
|
border: InputBorder.none,
|
||||||
hintText: state.type.value == 1 ? "请输入手机号或email" : "请输入好房管家管理员的账号",
|
hintText: state.type.value == 1 ? "请输入手机号或email" : "请输入星寓管理员的账号",
|
||||||
hintStyle: TextStyle(
|
hintStyle: TextStyle(
|
||||||
color: AppColors.placeholderTextColor,
|
color: AppColors.placeholderTextColor,
|
||||||
fontSize: ScreenUtil().setSp(22),
|
fontSize: ScreenUtil().setSp(22),
|
||||||
@ -182,18 +182,35 @@ class _RecipientInformationPageState extends State<RecipientInformationPage> {
|
|||||||
Toast.show(msg: "请输入手机号或email");
|
Toast.show(msg: "请输入手机号或email");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(state.type.value == 1){
|
if(state.isFromType.value == 1){
|
||||||
logic.transferLockConfirmInfoData((v){
|
// 转移智能锁
|
||||||
showCupertinoAlertDialog(context, v);
|
if(state.type.value == 1){
|
||||||
});
|
logic.transferLockConfirmInfoData((v){
|
||||||
|
showCupertinoAlertDialog(context, v);
|
||||||
|
});
|
||||||
|
}else{
|
||||||
|
Get.toNamed(Routers.selectBranchPage, arguments: {
|
||||||
|
"idList":state.idList.value,
|
||||||
|
"countryCode":state.countryCode.value,
|
||||||
|
"number":state.numberController.text,
|
||||||
|
"isFromType":state.isFromType.value,
|
||||||
|
});
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
Get.toNamed(Routers.selectBranchPage, arguments: {
|
// 转移网关
|
||||||
"idList":state.idList.value,
|
if(state.type.value == 1){
|
||||||
"countryCode":state.countryCode.value,
|
logic.transferGateWayConfirmInfoData((v){
|
||||||
"number":state.numberController.text,
|
showCupertinoAlertDialog(context, v);
|
||||||
});
|
});
|
||||||
|
}else{
|
||||||
|
Get.toNamed(Routers.selectBranchPage, arguments: {
|
||||||
|
"idList":state.idList.value,
|
||||||
|
"countryCode":state.countryCode.value,
|
||||||
|
"number":state.numberController.text,
|
||||||
|
"isFromType":state.isFromType.value
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -211,6 +228,7 @@ class _RecipientInformationPageState extends State<RecipientInformationPage> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 点击确认
|
||||||
void showCupertinoAlertDialog(BuildContext context, RecipientInformationData recipientInformationData) {
|
void showCupertinoAlertDialog(BuildContext context, RecipientInformationData recipientInformationData) {
|
||||||
showGeneralDialog(
|
showGeneralDialog(
|
||||||
context: context,
|
context: context,
|
||||||
@ -248,7 +266,7 @@ class _RecipientInformationPageState extends State<RecipientInformationPage> {
|
|||||||
child: Container(
|
child: Container(
|
||||||
width: 80.w,
|
width: 80.w,
|
||||||
color: Colors.red,
|
color: Colors.red,
|
||||||
child: Center(child: Text(state.type.value == 1 ? "个人用户" : "好房管家", style: TextStyle(fontSize: 18.sp, color: Colors.white))),
|
child: Center(child: Text(state.type.value == 1 ? "个人用户" : "星寓", style: TextStyle(fontSize: 18.sp, color: Colors.white))),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
@ -279,7 +297,13 @@ class _RecipientInformationPageState extends State<RecipientInformationPage> {
|
|||||||
ElevatedButton(
|
ElevatedButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Get.back();
|
Get.back();
|
||||||
logic.transferLockInfoData();
|
if(state.isFromType.value == 1){
|
||||||
|
// 转移智能锁 transferGatewayInfoData
|
||||||
|
logic.transferLockInfoData();
|
||||||
|
}else{
|
||||||
|
// 转移网关
|
||||||
|
logic.transferGatewayInfoData();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
style: ElevatedButton.styleFrom(
|
style: ElevatedButton.styleFrom(
|
||||||
onPrimary: AppColors.appBarIconColor,
|
onPrimary: AppColors.appBarIconColor,
|
||||||
|
|||||||
@ -8,7 +8,7 @@ class RecipientInformationState{
|
|||||||
|
|
||||||
final countryName = "中国".obs;
|
final countryName = "中国".obs;
|
||||||
final countryCode = "86".obs;
|
final countryCode = "86".obs;
|
||||||
final isFromType = 1.obs;
|
final isFromType = 1.obs; // 1从转移智能锁过来 2 转移网关
|
||||||
final idList = [].obs;
|
final idList = [].obs;
|
||||||
RecipientInformationState() {
|
RecipientInformationState() {
|
||||||
Map map = Get.arguments;
|
Map map = Get.arguments;
|
||||||
|
|||||||
@ -175,7 +175,7 @@ class _SelectBranchPageState extends State<SelectBranchPage> {
|
|||||||
child: Container(
|
child: Container(
|
||||||
width: 80.w,
|
width: 80.w,
|
||||||
color: Colors.red,
|
color: Colors.red,
|
||||||
child: Center(child: Text(state.type.value == 1 ? "个人用户" : "好房管家", style: TextStyle(fontSize: 18.sp, color: Colors.white))),
|
child: Center(child: Text(state.type.value == 1 ? "个人用户" : "星寓", style: TextStyle(fontSize: 18.sp, color: Colors.white))),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
|
|||||||
@ -183,7 +183,7 @@ class _TransferSmartLockPageState extends State<TransferSmartLockPage> {
|
|||||||
}
|
}
|
||||||
var data = await Get.toNamed(Routers.recipientInformationPage, arguments: {
|
var data = await Get.toNamed(Routers.recipientInformationPage, arguments: {
|
||||||
"idList":idList,
|
"idList":idList,
|
||||||
"isFromType":2,
|
"isFromType":1,
|
||||||
});
|
});
|
||||||
if(data != null) {
|
if(data != null) {
|
||||||
logic.getTransferLockListData();
|
logic.getTransferLockListData();
|
||||||
|
|||||||
@ -94,6 +94,8 @@ abstract class Api {
|
|||||||
final String transferLockURL = '/room/transfer'; // 转移智能锁
|
final String transferLockURL = '/room/transfer'; // 转移智能锁
|
||||||
|
|
||||||
final String gatewaykListURL = '/plug/list'; // 转网关列表
|
final String gatewaykListURL = '/plug/list'; // 转网关列表
|
||||||
|
final String transferGatewayConfirmURL = '/plug/transferPlugConfirm'; // 转移网关确认
|
||||||
|
final String transferGatewayURL = '/plug/transfer'; // 转移网关
|
||||||
|
|
||||||
final String getKeyDetailURL = '/key/get'; //获取单把钥匙详情信息
|
final String getKeyDetailURL = '/key/get'; //获取单把钥匙详情信息
|
||||||
final String lockUserListURL = '/keyUser/listKeyUser'; //锁用户列表
|
final String lockUserListURL = '/keyUser/listKeyUser'; //锁用户列表
|
||||||
@ -102,6 +104,7 @@ abstract class Api {
|
|||||||
final String addAuthorizedAdminURL = '/authorizedAdmin/add'; //增加授权管理员
|
final String addAuthorizedAdminURL = '/authorizedAdmin/add'; //增加授权管理员
|
||||||
final String keyListByUserURL = '/keyUser/listByUse'; //用户拥有的锁
|
final String keyListByUserURL = '/keyUser/listByUse'; //用户拥有的锁
|
||||||
final String authorizedAdminListURL = '/authorizedAdmin/list'; //授权管理员列表
|
final String authorizedAdminListURL = '/authorizedAdmin/list'; //授权管理员列表
|
||||||
|
final String authorizedAdminDetailURL = '/authorizedAdmin/detail'; //授权管理员详情
|
||||||
final String deleteAdministratorURL = '/authorizedAdmin/delete'; //删除授权管理员
|
final String deleteAdministratorURL = '/authorizedAdmin/delete'; //删除授权管理员
|
||||||
final String updateAdministratorURL =
|
final String updateAdministratorURL =
|
||||||
'/authorizedAdmin/update'; //管理员姓名/有效期/远程开锁修改
|
'/authorizedAdmin/update'; //管理员姓名/有效期/远程开锁修改
|
||||||
|
|||||||
@ -409,16 +409,16 @@ class ApiProvider extends BaseProvider {
|
|||||||
post(deleteElectronicKeyURL.toUrl,
|
post(deleteElectronicKeyURL.toUrl,
|
||||||
jsonEncode({'uid': uid, 'includeUnderlings': includeUnderlings}));
|
jsonEncode({'uid': uid, 'includeUnderlings': includeUnderlings}));
|
||||||
|
|
||||||
Future<Response> updateAdministrator(String uid, String name, String endDate,
|
Future<Response> updateAdministrator(String uid, String keyName,
|
||||||
String startDate, String isRemoteUnlock) =>
|
String endDate, String startDate, String remoteEnable) =>
|
||||||
post(
|
post(
|
||||||
deleteElectronicKeyURL.toUrl,
|
updateAdministratorURL.toUrl,
|
||||||
jsonEncode({
|
jsonEncode({
|
||||||
'uid': uid,
|
'uid': uid,
|
||||||
'name': name,
|
'keyName': keyName,
|
||||||
'endDate': endDate,
|
'endDate': endDate,
|
||||||
'startDate': startDate,
|
'startDate': startDate,
|
||||||
'isRemoteUnlock': isRemoteUnlock
|
'remoteEnable': remoteEnable
|
||||||
}));
|
}));
|
||||||
|
|
||||||
Future<Response> expireLockList(
|
Future<Response> expireLockList(
|
||||||
@ -928,17 +928,11 @@ class ApiProvider extends BaseProvider {
|
|||||||
|
|
||||||
// 更新ICCard序号
|
// 更新ICCard序号
|
||||||
Future<Response> updateIdCardUserNoLoadData(
|
Future<Response> updateIdCardUserNoLoadData(
|
||||||
String cardId,
|
String cardId, String lockId, String cardUserNo) =>
|
||||||
String lockId,
|
|
||||||
String cardUserNo) =>
|
|
||||||
post(
|
post(
|
||||||
updateICCardUserNoURL.toUrl,
|
updateICCardUserNoURL.toUrl,
|
||||||
jsonEncode({
|
jsonEncode(
|
||||||
'cardId': cardId,
|
{'cardId': cardId, 'lockId': lockId, 'cardUserNo': cardUserNo}));
|
||||||
'lockId': lockId,
|
|
||||||
'cardUserNo': cardUserNo
|
|
||||||
})
|
|
||||||
);
|
|
||||||
|
|
||||||
// 获取转移锁锁列表
|
// 获取转移锁锁列表
|
||||||
Future<Response> getTransferLockListData() =>
|
Future<Response> getTransferLockListData() =>
|
||||||
@ -987,6 +981,34 @@ class ApiProvider extends BaseProvider {
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// 转移网关确认
|
||||||
|
Future<Response> transferGatewayConfirmInfoData(
|
||||||
|
String receiverUserid,
|
||||||
|
String type,
|
||||||
|
String countryCode) =>
|
||||||
|
post(
|
||||||
|
transferGatewayConfirmURL.toUrl,
|
||||||
|
jsonEncode({
|
||||||
|
'receiverUserid': receiverUserid,
|
||||||
|
'type': type,
|
||||||
|
'countryCode': countryCode
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
|
// 转移网关
|
||||||
|
Future<Response> transferGatewayInfoData(
|
||||||
|
String receiverUserid,
|
||||||
|
List plugIdList,
|
||||||
|
String countryCode) =>
|
||||||
|
post(
|
||||||
|
transferGatewayURL.toUrl,
|
||||||
|
jsonEncode({
|
||||||
|
'receiverUserid': receiverUserid,
|
||||||
|
'plugIdList': plugIdList,
|
||||||
|
'countryCode': countryCode
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
Future<Response> listLockByGroup(String type, String keyGroupId) => post(
|
Future<Response> listLockByGroup(String type, String keyGroupId) => post(
|
||||||
listLockByGroupURL.toUrl,
|
listLockByGroupURL.toUrl,
|
||||||
jsonEncode({'type': type, 'keyGroupId': keyGroupId}));
|
jsonEncode({'type': type, 'keyGroupId': keyGroupId}));
|
||||||
@ -1012,6 +1034,26 @@ class ApiProvider extends BaseProvider {
|
|||||||
authorizedAdminListURL.toUrl,
|
authorizedAdminListURL.toUrl,
|
||||||
jsonEncode({'pageNo': pageNo, 'pageSize': pageSize}));
|
jsonEncode({'pageNo': pageNo, 'pageSize': pageSize}));
|
||||||
|
|
||||||
|
Future<Response> authorizedAdminDetail(int uid) =>
|
||||||
|
post(authorizedAdminDetailURL.toUrl, jsonEncode({'uid': uid}));
|
||||||
|
|
||||||
|
Future<Response> deleteAuthorizedAdmin(
|
||||||
|
String uid, String includeUnderlings) =>
|
||||||
|
post(deleteAdministratorURL.toUrl,
|
||||||
|
jsonEncode({'uid': uid, 'includeUnderlings': includeUnderlings}));
|
||||||
|
|
||||||
|
Future<Response> updateAuthorizedAdmin(String uid, String name,
|
||||||
|
String endDate, String startDate, String isRemoteUnlock) =>
|
||||||
|
post(
|
||||||
|
updateAdministratorURL.toUrl,
|
||||||
|
jsonEncode({
|
||||||
|
'uid': uid,
|
||||||
|
'name': name,
|
||||||
|
'endDate': endDate,
|
||||||
|
'startDate': startDate,
|
||||||
|
'isRemoteUnlock': isRemoteUnlock
|
||||||
|
}));
|
||||||
|
|
||||||
Future<Response> setAlertMode(String alertMode, String isOn) => post(
|
Future<Response> setAlertMode(String alertMode, String isOn) => post(
|
||||||
setAlertModeURL.toUrl,
|
setAlertModeURL.toUrl,
|
||||||
jsonEncode({'alertMode': alertMode, 'isOn': isOn}));
|
jsonEncode({'alertMode': alertMode, 'isOn': isOn}));
|
||||||
|
|||||||
@ -61,8 +61,8 @@ class BaseProvider extends GetConnect with Api {
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
getDataResult(T){
|
getDataResult(T) {
|
||||||
switch(T["errorCode"]){
|
switch (T["errorCode"]) {
|
||||||
case 403:
|
case 403:
|
||||||
Get.offNamedUntil(Routers.starLockLoginPage, (route) => false);
|
Get.offNamedUntil(Routers.starLockLoginPage, (route) => false);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@ -8,8 +8,8 @@ import 'package:star_lock/main/lockDetail/lcokSet/basicInformation/basicInformat
|
|||||||
import 'package:star_lock/main/lockDetail/lcokSet/basicInformation/lockSeletGrouping/LockGroupListEntity.dart';
|
import 'package:star_lock/main/lockDetail/lcokSet/basicInformation/lockSeletGrouping/LockGroupListEntity.dart';
|
||||||
import 'package:star_lock/main/lockDetail/passwordKey/passwordKeyList/passwordKeyListEntity.dart';
|
import 'package:star_lock/main/lockDetail/passwordKey/passwordKeyList/passwordKeyListEntity.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/mine/mineSet/authorizedAdministrator/administratorDetails/administratorDetailEntity.dart';
|
||||||
import 'package:star_lock/mine/mineSet/authorizedAdministrator/authorizedAdminListEntity.dart';
|
import 'package:star_lock/mine/mineSet/authorizedAdministrator/authorizedAdminListEntity.dart';
|
||||||
import 'package:star_lock/mine/mineSet/entity/userSettingInfoEntity.dart';
|
|
||||||
import 'package:star_lock/mine/mineSet/lockUserManage/expireLockList/expireLockListEntity.dart';
|
import 'package:star_lock/mine/mineSet/lockUserManage/expireLockList/expireLockListEntity.dart';
|
||||||
import 'package:star_lock/mine/mineSet/lockUserManage/keyListByUserEntity.dart';
|
import 'package:star_lock/mine/mineSet/lockUserManage/keyListByUserEntity.dart';
|
||||||
import '../common/safetyVerification/entity/CheckSafetyVerificationEntity.dart';
|
import '../common/safetyVerification/entity/CheckSafetyVerificationEntity.dart';
|
||||||
@ -27,9 +27,12 @@ import '../main/lockDetail/lcokSet/configuringWifi/configuringWifiEntity.dart';
|
|||||||
import '../main/lockDetail/lcokSet/lockSet/CheckingInInfoDataEntity.dart';
|
import '../main/lockDetail/lcokSet/lockSet/CheckingInInfoDataEntity.dart';
|
||||||
import '../main/lockDetail/lcokSet/lockTime/GetServerDatetimeEntity.dart';
|
import '../main/lockDetail/lcokSet/lockTime/GetServerDatetimeEntity.dart';
|
||||||
import '../main/lockDetail/lcokSet/normallyOpenMode/GetPassageModeConfigEntity.dart';
|
import '../main/lockDetail/lcokSet/normallyOpenMode/GetPassageModeConfigEntity.dart';
|
||||||
|
import '../main/lockDetail/otherTypeKey/addFingerprint/addFingerprint/addFingerprint_entity.dart';
|
||||||
|
import '../main/lockDetail/otherTypeKey/addICCard/addICCard_entity.dart';
|
||||||
import '../main/lockDetail/otherTypeKey/otherTypeKeyList/fingerprintListData_entity.dart';
|
import '../main/lockDetail/otherTypeKey/otherTypeKeyList/fingerprintListData_entity.dart';
|
||||||
import '../main/lockMian/entity/lockInfoEntity.dart';
|
import '../main/lockMian/entity/lockInfoEntity.dart';
|
||||||
import '../mine/addLock/saveLock/entity/SaveLockEntity.dart';
|
import '../mine/addLock/saveLock/entity/SaveLockEntity.dart';
|
||||||
|
import '../mine/mineSet/mineSet/entity/userSettingInfoEntity.dart';
|
||||||
import '../mine/mineSet/transferGateway/selectGetewayList_entity.dart';
|
import '../mine/mineSet/transferGateway/selectGetewayList_entity.dart';
|
||||||
import '../mine/mineSet/transferSmartLock/recipientInformation/recipientInformation_entity.dart';
|
import '../mine/mineSet/transferSmartLock/recipientInformation/recipientInformation_entity.dart';
|
||||||
import '../mine/mineSet/transferSmartLock/transferSmartLockList/transferSmartLock_entity.dart';
|
import '../mine/mineSet/transferSmartLock/transferSmartLockList/transferSmartLock_entity.dart';
|
||||||
@ -404,10 +407,14 @@ class ApiRepository {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//更新授权管理员
|
//更新授权管理员
|
||||||
Future<ElectronicKeyListEntity> updateAdministrator(String uid, String name,
|
Future<ElectronicKeyListEntity> updateAdministrator(
|
||||||
String endDate, String startDate, String isRemoteUnlock) async {
|
String uid,
|
||||||
|
String keyName,
|
||||||
|
String endDate,
|
||||||
|
String startDate,
|
||||||
|
String remoteEnable) async {
|
||||||
final res = await apiProvider.updateAdministrator(
|
final res = await apiProvider.updateAdministrator(
|
||||||
uid, name, endDate, startDate, isRemoteUnlock);
|
uid, keyName, endDate, startDate, remoteEnable);
|
||||||
return ElectronicKeyListEntity.fromJson(res.body);
|
return ElectronicKeyListEntity.fromJson(res.body);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -653,6 +660,31 @@ class ApiRepository {
|
|||||||
return AuthorizedAdminListEntity.fromJson(res.body);
|
return AuthorizedAdminListEntity.fromJson(res.body);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//授权管理员详情
|
||||||
|
Future<AdministratorDetailEntity> authorizedAdminDetail(int uid) async {
|
||||||
|
final res = await apiProvider.authorizedAdminDetail(uid);
|
||||||
|
return AdministratorDetailEntity.fromJson(res.body);
|
||||||
|
}
|
||||||
|
|
||||||
|
//删除授权管理员
|
||||||
|
Future<AuthorizedAdminListEntity> deleteAuthorizedAdmin(
|
||||||
|
String uid, String includeUnderlings) async {
|
||||||
|
final res = await apiProvider.deleteAuthorizedAdmin(uid, includeUnderlings);
|
||||||
|
return AuthorizedAdminListEntity.fromJson(res.body);
|
||||||
|
}
|
||||||
|
|
||||||
|
//更新授权管理员
|
||||||
|
Future<AuthorizedAdminListEntity> updateAuthorizedAdmin(
|
||||||
|
String uid,
|
||||||
|
String name,
|
||||||
|
String endDate,
|
||||||
|
String startDate,
|
||||||
|
String isRemoteUnlock) async {
|
||||||
|
final res = await apiProvider.updateAuthorizedAdmin(
|
||||||
|
uid, name, endDate, startDate, isRemoteUnlock);
|
||||||
|
return AuthorizedAdminListEntity.fromJson(res.body);
|
||||||
|
}
|
||||||
|
|
||||||
//提示音
|
//提示音
|
||||||
Future<ExpireLockListEntity> setAlertMode(
|
Future<ExpireLockListEntity> setAlertMode(
|
||||||
String alertMode, String isOn) async {
|
String alertMode, String isOn) async {
|
||||||
@ -883,7 +915,7 @@ class ApiRepository {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 添加指纹
|
// 添加指纹
|
||||||
Future<CheckingInListMonthEntity> addFingerprintsData({
|
Future<AddFingerprintEntity> addFingerprintsData({
|
||||||
required String lockId,
|
required String lockId,
|
||||||
required String endDate,
|
required String endDate,
|
||||||
required String addType,
|
required String addType,
|
||||||
@ -904,7 +936,7 @@ class ApiRepository {
|
|||||||
isCoerced,
|
isCoerced,
|
||||||
startDate,
|
startDate,
|
||||||
weekDay);
|
weekDay);
|
||||||
return CheckingInListMonthEntity.fromJson(res.body);
|
return AddFingerprintEntity.fromJson(res.body);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 编辑指纹
|
// 编辑指纹
|
||||||
@ -955,7 +987,7 @@ class ApiRepository {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 添加ID卡
|
// 添加ID卡
|
||||||
Future<CheckingInListMonthEntity> addICCardData({
|
Future<AddICCardEntity> addICCardData({
|
||||||
required String lockId,
|
required String lockId,
|
||||||
required String endDate,
|
required String endDate,
|
||||||
required String cardName,
|
required String cardName,
|
||||||
@ -968,7 +1000,7 @@ class ApiRepository {
|
|||||||
}) async {
|
}) async {
|
||||||
final res = await apiProvider.addICCardData(lockId, endDate, cardName,
|
final res = await apiProvider.addICCardData(lockId, endDate, cardName,
|
||||||
cardNumber, cardType, addType, startDate, isCoerced, weekDay);
|
cardNumber, cardType, addType, startDate, isCoerced, weekDay);
|
||||||
return CheckingInListMonthEntity.fromJson(res.body);
|
return AddICCardEntity.fromJson(res.body);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 编辑IC卡
|
// 编辑IC卡
|
||||||
@ -998,13 +1030,11 @@ class ApiRepository {
|
|||||||
|
|
||||||
// 更新ICCard用户序号
|
// 更新ICCard用户序号
|
||||||
Future<LoginEntity> updateIdCardUserNoLoadData(
|
Future<LoginEntity> updateIdCardUserNoLoadData(
|
||||||
{
|
{required String lockId,
|
||||||
required String lockId,
|
required String cardId,
|
||||||
required String cardId,
|
required String cardUserNo}) async {
|
||||||
required String cardUserNo
|
final res = await apiProvider.updateIdCardUserNoLoadData(
|
||||||
}) async {
|
lockId, cardId, cardUserNo);
|
||||||
final res =
|
|
||||||
await apiProvider.updateIdCardUserNoLoadData(lockId, cardId, cardUserNo);
|
|
||||||
return LoginEntity.fromJson(res.body);
|
return LoginEntity.fromJson(res.body);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1015,32 +1045,49 @@ class ApiRepository {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 转移智能锁确认
|
// 转移智能锁确认
|
||||||
Future<RecipientInformationEntity> transferLockConfirmInfoData({
|
Future<RecipientInformationEntity> transferLockConfirmInfoData(
|
||||||
required String receiverUserid,
|
{required String receiverUserid,
|
||||||
required String type,
|
required String type,
|
||||||
required String countryCode
|
required String countryCode}) async {
|
||||||
}) async {
|
final res = await apiProvider.transferLockConfirmInfoData(
|
||||||
final res = await apiProvider.transferLockConfirmInfoData(receiverUserid, type, countryCode);
|
receiverUserid, type, countryCode);
|
||||||
return RecipientInformationEntity.fromJson(res.body);
|
return RecipientInformationEntity.fromJson(res.body);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 转移智能锁
|
// 转移智能锁
|
||||||
Future<RecipientInformationEntity> transferLockInfoData({
|
Future<RecipientInformationEntity> transferLockInfoData(
|
||||||
required String receiverUserid,
|
{required String receiverUserid,
|
||||||
required List lockIdList,
|
required List lockIdList,
|
||||||
required String countryCode
|
required String countryCode}) async {
|
||||||
}) async {
|
final res = await apiProvider.transferLockInfoData(
|
||||||
final res = await apiProvider.transferLockInfoData(receiverUserid, lockIdList, countryCode);
|
receiverUserid, lockIdList, countryCode);
|
||||||
return RecipientInformationEntity.fromJson(res.body);
|
return RecipientInformationEntity.fromJson(res.body);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取网关列表
|
// 获取网关列表
|
||||||
Future<GetewayDataEntity> getGatewayListData({
|
Future<GetewayDataEntity> getGatewayListData(
|
||||||
required String pageNo,
|
{required String pageNo, required String pageSize}) async {
|
||||||
required String pageSize
|
|
||||||
}) async {
|
|
||||||
final res = await apiProvider.getGatewayListData(pageNo, pageSize);
|
final res = await apiProvider.getGatewayListData(pageNo, pageSize);
|
||||||
return GetewayDataEntity.fromJson(res.body);
|
return GetewayDataEntity.fromJson(res.body);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 转移网关确认
|
||||||
|
Future<RecipientInformationEntity> transferGatewayConfirmInfoData(
|
||||||
|
{required String receiverUserid,
|
||||||
|
required String type,
|
||||||
|
required String countryCode}) async {
|
||||||
|
final res = await apiProvider.transferGatewayConfirmInfoData(
|
||||||
|
receiverUserid, type, countryCode);
|
||||||
|
return RecipientInformationEntity.fromJson(res.body);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 转移智能锁
|
||||||
|
Future<RecipientInformationEntity> transferGatewayInfoData(
|
||||||
|
{required String receiverUserid,
|
||||||
|
required List plugIdList,
|
||||||
|
required String countryCode}) async {
|
||||||
|
final res = await apiProvider.transferGatewayInfoData(
|
||||||
|
receiverUserid, plugIdList, countryCode);
|
||||||
|
return RecipientInformationEntity.fromJson(res.body);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import 'dart:convert';
|
|||||||
|
|
||||||
import 'package:shared_preferences/shared_preferences.dart';
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
|
|
||||||
|
import '../login/login/entity/LoginData.dart';
|
||||||
import '../login/login/entity/LoginEntity.dart';
|
import '../login/login/entity/LoginEntity.dart';
|
||||||
|
|
||||||
class Storage {
|
class Storage {
|
||||||
@ -122,7 +123,7 @@ class Storage {
|
|||||||
String? userId = '';
|
String? userId = '';
|
||||||
final data = await Storage.getString('userLoginData');
|
final data = await Storage.getString('userLoginData');
|
||||||
if (data != null && data.isNotEmpty) {
|
if (data != null && data.isNotEmpty) {
|
||||||
userId = LoginEntity.fromJson(jsonDecode(data)).data!.userid.toString();
|
userId = LoginData.fromJson(jsonDecode(data)).userid.toString();
|
||||||
}
|
}
|
||||||
print("pubUserId:$userId");
|
print("pubUserId:$userId");
|
||||||
return userId;
|
return userId;
|
||||||
|
|||||||
@ -100,7 +100,7 @@ dependencies:
|
|||||||
|
|
||||||
# 谷歌地图
|
# 谷歌地图
|
||||||
google_maps_flutter: ^2.2.5
|
google_maps_flutter: ^2.2.5
|
||||||
geocoding: ^2.1.0
|
# geocoding: ^2.1.0
|
||||||
|
|
||||||
# 允许App发现网络的相关信息并且进行相应的配置
|
# 允许App发现网络的相关信息并且进行相应的配置
|
||||||
network_info_plus: ^4.0.2
|
network_info_plus: ^4.0.2
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user