Merge branch 'master' of https://gitee.com/weishaoyang/star_lock
This commit is contained in:
commit
c84a03dad5
@ -335,7 +335,8 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage> {
|
|||||||
|
|
||||||
//标记房间为已入住 isOn:已入住: 1 空闲:2
|
//标记房间为已入住 isOn:已入住: 1 空闲:2
|
||||||
Future<void> updateRoomCheckIn() async {
|
Future<void> updateRoomCheckIn() async {
|
||||||
var entity = await ApiRepository.to.updateSetting('0', '1', '13');
|
var entity = await ApiRepository.to
|
||||||
|
.updateSetting(keyInfo.lockId.toString(), '1', '13');
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
print("标记为已入住成功啦啦啦啦啦");
|
print("标记为已入住成功啦啦啦啦啦");
|
||||||
Toast.show(msg: "标记成功");
|
Toast.show(msg: "标记成功");
|
||||||
|
|||||||
@ -133,8 +133,8 @@ class _AuthorizedAdminListPageState extends State<AuthorizedAdminListPage> {
|
|||||||
}
|
}
|
||||||
return _electronicKeyItem('images/controls_user.png',
|
return _electronicKeyItem('images/controls_user.png',
|
||||||
indexEntity.keyName!, useDateStr, keyStatus, isAdminKey, () {
|
indexEntity.keyName!, useDateStr, keyStatus, isAdminKey, () {
|
||||||
// Navigator.pushNamed(context, Routers.authorizedAdminDetailPage);
|
Navigator.pushNamed(context, Routers.electronicKeyDetailPage,
|
||||||
Navigator.pushNamed(context, Routers.electronicKeyDetailPage);
|
arguments: {'itemData': indexEntity});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -96,7 +96,7 @@ class _ElectronicKeyDetailPageState extends State<ElectronicKeyDetailPage> {
|
|||||||
const SizedBox(height: 1),
|
const SizedBox(height: 1),
|
||||||
CommonItem(
|
CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.senderTime!.tr,
|
leftTitel: TranslationLoader.lanKeys!.senderTime!.tr,
|
||||||
rightTitle: itemData.date.toString(),
|
rightTitle: getSenderDate(itemData),
|
||||||
action: () {}),
|
action: () {}),
|
||||||
Container(height: 10.h),
|
Container(height: 10.h),
|
||||||
CommonItem(
|
CommonItem(
|
||||||
@ -115,7 +115,10 @@ class _ElectronicKeyDetailPageState extends State<ElectronicKeyDetailPage> {
|
|||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () {
|
action: () {
|
||||||
Navigator.pushNamed(context, Routers.keyOperationRecordPage,
|
Navigator.pushNamed(context, Routers.keyOperationRecordPage,
|
||||||
arguments: {});
|
arguments: {
|
||||||
|
'lockId': itemData.lockId.toString(),
|
||||||
|
'keyId': itemData.keyId.toString()
|
||||||
|
});
|
||||||
}),
|
}),
|
||||||
Container(height: 40.h),
|
Container(height: 40.h),
|
||||||
SubmitBtn(
|
SubmitBtn(
|
||||||
@ -160,6 +163,14 @@ class _ElectronicKeyDetailPageState extends State<ElectronicKeyDetailPage> {
|
|||||||
return useDateStr;
|
return useDateStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//发送时间
|
||||||
|
String getSenderDate(ElectronicKeyListItem indexEntity) {
|
||||||
|
String senderDate = '';
|
||||||
|
DateTime dateStr = DateTime.fromMillisecondsSinceEpoch(indexEntity.date!);
|
||||||
|
senderDate = dateStr.toLocal().toString().substring(0, 16);
|
||||||
|
return senderDate;
|
||||||
|
}
|
||||||
|
|
||||||
Widget commonItem(String leftTitle, String rightTitle,
|
Widget commonItem(String leftTitle, String rightTitle,
|
||||||
{bool isHaveDirection = false,
|
{bool isHaveDirection = false,
|
||||||
bool isHaveLine = false,
|
bool isHaveLine = false,
|
||||||
|
|||||||
@ -17,8 +17,31 @@ class KeyOperationRecordPage extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _KeyOperationRecordPageState extends State<KeyOperationRecordPage> {
|
class _KeyOperationRecordPageState extends State<KeyOperationRecordPage> {
|
||||||
|
String _keyId = '';
|
||||||
|
String _lockId = '';
|
||||||
|
String _keyboardPwdId = ''; //密码ID
|
||||||
|
String _cardId = ''; //卡ID
|
||||||
|
String _fingerprintId = ''; //指纹ID
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
dynamic obj = ModalRoute.of(context)?.settings.arguments;
|
||||||
|
if (obj != null && (obj["keyId"] != null)) {
|
||||||
|
_keyId = obj["keyId"];
|
||||||
|
}
|
||||||
|
if (obj != null && (obj["lockId"] != null)) {
|
||||||
|
_lockId = obj["lockId"];
|
||||||
|
}
|
||||||
|
if (obj != null && (obj["keyboardPwdId"] != null)) {
|
||||||
|
_keyboardPwdId = obj["keyboardPwdId"];
|
||||||
|
}
|
||||||
|
if (obj != null && (obj["cardId"] != null)) {
|
||||||
|
_cardId = obj["cardId"];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (obj != null && (obj["fingerprintId"] != null)) {
|
||||||
|
_fingerprintId = obj["fingerprintId"];
|
||||||
|
}
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: AppColors.mainBackgroundColor,
|
backgroundColor: AppColors.mainBackgroundColor,
|
||||||
appBar: TitleAppBar(
|
appBar: TitleAppBar(
|
||||||
@ -55,8 +78,21 @@ class _KeyOperationRecordPageState extends State<KeyOperationRecordPage> {
|
|||||||
|
|
||||||
//请求操作记录列表
|
//请求操作记录列表
|
||||||
Future<List<KeyRecordDataItem>> mockNetworkDataRequest() async {
|
Future<List<KeyRecordDataItem>> mockNetworkDataRequest() async {
|
||||||
KeyOperationRecordEntity entity = await ApiRepository.to
|
KeyOperationRecordEntity entity = await ApiRepository.to.lockRecordList(
|
||||||
.lockRecordList('0', '63', '0', '28', '1', '1', '20', '0', '', '', '');
|
'0',
|
||||||
|
_keyId,
|
||||||
|
'0',
|
||||||
|
_lockId,
|
||||||
|
'1',
|
||||||
|
'1',
|
||||||
|
'20',
|
||||||
|
'0',
|
||||||
|
'',
|
||||||
|
'',
|
||||||
|
'',
|
||||||
|
_keyboardPwdId,
|
||||||
|
_cardId,
|
||||||
|
_fingerprintId);
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
print("操作记录列表成功:${entity.data?.itemList}");
|
print("操作记录列表成功:${entity.data?.itemList}");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -196,8 +196,8 @@ class _ElectronicKeyListPageState extends State<ElectronicKeyListPage> {
|
|||||||
|
|
||||||
//电子钥匙重置请求
|
//电子钥匙重置请求
|
||||||
Future<void> resetElectronicKeyListRequest() async {
|
Future<void> resetElectronicKeyListRequest() async {
|
||||||
ElectronicKeyListEntity entity =
|
ElectronicKeyListEntity entity = await ApiRepository.to
|
||||||
await ApiRepository.to.resetElectronicKey('28', '0');
|
.resetElectronicKey(keyInfo.lockId.toString(), '0');
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
print("重置电子钥匙成功啦啦啦啦啦");
|
print("重置电子钥匙成功啦啦啦啦啦");
|
||||||
Toast.show(msg: "重置成功");
|
Toast.show(msg: "重置成功");
|
||||||
|
|||||||
@ -445,7 +445,8 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
|
|||||||
|
|
||||||
//标记房间为已入住 isOn:已入住: 1 空闲:2
|
//标记房间为已入住 isOn:已入住: 1 空闲:2
|
||||||
Future<void> updateRoomCheckIn() async {
|
Future<void> updateRoomCheckIn() async {
|
||||||
var entity = await ApiRepository.to.updateSetting('0', '1', '13');
|
var entity = await ApiRepository.to
|
||||||
|
.updateSetting(keyInfo.lockId.toString(), '1', '13');
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
print("标记为已入住成功啦啦啦啦啦");
|
print("标记为已入住成功啦啦啦啦啦");
|
||||||
Toast.show(msg: "标记成功");
|
Toast.show(msg: "标记成功");
|
||||||
|
|||||||
@ -17,7 +17,11 @@ class LockDetailPage extends StatefulWidget {
|
|||||||
final KeyInfos keyInfo;
|
final KeyInfos keyInfo;
|
||||||
final LockMainEntity lockMainEntity;
|
final LockMainEntity lockMainEntity;
|
||||||
|
|
||||||
const LockDetailPage({Key? key, required this.lockMainEntity, required this.isFrist, required this.keyInfo})
|
const LockDetailPage(
|
||||||
|
{Key? key,
|
||||||
|
required this.lockMainEntity,
|
||||||
|
required this.isFrist,
|
||||||
|
required this.keyInfo})
|
||||||
: super(key: key);
|
: super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -34,15 +38,19 @@ class _LockDetailPageState extends State<LockDetailPage> {
|
|||||||
super.initState();
|
super.initState();
|
||||||
|
|
||||||
state.keyInfos.value = widget.keyInfo;
|
state.keyInfos.value = widget.keyInfo;
|
||||||
BlueManage().connectDeviceName = state.keyInfos.value.bluetooth!.bluetoothDeviceName!;
|
BlueManage().connectDeviceName =
|
||||||
BlueManage().connectDeviceMacAddress = state.keyInfos.value.bluetooth!.bluetoothDeviceId!;
|
state.keyInfos.value.bluetooth!.bluetoothDeviceName!;
|
||||||
|
BlueManage().connectDeviceMacAddress =
|
||||||
|
state.keyInfos.value.bluetooth!.bluetoothDeviceId!;
|
||||||
|
|
||||||
List<int> publicKeyData = state.keyInfos.value.bluetooth!.publicKey!.cast<int>();
|
List<int> publicKeyData =
|
||||||
|
state.keyInfos.value.bluetooth!.publicKey!.cast<int>();
|
||||||
var saveStrList = changeIntListToStringList(publicKeyData);
|
var saveStrList = changeIntListToStringList(publicKeyData);
|
||||||
Storage.setStringList(saveBluePublicKey, saveStrList);
|
Storage.setStringList(saveBluePublicKey, saveStrList);
|
||||||
|
|
||||||
// 私钥
|
// 私钥
|
||||||
List<int> privateKeyData = state.keyInfos.value.bluetooth!.privateKey!.cast<int>();
|
List<int> privateKeyData =
|
||||||
|
state.keyInfos.value.bluetooth!.privateKey!.cast<int>();
|
||||||
var savePrivateKeyList = changeIntListToStringList(privateKeyData);
|
var savePrivateKeyList = changeIntListToStringList(privateKeyData);
|
||||||
Storage.setStringList(saveBluePrivateKey, savePrivateKeyList);
|
Storage.setStringList(saveBluePrivateKey, savePrivateKeyList);
|
||||||
|
|
||||||
@ -57,16 +65,12 @@ class _LockDetailPageState extends State<LockDetailPage> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
|
||||||
return Container(
|
return Container(
|
||||||
width: 1.sw,
|
width: 1.sw,
|
||||||
height: 1.sh - ScreenUtil().statusBarHeight*2,
|
height: 1.sh - ScreenUtil().statusBarHeight * 2,
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [topWidget(), Expanded(child: bottomWidget())],
|
||||||
topWidget(),
|
|
||||||
Expanded(child: bottomWidget())
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -187,7 +191,11 @@ class _LockDetailPageState extends State<LockDetailPage> {
|
|||||||
}),
|
}),
|
||||||
bottomItem('images/main/icon_main_password.png',
|
bottomItem('images/main/icon_main_password.png',
|
||||||
TranslationLoader.lanKeys!.password!.tr, () {
|
TranslationLoader.lanKeys!.password!.tr, () {
|
||||||
Navigator.pushNamed(context, Routers.passwordKeyListPage);
|
Navigator.pushNamed(context, Routers.passwordKeyListPage,
|
||||||
|
arguments: {
|
||||||
|
"lockMainEntity": widget.lockMainEntity,
|
||||||
|
"keyInfo": widget.keyInfo
|
||||||
|
});
|
||||||
}),
|
}),
|
||||||
bottomItem('images/main/icon_main_icCard.png',
|
bottomItem('images/main/icon_main_icCard.png',
|
||||||
TranslationLoader.lanKeys!.card!.tr, () {
|
TranslationLoader.lanKeys!.card!.tr, () {
|
||||||
@ -223,7 +231,11 @@ class _LockDetailPageState extends State<LockDetailPage> {
|
|||||||
}),
|
}),
|
||||||
bottomItem('images/main/icon_main_operatingRecord.png',
|
bottomItem('images/main/icon_main_operatingRecord.png',
|
||||||
TranslationLoader.lanKeys!.operatingRecord!.tr, () {
|
TranslationLoader.lanKeys!.operatingRecord!.tr, () {
|
||||||
Navigator.pushNamed(context, Routers.lockOperatingRecordPage);
|
Navigator.pushNamed(context, Routers.lockOperatingRecordPage,
|
||||||
|
arguments: {
|
||||||
|
"lockMainEntity": widget.lockMainEntity,
|
||||||
|
"keyInfo": widget.keyInfo
|
||||||
|
});
|
||||||
}),
|
}),
|
||||||
bottomItem('images/main/icon_main_set.png',
|
bottomItem('images/main/icon_main_set.png',
|
||||||
TranslationLoader.lanKeys!.set!.tr, () {
|
TranslationLoader.lanKeys!.set!.tr, () {
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import 'package:get/get.dart';
|
|||||||
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecordEntity.dart';
|
import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecordEntity.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/main/lockMian/entity/lockInfoEntity.dart';
|
||||||
|
|
||||||
import '../../../app_settings/app_colors.dart';
|
import '../../../app_settings/app_colors.dart';
|
||||||
import '../../../tools/jh_pop_menus.dart';
|
import '../../../tools/jh_pop_menus.dart';
|
||||||
@ -19,8 +20,19 @@ class LockOperatingRecordPage extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _LockOperatingRecordPageState extends State<LockOperatingRecordPage> {
|
class _LockOperatingRecordPageState extends State<LockOperatingRecordPage> {
|
||||||
|
late KeyInfos keyInfo;
|
||||||
|
late LockMainEntity lockMainEntity;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
dynamic obj = ModalRoute.of(context)?.settings.arguments;
|
||||||
|
if (obj != null && (obj["lockMainEntity"] != null)) {
|
||||||
|
lockMainEntity = obj["lockMainEntity"];
|
||||||
|
}
|
||||||
|
if (obj != null && (obj["keyInfo"] != null)) {
|
||||||
|
keyInfo = obj["keyInfo"];
|
||||||
|
}
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: AppColors.mainBackgroundColor,
|
backgroundColor: AppColors.mainBackgroundColor,
|
||||||
appBar: TitleAppBar(
|
appBar: TitleAppBar(
|
||||||
@ -93,8 +105,21 @@ class _LockOperatingRecordPageState extends State<LockOperatingRecordPage> {
|
|||||||
|
|
||||||
//请求操作记录列表
|
//请求操作记录列表
|
||||||
Future<List<KeyRecordDataItem>> mockNetworkDataRequest() async {
|
Future<List<KeyRecordDataItem>> mockNetworkDataRequest() async {
|
||||||
KeyOperationRecordEntity entity = await ApiRepository.to
|
KeyOperationRecordEntity entity = await ApiRepository.to.lockRecordList(
|
||||||
.lockRecordList('0', '63', '0', '28', '1', '1', '20', '0', '', '', '');
|
'0',
|
||||||
|
keyInfo.keyId.toString(),
|
||||||
|
'0',
|
||||||
|
keyInfo.lockId.toString(),
|
||||||
|
'1',
|
||||||
|
'1',
|
||||||
|
'20',
|
||||||
|
'0',
|
||||||
|
'',
|
||||||
|
'',
|
||||||
|
'',
|
||||||
|
'',
|
||||||
|
'',
|
||||||
|
'');
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
print("操作记录列表成功:${entity.data?.itemList}");
|
print("操作记录列表成功:${entity.data?.itemList}");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -99,7 +99,11 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage> {
|
|||||||
rightTitle: "",
|
rightTitle: "",
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () {
|
action: () {
|
||||||
Navigator.pushNamed(context, Routers.keyOperationRecordPage);
|
Navigator.pushNamed(context, Routers.keyOperationRecordPage,
|
||||||
|
arguments: {
|
||||||
|
'lockId': itemData.lockId.toString(),
|
||||||
|
'keyId': itemData.keyboardPwdId.toString()
|
||||||
|
});
|
||||||
}),
|
}),
|
||||||
Container(height: 40.h),
|
Container(height: 40.h),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
|
|||||||
@ -2,6 +2,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/passwordKey/passwordKeyList/passwordKeyListEntity.dart';
|
import 'package:star_lock/main/lockDetail/passwordKey/passwordKeyList/passwordKeyListEntity.dart';
|
||||||
|
import 'package:star_lock/main/lockMian/entity/lockInfoEntity.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/toast.dart';
|
import 'package:star_lock/tools/toast.dart';
|
||||||
@ -20,8 +21,18 @@ class PasswordKeyListPage extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _PasswordKeyListPageState extends State<PasswordKeyListPage> {
|
class _PasswordKeyListPageState extends State<PasswordKeyListPage> {
|
||||||
|
late KeyInfos keyInfo;
|
||||||
|
late LockMainEntity lockMainEntity;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
dynamic obj = ModalRoute.of(context)?.settings.arguments;
|
||||||
|
if (obj != null && (obj["lockMainEntity"] != null)) {
|
||||||
|
lockMainEntity = obj["lockMainEntity"];
|
||||||
|
}
|
||||||
|
if (obj != null && (obj["keyInfo"] != null)) {
|
||||||
|
keyInfo = obj["keyInfo"];
|
||||||
|
}
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: AppColors.mainBackgroundColor,
|
backgroundColor: AppColors.mainBackgroundColor,
|
||||||
appBar: TitleAppBar(
|
appBar: TitleAppBar(
|
||||||
@ -67,7 +78,10 @@ class _PasswordKeyListPageState extends State<PasswordKeyListPage> {
|
|||||||
btnName: TranslationLoader.lanKeys!.getPassword!.tr,
|
btnName: TranslationLoader.lanKeys!.getPassword!.tr,
|
||||||
onClick: () {
|
onClick: () {
|
||||||
Navigator.pushNamed(
|
Navigator.pushNamed(
|
||||||
context, Routers.passwordKeyManagePage);
|
context, Routers.passwordKeyManagePage, arguments: {
|
||||||
|
"lockMainEntity": lockMainEntity,
|
||||||
|
"keyInfo": keyInfo
|
||||||
|
});
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
@ -86,8 +100,8 @@ class _PasswordKeyListPageState extends State<PasswordKeyListPage> {
|
|||||||
|
|
||||||
//请求密码钥匙列表
|
//请求密码钥匙列表
|
||||||
Future<List<PasswordKeyListItem>> mockNetworkDataRequest() async {
|
Future<List<PasswordKeyListItem>> mockNetworkDataRequest() async {
|
||||||
PasswordKeyListEntity entity =
|
PasswordKeyListEntity entity = await ApiRepository.to
|
||||||
await ApiRepository.to.passwordKeyList('0', '28', '0', '1', '20');
|
.passwordKeyList('0', keyInfo.lockId.toString(), '0', '1', '20');
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
print("密码钥匙列表成功:${entity.data?.itemList}");
|
print("密码钥匙列表成功:${entity.data?.itemList}");
|
||||||
}
|
}
|
||||||
@ -102,7 +116,7 @@ class _PasswordKeyListPageState extends State<PasswordKeyListPage> {
|
|||||||
//密码钥匙重置请求
|
//密码钥匙重置请求
|
||||||
Future<void> resetPasswordKeyListRequest() async {
|
Future<void> resetPasswordKeyListRequest() async {
|
||||||
PasswordKeyListEntity entity =
|
PasswordKeyListEntity entity =
|
||||||
await ApiRepository.to.resetPasswordKey('28', '0');
|
await ApiRepository.to.resetPasswordKey(keyInfo.lockId.toString(), '0');
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
print("重置电子钥匙成功啦啦啦啦啦");
|
print("重置电子钥匙成功啦啦啦啦啦");
|
||||||
Toast.show(msg: "重置成功");
|
Toast.show(msg: "重置成功");
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:star_lock/main/lockDetail/passwordKey/passwordKeyManage/passwordKeyManage_tabbar.dart';
|
import 'package:star_lock/main/lockDetail/passwordKey/passwordKeyManage/passwordKeyManage_tabbar.dart';
|
||||||
|
import 'package:star_lock/main/lockMian/entity/lockInfoEntity.dart';
|
||||||
|
|
||||||
import '../../../../app_settings/app_colors.dart';
|
import '../../../../app_settings/app_colors.dart';
|
||||||
import '../../../../tools/titleAppBar.dart';
|
import '../../../../tools/titleAppBar.dart';
|
||||||
@ -15,16 +15,33 @@ class PasswordKeyManagePage extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _PasswordKeyManagePageState extends State<PasswordKeyManagePage> {
|
class _PasswordKeyManagePageState extends State<PasswordKeyManagePage> {
|
||||||
var index=0;
|
var index = 0;
|
||||||
|
late KeyInfos keyInfo;
|
||||||
|
late LockMainEntity lockMainEntity;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
dynamic obj = ModalRoute.of(context)?.settings.arguments;
|
||||||
|
if (obj != null && (obj["lockMainEntity"] != null)) {
|
||||||
|
lockMainEntity = obj["lockMainEntity"];
|
||||||
|
}
|
||||||
|
if (obj != null && (obj["keyInfo"] != null)) {
|
||||||
|
keyInfo = obj["keyInfo"];
|
||||||
|
}
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: AppColors.mainBackgroundColor,
|
backgroundColor: AppColors.mainBackgroundColor,
|
||||||
appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys!.getPassword!.tr, haveBack:true, backgroundColor: AppColors.mainColor),
|
appBar: TitleAppBar(
|
||||||
|
barTitle: TranslationLoader.lanKeys!.getPassword!.tr,
|
||||||
|
haveBack: true,
|
||||||
|
backgroundColor: AppColors.mainColor),
|
||||||
body: Column(
|
body: Column(
|
||||||
children: [
|
children: [
|
||||||
PasswordKeyManageTabbarPage(initialIndex: index,),
|
PasswordKeyManageTabbarPage(
|
||||||
|
initialIndex: index,
|
||||||
|
keyInfo: keyInfo,
|
||||||
|
lockMainEntity: lockMainEntity,
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
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/main/lockMian/entity/lockInfoEntity.dart';
|
||||||
|
|
||||||
import '../../../../app_settings/app_colors.dart';
|
import '../../../../app_settings/app_colors.dart';
|
||||||
import '../../../../tools/CustomUnderlineTabIndicator.dart';
|
import '../../../../tools/CustomUnderlineTabIndicator.dart';
|
||||||
@ -9,8 +10,14 @@ import '../passwordKey_Perpetual/passwordKey_perpetual_page.dart';
|
|||||||
|
|
||||||
class PasswordKeyManageTabbarPage extends StatefulWidget {
|
class PasswordKeyManageTabbarPage extends StatefulWidget {
|
||||||
var initialIndex = 1;
|
var initialIndex = 1;
|
||||||
|
final KeyInfos keyInfo;
|
||||||
|
final LockMainEntity lockMainEntity;
|
||||||
|
|
||||||
PasswordKeyManageTabbarPage({Key? key, required this.initialIndex})
|
PasswordKeyManageTabbarPage(
|
||||||
|
{Key? key,
|
||||||
|
required this.initialIndex,
|
||||||
|
required this.keyInfo,
|
||||||
|
required this.lockMainEntity})
|
||||||
: super(key: key);
|
: super(key: key);
|
||||||
@override
|
@override
|
||||||
State<PasswordKeyManageTabbarPage> createState() =>
|
State<PasswordKeyManageTabbarPage> createState() =>
|
||||||
@ -98,6 +105,8 @@ class _PasswordKeyManageTabbarPageState
|
|||||||
children: _itemTabs
|
children: _itemTabs
|
||||||
.map((ItemView item) => PasswordKeyPerpetualPage(
|
.map((ItemView item) => PasswordKeyPerpetualPage(
|
||||||
type: item.type,
|
type: item.type,
|
||||||
|
getKeyInfo: widget.keyInfo,
|
||||||
|
lockMainEntity: widget.lockMainEntity,
|
||||||
))
|
))
|
||||||
.toList(),
|
.toList(),
|
||||||
),
|
),
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import 'package:flutter_pickers/style/default_style.dart';
|
|||||||
import 'package:flutter_pickers/time_picker/model/date_mode.dart';
|
import 'package:flutter_pickers/time_picker/model/date_mode.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/lockMian/entity/lockInfoEntity.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/toast.dart';
|
import 'package:star_lock/tools/toast.dart';
|
||||||
@ -17,8 +18,14 @@ import '../../../../translations/trans_lib.dart';
|
|||||||
|
|
||||||
class PasswordKeyPerpetualPage extends StatefulWidget {
|
class PasswordKeyPerpetualPage extends StatefulWidget {
|
||||||
final String type;
|
final String type;
|
||||||
|
final KeyInfos getKeyInfo;
|
||||||
|
final LockMainEntity lockMainEntity;
|
||||||
|
|
||||||
const PasswordKeyPerpetualPage({Key? key, required this.type})
|
const PasswordKeyPerpetualPage(
|
||||||
|
{Key? key,
|
||||||
|
required this.type,
|
||||||
|
required this.getKeyInfo,
|
||||||
|
required this.lockMainEntity})
|
||||||
: super(key: key);
|
: super(key: key);
|
||||||
@override
|
@override
|
||||||
State<PasswordKeyPerpetualPage> createState() =>
|
State<PasswordKeyPerpetualPage> createState() =>
|
||||||
@ -27,14 +34,14 @@ class PasswordKeyPerpetualPage extends StatefulWidget {
|
|||||||
|
|
||||||
class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> {
|
class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> {
|
||||||
final TextEditingController _controller = TextEditingController();
|
final TextEditingController _controller = TextEditingController();
|
||||||
late bool _isSendSuccess;
|
late bool _isSendSuccess; //是否发送成功
|
||||||
late bool _isPermanent;
|
late bool _isPermanent; //是否永久
|
||||||
late String _getPwdStr;
|
late String _getPwdStr;
|
||||||
String _selectEffectiveDate = ''; //生效时间
|
String _selectEffectiveDate = ''; //生效时间
|
||||||
String _selectFailureDate = ''; //失效时间
|
String _selectFailureDate = ''; //失效时间
|
||||||
late DateTime _effectiveDateTime;
|
late DateTime _effectiveDateTime;
|
||||||
late DateTime _failureDateTime;
|
late DateTime _failureDateTime;
|
||||||
late String cyclicModeStr;
|
late String cyclicModeStr; //循环模式
|
||||||
late String effectiveHourStr;
|
late String effectiveHourStr;
|
||||||
late String failureHourStr;
|
late String failureHourStr;
|
||||||
|
|
||||||
@ -365,7 +372,7 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> {
|
|||||||
Future<void> getKeyboardPwdRequest() async {
|
Future<void> getKeyboardPwdRequest() async {
|
||||||
String getFailureDateTime = '0';
|
String getFailureDateTime = '0';
|
||||||
String getEffectiveDateTime = '0';
|
String getEffectiveDateTime = '0';
|
||||||
String lockId = '28';
|
String lockId = widget.getKeyInfo.lockId.toString();
|
||||||
int passwordType = int.parse(widget.type);
|
int passwordType = int.parse(widget.type);
|
||||||
String getKeyType = passwordType.toString();
|
String getKeyType = passwordType.toString();
|
||||||
if (passwordType == 0) {
|
if (passwordType == 0) {
|
||||||
|
|||||||
@ -209,7 +209,10 @@ class ApiProvider extends BaseProvider {
|
|||||||
String startDate,
|
String startDate,
|
||||||
String recordType,
|
String recordType,
|
||||||
String searchStr,
|
String searchStr,
|
||||||
String timezoneRawOffSet) =>
|
String timezoneRawOffSet,
|
||||||
|
String keyboardPwdId,
|
||||||
|
String cardId,
|
||||||
|
String fingerprintId) =>
|
||||||
post(
|
post(
|
||||||
keyOperationRecordURL.toUrl,
|
keyOperationRecordURL.toUrl,
|
||||||
jsonEncode({
|
jsonEncode({
|
||||||
@ -223,7 +226,10 @@ class ApiProvider extends BaseProvider {
|
|||||||
'startDate': startDate,
|
'startDate': startDate,
|
||||||
'recordType': recordType,
|
'recordType': recordType,
|
||||||
'searchStr': searchStr,
|
'searchStr': searchStr,
|
||||||
'timezoneRawOffSet': timezoneRawOffSet
|
'timezoneRawOffSet': timezoneRawOffSet,
|
||||||
|
'keyboardPwdId': keyboardPwdId,
|
||||||
|
'cardId': cardId,
|
||||||
|
'fingerprintId': fingerprintId
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// 绑定蓝牙管理员
|
// 绑定蓝牙管理员
|
||||||
|
|||||||
@ -160,7 +160,10 @@ class ApiRepository {
|
|||||||
String startDate,
|
String startDate,
|
||||||
String recordType,
|
String recordType,
|
||||||
String searchStr,
|
String searchStr,
|
||||||
String timezoneRawOffSet) async {
|
String timezoneRawOffSet,
|
||||||
|
String keyboardPwdId,
|
||||||
|
String cardId,
|
||||||
|
String fingerprintId) async {
|
||||||
final res = await apiProvider.lockRecordList(
|
final res = await apiProvider.lockRecordList(
|
||||||
endDate,
|
endDate,
|
||||||
keyId,
|
keyId,
|
||||||
@ -172,7 +175,10 @@ class ApiRepository {
|
|||||||
startDate,
|
startDate,
|
||||||
recordType,
|
recordType,
|
||||||
searchStr,
|
searchStr,
|
||||||
timezoneRawOffSet);
|
timezoneRawOffSet,
|
||||||
|
keyboardPwdId,
|
||||||
|
cardId,
|
||||||
|
fingerprintId);
|
||||||
return KeyOperationRecordEntity.fromJson(res.body);
|
return KeyOperationRecordEntity.fromJson(res.body);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user