Merge branch 'master' of gitee.com:starlock-cn/app-starlock
This commit is contained in:
commit
cada1ff2b6
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"starLock":"星锁",
|
"starLock":"星锁",
|
||||||
"clickUnlockAndHoldDownClose":"点击开锁,长按关闭",
|
"clickUnlockAndHoldDownClose":"点击开锁,长按闭锁",
|
||||||
"checkingIn":"考勤",
|
"checkingIn":"考勤",
|
||||||
"electronicKey":"电子钥匙",
|
"electronicKey":"电子钥匙",
|
||||||
"password":"密码",
|
"password":"密码",
|
||||||
|
|||||||
@ -102,7 +102,7 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver, BaseWidget {
|
|||||||
super.initState();
|
super.initState();
|
||||||
WidgetsBinding.instance.addObserver(this);
|
WidgetsBinding.instance.addObserver(this);
|
||||||
|
|
||||||
openBlueScan();
|
// openBlueScan();
|
||||||
|
|
||||||
initAliyunPush();
|
initAliyunPush();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -110,6 +110,7 @@ class BlueManage {
|
|||||||
/// 调用发送数据
|
/// 调用发送数据
|
||||||
Future<void> bludSendData(String deviceName, ConnectStateCallBack stateCallBack, {bool isAddEquipment = false}) async {
|
Future<void> bludSendData(String deviceName, ConnectStateCallBack stateCallBack, {bool isAddEquipment = false}) async {
|
||||||
_flutterReactiveBle!.statusStream.listen((status) {
|
_flutterReactiveBle!.statusStream.listen((status) {
|
||||||
|
Get.log("_flutterReactiveBle.status:$status");
|
||||||
if (status == BleStatus.ready) {
|
if (status == BleStatus.ready) {
|
||||||
// 蓝牙已开启,可以进行蓝牙操作
|
// 蓝牙已开启,可以进行蓝牙操作
|
||||||
if(deviceConnectionState != DeviceConnectionState.connected){
|
if(deviceConnectionState != DeviceConnectionState.connected){
|
||||||
|
|||||||
@ -17,6 +17,7 @@ import '../../../../blue/io_tool/manager_event_bus.dart';
|
|||||||
import '../../../../blue/sender_manage.dart';
|
import '../../../../blue/sender_manage.dart';
|
||||||
import '../../../../network/api_repository.dart';
|
import '../../../../network/api_repository.dart';
|
||||||
import '../../../../tools/baseGetXController.dart';
|
import '../../../../tools/baseGetXController.dart';
|
||||||
|
import '../../../../tools/eventBusEventManage.dart';
|
||||||
import '../../../../tools/storage.dart';
|
import '../../../../tools/storage.dart';
|
||||||
import 'authorizedAdmin_state.dart';
|
import 'authorizedAdmin_state.dart';
|
||||||
|
|
||||||
@ -89,76 +90,76 @@ class AuthorizedAdminLogic extends BaseGetXController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (reply is AddUserReply) {
|
// if (reply is AddUserReply) {
|
||||||
_replyAddUserKey(reply);
|
// _replyAddUserKey(reply);
|
||||||
}
|
// }
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _replyAddUserKey(Reply reply) async {
|
// Future<void> _replyAddUserKey(Reply reply) async {
|
||||||
var lockId = reply.data.sublist(2, 42);
|
// var lockId = reply.data.sublist(2, 42);
|
||||||
print("lockId:$lockId");
|
// print("lockId:$lockId");
|
||||||
|
//
|
||||||
var token = reply.data.sublist(42, 46);
|
// var token = reply.data.sublist(42, 46);
|
||||||
List<String> strTokenList = changeIntListToStringList(token);
|
// List<String> strTokenList = changeIntListToStringList(token);
|
||||||
Storage.setStringList(saveBlueToken, strTokenList);
|
// Storage.setStringList(saveBlueToken, strTokenList);
|
||||||
print("token:$token");
|
// print("token:$token");
|
||||||
|
//
|
||||||
int status = reply.data[46];
|
// int status = reply.data[46];
|
||||||
print("status:$status");
|
// print("status:$status");
|
||||||
|
//
|
||||||
// userNo = reply.data[46];
|
// // userNo = reply.data[46];
|
||||||
// print("status:$status");
|
// // print("status:$status");
|
||||||
switch (status) {
|
// switch (status) {
|
||||||
case 0x00:
|
// case 0x00:
|
||||||
//成功
|
// //成功
|
||||||
print("添加用户数据解析成功");
|
// print("添加用户数据解析成功");
|
||||||
state.isSendSuccess.value = true;
|
// state.isSendSuccess.value = true;
|
||||||
showToast("添加成功");
|
// showToast("添加成功");
|
||||||
// bindBlueAdmin();
|
// // bindBlueAdmin();
|
||||||
break;
|
// break;
|
||||||
case 0x06:
|
// case 0x06:
|
||||||
//无权限
|
// //无权限
|
||||||
print("需要鉴权");
|
// print("需要鉴权");
|
||||||
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
// var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||||
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
// List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||||
|
//
|
||||||
var publicKey = await Storage.getStringList(saveBluePublicKey);
|
// var publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||||
List<int> publicKeyDataList = changeStringListToIntList(publicKey!);
|
// List<int> publicKeyDataList = changeStringListToIntList(publicKey!);
|
||||||
|
//
|
||||||
IoSenderManage.senderAddUser(
|
// IoSenderManage.senderAddUser(
|
||||||
lockID: BlueManage().connectDeviceName,
|
// lockID: BlueManage().connectDeviceName,
|
||||||
authUserID: await Storage.getUid(),
|
// authUserID: await Storage.getUid(),
|
||||||
keyID: "1",
|
// keyID: "1",
|
||||||
userID: state.addUserId.value,
|
// userID: state.addUserId.value,
|
||||||
openMode: 1,
|
// openMode: 1,
|
||||||
keyType: (state.type.value == "1") ? 0 : 1,
|
// keyType: (state.type.value == "1") ? 0 : 1,
|
||||||
startDate: state.effectiveDateTime.value.millisecondsSinceEpoch,
|
// startDate: state.effectiveDateTime.value.millisecondsSinceEpoch,
|
||||||
expireDate: state.failureDateTime.value.millisecondsSinceEpoch,
|
// expireDate: state.failureDateTime.value.millisecondsSinceEpoch,
|
||||||
role: 0,
|
// role: 0,
|
||||||
password: "123456",
|
// password: "123456",
|
||||||
needAuthor: 1,
|
// needAuthor: 1,
|
||||||
publicKey: publicKeyDataList,
|
// publicKey: publicKeyDataList,
|
||||||
privateKey: getPrivateKeyList,
|
// privateKey: getPrivateKeyList,
|
||||||
token: token);
|
// token: token);
|
||||||
break;
|
// break;
|
||||||
case 0x07:
|
// case 0x07:
|
||||||
//无权限
|
// //无权限
|
||||||
print("用户无权限");
|
// print("用户无权限");
|
||||||
|
//
|
||||||
break;
|
// break;
|
||||||
case 0x09:
|
// case 0x09:
|
||||||
// 权限校验错误
|
// // 权限校验错误
|
||||||
print("添加用户权限校验错误");
|
// print("添加用户权限校验错误");
|
||||||
|
//
|
||||||
break;
|
// break;
|
||||||
default:
|
// default:
|
||||||
//失败
|
// //失败
|
||||||
print("领锁失败");
|
// print("领锁失败");
|
||||||
|
//
|
||||||
break;
|
// break;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
// 转移权限
|
// 转移权限
|
||||||
Future<void> transferPermissionsAction() async {
|
Future<void> transferPermissionsAction() async {
|
||||||
@ -189,53 +190,74 @@ class AuthorizedAdminLogic extends BaseGetXController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 添加用户
|
// 添加用户
|
||||||
Future<void> addUserConnectBlue(String receiveId) async {
|
// Future<void> addUserConnectBlue(String receiveId) async {
|
||||||
// 进来之后首先连接
|
// // 进来之后首先连接
|
||||||
BlueManage().bludSendData(BlueManage().connectDeviceName, (DeviceConnectionState connecteState) async {
|
// BlueManage().bludSendData(BlueManage().connectDeviceName, (DeviceConnectionState connecteState) async {
|
||||||
if (connecteState == DeviceConnectionState.connected) {
|
// if (connecteState == DeviceConnectionState.connected) {
|
||||||
// 私钥
|
// // 私钥
|
||||||
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
// var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||||
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
// List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||||
|
//
|
||||||
var publicKey = await Storage.getStringList(saveBluePublicKey);
|
// var publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||||
List<int> publicKeyDataList = changeStringListToIntList(publicKey!);
|
// List<int> publicKeyDataList = changeStringListToIntList(publicKey!);
|
||||||
|
//
|
||||||
var token = await Storage.getStringList(saveBlueToken);
|
// var token = await Storage.getStringList(saveBlueToken);
|
||||||
List<int> getTokenList = [0, 0, 0, 0];
|
// List<int> getTokenList = [0, 0, 0, 0];
|
||||||
if (token != null) {
|
// if (token != null) {
|
||||||
getTokenList = changeStringListToIntList(token);
|
// getTokenList = changeStringListToIntList(token);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
IoSenderManage.senderAddUser(
|
// IoSenderManage.senderAddUser(
|
||||||
lockID: BlueManage().connectDeviceName,
|
// lockID: BlueManage().connectDeviceName,
|
||||||
authUserID: await Storage.getUid(),
|
// authUserID: await Storage.getUid(),
|
||||||
keyID: "1",
|
// keyID: "1",
|
||||||
userID: receiveId,
|
// userID: receiveId,
|
||||||
openMode: 1,
|
// openMode: 1,
|
||||||
keyType: (state.type.value == "1") ? 0 : 1,
|
// keyType: (state.type.value == "1") ? 0 : 1,
|
||||||
startDate: state.effectiveDateTime.value.millisecondsSinceEpoch,
|
// startDate: state.effectiveDateTime.value.millisecondsSinceEpoch,
|
||||||
expireDate: state.failureDateTime.value.millisecondsSinceEpoch,
|
// expireDate: state.failureDateTime.value.millisecondsSinceEpoch,
|
||||||
role: 0,
|
// role: 0,
|
||||||
password: "123456",
|
// password: "123456",
|
||||||
needAuthor: 1,
|
// needAuthor: 1,
|
||||||
publicKey: publicKeyDataList,
|
// publicKey: publicKeyDataList,
|
||||||
privateKey: getPrivateKeyList,
|
// privateKey: getPrivateKeyList,
|
||||||
token: getTokenList);
|
// 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 getFailureDateTime = '0';
|
||||||
String getEffectiveDateTime = '0';
|
String getEffectiveDateTime = '0';
|
||||||
String lockID = state.keyInfo.value.lockId.toString();
|
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') {
|
if (state.type.value == '0') {
|
||||||
getFailureDateTime =
|
getKeyType = "2";
|
||||||
state.failureDateTime.value.millisecondsSinceEpoch.toString();
|
getFailureDateTime = state.failureDateTime.value.millisecondsSinceEpoch.toString();
|
||||||
getEffectiveDateTime =
|
getEffectiveDateTime = state.effectiveDateTime.value.millisecondsSinceEpoch.toString();
|
||||||
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(
|
var entity = await ApiRepository.to.sendElectronicKey(
|
||||||
@ -260,19 +282,20 @@ class AuthorizedAdminLogic extends BaseGetXController {
|
|||||||
state.isSendSuccess.value = true;
|
state.isSendSuccess.value = true;
|
||||||
// Toast.show(msg: "添加成功");
|
// Toast.show(msg: "添加成功");
|
||||||
state.addUserId.value = entity.data!.receiverUser!.id.toString();
|
state.addUserId.value = entity.data!.receiverUser!.id.toString();
|
||||||
addUserConnectBlue(state.addUserId.value);
|
// addUserConnectBlue(state.addUserId.value);
|
||||||
|
eventBus.fire(AuthorizedAdminPageRefreshUI());
|
||||||
} else {
|
} else {
|
||||||
if (entity.errorCode == 425) {
|
if (entity.errorCode == 425) {
|
||||||
//用户未注册
|
//用户未注册
|
||||||
_showDialog(widgetContext, '${entity.errorMsg}');
|
_showDialog('${entity.errorMsg}');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//用户未注册确认弹窗
|
//用户未注册确认弹窗
|
||||||
void _showDialog(widgetContext, String errMsg) {
|
void _showDialog(String errMsg) {
|
||||||
showCupertinoDialog(
|
showCupertinoDialog(
|
||||||
context: widgetContext,
|
context: Get.context!,
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
return CupertinoAlertDialog(
|
return CupertinoAlertDialog(
|
||||||
title: const Text('接收者号码未注册,请选择号码所在的国家并重新发送'),
|
title: const Text('接收者号码未注册,请选择号码所在的国家并重新发送'),
|
||||||
|
|||||||
@ -37,6 +37,7 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
state.type.value = widget.type;
|
state.type.value = widget.type;
|
||||||
|
Get.log("widget.type:${widget.type}");
|
||||||
|
|
||||||
return SingleChildScrollView(
|
return SingleChildScrollView(
|
||||||
child: Obx(() => indexChangeWidget()),
|
child: Obx(() => indexChangeWidget()),
|
||||||
@ -202,11 +203,7 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage> {
|
|||||||
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||||
if (isDemoMode == false) {
|
if (isDemoMode == false) {
|
||||||
//发送钥匙请求
|
//发送钥匙请求
|
||||||
if (state.emailOrPhoneController.text.isNotEmpty &&
|
logic.sendElectronicKeyRequest();
|
||||||
state.keyNameController.value.text.isNotEmpty) {
|
|
||||||
// logic.addUserConnectBlue();
|
|
||||||
logic.sendElectronicKeyRequest(context);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
logic.showToast("演示模式");
|
logic.showToast("演示模式");
|
||||||
}
|
}
|
||||||
@ -221,8 +218,8 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage> {
|
|||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||||
if (isDemoMode == false) {
|
if (isDemoMode == false) {
|
||||||
Navigator.pushNamed(
|
Get.toNamed(Routers.volumeAuthorizationLockManagePage);
|
||||||
context, Routers.volumeAuthorizationLockManagePage);
|
// Navigator.pushNamed(context, Routers.volumeAuthorizationLockManagePage);
|
||||||
} else {
|
} else {
|
||||||
logic.showToast("演示模式");
|
logic.showToast("演示模式");
|
||||||
}
|
}
|
||||||
@ -304,7 +301,7 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage> {
|
|||||||
height: 10.h,
|
height: 10.h,
|
||||||
),
|
),
|
||||||
OutLineBtn(
|
OutLineBtn(
|
||||||
btnName: '标记为已入住',
|
btnName: '标记为:已入住',
|
||||||
onClick: () {
|
onClick: () {
|
||||||
updateRoomCheckIn();
|
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/authorizedAdmin/authorizedAdminList/authorizedAdminList_state.dart';
|
||||||
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/entity/ElectronicKeyListEntity.dart';
|
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/entity/ElectronicKeyListEntity.dart';
|
||||||
import 'package:star_lock/network/api_repository.dart';
|
import 'package:star_lock/network/api_repository.dart';
|
||||||
import 'package:star_lock/tools/baseGetXController.dart';
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
|
|
||||||
|
import '../../../../tools/eventBusEventManage.dart';
|
||||||
|
|
||||||
class AuthorizedAdminListLogic extends BaseGetXController {
|
class AuthorizedAdminListLogic extends BaseGetXController {
|
||||||
final AuthorizedAdminListState state = AuthorizedAdminListState();
|
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
|
@override
|
||||||
void onReady() {
|
void onReady() {
|
||||||
// TODO: implement onReady
|
// TODO: implement onReady
|
||||||
super.onReady();
|
super.onReady();
|
||||||
|
_getAuthorizedAdminPageRefreshUIAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -57,5 +72,7 @@ class AuthorizedAdminListLogic extends BaseGetXController {
|
|||||||
@override
|
@override
|
||||||
void onClose() {
|
void onClose() {
|
||||||
// TODO: implement onClose
|
// TODO: implement onClose
|
||||||
|
super.onClose();
|
||||||
|
_getAuthorizedAdminPageRefreshUIEvent?.cancel();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -206,6 +206,7 @@ class _AuthorizedAdminListPageState extends State<AuthorizedAdminListPage> {
|
|||||||
//使用期限
|
//使用期限
|
||||||
String getUseDateStr(ElectronicKeyListItem indexEntity) {
|
String getUseDateStr(ElectronicKeyListItem indexEntity) {
|
||||||
String useDateStr = '';
|
String useDateStr = '';
|
||||||
|
|
||||||
if (indexEntity.keyType == XSConstantMacro.keyTypeTime) {
|
if (indexEntity.keyType == XSConstantMacro.keyTypeTime) {
|
||||||
//限期
|
//限期
|
||||||
DateTime startDateStr =
|
DateTime startDateStr =
|
||||||
@ -219,15 +220,16 @@ class _AuthorizedAdminListPageState extends State<AuthorizedAdminListPage> {
|
|||||||
// DateTime dateStr = DateTime.fromMillisecondsSinceEpoch(indexEntity.date!);
|
// DateTime dateStr = DateTime.fromMillisecondsSinceEpoch(indexEntity.date!);
|
||||||
// useDateStr = '${dateStr.toLocal().toString().substring(0, 16)} 永久';
|
// useDateStr = '${dateStr.toLocal().toString().substring(0, 16)} 永久';
|
||||||
useDateStr = "永久";
|
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;
|
return useDateStr;
|
||||||
}
|
}
|
||||||
@ -265,41 +267,32 @@ class _AuthorizedAdminListPageState extends State<AuthorizedAdminListPage> {
|
|||||||
height: 100.h,
|
height: 100.h,
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
SizedBox(
|
SizedBox(width: 30.w),
|
||||||
width: 30.w,
|
Image.asset(avatarURL, width: 60.w, height: 60.w,),
|
||||||
),
|
SizedBox(width: 20.w),
|
||||||
Image.asset(
|
|
||||||
avatarURL,
|
|
||||||
width: 60.w,
|
|
||||||
height: 60.w,
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
width: 20.w,
|
|
||||||
),
|
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Row(
|
Row(
|
||||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
children: [
|
||||||
Text(
|
SizedBox(
|
||||||
receiveUser,
|
width: 1.sw - 110.w - 100.w,
|
||||||
style: TextStyle(
|
child: Row(
|
||||||
fontSize: 24.sp, color: AppColors.blackColor),
|
children: [
|
||||||
|
Flexible(
|
||||||
|
child: Text(
|
||||||
|
receiveUser,
|
||||||
|
maxLines: 1,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
style: TextStyle(fontSize: 24.sp, color: AppColors.blackColor)
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
SizedBox(width: 10.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(
|
Text(
|
||||||
keyStatus,
|
keyStatus,
|
||||||
style: TextStyle(fontSize: 18.sp, color: Colors.red),
|
style: TextStyle(fontSize: 18.sp, color: Colors.red),
|
||||||
|
|||||||
@ -353,6 +353,7 @@ class CardListLogic extends BaseGetXController {
|
|||||||
late StreamSubscription _teamEvent;
|
late StreamSubscription _teamEvent;
|
||||||
void _initRefreshAction() {
|
void _initRefreshAction() {
|
||||||
_teamEvent = eventBus.on<OtherTypeRefreshListEvent>().listen((event) {
|
_teamEvent = eventBus.on<OtherTypeRefreshListEvent>().listen((event) {
|
||||||
|
pageNo = 1;
|
||||||
getICCardListData();
|
getICCardListData();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -209,13 +209,24 @@ class _CardListPageState extends State<CardListPage> with RouteAware {
|
|||||||
Row(
|
Row(
|
||||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Text(lockTypeTitle,
|
SizedBox(
|
||||||
style: TextStyle(
|
width: 1.sw - 110.w - 100.w,
|
||||||
fontSize: 24.sp, color: AppColors.blackColor)),
|
child: Row(
|
||||||
Expanded(child: Container()),
|
children: [
|
||||||
|
Flexible(
|
||||||
|
child: Text(
|
||||||
|
lockTypeTitle,
|
||||||
|
maxLines: 1,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
style: TextStyle(fontSize: 24.sp, color: AppColors.blackColor)
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
Text(ifInvalidation,
|
Text(ifInvalidation,
|
||||||
style: TextStyle(
|
style: TextStyle(fontSize: 22.sp, color: Colors.red)),
|
||||||
fontSize: 22.sp, color: Colors.red)),
|
|
||||||
SizedBox(width: 10.w),
|
SizedBox(width: 10.w),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@ -290,17 +290,9 @@ class _ElectronicKeyListPageState extends State<ElectronicKeyListPage> {
|
|||||||
height: 90.h,
|
height: 90.h,
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
SizedBox(
|
SizedBox(width: 30.w),
|
||||||
width: 30.w,
|
Image.asset(avatarURL, width: 60.w, height: 60.w,),
|
||||||
),
|
SizedBox(width: 20.w),
|
||||||
Image.asset(
|
|
||||||
avatarURL,
|
|
||||||
width: 60.w,
|
|
||||||
height: 60.w,
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
width: 20.w,
|
|
||||||
),
|
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
@ -308,22 +300,28 @@ class _ElectronicKeyListPageState extends State<ElectronicKeyListPage> {
|
|||||||
Row(
|
Row(
|
||||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
SizedBox(
|
||||||
receiveUser,
|
width: 1.sw - 110.w - 34.w - 60.w,
|
||||||
style: TextStyle(fontSize: 24.sp, color: AppColors.blackColor),
|
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),
|
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(
|
Text(
|
||||||
keyStatus,
|
keyStatus,
|
||||||
style: TextStyle(fontSize: 18.sp, color: Colors.red),
|
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") {
|
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)) {
|
if (!startDateTime.isBefore(endDateTime) || startDateTime.isAtSameMomentAs(endDateTime)) {
|
||||||
showToast("失效时间需大于生效时间");
|
showToast("失效时间需大于生效时间");
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -385,6 +385,7 @@ class FingerprintListLogic extends BaseGetXController{
|
|||||||
late StreamSubscription _teamEvent;
|
late StreamSubscription _teamEvent;
|
||||||
void _initRefreshAction() {
|
void _initRefreshAction() {
|
||||||
_teamEvent = eventBus.on<OtherTypeRefreshListEvent>().listen((event) {
|
_teamEvent = eventBus.on<OtherTypeRefreshListEvent>().listen((event) {
|
||||||
|
pageNo = 1;
|
||||||
getFingerprintsListData();
|
getFingerprintsListData();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -213,10 +213,22 @@ class _FingerprintListPageState extends State<FingerprintListPage> with RouteAwa
|
|||||||
Row(
|
Row(
|
||||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Text(lockTypeTitle,
|
SizedBox(
|
||||||
style: TextStyle(
|
width: ifInvalidation.isNotEmpty ? 1.sw - 110.w - 100.w : 1.sw - 110.w - 50.w,
|
||||||
fontSize: 24.sp, color: AppColors.blackColor)),
|
child: Row(
|
||||||
Expanded(child: Container()),
|
children: [
|
||||||
|
Flexible(
|
||||||
|
child: Text(
|
||||||
|
lockTypeTitle,
|
||||||
|
maxLines: 1,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
style: TextStyle(fontSize: 24.sp, color: AppColors.blackColor)
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
Text(ifInvalidation,
|
Text(ifInvalidation,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 22.sp, color: Colors.red)),
|
fontSize: 22.sp, color: Colors.red)),
|
||||||
|
|||||||
@ -47,7 +47,7 @@ class _EditLockNamePageState extends State<EditLockNamePage> {
|
|||||||
leftWidget: const SizedBox(),
|
leftWidget: const SizedBox(),
|
||||||
hintText: TranslationLoader.lanKeys!.pleaseEnterNumberOrEmail!.tr,
|
hintText: TranslationLoader.lanKeys!.pleaseEnterNumberOrEmail!.tr,
|
||||||
inputFormatters: [
|
inputFormatters: [
|
||||||
LengthLimitingTextInputFormatter(20),
|
LengthLimitingTextInputFormatter(50),
|
||||||
]),
|
]),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -73,10 +73,8 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
|
|||||||
|
|
||||||
// 根据权限显示不同的列表
|
// 根据权限显示不同的列表
|
||||||
List<Widget> getListWidget() {
|
List<Widget> getListWidget() {
|
||||||
print(
|
// print("state.lockBasicInfo.value.isLockOwner:${state.lockBasicInfo.value.isLockOwner} state.lockBasicInfo.value.keyRight:${state.lockBasicInfo.value.keyRight}");
|
||||||
"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) {
|
||||||
if (state.lockBasicInfo.value.isLockOwner == 1 ||
|
|
||||||
state.lockBasicInfo.value.keyRight == 1) {
|
|
||||||
// 超级管理员、授权管理员
|
// 超级管理员、授权管理员
|
||||||
return getAllWidget();
|
return getAllWidget();
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -29,9 +29,10 @@ class LockSoundSetLogic extends BaseGetXController {
|
|||||||
// eventBus.fire(RefreshLockListInfoDataEvent());
|
// eventBus.fire(RefreshLockListInfoDataEvent());
|
||||||
state.lockSetInfoData.value.lockSettingInfo!.lockSound = state.isOpenLockSound.value == true ? 1 :0;
|
state.lockSetInfoData.value.lockSettingInfo!.lockSound = state.isOpenLockSound.value == true ? 1 :0;
|
||||||
state.lockSetInfoData.value.lockSettingInfo!.lockSoundVolume = state.lockSoundLevel.value;
|
state.lockSetInfoData.value.lockSettingInfo!.lockSoundVolume = state.lockSoundLevel.value;
|
||||||
eventBus.fire(PassCurrentLockInformationEvent(state.lockSetInfoData.value));
|
|
||||||
ifCanNext();
|
ifCanNext();
|
||||||
showToast("操作成功");
|
showToast("操作成功", something: (){
|
||||||
|
eventBus.fire(PassCurrentLockInformationEvent(state.lockSetInfoData.value));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -200,19 +200,22 @@ class _PasswordKeyListPageState extends State<PasswordKeyListPage> {
|
|||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
SizedBox(
|
||||||
child: Text(
|
width: passwordKeyListItem.keyboardPwdStatus == 2 ? 1.sw - 110.w - 100.w : 1.sw - 110.w - 50.w,
|
||||||
lockTypeTitle,
|
child: Row(
|
||||||
style: TextStyle(
|
children: [
|
||||||
fontSize: 24.sp, color: AppColors.blackColor),
|
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),
|
SizedBox(width: 10.w),
|
||||||
passwordKeyListItem.keyboardPwdStatus == 2 ? Text('已过期', style: TextStyle(color: Colors.red, fontSize: 20.sp),) : Container(),
|
passwordKeyListItem.keyboardPwdStatus == 2 ? Text('已过期', style: TextStyle(color: Colors.red, fontSize: 20.sp),) : Container(),
|
||||||
SizedBox(width: 15.w)
|
SizedBox(width: 15.w)
|
||||||
|
|||||||
@ -47,9 +47,7 @@ class _AuthorizedAdministratorListPageState
|
|||||||
),
|
),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
// 处理操作按钮的点击事件
|
// 处理操作按钮的点击事件
|
||||||
Navigator.pushNamed(
|
Navigator.pushNamed(context, Routers.addAuthorizedAdministratorPage).then((value) {
|
||||||
context, Routers.addAuthorizedAdministratorPage)
|
|
||||||
.then((value) {
|
|
||||||
setState(() {
|
setState(() {
|
||||||
mockNetworkDataRequest();
|
mockNetworkDataRequest();
|
||||||
});
|
});
|
||||||
@ -208,10 +206,26 @@ class _AuthorizedAdministratorListPageState
|
|||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
// Text(
|
||||||
itemData.name ?? '',
|
// itemData.name ?? '',
|
||||||
style: TextStyle(
|
// style: TextStyle(
|
||||||
fontSize: 24.sp, color: AppColors.blackColor),
|
// 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,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
"2023.6.21 11.15 永久",
|
getUseDateStr(itemData),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 18.sp,
|
fontSize: 18.sp,
|
||||||
color: AppColors.placeholderTextColor),
|
color: AppColors.placeholderTextColor),
|
||||||
|
|||||||
@ -59,13 +59,16 @@ class CommonItem extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
isHaveRightWidget!
|
isHaveRightWidget!
|
||||||
? rightWidget!
|
? rightWidget!
|
||||||
: Text(
|
: SizedBox(
|
||||||
rightTitle ?? "",
|
width: 250.w,
|
||||||
textAlign: TextAlign.right,
|
child: Text(
|
||||||
overflow: TextOverflow.ellipsis,
|
rightTitle ?? "",
|
||||||
maxLines: 2,
|
textAlign: TextAlign.right,
|
||||||
style: TextStyle(fontSize: 22.sp, color: AppColors.darkGrayTextColor),
|
overflow: TextOverflow.ellipsis,
|
||||||
),
|
maxLines: 2,
|
||||||
|
style: TextStyle(fontSize: 22.sp, color: AppColors.darkGrayTextColor),
|
||||||
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
isHaveDirection! ? SizedBox(width: 3.w) : Container(),
|
isHaveDirection! ? SizedBox(width: 3.w) : Container(),
|
||||||
|
|||||||
@ -95,6 +95,11 @@ class ElectronicKeyListRefreshUI {
|
|||||||
ElectronicKeyListRefreshUI();
|
ElectronicKeyListRefreshUI();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// 刷新授权管理员列表
|
||||||
|
class AuthorizedAdminPageRefreshUI {
|
||||||
|
AuthorizedAdminPageRefreshUI();
|
||||||
|
}
|
||||||
|
|
||||||
/// 刷新门锁日志列表
|
/// 刷新门锁日志列表
|
||||||
class DoorLockLogListRefreshUI {
|
class DoorLockLogListRefreshUI {
|
||||||
DateTime getDoorLockLogTime;
|
DateTime getDoorLockLogTime;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user