修复打开APP请求权限问题,修改已知bug
This commit is contained in:
parent
bfbe9e0e14
commit
22423607d1
@ -1,6 +1,6 @@
|
||||
{
|
||||
"starLock":"星锁",
|
||||
"clickUnlockAndHoldDownClose":"点击开锁,长按关闭",
|
||||
"clickUnlockAndHoldDownClose":"点击开锁,长按闭锁",
|
||||
"checkingIn":"考勤",
|
||||
"electronicKey":"电子钥匙",
|
||||
"password":"密码",
|
||||
|
||||
@ -695,7 +695,9 @@
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = D28DFC3BEA6D46B5F5B5E55F /* Pods-Runner.debug-dev.xcconfig */;
|
||||
buildSettings = {
|
||||
DEVELOPMENT_TEAM = SF86QP26TZ;
|
||||
CODE_SIGN_IDENTITY = "Apple Development: Tian Sky (33RZ5UJ9WP)";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
DEVELOPMENT_TEAM = 7D53BZAN75;
|
||||
PRODUCT_NAME = Runner;
|
||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||
SUPPORTS_MACCATALYST = NO;
|
||||
@ -708,7 +710,9 @@
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 6285D102821F3D2FB7B09E43 /* Pods-Runner.profile-dev.xcconfig */;
|
||||
buildSettings = {
|
||||
DEVELOPMENT_TEAM = SF86QP26TZ;
|
||||
CODE_SIGN_IDENTITY = "Apple Development: Tian Sky (33RZ5UJ9WP)";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
DEVELOPMENT_TEAM = 7D53BZAN75;
|
||||
PRODUCT_NAME = Runner;
|
||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||
SUPPORTS_MACCATALYST = NO;
|
||||
@ -721,6 +725,9 @@
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 295A8AFEEC4806105FAA13B5 /* Pods-Runner.release-dev.xcconfig */;
|
||||
buildSettings = {
|
||||
CODE_SIGN_IDENTITY = "Apple Development: Tian Sky (33RZ5UJ9WP)";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
DEVELOPMENT_TEAM = 7D53BZAN75;
|
||||
PRODUCT_NAME = Runner;
|
||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||
SUPPORTS_MACCATALYST = NO;
|
||||
@ -733,6 +740,9 @@
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 51086737647B9B5E510020C6 /* Pods-Runner.debug-pre.xcconfig */;
|
||||
buildSettings = {
|
||||
CODE_SIGN_IDENTITY = "Apple Development: Tian Sky (33RZ5UJ9WP)";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
DEVELOPMENT_TEAM = 7D53BZAN75;
|
||||
PRODUCT_NAME = Runner;
|
||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||
SUPPORTS_MACCATALYST = NO;
|
||||
@ -745,7 +755,9 @@
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = D001CDA3D7BF065A0C6E3B64 /* Pods-Runner.profile-pre.xcconfig */;
|
||||
buildSettings = {
|
||||
DEVELOPMENT_TEAM = SF86QP26TZ;
|
||||
CODE_SIGN_IDENTITY = "Apple Development: Tian Sky (33RZ5UJ9WP)";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
DEVELOPMENT_TEAM = 7D53BZAN75;
|
||||
PRODUCT_NAME = Runner;
|
||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||
SUPPORTS_MACCATALYST = NO;
|
||||
@ -758,6 +770,9 @@
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 68C41ACED6A779BAAA0A51A7 /* Pods-Runner.release-pre.xcconfig */;
|
||||
buildSettings = {
|
||||
CODE_SIGN_IDENTITY = "Apple Development: Tian Sky (33RZ5UJ9WP)";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
DEVELOPMENT_TEAM = 7D53BZAN75;
|
||||
PRODUCT_NAME = Runner;
|
||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||
SUPPORTS_MACCATALYST = NO;
|
||||
@ -770,6 +785,9 @@
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 4A63B2C308CB401731950EC8 /* Pods-Runner.debug-sky.xcconfig */;
|
||||
buildSettings = {
|
||||
CODE_SIGN_IDENTITY = "Apple Development: Tian Sky (33RZ5UJ9WP)";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
DEVELOPMENT_TEAM = 7D53BZAN75;
|
||||
PRODUCT_NAME = Runner;
|
||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||
SUPPORTS_MACCATALYST = NO;
|
||||
@ -782,6 +800,9 @@
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 8CD96970DEA44F6CC71DEECE /* Pods-Runner.profile-sky.xcconfig */;
|
||||
buildSettings = {
|
||||
CODE_SIGN_IDENTITY = "Apple Development: Tian Sky (33RZ5UJ9WP)";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
DEVELOPMENT_TEAM = 7D53BZAN75;
|
||||
PRODUCT_NAME = Runner;
|
||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||
SUPPORTS_MACCATALYST = NO;
|
||||
@ -794,6 +815,9 @@
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 16A83D21DFB231D8453DC681 /* Pods-Runner.release-sky.xcconfig */;
|
||||
buildSettings = {
|
||||
CODE_SIGN_IDENTITY = "Apple Development: Tian Sky (33RZ5UJ9WP)";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
DEVELOPMENT_TEAM = 7D53BZAN75;
|
||||
PRODUCT_NAME = Runner;
|
||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||
SUPPORTS_MACCATALYST = NO;
|
||||
@ -806,6 +830,9 @@
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = 22D858E988707FF26E068457 /* Pods-Runner.debug-xhj.xcconfig */;
|
||||
buildSettings = {
|
||||
CODE_SIGN_IDENTITY = "Apple Development: Tian Sky (33RZ5UJ9WP)";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
DEVELOPMENT_TEAM = 7D53BZAN75;
|
||||
PRODUCT_NAME = Runner;
|
||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||
SUPPORTS_MACCATALYST = NO;
|
||||
@ -818,6 +845,9 @@
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = D62237D2D011BDC27FB2BC28 /* Pods-Runner.profile-xhj.xcconfig */;
|
||||
buildSettings = {
|
||||
CODE_SIGN_IDENTITY = "Apple Development: Tian Sky (33RZ5UJ9WP)";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
DEVELOPMENT_TEAM = 7D53BZAN75;
|
||||
PRODUCT_NAME = Runner;
|
||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||
SUPPORTS_MACCATALYST = NO;
|
||||
@ -830,6 +860,9 @@
|
||||
isa = XCBuildConfiguration;
|
||||
baseConfigurationReference = CDC2B8ED804B514A774F187D /* Pods-Runner.release-xhj.xcconfig */;
|
||||
buildSettings = {
|
||||
CODE_SIGN_IDENTITY = "Apple Development: Tian Sky (33RZ5UJ9WP)";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
DEVELOPMENT_TEAM = 7D53BZAN75;
|
||||
PRODUCT_NAME = Runner;
|
||||
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
|
||||
SUPPORTS_MACCATALYST = NO;
|
||||
@ -966,7 +999,7 @@
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
||||
CODE_SIGN_IDENTITY = "Apple Development";
|
||||
CODE_SIGN_IDENTITY = "Apple Development: Tian Sky (33RZ5UJ9WP)";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||
DEVELOPMENT_TEAM = 7D53BZAN75;
|
||||
@ -1641,7 +1674,7 @@
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
||||
CODE_SIGN_IDENTITY = "Apple Development";
|
||||
CODE_SIGN_IDENTITY = "Apple Development: Tian Sky (33RZ5UJ9WP)";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||
DEVELOPMENT_TEAM = 7D53BZAN75;
|
||||
@ -1786,7 +1819,7 @@
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
|
||||
CODE_SIGN_IDENTITY = "Apple Development";
|
||||
CODE_SIGN_IDENTITY = "Apple Development: Tian Sky (33RZ5UJ9WP)";
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||
DEVELOPMENT_TEAM = 7D53BZAN75;
|
||||
|
||||
@ -102,7 +102,7 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver, BaseWidget {
|
||||
super.initState();
|
||||
WidgetsBinding.instance.addObserver(this);
|
||||
|
||||
openBlueScan();
|
||||
// openBlueScan();
|
||||
|
||||
initAliyunPush();
|
||||
}
|
||||
|
||||
@ -110,6 +110,7 @@ class BlueManage {
|
||||
/// 调用发送数据
|
||||
Future<void> bludSendData(String deviceName, ConnectStateCallBack stateCallBack, {bool isAddEquipment = false}) async {
|
||||
_flutterReactiveBle!.statusStream.listen((status) {
|
||||
Get.log("_flutterReactiveBle.status:$status");
|
||||
if (status == BleStatus.ready) {
|
||||
// 蓝牙已开启,可以进行蓝牙操作
|
||||
if(deviceConnectionState != DeviceConnectionState.connected){
|
||||
|
||||
@ -17,6 +17,7 @@ import '../../../../blue/io_tool/manager_event_bus.dart';
|
||||
import '../../../../blue/sender_manage.dart';
|
||||
import '../../../../network/api_repository.dart';
|
||||
import '../../../../tools/baseGetXController.dart';
|
||||
import '../../../../tools/eventBusEventManage.dart';
|
||||
import '../../../../tools/storage.dart';
|
||||
import 'authorizedAdmin_state.dart';
|
||||
|
||||
@ -89,76 +90,76 @@ class AuthorizedAdminLogic extends BaseGetXController {
|
||||
}
|
||||
}
|
||||
|
||||
if (reply is AddUserReply) {
|
||||
_replyAddUserKey(reply);
|
||||
}
|
||||
// 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("添加用户数据解析成功");
|
||||
state.isSendSuccess.value = true;
|
||||
showToast("添加成功");
|
||||
// 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: state.addUserId.value,
|
||||
openMode: 1,
|
||||
keyType: (state.type.value == "1") ? 0 : 1,
|
||||
startDate: state.effectiveDateTime.value.millisecondsSinceEpoch,
|
||||
expireDate: state.failureDateTime.value.millisecondsSinceEpoch,
|
||||
role: 0,
|
||||
password: "123456",
|
||||
needAuthor: 1,
|
||||
publicKey: publicKeyDataList,
|
||||
privateKey: getPrivateKeyList,
|
||||
token: token);
|
||||
break;
|
||||
case 0x07:
|
||||
//无权限
|
||||
print("用户无权限");
|
||||
|
||||
break;
|
||||
case 0x09:
|
||||
// 权限校验错误
|
||||
print("添加用户权限校验错误");
|
||||
|
||||
break;
|
||||
default:
|
||||
//失败
|
||||
print("领锁失败");
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
// 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("添加用户数据解析成功");
|
||||
// state.isSendSuccess.value = true;
|
||||
// showToast("添加成功");
|
||||
// // 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: state.addUserId.value,
|
||||
// openMode: 1,
|
||||
// keyType: (state.type.value == "1") ? 0 : 1,
|
||||
// startDate: state.effectiveDateTime.value.millisecondsSinceEpoch,
|
||||
// expireDate: state.failureDateTime.value.millisecondsSinceEpoch,
|
||||
// role: 0,
|
||||
// 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 {
|
||||
@ -189,53 +190,74 @@ class AuthorizedAdminLogic extends BaseGetXController {
|
||||
}
|
||||
|
||||
// 添加用户
|
||||
Future<void> addUserConnectBlue(String receiveId) async {
|
||||
// 进来之后首先连接
|
||||
BlueManage().bludSendData(BlueManage().connectDeviceName, (DeviceConnectionState connecteState) async {
|
||||
if (connecteState == 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: receiveId,
|
||||
openMode: 1,
|
||||
keyType: (state.type.value == "1") ? 0 : 1,
|
||||
startDate: state.effectiveDateTime.value.millisecondsSinceEpoch,
|
||||
expireDate: state.failureDateTime.value.millisecondsSinceEpoch,
|
||||
role: 0,
|
||||
password: "123456",
|
||||
needAuthor: 1,
|
||||
publicKey: publicKeyDataList,
|
||||
privateKey: getPrivateKeyList,
|
||||
token: getTokenList);
|
||||
}
|
||||
});
|
||||
}
|
||||
// Future<void> addUserConnectBlue(String receiveId) async {
|
||||
// // 进来之后首先连接
|
||||
// BlueManage().bludSendData(BlueManage().connectDeviceName, (DeviceConnectionState connecteState) async {
|
||||
// if (connecteState == 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: receiveId,
|
||||
// openMode: 1,
|
||||
// keyType: (state.type.value == "1") ? 0 : 1,
|
||||
// startDate: state.effectiveDateTime.value.millisecondsSinceEpoch,
|
||||
// expireDate: state.failureDateTime.value.millisecondsSinceEpoch,
|
||||
// role: 0,
|
||||
// password: "123456",
|
||||
// needAuthor: 1,
|
||||
// publicKey: publicKeyDataList,
|
||||
// privateKey: getPrivateKeyList,
|
||||
// token: getTokenList);
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
//发送授权管理员列表请求
|
||||
Future<void> sendElectronicKeyRequest(BuildContext widgetContext) async {
|
||||
Future<void> sendElectronicKeyRequest() async {
|
||||
if(state.emailOrPhoneController.text.isEmpty){
|
||||
showToast("请输入接收者账号");
|
||||
return;
|
||||
}
|
||||
if(state.keyNameController.text.isEmpty){
|
||||
showToast("请输入接收者姓名");
|
||||
return;
|
||||
}
|
||||
|
||||
String getFailureDateTime = '0';
|
||||
String getEffectiveDateTime = '0';
|
||||
String lockID = state.keyInfo.value.lockId.toString();
|
||||
String getKeyType = (int.parse(state.type.value) + 1).toString();
|
||||
Get.log("state.type.value:${state.type.value}");
|
||||
String getKeyType = "1";
|
||||
if (state.type.value == '0') {
|
||||
getFailureDateTime =
|
||||
state.failureDateTime.value.millisecondsSinceEpoch.toString();
|
||||
getEffectiveDateTime =
|
||||
state.effectiveDateTime.value.millisecondsSinceEpoch.toString();
|
||||
getKeyType = "2";
|
||||
getFailureDateTime = state.failureDateTime.value.millisecondsSinceEpoch.toString();
|
||||
getEffectiveDateTime = state.effectiveDateTime.value.millisecondsSinceEpoch.toString();
|
||||
|
||||
DateTime startDateTime = DateTime(state.effectiveDateTime.value.year, state.effectiveDateTime.value.month, state.effectiveDateTime.value.day, state.effectiveDateTime.value.hour, state.effectiveDateTime.value.minute);
|
||||
DateTime endDateTime = DateTime(state.failureDateTime.value.year, state.failureDateTime.value.month, state.failureDateTime.value.day, state.failureDateTime.value.hour, state.failureDateTime.value.minute);
|
||||
if (!startDateTime.isBefore(endDateTime) || startDateTime.isAtSameMomentAs(endDateTime)) {
|
||||
showToast("失效时间需大于生效时间");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!startDateTime.isBefore(DateTime.now()) || startDateTime.isAtSameMomentAs(DateTime.now())) {
|
||||
showToast("生效时间需大于当前时间");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
var entity = await ApiRepository.to.sendElectronicKey(
|
||||
@ -260,19 +282,20 @@ class AuthorizedAdminLogic extends BaseGetXController {
|
||||
state.isSendSuccess.value = true;
|
||||
// Toast.show(msg: "添加成功");
|
||||
state.addUserId.value = entity.data!.receiverUser!.id.toString();
|
||||
addUserConnectBlue(state.addUserId.value);
|
||||
// addUserConnectBlue(state.addUserId.value);
|
||||
eventBus.fire(AuthorizedAdminPageRefreshUI());
|
||||
} else {
|
||||
if (entity.errorCode == 425) {
|
||||
//用户未注册
|
||||
_showDialog(widgetContext, '${entity.errorMsg}');
|
||||
_showDialog('${entity.errorMsg}');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//用户未注册确认弹窗
|
||||
void _showDialog(widgetContext, String errMsg) {
|
||||
void _showDialog(String errMsg) {
|
||||
showCupertinoDialog(
|
||||
context: widgetContext,
|
||||
context: Get.context!,
|
||||
builder: (context) {
|
||||
return CupertinoAlertDialog(
|
||||
title: const Text('接收者号码未注册,请选择号码所在的国家并重新发送'),
|
||||
|
||||
@ -37,6 +37,7 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
state.type.value = widget.type;
|
||||
Get.log("widget.type:${widget.type}");
|
||||
|
||||
return SingleChildScrollView(
|
||||
child: Obx(() => indexChangeWidget()),
|
||||
@ -202,11 +203,7 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage> {
|
||||
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||
if (isDemoMode == false) {
|
||||
//发送钥匙请求
|
||||
if (state.emailOrPhoneController.text.isNotEmpty &&
|
||||
state.keyNameController.value.text.isNotEmpty) {
|
||||
// logic.addUserConnectBlue();
|
||||
logic.sendElectronicKeyRequest(context);
|
||||
}
|
||||
logic.sendElectronicKeyRequest();
|
||||
} else {
|
||||
logic.showToast("演示模式");
|
||||
}
|
||||
@ -221,8 +218,8 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage> {
|
||||
onPressed: () async {
|
||||
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||
if (isDemoMode == false) {
|
||||
Navigator.pushNamed(
|
||||
context, Routers.volumeAuthorizationLockManagePage);
|
||||
Get.toNamed(Routers.volumeAuthorizationLockManagePage);
|
||||
// Navigator.pushNamed(context, Routers.volumeAuthorizationLockManagePage);
|
||||
} else {
|
||||
logic.showToast("演示模式");
|
||||
}
|
||||
@ -304,7 +301,7 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage> {
|
||||
height: 10.h,
|
||||
),
|
||||
OutLineBtn(
|
||||
btnName: '标记为已入住',
|
||||
btnName: '标记为:已入住',
|
||||
onClick: () {
|
||||
updateRoomCheckIn();
|
||||
},
|
||||
|
||||
@ -1,8 +1,12 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:star_lock/main/lockDetail/authorizedAdmin/authorizedAdminList/authorizedAdminList_state.dart';
|
||||
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/entity/ElectronicKeyListEntity.dart';
|
||||
import 'package:star_lock/network/api_repository.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
|
||||
import '../../../../tools/eventBusEventManage.dart';
|
||||
|
||||
class AuthorizedAdminListLogic extends BaseGetXController {
|
||||
final AuthorizedAdminListState state = AuthorizedAdminListState();
|
||||
|
||||
@ -42,10 +46,21 @@ class AuthorizedAdminListLogic extends BaseGetXController {
|
||||
}
|
||||
}
|
||||
|
||||
/// 刷新电子钥匙列表
|
||||
StreamSubscription? _getAuthorizedAdminPageRefreshUIEvent;
|
||||
void _getAuthorizedAdminPageRefreshUIAction() {
|
||||
// 蓝牙协议通知传输跟蓝牙之外的数据传输类不一样 eventBus
|
||||
_getAuthorizedAdminPageRefreshUIEvent = eventBus.on<AuthorizedAdminPageRefreshUI>().listen((event) {
|
||||
pageNo = 1;
|
||||
mockNetworkDataRequest();
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
// TODO: implement onReady
|
||||
super.onReady();
|
||||
_getAuthorizedAdminPageRefreshUIAction();
|
||||
}
|
||||
|
||||
@override
|
||||
@ -57,5 +72,7 @@ class AuthorizedAdminListLogic extends BaseGetXController {
|
||||
@override
|
||||
void onClose() {
|
||||
// TODO: implement onClose
|
||||
super.onClose();
|
||||
_getAuthorizedAdminPageRefreshUIEvent?.cancel();
|
||||
}
|
||||
}
|
||||
|
||||
@ -206,6 +206,7 @@ class _AuthorizedAdminListPageState extends State<AuthorizedAdminListPage> {
|
||||
//使用期限
|
||||
String getUseDateStr(ElectronicKeyListItem indexEntity) {
|
||||
String useDateStr = '';
|
||||
|
||||
if (indexEntity.keyType == XSConstantMacro.keyTypeTime) {
|
||||
//限期
|
||||
DateTime startDateStr =
|
||||
@ -219,15 +220,16 @@ class _AuthorizedAdminListPageState extends State<AuthorizedAdminListPage> {
|
||||
// DateTime dateStr = DateTime.fromMillisecondsSinceEpoch(indexEntity.date!);
|
||||
// useDateStr = '${dateStr.toLocal().toString().substring(0, 16)} 永久';
|
||||
useDateStr = "永久";
|
||||
} else if (indexEntity.keyType == XSConstantMacro.keyTypeOnce) {
|
||||
//单次
|
||||
// DateTime dateStr = DateTime.fromMillisecondsSinceEpoch(indexEntity.date!);
|
||||
// useDateStr = '${dateStr.toLocal().toString().substring(0, 16)} 单次';
|
||||
useDateStr = "单次";
|
||||
} else if (indexEntity.keyType == XSConstantMacro.keyTypeLoop) {
|
||||
//循环
|
||||
useDateStr = '循环';
|
||||
}
|
||||
// else if (indexEntity.keyType == XSConstantMacro.keyTypeOnce) {
|
||||
// //单次
|
||||
// // DateTime dateStr = DateTime.fromMillisecondsSinceEpoch(indexEntity.date!);
|
||||
// // useDateStr = '${dateStr.toLocal().toString().substring(0, 16)} 单次';
|
||||
// useDateStr = "单次";
|
||||
// } else if (indexEntity.keyType == XSConstantMacro.keyTypeLoop) {
|
||||
// //循环
|
||||
// useDateStr = '循环';
|
||||
// }
|
||||
|
||||
return useDateStr;
|
||||
}
|
||||
@ -265,41 +267,32 @@ class _AuthorizedAdminListPageState extends State<AuthorizedAdminListPage> {
|
||||
height: 100.h,
|
||||
child: Row(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 30.w,
|
||||
),
|
||||
Image.asset(
|
||||
avatarURL,
|
||||
width: 60.w,
|
||||
height: 60.w,
|
||||
),
|
||||
SizedBox(
|
||||
width: 20.w,
|
||||
),
|
||||
SizedBox(width: 30.w),
|
||||
Image.asset(avatarURL, width: 60.w, height: 60.w,),
|
||||
SizedBox(width: 20.w),
|
||||
Expanded(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
receiveUser,
|
||||
style: TextStyle(
|
||||
fontSize: 24.sp, color: AppColors.blackColor),
|
||||
SizedBox(
|
||||
width: 1.sw - 110.w - 100.w,
|
||||
child: Row(
|
||||
children: [
|
||||
Flexible(
|
||||
child: Text(
|
||||
receiveUser,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(fontSize: 24.sp, color: AppColors.blackColor)
|
||||
),
|
||||
),
|
||||
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(width: 10.w),
|
||||
// isAdminKey
|
||||
// ? Image.asset(
|
||||
// 'images/icon_electronicKey_admin.png',
|
||||
// width: 24.w,
|
||||
// height: 20.w,
|
||||
// )
|
||||
// : Container(),
|
||||
Expanded(
|
||||
child: SizedBox(
|
||||
width: 20.w,
|
||||
)),
|
||||
Text(
|
||||
keyStatus,
|
||||
style: TextStyle(fontSize: 18.sp, color: Colors.red),
|
||||
|
||||
@ -353,6 +353,7 @@ class CardListLogic extends BaseGetXController {
|
||||
late StreamSubscription _teamEvent;
|
||||
void _initRefreshAction() {
|
||||
_teamEvent = eventBus.on<OtherTypeRefreshListEvent>().listen((event) {
|
||||
pageNo = 1;
|
||||
getICCardListData();
|
||||
});
|
||||
}
|
||||
|
||||
@ -209,13 +209,24 @@ class _CardListPageState extends State<CardListPage> with RouteAware {
|
||||
Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(lockTypeTitle,
|
||||
style: TextStyle(
|
||||
fontSize: 24.sp, color: AppColors.blackColor)),
|
||||
Expanded(child: Container()),
|
||||
SizedBox(
|
||||
width: 1.sw - 110.w - 100.w,
|
||||
child: Row(
|
||||
children: [
|
||||
Flexible(
|
||||
child: Text(
|
||||
lockTypeTitle,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(fontSize: 24.sp, color: AppColors.blackColor)
|
||||
),
|
||||
),
|
||||
|
||||
],
|
||||
),
|
||||
),
|
||||
Text(ifInvalidation,
|
||||
style: TextStyle(
|
||||
fontSize: 22.sp, color: Colors.red)),
|
||||
style: TextStyle(fontSize: 22.sp, color: Colors.red)),
|
||||
SizedBox(width: 10.w),
|
||||
],
|
||||
),
|
||||
|
||||
@ -290,17 +290,9 @@ class _ElectronicKeyListPageState extends State<ElectronicKeyListPage> {
|
||||
height: 90.h,
|
||||
child: Row(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 30.w,
|
||||
),
|
||||
Image.asset(
|
||||
avatarURL,
|
||||
width: 60.w,
|
||||
height: 60.w,
|
||||
),
|
||||
SizedBox(
|
||||
width: 20.w,
|
||||
),
|
||||
SizedBox(width: 30.w),
|
||||
Image.asset(avatarURL, width: 60.w, height: 60.w,),
|
||||
SizedBox(width: 20.w),
|
||||
Expanded(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
@ -308,22 +300,28 @@ class _ElectronicKeyListPageState extends State<ElectronicKeyListPage> {
|
||||
Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
receiveUser,
|
||||
style: TextStyle(fontSize: 24.sp, color: AppColors.blackColor),
|
||||
SizedBox(
|
||||
width: 1.sw - 110.w - 34.w - 60.w,
|
||||
child: Row(
|
||||
children: [
|
||||
Flexible(
|
||||
child: Text(
|
||||
receiveUser,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(fontSize: 24.sp, color: AppColors.blackColor)
|
||||
),
|
||||
),
|
||||
SizedBox(width: 10.w),
|
||||
isAdminKey
|
||||
? Image.asset('images/icon_electronicKey_admin.png', width: 24.w, height: 20.w,)
|
||||
: Container(),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
// Expanded(child: SizedBox(width: 20.w,)),
|
||||
SizedBox(width: 10.w),
|
||||
isAdminKey
|
||||
? Image.asset(
|
||||
'images/icon_electronicKey_admin.png',
|
||||
width: 24.w,
|
||||
height: 20.w,
|
||||
)
|
||||
: Container(),
|
||||
Expanded(
|
||||
child: SizedBox(
|
||||
width: 20.w,
|
||||
)),
|
||||
Text(
|
||||
keyStatus,
|
||||
style: TextStyle(fontSize: 18.sp, color: Colors.red),
|
||||
@ -342,7 +340,7 @@ class _ElectronicKeyListPageState extends State<ElectronicKeyListPage> {
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(width: 20.h),
|
||||
// SizedBox(width: 20.h),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@ -28,6 +28,7 @@ class SendElectronicKeyLogic extends BaseGetXController {
|
||||
|
||||
//发送钥匙请求
|
||||
if (state.type.value == "0" || state.type.value == "3") {
|
||||
print("startDateTime:$startDateTime endDateTime:$endDateTime DateTime.now():${DateTime.now()} startDateTime.isBefore(endDateTime):${startDateTime.isBefore(endDateTime)}");
|
||||
if (!startDateTime.isBefore(endDateTime) || startDateTime.isAtSameMomentAs(endDateTime)) {
|
||||
showToast("失效时间需大于生效时间");
|
||||
return;
|
||||
|
||||
@ -385,6 +385,7 @@ class FingerprintListLogic extends BaseGetXController{
|
||||
late StreamSubscription _teamEvent;
|
||||
void _initRefreshAction() {
|
||||
_teamEvent = eventBus.on<OtherTypeRefreshListEvent>().listen((event) {
|
||||
pageNo = 1;
|
||||
getFingerprintsListData();
|
||||
});
|
||||
}
|
||||
|
||||
@ -213,10 +213,22 @@ class _FingerprintListPageState extends State<FingerprintListPage> with RouteAwa
|
||||
Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(lockTypeTitle,
|
||||
style: TextStyle(
|
||||
fontSize: 24.sp, color: AppColors.blackColor)),
|
||||
Expanded(child: Container()),
|
||||
SizedBox(
|
||||
width: ifInvalidation.isNotEmpty ? 1.sw - 110.w - 100.w : 1.sw - 110.w - 50.w,
|
||||
child: Row(
|
||||
children: [
|
||||
Flexible(
|
||||
child: Text(
|
||||
lockTypeTitle,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(fontSize: 24.sp, color: AppColors.blackColor)
|
||||
),
|
||||
),
|
||||
|
||||
],
|
||||
),
|
||||
),
|
||||
Text(ifInvalidation,
|
||||
style: TextStyle(
|
||||
fontSize: 22.sp, color: Colors.red)),
|
||||
|
||||
@ -47,7 +47,7 @@ class _EditLockNamePageState extends State<EditLockNamePage> {
|
||||
leftWidget: const SizedBox(),
|
||||
hintText: TranslationLoader.lanKeys!.pleaseEnterNumberOrEmail!.tr,
|
||||
inputFormatters: [
|
||||
LengthLimitingTextInputFormatter(20),
|
||||
LengthLimitingTextInputFormatter(50),
|
||||
]),
|
||||
));
|
||||
}
|
||||
|
||||
@ -73,10 +73,8 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
|
||||
|
||||
// 根据权限显示不同的列表
|
||||
List<Widget> getListWidget() {
|
||||
print(
|
||||
"state.lockBasicInfo.value.isLockOwner:${state.lockBasicInfo.value.isLockOwner} state.lockBasicInfo.value.keyRight:${state.lockBasicInfo.value.keyRight}");
|
||||
if (state.lockBasicInfo.value.isLockOwner == 1 ||
|
||||
state.lockBasicInfo.value.keyRight == 1) {
|
||||
// print("state.lockBasicInfo.value.isLockOwner:${state.lockBasicInfo.value.isLockOwner} state.lockBasicInfo.value.keyRight:${state.lockBasicInfo.value.keyRight}");
|
||||
if (state.lockBasicInfo.value.isLockOwner == 1 || state.lockBasicInfo.value.keyRight == 1) {
|
||||
// 超级管理员、授权管理员
|
||||
return getAllWidget();
|
||||
} else {
|
||||
|
||||
@ -29,9 +29,10 @@ class LockSoundSetLogic extends BaseGetXController {
|
||||
// eventBus.fire(RefreshLockListInfoDataEvent());
|
||||
state.lockSetInfoData.value.lockSettingInfo!.lockSound = state.isOpenLockSound.value == true ? 1 :0;
|
||||
state.lockSetInfoData.value.lockSettingInfo!.lockSoundVolume = state.lockSoundLevel.value;
|
||||
eventBus.fire(PassCurrentLockInformationEvent(state.lockSetInfoData.value));
|
||||
ifCanNext();
|
||||
showToast("操作成功");
|
||||
showToast("操作成功", something: (){
|
||||
eventBus.fire(PassCurrentLockInformationEvent(state.lockSetInfoData.value));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -200,19 +200,22 @@ class _PasswordKeyListPageState extends State<PasswordKeyListPage> {
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Text(
|
||||
lockTypeTitle,
|
||||
style: TextStyle(
|
||||
fontSize: 24.sp, color: AppColors.blackColor),
|
||||
SizedBox(
|
||||
width: passwordKeyListItem.keyboardPwdStatus == 2 ? 1.sw - 110.w - 100.w : 1.sw - 110.w - 50.w,
|
||||
child: Row(
|
||||
children: [
|
||||
Flexible(
|
||||
child: Text(
|
||||
lockTypeTitle,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(fontSize: 24.sp, color: AppColors.blackColor)
|
||||
),
|
||||
)
|
||||
]
|
||||
),
|
||||
),
|
||||
// Expanded(
|
||||
// child: SizedBox(
|
||||
// width: 20.w,
|
||||
// )),
|
||||
SizedBox(width: 10.w),
|
||||
passwordKeyListItem.keyboardPwdStatus == 2 ? Text('已过期', style: TextStyle(color: Colors.red, fontSize: 20.sp),) : Container(),
|
||||
SizedBox(width: 15.w)
|
||||
|
||||
@ -47,9 +47,7 @@ class _AuthorizedAdministratorListPageState
|
||||
),
|
||||
onPressed: () {
|
||||
// 处理操作按钮的点击事件
|
||||
Navigator.pushNamed(
|
||||
context, Routers.addAuthorizedAdministratorPage)
|
||||
.then((value) {
|
||||
Navigator.pushNamed(context, Routers.addAuthorizedAdministratorPage).then((value) {
|
||||
setState(() {
|
||||
mockNetworkDataRequest();
|
||||
});
|
||||
@ -208,10 +206,26 @@ class _AuthorizedAdministratorListPageState
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
itemData.name ?? '',
|
||||
style: TextStyle(
|
||||
fontSize: 24.sp, color: AppColors.blackColor),
|
||||
// Text(
|
||||
// itemData.name ?? '',
|
||||
// style: TextStyle(
|
||||
// fontSize: 24.sp, color: AppColors.blackColor),
|
||||
// ),
|
||||
SizedBox(
|
||||
width: 1.sw - 110.w - 100.w,
|
||||
child: Row(
|
||||
children: [
|
||||
Flexible(
|
||||
child: Text(
|
||||
itemData.name ?? '',
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(fontSize: 24.sp, color: AppColors.blackColor)
|
||||
),
|
||||
),
|
||||
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
@ -220,7 +234,7 @@ class _AuthorizedAdministratorListPageState
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
"2023.6.21 11.15 永久",
|
||||
getUseDateStr(itemData),
|
||||
style: TextStyle(
|
||||
fontSize: 18.sp,
|
||||
color: AppColors.placeholderTextColor),
|
||||
|
||||
@ -59,13 +59,16 @@ class CommonItem extends StatelessWidget {
|
||||
children: [
|
||||
isHaveRightWidget!
|
||||
? rightWidget!
|
||||
: Text(
|
||||
rightTitle ?? "",
|
||||
textAlign: TextAlign.right,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
maxLines: 2,
|
||||
style: TextStyle(fontSize: 22.sp, color: AppColors.darkGrayTextColor),
|
||||
),
|
||||
: SizedBox(
|
||||
width: 250.w,
|
||||
child: Text(
|
||||
rightTitle ?? "",
|
||||
textAlign: TextAlign.right,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
maxLines: 2,
|
||||
style: TextStyle(fontSize: 22.sp, color: AppColors.darkGrayTextColor),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
isHaveDirection! ? SizedBox(width: 3.w) : Container(),
|
||||
|
||||
@ -94,3 +94,8 @@ class ReadMessageRefreshUI {
|
||||
class ElectronicKeyListRefreshUI {
|
||||
ElectronicKeyListRefreshUI();
|
||||
}
|
||||
|
||||
/// 刷新授权管理员列表
|
||||
class AuthorizedAdminPageRefreshUI {
|
||||
AuthorizedAdminPageRefreshUI();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user