完善锁设置功能,修复已知bug
This commit is contained in:
parent
181922c6ff
commit
1434a44f78
@ -40,7 +40,7 @@
|
|||||||
<!--允许读设备等信息,用于问题排查-->
|
<!--允许读设备等信息,用于问题排查-->
|
||||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||||
<application
|
<application
|
||||||
android:label="star_lock"
|
android:label="星锁"
|
||||||
android:name="${applicationName}"
|
android:name="${applicationName}"
|
||||||
android:icon="@mipmap/ic_logo">
|
android:icon="@mipmap/ic_logo">
|
||||||
<!-- 配置定位Service -->
|
<!-- 配置定位Service -->
|
||||||
|
|||||||
@ -1,9 +1,7 @@
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:star_lock/common/safetyVerification/safetyVerification_binding.dart';
|
import 'package:star_lock/common/safetyVerification/safetyVerification_binding.dart';
|
||||||
import 'package:star_lock/login/register/starLock_register_binding.dart';
|
import 'package:star_lock/login/register/starLock_register_binding.dart';
|
||||||
import 'package:get/get.dart';
|
|
||||||
import 'package:star_lock/common/safetyVerification/safetyVerification_binding.dart';
|
|
||||||
import 'package:star_lock/login/register/starLock_register_binding.dart';
|
|
||||||
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserList_page.dart';
|
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserList_page.dart';
|
||||||
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupList_page.dart';
|
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupList_page.dart';
|
||||||
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendReceiver/massSendReceiver_page.dart';
|
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendReceiver/massSendReceiver_page.dart';
|
||||||
@ -18,7 +16,6 @@ import 'package:star_lock/mine/mineSet/authorizedAdministrator/administratorDeta
|
|||||||
import 'package:star_lock/mine/mineSet/lockGroup/lockGroupList_page.dart';
|
import 'package:star_lock/mine/mineSet/lockGroup/lockGroupList_page.dart';
|
||||||
import 'package:star_lock/mine/mineSet/lockUserManage/expireLockList/expireLockChangeDate_page.dart';
|
import 'package:star_lock/mine/mineSet/lockUserManage/expireLockList/expireLockChangeDate_page.dart';
|
||||||
import 'package:star_lock/mine/mineSet/lockUserManage/expireLockList/expireLockList_page.dart';
|
import 'package:star_lock/mine/mineSet/lockUserManage/expireLockList/expireLockList_page.dart';
|
||||||
import 'package:star_lock/mine/mineSet/lockUserManage/lockUserManageList_Page.dart';
|
|
||||||
import 'package:star_lock/mine/mineSet/mineSet/mineSet_page.dart';
|
import 'package:star_lock/mine/mineSet/mineSet/mineSet_page.dart';
|
||||||
import 'package:star_lock/mine/mineSet/transferGateway/selectGetewayList_page.dart';
|
import 'package:star_lock/mine/mineSet/transferGateway/selectGetewayList_page.dart';
|
||||||
import 'package:star_lock/mine/mineSet/transferSmartLock/recipientInformation/recipientInformation_page.dart';
|
import 'package:star_lock/mine/mineSet/transferSmartLock/recipientInformation/recipientInformation_page.dart';
|
||||||
@ -128,7 +125,8 @@ import 'mine/mineSet/authorityManagement/getNameList_page.dart';
|
|||||||
import 'mine/mineSet/hideInvalidUnlockPermissions/hideInvalidUnlockPermissions_page.dart';
|
import 'mine/mineSet/hideInvalidUnlockPermissions/hideInvalidUnlockPermissions_page.dart';
|
||||||
import 'mine/mineSet/lockGroup/lockItemList_page.dart';
|
import 'mine/mineSet/lockGroup/lockItemList_page.dart';
|
||||||
import 'mine/mineSet/lockScreen/lockScreen_page.dart';
|
import 'mine/mineSet/lockScreen/lockScreen_page.dart';
|
||||||
import 'mine/mineSet/lockUserManage/ownedKeyList_page.dart';
|
import 'mine/mineSet/lockUserManage/lockUserManageList/lockUserManageList_page.dart';
|
||||||
|
import 'mine/mineSet/lockUserManage/ownedKeyList/ownedKeyList_page.dart';
|
||||||
import 'mine/supportStaff/supportStaff_page.dart';
|
import 'mine/supportStaff/supportStaff_page.dart';
|
||||||
import 'mine/valueAddedServices/valueAddedServicesBuy/valueAddedServicesBuy_page.dart';
|
import 'mine/valueAddedServices/valueAddedServicesBuy/valueAddedServicesBuy_page.dart';
|
||||||
import 'mine/valueAddedServices/valueAddedServicesBuyAndUseRecord/valueAddedServicesBuyAndUseRecordManage/valueAddedServicesBuyAndUseRecordManage_page.dart';
|
import 'mine/valueAddedServices/valueAddedServicesBuyAndUseRecord/valueAddedServicesBuyAndUseRecordManage/valueAddedServicesBuyAndUseRecordManage_page.dart';
|
||||||
|
|||||||
@ -8,6 +8,7 @@ import 'package:star_lock/blue/sender_manage.dart';
|
|||||||
|
|
||||||
import '../app_settings/app_settings.dart';
|
import '../app_settings/app_settings.dart';
|
||||||
import '../tools/storage.dart';
|
import '../tools/storage.dart';
|
||||||
|
import '../tools/toast.dart';
|
||||||
import 'io_tool/io_manager.dart';
|
import 'io_tool/io_manager.dart';
|
||||||
import 'io_tool/io_model.dart';
|
import 'io_tool/io_model.dart';
|
||||||
import 'io_tool/io_tool.dart';
|
import 'io_tool/io_tool.dart';
|
||||||
@ -230,10 +231,14 @@ class BlueManage{
|
|||||||
}
|
}
|
||||||
connectStateCallBack!(deviceConnectionState!);
|
connectStateCallBack!(deviceConnectionState!);
|
||||||
}else{
|
}else{
|
||||||
print("333333333:${deviceConnectionState}");
|
// print("333333333:${deviceConnectionState}");
|
||||||
connect(deviceMAC, deviceName, isShowLoading: false, connectStateCallBack: (state){
|
connect(deviceMAC, deviceName, isShowLoading: false, connectStateCallBack: (state){
|
||||||
print("44444444:${state}");
|
// print("44444444:${state}");
|
||||||
connectStateCallBack!(state);
|
// if(deviceConnectionState == DeviceConnectionState.connected){
|
||||||
|
connectStateCallBack!(state);
|
||||||
|
// }else {
|
||||||
|
// Toast.show(msg: "连接设备失败,请确保在设备附近,设备未被连接,设备已打开");
|
||||||
|
// }
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import 'package:get/get.dart';
|
|||||||
|
|
||||||
import '../../appRouters.dart';
|
import '../../appRouters.dart';
|
||||||
import '../../app_settings/app_colors.dart';
|
import '../../app_settings/app_colors.dart';
|
||||||
|
import '../../common/XSConstantMacro/XSConstantMacro.dart';
|
||||||
import '../../tools/tf_loginInput.dart';
|
import '../../tools/tf_loginInput.dart';
|
||||||
import '../../tools/submitBtn.dart';
|
import '../../tools/submitBtn.dart';
|
||||||
import '../../tools/titleAppBar.dart';
|
import '../../tools/titleAppBar.dart';
|
||||||
@ -102,13 +103,25 @@ class _StarLockLoginPageState extends State<StarLockLoginPage> {
|
|||||||
alignment: PlaceholderAlignment.middle,
|
alignment: PlaceholderAlignment.middle,
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
child: Text('《${TranslationLoader.lanKeys!.userAgreement!.tr}》', style: TextStyle(color: AppColors.mainColor, fontSize: 20.sp)),
|
child: Text('《${TranslationLoader.lanKeys!.userAgreement!.tr}》', style: TextStyle(color: AppColors.mainColor, fontSize: 20.sp)),
|
||||||
onTap: () {},
|
onTap: () {
|
||||||
|
Get.toNamed(Routers.webviewShowPage,
|
||||||
|
arguments: {
|
||||||
|
"url": XSConstantMacro.userAgreementURL,
|
||||||
|
"title": '用户协议'
|
||||||
|
});
|
||||||
|
},
|
||||||
)),
|
)),
|
||||||
WidgetSpan(
|
WidgetSpan(
|
||||||
alignment: PlaceholderAlignment.middle,
|
alignment: PlaceholderAlignment.middle,
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
child: Text('《${TranslationLoader.lanKeys!.privacyPolicy!.tr}》', style: TextStyle( color: AppColors.mainColor, fontSize: 20.sp)),
|
child: Text('《${TranslationLoader.lanKeys!.privacyPolicy!.tr}》', style: TextStyle( color: AppColors.mainColor, fontSize: 20.sp)),
|
||||||
onTap: () {},
|
onTap: () {
|
||||||
|
Get.toNamed(Routers.webviewShowPage,
|
||||||
|
arguments: {
|
||||||
|
"url": XSConstantMacro.privacyPolicyURL,
|
||||||
|
"title": '隐私政策'
|
||||||
|
});
|
||||||
|
},
|
||||||
)),
|
)),
|
||||||
],
|
],
|
||||||
)),
|
)),
|
||||||
|
|||||||
@ -8,6 +8,7 @@ import 'package:get/get.dart';
|
|||||||
|
|
||||||
import '../../appRouters.dart';
|
import '../../appRouters.dart';
|
||||||
import '../../app_settings/app_colors.dart';
|
import '../../app_settings/app_colors.dart';
|
||||||
|
import '../../common/XSConstantMacro/XSConstantMacro.dart';
|
||||||
import '../../tools/tf_loginInput.dart';
|
import '../../tools/tf_loginInput.dart';
|
||||||
import '../../tools/submitBtn.dart';
|
import '../../tools/submitBtn.dart';
|
||||||
import '../../tools/titleAppBar.dart';
|
import '../../tools/titleAppBar.dart';
|
||||||
@ -358,7 +359,13 @@ class _StarLockRegisterPageState extends State<StarLockRegisterPage> {
|
|||||||
'《${TranslationLoader.lanKeys!.userAgreement!.tr}》',
|
'《${TranslationLoader.lanKeys!.userAgreement!.tr}》',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: AppColors.mainColor, fontSize: 20.sp)),
|
color: AppColors.mainColor, fontSize: 20.sp)),
|
||||||
onTap: () {},
|
onTap: () {
|
||||||
|
Get.toNamed(Routers.webviewShowPage,
|
||||||
|
arguments: {
|
||||||
|
"url": XSConstantMacro.userAgreementURL,
|
||||||
|
"title": '用户协议'
|
||||||
|
});
|
||||||
|
},
|
||||||
)),
|
)),
|
||||||
WidgetSpan(
|
WidgetSpan(
|
||||||
alignment: PlaceholderAlignment.middle,
|
alignment: PlaceholderAlignment.middle,
|
||||||
@ -367,7 +374,12 @@ class _StarLockRegisterPageState extends State<StarLockRegisterPage> {
|
|||||||
'《${TranslationLoader.lanKeys!.privacyPolicy!.tr}》',
|
'《${TranslationLoader.lanKeys!.privacyPolicy!.tr}》',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
color: AppColors.mainColor, fontSize: 20.sp)),
|
color: AppColors.mainColor, fontSize: 20.sp)),
|
||||||
onTap: () {},
|
onTap: () {
|
||||||
|
Get.toNamed(Routers.webviewShowPage, arguments: {
|
||||||
|
"url": XSConstantMacro.privacyPolicyURL,
|
||||||
|
"title": '隐私政策'
|
||||||
|
});
|
||||||
|
},
|
||||||
)),
|
)),
|
||||||
],
|
],
|
||||||
)),
|
)),
|
||||||
|
|||||||
@ -315,14 +315,24 @@ class _AuthorizedAdminPageState extends State<AuthorizedAdminPage> {
|
|||||||
|
|
||||||
//标记房间为已入住 isOn:已入住: 1 空闲:2
|
//标记房间为已入住 isOn:已入住: 1 空闲:2
|
||||||
Future<void> updateRoomCheckIn() async {
|
Future<void> updateRoomCheckIn() async {
|
||||||
var entity = await ApiRepository.to
|
// var entity = await ApiRepository.to
|
||||||
.updateSetting(state.keyInfo.value.lockId.toString(), '1', '13');
|
// .updateSetting(state.keyInfo.value.lockId.toString(), '1', '13');
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
// if (entity.errorCode!.codeIsSuccessful) {
|
||||||
|
// print("标记为已入住成功啦啦啦啦啦");
|
||||||
|
// Toast.show(msg: "标记成功");
|
||||||
|
// setState(() {});
|
||||||
|
// } else {
|
||||||
|
// Toast.show(msg: '操作失败');
|
||||||
|
// }
|
||||||
|
|
||||||
|
var entity = await ApiRepository.to.setRoomStatusData(
|
||||||
|
lockId: state.keyInfo.value.lockId!,
|
||||||
|
roomStatus:1,
|
||||||
|
);
|
||||||
|
if(entity.errorCode!.codeIsSuccessful){
|
||||||
print("标记为已入住成功啦啦啦啦啦");
|
print("标记为已入住成功啦啦啦啦啦");
|
||||||
Toast.show(msg: "标记成功");
|
Toast.show(msg: "标记成功");
|
||||||
setState(() {});
|
setState(() {});
|
||||||
} else {
|
|
||||||
Toast.show(msg: '操作失败');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -62,7 +62,7 @@ class _CheckingInSetPageState extends State<CheckingInSetPage> {
|
|||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () async {
|
action: () async {
|
||||||
var data = await Get.toNamed(Routers.checkingInSetWorkTimePage, arguments: {
|
var data = await Get.toNamed(Routers.checkingInSetWorkTimePage, arguments: {
|
||||||
"getKeyInfosData": state.getKeyInfosData.value,
|
// "getKeyInfosData": state.getKeyInfosData.value,
|
||||||
"companyId": state.companyId.value,
|
"companyId": state.companyId.value,
|
||||||
"pushType": "2",
|
"pushType": "2",
|
||||||
"checkingInSetInfo": state.checkingInSetInfo.value,
|
"checkingInSetInfo": state.checkingInSetInfo.value,
|
||||||
|
|||||||
@ -5,7 +5,7 @@ import '../../../lockMian/entity/lockListInfo_entity.dart';
|
|||||||
import '../checkingInSet/checkingInSet_entity.dart';
|
import '../checkingInSet/checkingInSet_entity.dart';
|
||||||
|
|
||||||
class CheckingInSetWorkTimeState{
|
class CheckingInSetWorkTimeState{
|
||||||
final getKeyInfosData = LockListInfoItemEntity().obs;
|
// final getKeyInfosData = LockListInfoItemEntity().obs;
|
||||||
final checkingInSetInfo = CheckingInSetInfo().obs;
|
final checkingInSetInfo = CheckingInSetInfo().obs;
|
||||||
final companyId = "".obs;
|
final companyId = "".obs;
|
||||||
|
|
||||||
@ -19,7 +19,7 @@ class CheckingInSetWorkTimeState{
|
|||||||
CheckingInSetWorkTimeState() {
|
CheckingInSetWorkTimeState() {
|
||||||
Map map = Get.arguments;
|
Map map = Get.arguments;
|
||||||
pushType.value = map["pushType"];
|
pushType.value = map["pushType"];
|
||||||
getKeyInfosData.value = map["getKeyInfosData"];
|
// getKeyInfosData.value = map["getKeyInfosData"];
|
||||||
companyId.value = map["companyId"];
|
companyId.value = map["companyId"];
|
||||||
checkingInSetInfo.value = map["checkingInSetInfo"];
|
checkingInSetInfo.value = map["checkingInSetInfo"];
|
||||||
if(pushType.value != "0"){
|
if(pushType.value != "0"){
|
||||||
|
|||||||
@ -165,7 +165,8 @@ class CheckingInAddStaffLogic extends BaseGetXController{
|
|||||||
"0",
|
"0",
|
||||||
'0',
|
'0',
|
||||||
0,
|
0,
|
||||||
0);
|
0,
|
||||||
|
1);
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
print('获取密码成功');
|
print('获取密码成功');
|
||||||
if (entity.data != null) {
|
if (entity.data != null) {
|
||||||
|
|||||||
@ -152,12 +152,14 @@ class _ElectronicKeyDetailPageState extends State<ElectronicKeyDetailPage> {
|
|||||||
'${startDateStr.toLocal().toString().substring(0, 16)}\n${endDateStr.toLocal().toString().substring(0, 16)}';
|
'${startDateStr.toLocal().toString().substring(0, 16)}\n${endDateStr.toLocal().toString().substring(0, 16)}';
|
||||||
} else if (indexEntity.keyType == XSConstantMacro.keyTypeLong) {
|
} else if (indexEntity.keyType == XSConstantMacro.keyTypeLong) {
|
||||||
//永久
|
//永久
|
||||||
DateTime dateStr = DateTime.fromMillisecondsSinceEpoch(indexEntity.date!);
|
// DateTime dateStr = DateTime.fromMillisecondsSinceEpoch(indexEntity.date!);
|
||||||
useDateStr = '${dateStr.toLocal().toString().substring(0, 16)}\n 永久';
|
// useDateStr = '${dateStr.toLocal().toString().substring(0, 16)}\n 永久';
|
||||||
|
useDateStr = '永久';
|
||||||
} else if (indexEntity.keyType == XSConstantMacro.keyTypeOnce) {
|
} else if (indexEntity.keyType == XSConstantMacro.keyTypeOnce) {
|
||||||
//单次
|
//单次
|
||||||
DateTime dateStr = DateTime.fromMillisecondsSinceEpoch(indexEntity.date!);
|
// DateTime dateStr = DateTime.fromMillisecondsSinceEpoch(indexEntity.date!);
|
||||||
useDateStr = '${dateStr.toLocal().toString().substring(0, 16)}\n 单次';
|
// useDateStr = '${dateStr.toLocal().toString().substring(0, 16)}\n 单次';
|
||||||
|
useDateStr = '单次';
|
||||||
} else if (indexEntity.keyType == XSConstantMacro.keyTypeLoop) {
|
} else if (indexEntity.keyType == XSConstantMacro.keyTypeLoop) {
|
||||||
//循环
|
//循环
|
||||||
useDateStr = '循环';
|
useDateStr = '循环';
|
||||||
@ -169,7 +171,7 @@ class _ElectronicKeyDetailPageState extends State<ElectronicKeyDetailPage> {
|
|||||||
//发送时间
|
//发送时间
|
||||||
String getSenderDate(ElectronicKeyListItem indexEntity) {
|
String getSenderDate(ElectronicKeyListItem indexEntity) {
|
||||||
String senderDate = '';
|
String senderDate = '';
|
||||||
DateTime dateStr = DateTime.fromMillisecondsSinceEpoch(indexEntity.date!);
|
DateTime dateStr = DateTime.fromMillisecondsSinceEpoch(indexEntity.sendDate!);
|
||||||
senderDate = dateStr.toLocal().toString().substring(0, 16);
|
senderDate = dateStr.toLocal().toString().substring(0, 16);
|
||||||
return senderDate;
|
return senderDate;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -83,7 +83,7 @@ class ElectronicKeyListItem {
|
|||||||
String? remarks;
|
String? remarks;
|
||||||
int? isCameraEnable;
|
int? isCameraEnable;
|
||||||
int? faceAuthentication;
|
int? faceAuthentication;
|
||||||
int? date;
|
int? sendDate;
|
||||||
int? remoteEnable;
|
int? remoteEnable;
|
||||||
int? appUnlockMustOnline;
|
int? appUnlockMustOnline;
|
||||||
List? weekDays;
|
List? weekDays;
|
||||||
@ -105,7 +105,7 @@ class ElectronicKeyListItem {
|
|||||||
this.remarks,
|
this.remarks,
|
||||||
this.isCameraEnable,
|
this.isCameraEnable,
|
||||||
this.faceAuthentication,
|
this.faceAuthentication,
|
||||||
this.date,
|
this.sendDate,
|
||||||
this.remoteEnable,
|
this.remoteEnable,
|
||||||
this.appUnlockMustOnline,
|
this.appUnlockMustOnline,
|
||||||
this.weekDays});
|
this.weekDays});
|
||||||
@ -131,7 +131,7 @@ class ElectronicKeyListItem {
|
|||||||
json['faceAuthentication'] != null
|
json['faceAuthentication'] != null
|
||||||
? faceAuthentication = json['faceAuthentication']
|
? faceAuthentication = json['faceAuthentication']
|
||||||
: 0;
|
: 0;
|
||||||
date = json['date'];
|
sendDate = json['sendDate'];
|
||||||
remoteEnable = json['remoteEnable'];
|
remoteEnable = json['remoteEnable'];
|
||||||
appUnlockMustOnline = json['appUnlockMustOnline'];
|
appUnlockMustOnline = json['appUnlockMustOnline'];
|
||||||
json['weekDays'] != null ? weekDays = json['weekDays'] : [];
|
json['weekDays'] != null ? weekDays = json['weekDays'] : [];
|
||||||
@ -155,7 +155,7 @@ class ElectronicKeyListItem {
|
|||||||
data['remarks'] = remarks;
|
data['remarks'] = remarks;
|
||||||
data['isCameraEnable'] = isCameraEnable;
|
data['isCameraEnable'] = isCameraEnable;
|
||||||
data['faceAuthentication'] = faceAuthentication;
|
data['faceAuthentication'] = faceAuthentication;
|
||||||
data['date'] = date;
|
data['sendDate'] = sendDate;
|
||||||
data['remoteEnable'] = remoteEnable;
|
data['remoteEnable'] = remoteEnable;
|
||||||
data['appUnlockMustOnline'] = appUnlockMustOnline;
|
data['appUnlockMustOnline'] = appUnlockMustOnline;
|
||||||
data['weekDays'] = weekDays;
|
data['weekDays'] = weekDays;
|
||||||
|
|||||||
@ -394,14 +394,24 @@ class _SendElectronicKeyPageState extends State<SendElectronicKeyPage> {
|
|||||||
|
|
||||||
//标记房间为已入住 isOn:已入住: 1 空闲:2
|
//标记房间为已入住 isOn:已入住: 1 空闲:2
|
||||||
Future<void> updateRoomCheckIn() async {
|
Future<void> updateRoomCheckIn() async {
|
||||||
var entity = await ApiRepository.to
|
// var entity = await ApiRepository.to
|
||||||
.updateSetting(state.keyInfo.value.lockId.toString(), '1', '13');
|
// .updateSetting(state.keyInfo.value.lockId.toString(), '1', '13');
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
// if (entity.errorCode!.codeIsSuccessful) {
|
||||||
|
// print("标记为已入住成功啦啦啦啦啦");
|
||||||
|
// Toast.show(msg: "标记成功");
|
||||||
|
// setState(() {});
|
||||||
|
// } else {
|
||||||
|
// Toast.show(msg: '操作失败');
|
||||||
|
// }
|
||||||
|
|
||||||
|
var entity = await ApiRepository.to.setRoomStatusData(
|
||||||
|
lockId: state.keyInfo.value.lockId!,
|
||||||
|
roomStatus:1,
|
||||||
|
);
|
||||||
|
if(entity.errorCode!.codeIsSuccessful){
|
||||||
print("标记为已入住成功啦啦啦啦啦");
|
print("标记为已入住成功啦啦啦啦啦");
|
||||||
Toast.show(msg: "标记成功");
|
Toast.show(msg: "标记成功");
|
||||||
setState(() {});
|
setState(() {});
|
||||||
} else {
|
|
||||||
Toast.show(msg: '操作失败');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -7,7 +7,6 @@ import 'package:star_lock/tools/baseGetXController.dart';
|
|||||||
import '../../../../blue/blue_manage.dart';
|
import '../../../../blue/blue_manage.dart';
|
||||||
import '../../../../blue/io_protocol/io_readSupportFunctionsWithParameters.dart';
|
import '../../../../blue/io_protocol/io_readSupportFunctionsWithParameters.dart';
|
||||||
import '../../../../blue/io_reply.dart';
|
import '../../../../blue/io_reply.dart';
|
||||||
import '../../../../blue/io_tool/io_manager.dart';
|
|
||||||
import '../../../../blue/io_tool/io_tool.dart';
|
import '../../../../blue/io_tool/io_tool.dart';
|
||||||
import '../../../../blue/io_tool/manager_event_bus.dart';
|
import '../../../../blue/io_tool/manager_event_bus.dart';
|
||||||
import '../../../../blue/sender_manage.dart';
|
import '../../../../blue/sender_manage.dart';
|
||||||
@ -20,26 +19,16 @@ import 'automaticBlocking_state.dart';
|
|||||||
class AutomaticBlockingLogic extends BaseGetXController{
|
class AutomaticBlockingLogic extends BaseGetXController{
|
||||||
final AutomaticBlockingState state = AutomaticBlockingState();
|
final AutomaticBlockingState state = AutomaticBlockingState();
|
||||||
|
|
||||||
void _setAutoUnLock() async{
|
void setAutoUnLock() async{
|
||||||
String autoTime;
|
|
||||||
if(state.isOpen.value == false){
|
|
||||||
autoTime = "-1";
|
|
||||||
}else{
|
|
||||||
if(state.isCustomLockTime.value == true){
|
|
||||||
autoTime = state.timeController.text;
|
|
||||||
}else{
|
|
||||||
autoTime = state.autoLockTime.value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var entity = await ApiRepository.to.setAutoUnlock(
|
var entity = await ApiRepository.to.setAutoUnlock(
|
||||||
lockId: state.lockSetInfoData.value.lockId!,
|
lockId: state.lockSetInfoData.value.lockId!,
|
||||||
autoLockTime:int.parse(autoTime),
|
autoLock:state.isOpen.value == true ? 1 : 0,
|
||||||
type: 1,
|
autoLockSecond: int.parse(state.autoLockTime.value),
|
||||||
);
|
);
|
||||||
if(entity.errorCode!.codeIsSuccessful){
|
if(entity.errorCode!.codeIsSuccessful){
|
||||||
state.autoLockTime.value = state.isOpen.value == false ? "0" : autoTime;
|
|
||||||
state.lockSetInfoData.value.lockSettingInfo!.autoLockSecond = int.parse(autoTime);
|
state.autoLockTime.value = state.isOpen.value == false ? "0" : state.autoLockTime.value;
|
||||||
|
state.lockSetInfoData.value.lockSettingInfo!.autoLockSecond = int.parse(state.autoLockTime.value);
|
||||||
eventBus.fire(RefreshLockListInfoDataEvent());
|
eventBus.fire(RefreshLockListInfoDataEvent());
|
||||||
eventBus.fire(PassCurrentLockInformationEvent(state.lockSetInfoData.value));
|
eventBus.fire(PassCurrentLockInformationEvent(state.lockSetInfoData.value));
|
||||||
Toast.show(msg: "操作成功");
|
Toast.show(msg: "操作成功");
|
||||||
@ -101,7 +90,7 @@ class AutomaticBlockingLogic extends BaseGetXController{
|
|||||||
case 0x00:
|
case 0x00:
|
||||||
//成功
|
//成功
|
||||||
print("${reply.commandType}数据解析成功");
|
print("${reply.commandType}数据解析成功");
|
||||||
_setAutoUnLock();
|
setAutoUnLock();
|
||||||
break;
|
break;
|
||||||
case 0x06:
|
case 0x06:
|
||||||
//无权限
|
//无权限
|
||||||
|
|||||||
@ -27,11 +27,9 @@ class CheckInCreatCompanyLogic extends BaseGetXController{
|
|||||||
|
|
||||||
// 设置考勤
|
// 设置考勤
|
||||||
void setLockSetGeneralSetting() async{
|
void setLockSetGeneralSetting() async{
|
||||||
var entity = await ApiRepository.to.setLockSetGeneralSettingData(
|
var entity = await ApiRepository.to.setCheckInData(
|
||||||
lockId: state.lockSetInfoData.value.lockId.toString(),
|
lockId: state.lockSetInfoData.value.lockId!,
|
||||||
changeType:"1",
|
attendance:1,
|
||||||
isOn:"1",
|
|
||||||
type:"1",
|
|
||||||
);
|
);
|
||||||
if(entity.errorCode!.codeIsSuccessful){
|
if(entity.errorCode!.codeIsSuccessful){
|
||||||
eventBus.fire(RefreshLockListInfoDataEvent());
|
eventBus.fire(RefreshLockListInfoDataEvent());
|
||||||
|
|||||||
@ -46,7 +46,7 @@ class _CheckInCreatCompanyPageState extends State<CheckInCreatCompanyPage> {
|
|||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () async {
|
action: () async {
|
||||||
var data = await Get.toNamed(Routers.checkingInSetWorkTimePage, arguments: {
|
var data = await Get.toNamed(Routers.checkingInSetWorkTimePage, arguments: {
|
||||||
"getKeyInfosData": state.lockSetInfoData.value,
|
// "getKeyInfosData": state.lockSetInfoData.value,
|
||||||
"companyId": "1",
|
"companyId": "1",
|
||||||
"pushType": "0",
|
"pushType": "0",
|
||||||
"checkingInSetInfo": CheckingInSetInfo(),
|
"checkingInSetInfo": CheckingInSetInfo(),
|
||||||
|
|||||||
@ -64,7 +64,8 @@ class _LockEscalationPageState extends State<LockEscalationPage> {
|
|||||||
height: 10.h,
|
height: 10.h,
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
"${TranslationLoader.lanKeys!.newVersion!.tr}:1.0.1",
|
// "${TranslationLoader.lanKeys!.newVersion!.tr}:1.0.1",
|
||||||
|
"未发现新版本",
|
||||||
style: TextStyle(color: AppColors.mainColor, fontSize: 18.sp),
|
style: TextStyle(color: AppColors.mainColor, fontSize: 18.sp),
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
|
|||||||
@ -403,7 +403,7 @@ class LockSettingInfo {
|
|||||||
int? lightingTime;
|
int? lightingTime;
|
||||||
int? lightingSecond;
|
int? lightingSecond;
|
||||||
int? passageMode;
|
int? passageMode;
|
||||||
List<int>? passageModeConfig;
|
List<PassageModeConfig>? passageModeConfig;
|
||||||
int? attendance;
|
int? attendance;
|
||||||
int? appUnlockOnline;
|
int? appUnlockOnline;
|
||||||
int? bluetoothBroadcast;
|
int? bluetoothBroadcast;
|
||||||
@ -451,7 +451,12 @@ class LockSettingInfo {
|
|||||||
lightingTime = json['lightingTime'];
|
lightingTime = json['lightingTime'];
|
||||||
lightingSecond = json['lightingSecond'];
|
lightingSecond = json['lightingSecond'];
|
||||||
passageMode = json['passageMode'];
|
passageMode = json['passageMode'];
|
||||||
passageModeConfig = json['passageModeConfig'].cast<int>();
|
if (json['passageModeConfig'] != null) {
|
||||||
|
passageModeConfig = <PassageModeConfig>[];
|
||||||
|
json['passageModeConfig'].forEach((v) {
|
||||||
|
passageModeConfig!.add(PassageModeConfig.fromJson(v));
|
||||||
|
});
|
||||||
|
}
|
||||||
attendance = json['attendance'];
|
attendance = json['attendance'];
|
||||||
appUnlockOnline = json['appUnlockOnline'];
|
appUnlockOnline = json['appUnlockOnline'];
|
||||||
bluetoothBroadcast = json['bluetoothBroadcast'];
|
bluetoothBroadcast = json['bluetoothBroadcast'];
|
||||||
@ -477,7 +482,10 @@ class LockSettingInfo {
|
|||||||
data['lightingTime'] = lightingTime;
|
data['lightingTime'] = lightingTime;
|
||||||
data['lightingSecond'] = lightingSecond;
|
data['lightingSecond'] = lightingSecond;
|
||||||
data['passageMode'] = passageMode;
|
data['passageMode'] = passageMode;
|
||||||
data['passageModeConfig'] = passageModeConfig;
|
if (passageModeConfig != null) {
|
||||||
|
data['passageModeConfig'] =
|
||||||
|
passageModeConfig!.map((v) => v.toJson()).toList();
|
||||||
|
}
|
||||||
data['attendance'] = attendance;
|
data['attendance'] = attendance;
|
||||||
data['appUnlockOnline'] = appUnlockOnline;
|
data['appUnlockOnline'] = appUnlockOnline;
|
||||||
data['bluetoothBroadcast'] = bluetoothBroadcast;
|
data['bluetoothBroadcast'] = bluetoothBroadcast;
|
||||||
@ -488,3 +496,29 @@ class LockSettingInfo {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class PassageModeConfig {
|
||||||
|
int? startDate;
|
||||||
|
int? endDate;
|
||||||
|
List<int>? weekDays;
|
||||||
|
int? isAllDay;
|
||||||
|
|
||||||
|
PassageModeConfig(
|
||||||
|
{this.startDate, this.endDate, this.weekDays, this.isAllDay});
|
||||||
|
|
||||||
|
PassageModeConfig.fromJson(Map<String, dynamic> json) {
|
||||||
|
startDate = json['startDate'];
|
||||||
|
endDate = json['endDate'];
|
||||||
|
weekDays = json['weekDays'].cast<int>();
|
||||||
|
isAllDay = json['isAllDay'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
data['startDate'] = startDate;
|
||||||
|
data['endDate'] = endDate;
|
||||||
|
data['weekDays'] = weekDays;
|
||||||
|
data['isAllDay'] = isAllDay;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@ -64,8 +64,7 @@ class LockSetLogic extends BaseGetXController {
|
|||||||
print("${reply.commandType}需要鉴权");
|
print("${reply.commandType}需要鉴权");
|
||||||
|
|
||||||
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
||||||
List<int> getPrivateKeyList =
|
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
||||||
changeStringListToIntList(privateKey!);
|
|
||||||
|
|
||||||
var publicKey = await Storage.getStringList(saveBluePublicKey);
|
var publicKey = await Storage.getStringList(saveBluePublicKey);
|
||||||
List<int> publicKeyDataList = changeStringListToIntList(publicKey!);
|
List<int> publicKeyDataList = changeStringListToIntList(publicKey!);
|
||||||
@ -218,6 +217,7 @@ class LockSetLogic extends BaseGetXController {
|
|||||||
state.lockSettingInfo.value = state.lockSetInfoData.value.lockSettingInfo!;
|
state.lockSettingInfo.value = state.lockSetInfoData.value.lockSettingInfo!;
|
||||||
state.lockFeature.value = state.lockSetInfoData.value.lockFeature!;
|
state.lockFeature.value = state.lockSetInfoData.value.lockFeature!;
|
||||||
state.lockStatus.value = state.lockSetInfoData.value.lockStatus!;
|
state.lockStatus.value = state.lockSetInfoData.value.lockStatus!;
|
||||||
|
state.isAttendance.value = state.lockSettingInfo.value.attendance!;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -291,34 +291,32 @@ class LockSetLogic extends BaseGetXController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 设置是否打开考勤
|
// 设置是否打开考勤
|
||||||
void setLockSetGeneralSetting(String isOn) async {
|
void setLockSetGeneralSetting() async {
|
||||||
var entity = await ApiRepository.to.setLockSetGeneralSettingData(
|
var entity = await ApiRepository.to.setCheckInData(
|
||||||
lockId: state.lockSetInfoData.value.lockId.toString(),
|
lockId: state.lockSetInfoData.value.lockId!,
|
||||||
changeType: "1",
|
attendance:state.isAttendance.value == 1 ? 0 : 1,
|
||||||
isOn: isOn,
|
|
||||||
type: "1",
|
|
||||||
);
|
);
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if(entity.errorCode!.codeIsSuccessful){
|
||||||
eventBus.fire(RefreshLockListInfoDataEvent());
|
eventBus.fire(RefreshLockListInfoDataEvent());
|
||||||
|
|
||||||
// state.lockSetInfoData.value.attendance = int.parse(isOn);
|
state.isAttendance.value = (state.isAttendance.value == 1 ? 0 : 1);
|
||||||
// eventBus.fire(PassCurrentLockInformationEvent(state.getKeyInfosData.value));
|
state.lockSettingInfo.value.attendance = state.isAttendance.value;
|
||||||
|
print("state.lockSettingInfo.value.attendance:${state.lockSettingInfo.value.attendance}");
|
||||||
Toast.show(msg: "设置成功");
|
Toast.show(msg: "设置成功");
|
||||||
} else {}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 设置是否打开开锁提醒
|
// 设置是否打开开锁提醒
|
||||||
void setLockPickingReminder() async {
|
void setLockPickingReminder() async {
|
||||||
var entity = await ApiRepository.to.setLockPickingReminderData(
|
var entity = await ApiRepository.to.setLockPickingReminderData(
|
||||||
lockId: state.lockSetInfoData.value.lockId.toString(),
|
lockId: state.lockSetInfoData.value.lockId!,
|
||||||
keyId: state.lockSetInfoData.value.lockBasicInfo!.keyId.toString(),
|
unlockReminderPush: state.isLockPickingReminder.value == 1 ? 0 : 1,
|
||||||
monitorFlag: state.isLockPickingReminder.value == 1 ? "1" : "2", // 1开启,2关闭
|
|
||||||
);
|
);
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
eventBus.fire(RefreshLockListInfoDataEvent());
|
eventBus.fire(RefreshLockListInfoDataEvent());
|
||||||
|
|
||||||
// state.lockSetInfoData.value.unlockReminder = state.isLockPickingReminder.value;
|
state.isLockPickingReminder.value = (state.isLockPickingReminder.value == 1 ? 0 : 1);
|
||||||
// eventBus.fire(PassCurrentLockInformationEvent(state.getKeyInfosData.value));
|
state.lockSettingInfo.value.unlockReminderPush = state.isLockPickingReminder.value;
|
||||||
Toast.show(msg: "设置成功");
|
Toast.show(msg: "设置成功");
|
||||||
} else {}
|
} else {}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -188,8 +188,8 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
|
|||||||
SizedBox(height: 10.h),
|
SizedBox(height: 10.h),
|
||||||
// 常开模式
|
// 常开模式
|
||||||
Obx(() => Visibility(
|
Obx(() => Visibility(
|
||||||
// visible: state.lockFeature.value.passageMode == 1 ? true : false,
|
visible: state.lockFeature.value.passageMode == 1 ? true : false,
|
||||||
visible:true,
|
// visible:true,
|
||||||
child: CommonItem(
|
child: CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.normallyOpenMode!.tr,
|
leftTitel: TranslationLoader.lanKeys!.normallyOpenMode!.tr,
|
||||||
rightTitle: (state.lockSettingInfo.value.passageMode ?? 0) == 1
|
rightTitle: (state.lockSettingInfo.value.passageMode ?? 0) == 1
|
||||||
@ -320,20 +320,23 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
|
|||||||
// 标记房态
|
// 标记房态
|
||||||
Obx(() {
|
Obx(() {
|
||||||
var title = "";
|
var title = "";
|
||||||
if (state.lockSettingInfo.value.passageMode == 1) {
|
if (state.lockStatus.value.roomStatus == 1) {
|
||||||
title = TranslationLoader.lanKeys!.checkedIn!.tr;
|
title = TranslationLoader.lanKeys!.checkedIn!.tr;
|
||||||
} else if (state.lockSettingInfo.value.passageMode == 2) {
|
} else if (state.lockStatus.value.roomStatus == 0) {
|
||||||
title = TranslationLoader.lanKeys!.leisure!.tr;
|
title = TranslationLoader.lanKeys!.leisure!.tr;
|
||||||
}
|
}
|
||||||
return Visibility(
|
return Visibility(
|
||||||
visible: state.lockStatus.value.roomStatus == 1 ? true : false,
|
visible: state.lockStatus.value.roomStatus == 1 ? true : false,
|
||||||
|
// visible: true,
|
||||||
child: CommonItem(
|
child: CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.markedHouseState!.tr,
|
leftTitel: TranslationLoader.lanKeys!.markedHouseState!.tr,
|
||||||
rightTitle: title,
|
rightTitle: title,
|
||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () {
|
action: () {
|
||||||
Get.toNamed(Routers.markedHouseStatePage, arguments: state.lockSetInfoData.value);
|
Get.toNamed(Routers.markedHouseStatePage, arguments: {
|
||||||
|
'lockSetInfoData': state.lockSetInfoData.value
|
||||||
|
});
|
||||||
}));
|
}));
|
||||||
}),
|
}),
|
||||||
// 考勤
|
// 考勤
|
||||||
@ -470,28 +473,20 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
|
|||||||
}
|
}
|
||||||
|
|
||||||
CupertinoSwitch _openCheckInSwitch() {
|
CupertinoSwitch _openCheckInSwitch() {
|
||||||
|
print("111111state.lockSettingInfo.value.attendance:${state.lockSettingInfo.value.attendance}");
|
||||||
return CupertinoSwitch(
|
return CupertinoSwitch(
|
||||||
activeColor: CupertinoColors.activeBlue,
|
activeColor: CupertinoColors.activeBlue,
|
||||||
trackColor: CupertinoColors.systemGrey5,
|
trackColor: CupertinoColors.systemGrey5,
|
||||||
thumbColor: CupertinoColors.white,
|
thumbColor: CupertinoColors.white,
|
||||||
value: ((state.lockSettingInfo.value.attendance ?? 0) == 1) ? true : false,
|
value: ((state.isAttendance.value) == 1) ? true : false,
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
setState(() {
|
|
||||||
int isOnStr;
|
|
||||||
if (value == true) {
|
|
||||||
isOnStr = 1;
|
|
||||||
} else {
|
|
||||||
isOnStr = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
logic.openCheckingInData((checkingInInfoDataEntity) {
|
logic.openCheckingInData((checkingInInfoDataEntity) {
|
||||||
if (checkingInInfoDataEntity.data!.companyId == 0) {
|
if (checkingInInfoDataEntity.data!.companyId == 0) {
|
||||||
showCupertinoAlertDialog(context);
|
showCupertinoAlertDialog(context);
|
||||||
} else {
|
} else {
|
||||||
logic.setLockSetGeneralSetting(isOnStr.toString());
|
logic.setLockSetGeneralSetting();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -501,10 +496,9 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
|
|||||||
activeColor: CupertinoColors.activeBlue,
|
activeColor: CupertinoColors.activeBlue,
|
||||||
trackColor: CupertinoColors.systemGrey5,
|
trackColor: CupertinoColors.systemGrey5,
|
||||||
thumbColor: CupertinoColors.white,
|
thumbColor: CupertinoColors.white,
|
||||||
value: (state.lockSettingInfo.value.unlockReminder ?? 0) == 1 ? true : false,
|
value: (state.isLockPickingReminder.value) == 1 ? true : false,
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
setState(() {
|
setState(() {
|
||||||
state.isLockPickingReminder.value = state.isLockPickingReminder.value == 1 ? 2 : 1;
|
|
||||||
logic.setLockPickingReminder();
|
logic.setLockPickingReminder();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|||||||
@ -11,9 +11,9 @@ class LockSetState {
|
|||||||
|
|
||||||
final lockId = 0.obs;
|
final lockId = 0.obs;
|
||||||
|
|
||||||
var isAttendance = 1.obs;// 是否开启考勤
|
var isAttendance = 0.obs;// 是否开启考勤
|
||||||
var currentDeviceUUid = "".obs;// 当前设备的uuid
|
var currentDeviceUUid = "".obs;// 当前设备的uuid
|
||||||
var isLockPickingReminder = 1.obs;// 是否开启开锁提醒
|
var isLockPickingReminder = 0.obs;// 是否开启开锁提醒
|
||||||
var passwordTF = TextEditingController();
|
var passwordTF = TextEditingController();
|
||||||
|
|
||||||
LockSetState() {
|
LockSetState() {
|
||||||
|
|||||||
@ -28,7 +28,7 @@ class GetServerDatetimeEntity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class Data {
|
class Data {
|
||||||
String? date;
|
int? date;
|
||||||
|
|
||||||
Data(
|
Data(
|
||||||
{this.date});
|
{this.date});
|
||||||
|
|||||||
@ -186,7 +186,7 @@ class LockTimeLogic extends BaseGetXController{
|
|||||||
lockId: state.lockSetInfoData.value.lockId.toString(),
|
lockId: state.lockSetInfoData.value.lockId.toString(),
|
||||||
);
|
);
|
||||||
if(entity.errorCode!.codeIsSuccessful){
|
if(entity.errorCode!.codeIsSuccessful){
|
||||||
String dataEime = DateTool().dateToYMDHNSString("${int.parse(entity.data!.date!)}");
|
String dataEime = DateTool().dateToYMDHNSString("${entity.data!.date!}");
|
||||||
state.dateTime.value = dataEime;
|
state.dateTime.value = dataEime;
|
||||||
sendTiming();
|
sendTiming();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -53,19 +53,19 @@ class _LockTimePageState extends State<LockTimePage> {
|
|||||||
padding: EdgeInsets.only(top: 20.w, bottom: 20.w),
|
padding: EdgeInsets.only(top: 20.w, bottom: 20.w),
|
||||||
onClick: () {
|
onClick: () {
|
||||||
// print("1111111");
|
// print("1111111");
|
||||||
// logic.sendTiming();
|
logic.sendTiming();
|
||||||
logic.getServerDatetime();
|
// logic.getServerDatetime();
|
||||||
}),
|
}),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 40.h,
|
height: 40.h,
|
||||||
),
|
),
|
||||||
GestureDetector(
|
// GestureDetector(
|
||||||
onTap: () {},
|
// onTap: () {},
|
||||||
child: Container(
|
// child: Container(
|
||||||
child: Text(TranslationLoader.lanKeys!.setTheDSTMode!.tr,
|
// child: Text(TranslationLoader.lanKeys!.setTheDSTMode!.tr,
|
||||||
style: TextStyle(
|
// style: TextStyle(
|
||||||
fontSize: 24.sp, color: AppColors.mainColor))),
|
// fontSize: 24.sp, color: AppColors.mainColor))),
|
||||||
),
|
// ),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
));
|
));
|
||||||
|
|||||||
@ -11,19 +11,16 @@ class MarkedHouseStateLogic extends BaseGetXController{
|
|||||||
MarkedHouseStateState state = MarkedHouseStateState();
|
MarkedHouseStateState state = MarkedHouseStateState();
|
||||||
|
|
||||||
// 标记房态
|
// 标记房态
|
||||||
Future<void> setLockSetGeneralSetting() async{
|
Future<void> setRoomStatusData() async{
|
||||||
var entity = await ApiRepository.to.setLockSetGeneralSettingData(
|
var entity = await ApiRepository.to.setRoomStatusData(
|
||||||
lockId: state.getKeyInfosData.value.lockId.toString(),
|
lockId: state.lockSetInfoData.value.lockId!,
|
||||||
changeType:"1",
|
roomStatus:state.roomStatus.value,
|
||||||
isOn:state.roomStatus.value.toString(), // 已入住: 1 空闲:2
|
|
||||||
type:"13", // 标记房态
|
|
||||||
);
|
);
|
||||||
if(entity.errorCode!.codeIsSuccessful){
|
if(entity.errorCode!.codeIsSuccessful){
|
||||||
eventBus.fire(RefreshLockListInfoDataEvent());
|
eventBus.fire(RefreshLockListInfoDataEvent());
|
||||||
|
|
||||||
state.roomStatus.value = state.roomStatus.value;
|
state.lockSetInfoData.value.lockStatus!.roomStatus = state.roomStatus.value;
|
||||||
// state.getKeyInfosData.value.antiPrySwitch = state.roomStatus.value;
|
eventBus.fire(PassCurrentLockInformationEvent(state.lockSetInfoData.value));
|
||||||
// eventBus.fire(PassCurrentLockInformationEvent(state.lockSetInfoData.value.lockSetting!));
|
|
||||||
Toast.show(msg: "操作成功");
|
Toast.show(msg: "操作成功");
|
||||||
}else if(entity.errorCode! == 1){
|
}else if(entity.errorCode! == 1){
|
||||||
// 跳转到高级功能界面 需要开通高级功能
|
// 跳转到高级功能界面 需要开通高级功能
|
||||||
@ -31,5 +28,4 @@ class MarkedHouseStateLogic extends BaseGetXController{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -38,13 +38,13 @@ class _MarkedHouseStatePageState extends State<MarkedHouseStatePage> {
|
|||||||
rightWidget: GestureDetector(
|
rightWidget: GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
setState(() {
|
setState(() {
|
||||||
state.roomStatus.value = 2;
|
state.roomStatus.value = 0;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Image.asset(
|
Image.asset(
|
||||||
state.roomStatus.value == 2 ? 'images/icon_round_selet.png' : 'images/icon_round_unSelet.png',
|
state.roomStatus.value == 0 ? 'images/icon_round_selet.png' : 'images/icon_round_unSelet.png',
|
||||||
width: 30.w,
|
width: 30.w,
|
||||||
height: 30.w,
|
height: 30.w,
|
||||||
),
|
),
|
||||||
@ -82,7 +82,7 @@ class _MarkedHouseStatePageState extends State<MarkedHouseStatePage> {
|
|||||||
// margin: EdgeInsets.only(left: 03.w, right: 30.w, top: 20.w),
|
// margin: EdgeInsets.only(left: 03.w, right: 30.w, top: 20.w),
|
||||||
padding: EdgeInsets.only(top: 20.w, bottom: 20.w),
|
padding: EdgeInsets.only(top: 20.w, bottom: 20.w),
|
||||||
onClick: () {
|
onClick: () {
|
||||||
logic.setLockSetGeneralSetting();
|
logic.setRoomStatusData();
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
));
|
));
|
||||||
|
|||||||
@ -6,13 +6,13 @@ import '../lockSet/lockSetInfo_entity.dart';
|
|||||||
|
|
||||||
class MarkedHouseStateState{
|
class MarkedHouseStateState{
|
||||||
var lockSetInfoData = LockSetInfoData().obs;
|
var lockSetInfoData = LockSetInfoData().obs;
|
||||||
final getKeyInfosData = LockListInfoItemEntity().obs;
|
|
||||||
|
|
||||||
var roomStatus = 0.obs;
|
var roomStatus = 0.obs;
|
||||||
|
|
||||||
MarkedHouseStateState() {
|
MarkedHouseStateState() {
|
||||||
var map = Get.arguments;
|
var map = Get.arguments;
|
||||||
lockSetInfoData.value = map["lockSetInfoData"];
|
lockSetInfoData.value = map["lockSetInfoData"];
|
||||||
getKeyInfosData.value = map["keyInfo"];
|
|
||||||
|
roomStatus.value = lockSetInfoData.value.lockStatus!.roomStatus!;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -23,42 +23,30 @@ import 'normallyOpenMode_state.dart';
|
|||||||
class NormallyOpenModeLogic extends BaseGetXController{
|
class NormallyOpenModeLogic extends BaseGetXController{
|
||||||
NormallyOpenModeState state = NormallyOpenModeState();
|
NormallyOpenModeState state = NormallyOpenModeState();
|
||||||
|
|
||||||
// 获取锁的常开模式设置
|
|
||||||
void getNormallyOpenModeConfig() async{
|
|
||||||
var entity = await ApiRepository.to.getPassageModeConfig(
|
|
||||||
lockId: state.lockSetInfoData.value.lockId.toString(),
|
|
||||||
);
|
|
||||||
if(entity.errorCode!.codeIsSuccessful){
|
|
||||||
state.getPassageModeConfigData.value = entity;
|
|
||||||
state.isOpenNormallyOpenMode.value = state.getPassageModeConfigData.value.data!.passageMode == 1 ? true : false;
|
|
||||||
state.isOpenAutomaticUnLock.value = state.getPassageModeConfigData.value.data!.autoUnlock == 1 ? true : false;
|
|
||||||
state.isAllDay.value = state.getPassageModeConfigData.value.data!.isAllDay == 1 ? 1 : 2;
|
|
||||||
state.weekDays.value = state.getPassageModeConfigData.value.data!.weekDays!;
|
|
||||||
|
|
||||||
state.beginTimeMinute.value = state.getPassageModeConfigData.value.data!.startDate!;
|
|
||||||
state.beginTime.value = "${state.getPassageModeConfigData.value.data!.startDate!~/60}:${state.getPassageModeConfigData.value.data!.startDate! % 60}";
|
|
||||||
state.endTimeMinute.value = state.getPassageModeConfigData.value.data!.endDate!;
|
|
||||||
state.endTime.value = "${state.getPassageModeConfigData.value.data!.endDate!~/60}:${state.getPassageModeConfigData.value.data!.endDate! % 60}";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 配置锁的常开模式设置
|
// 配置锁的常开模式设置
|
||||||
void configPassageMode() async{
|
void configPassageMode() async{
|
||||||
|
if(state.weekDays.value.isNotEmpty){
|
||||||
|
Toast.show(msg:"请选择常开日期");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if(state.endTimeMinute.value < state.beginTimeMinute.value){
|
if(state.endTimeMinute.value < state.beginTimeMinute.value){
|
||||||
Toast.show(msg:"结束时间不能小于开始时间哦");
|
Toast.show(msg:"结束时间不能小于开始时间哦");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
print("state.isOpenNormallyOpenMode.value:${state.isOpenNormallyOpenMode.value}");
|
var map = {
|
||||||
var entity = await ApiRepository.to.configPassageModeLoadData(
|
"isAllDay":state.isAllDay.value,
|
||||||
lockId: state.lockSetInfoData.value.lockId.toString(),
|
"weekDays":state.weekDays.value,
|
||||||
passageMode:state.isOpenNormallyOpenMode.value == true ? "1":"2",
|
"startDate":state.beginTimeMinute.value,
|
||||||
autoUnlock:state.isOpenAutomaticUnLock.value == true ? "1":"2",
|
"endDate":state.endTimeMinute.value,
|
||||||
type: "1",
|
};
|
||||||
startDate: state.beginTimeMinute.value.toString(),
|
|
||||||
endDate: state.endTimeMinute.value.toString(),
|
// print("state.isOpenNormallyOpenMode.value:${state.isOpenNormallyOpenMode.value}");
|
||||||
isAllDay: state.isAllDay.value == 1 ? "1":"2",
|
var entity = await ApiRepository.to.setNormallyModeData(
|
||||||
weekDays: state.weekDays,
|
lockId: state.lockSetInfoData.value.lockId!,
|
||||||
|
passageMode:state.isOpenNormallyOpenMode.value == true ? 1:0,
|
||||||
|
passageModeConfig: map,
|
||||||
);
|
);
|
||||||
if(entity.errorCode!.codeIsSuccessful){
|
if(entity.errorCode!.codeIsSuccessful){
|
||||||
eventBus.fire(RefreshLockListInfoDataEvent());
|
eventBus.fire(RefreshLockListInfoDataEvent());
|
||||||
@ -194,7 +182,7 @@ class NormallyOpenModeLogic extends BaseGetXController{
|
|||||||
list.add(state.endTimeMinute.value);
|
list.add(state.endTimeMinute.value);
|
||||||
list.add(state.isAllDay.value == 1 ? 1:0);
|
list.add(state.isAllDay.value == 1 ? 1:0);
|
||||||
list.add(0);
|
list.add(0);
|
||||||
list.add(state.isOpenAutomaticUnLock.value == true ? 1:0);
|
list.add(0);
|
||||||
|
|
||||||
IoSenderManage.setSupportFunctionsWithParametersCommand(
|
IoSenderManage.setSupportFunctionsWithParametersCommand(
|
||||||
keyID: state.lockSetInfoData.value.lockBasicInfo!.keyId.toString(),
|
keyID: state.lockSetInfoData.value.lockBasicInfo!.keyId.toString(),
|
||||||
@ -216,10 +204,6 @@ class NormallyOpenModeLogic extends BaseGetXController{
|
|||||||
super.onReady();
|
super.onReady();
|
||||||
print("onReady()");
|
print("onReady()");
|
||||||
|
|
||||||
if(state.lockSetInfoData.value.lockSettingInfo!.passageMode == 1){
|
|
||||||
getNormallyOpenModeConfig();
|
|
||||||
}
|
|
||||||
|
|
||||||
_initReplySubscription();
|
_initReplySubscription();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -67,36 +67,36 @@ class _NormallyOpenModePageState extends State<NormallyOpenModePage> {
|
|||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
CommonItem(
|
// CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.automaticUnLock!.tr,
|
// leftTitel: TranslationLoader.lanKeys!.automaticUnLock!.tr,
|
||||||
rightTitle: "",
|
// rightTitle: "",
|
||||||
isHaveLine: false,
|
// isHaveLine: false,
|
||||||
isHaveRightWidget: true,
|
// isHaveRightWidget: true,
|
||||||
rightWidget:
|
// rightWidget:
|
||||||
SizedBox(width: 60.w, height: 50.h, child: _autoUnlockSwitch())),
|
// SizedBox(width: 60.w, height: 50.h, child: _autoUnlockSwitch())),
|
||||||
Container(
|
// Container(
|
||||||
height: 1.h,
|
// height: 1.h,
|
||||||
color: AppColors.mainBackgroundColor,
|
// color: AppColors.mainBackgroundColor,
|
||||||
),
|
// ),
|
||||||
Container(
|
// Container(
|
||||||
padding: EdgeInsets.only(
|
// padding: EdgeInsets.only(
|
||||||
left: 30.w, right: 30.w, top: 20.w, bottom: 20.w),
|
// left: 30.w, right: 30.w, top: 20.w, bottom: 20.w),
|
||||||
color: Colors.white,
|
// color: Colors.white,
|
||||||
child: Row(
|
// child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
// mainAxisAlignment: MainAxisAlignment.start,
|
||||||
children: [
|
// children: [
|
||||||
Expanded(
|
// Expanded(
|
||||||
child: Text(
|
// child: Text(
|
||||||
TranslationLoader.lanKeys!.automaticUnLockTip!.tr,
|
// TranslationLoader.lanKeys!.automaticUnLockTip!.tr,
|
||||||
style: TextStyle(fontSize: 20.sp),
|
// style: TextStyle(fontSize: 20.sp),
|
||||||
)),
|
// )),
|
||||||
],
|
// ],
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
Container(
|
// Container(
|
||||||
height: 10.h,
|
// height: 10.h,
|
||||||
color: AppColors.mainBackgroundColor,
|
// color: AppColors.mainBackgroundColor,
|
||||||
),
|
// ),
|
||||||
topWidget(),
|
topWidget(),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 10.h,
|
height: 10.h,
|
||||||
@ -224,7 +224,7 @@ class _NormallyOpenModePageState extends State<NormallyOpenModePage> {
|
|||||||
onTap: () {
|
onTap: () {
|
||||||
// 选择全天模式
|
// 选择全天模式
|
||||||
if(state.isAllDay.value == 1){
|
if(state.isAllDay.value == 1){
|
||||||
state.isAllDay.value = 2;
|
state.isAllDay.value = 0;
|
||||||
}else{
|
}else{
|
||||||
state.isAllDay.value = 1;
|
state.isAllDay.value = 1;
|
||||||
}
|
}
|
||||||
@ -304,17 +304,17 @@ class _NormallyOpenModePageState extends State<NormallyOpenModePage> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
CupertinoSwitch _autoUnlockSwitch() {
|
// CupertinoSwitch _autoUnlockSwitch() {
|
||||||
return CupertinoSwitch(
|
// return CupertinoSwitch(
|
||||||
activeColor: CupertinoColors.activeBlue,
|
// activeColor: CupertinoColors.activeBlue,
|
||||||
trackColor: CupertinoColors.systemGrey5,
|
// trackColor: CupertinoColors.systemGrey5,
|
||||||
thumbColor: CupertinoColors.white,
|
// thumbColor: CupertinoColors.white,
|
||||||
value: state.isOpenAutomaticUnLock.value,
|
// value: state.isOpenAutomaticUnLock.value,
|
||||||
onChanged: (value) {
|
// onChanged: (value) {
|
||||||
setState(() {
|
// setState(() {
|
||||||
state.isOpenAutomaticUnLock.value = value;
|
// state.isOpenAutomaticUnLock.value = value;
|
||||||
});
|
// });
|
||||||
},
|
// },
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,16 +1,13 @@
|
|||||||
|
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:star_lock/main/lockDetail/lcokSet/normallyOpenMode/getPassageModeConfig_entity.dart';
|
|
||||||
|
|
||||||
import '../../../lockMian/entity/lockListInfo_entity.dart';
|
|
||||||
import '../lockSet/lockSetInfo_entity.dart';
|
import '../lockSet/lockSetInfo_entity.dart';
|
||||||
|
|
||||||
class NormallyOpenModeState{
|
class NormallyOpenModeState{
|
||||||
var lockSetInfoData = LockSetInfoData().obs;
|
var lockSetInfoData = LockSetInfoData().obs;
|
||||||
|
|
||||||
var getPassageModeConfigData = GetPassageModeConfigEntity().obs;
|
// var getPassageModeConfigData = GetPassageModeConfigEntity().obs;
|
||||||
var isOpenNormallyOpenMode = false.obs;// 是否开启常开模式 常开模式:1-开启、2-关闭
|
var isOpenNormallyOpenMode = false.obs;// 是否开启常开模式 常开模式:1-开启、2-关闭
|
||||||
var isOpenAutomaticUnLock = false.obs;// 是否开启自动开锁模式 自动开锁:1-开启、2-关闭,开启后锁将在常开模式开始时自动打开
|
// var isOpenAutomaticUnLock = false.obs;// 是否开启自动开锁模式 自动开锁:1-开启、2-关闭,开启后锁将在常开模式开始时自动打开
|
||||||
var isAllDay = 0.obs;// 是否开启全天模式 是否全天常开:1-是、2-否, 如果全天常开,startDate和endDate参数将被忽略.
|
var isAllDay = 0.obs;// 是否开启全天模式 是否全天常开:1-是、2-否, 如果全天常开,startDate和endDate参数将被忽略.
|
||||||
var weekDays = [].obs;// 常开时期
|
var weekDays = [].obs;// 常开时期
|
||||||
var beginTime = "".obs;// 开始时间
|
var beginTime = "".obs;// 开始时间
|
||||||
@ -21,5 +18,16 @@ class NormallyOpenModeState{
|
|||||||
NormallyOpenModeState() {
|
NormallyOpenModeState() {
|
||||||
var map = Get.arguments;
|
var map = Get.arguments;
|
||||||
lockSetInfoData.value = map["lockSetInfoData"];
|
lockSetInfoData.value = map["lockSetInfoData"];
|
||||||
|
isOpenNormallyOpenMode.value = lockSetInfoData.value.lockSettingInfo!.passageMode! == 1 ? true : false;
|
||||||
|
|
||||||
|
if((isOpenNormallyOpenMode.value == true) && (lockSetInfoData.value.lockSettingInfo!.passageModeConfig!.isNotEmpty)){
|
||||||
|
isAllDay.value = lockSetInfoData.value.lockSettingInfo!.passageModeConfig![0].isAllDay!;
|
||||||
|
weekDays.value = lockSetInfoData.value.lockSettingInfo!.passageModeConfig![0].weekDays!;
|
||||||
|
|
||||||
|
beginTimeMinute.value = lockSetInfoData.value.lockSettingInfo!.passageModeConfig![0].startDate!;
|
||||||
|
beginTime.value = "${lockSetInfoData.value.lockSettingInfo!.passageModeConfig![0].startDate!~/60}:${lockSetInfoData.value.lockSettingInfo!.passageModeConfig![0].startDate! % 60}";
|
||||||
|
endTimeMinute.value = lockSetInfoData.value.lockSettingInfo!.passageModeConfig![0].endDate!;
|
||||||
|
endTime.value = "${lockSetInfoData.value.lockSettingInfo!.passageModeConfig![0].endDate!~/60}:${lockSetInfoData.value.lockSettingInfo!.passageModeConfig![0].endDate! % 60}";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -129,9 +129,10 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage> {
|
|||||||
// backgroundColor: Colors.white,
|
// backgroundColor: Colors.white,
|
||||||
side: BorderSide(width: 1, color: AppColors.mainColor)),
|
side: BorderSide(width: 1, color: AppColors.mainColor)),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Navigator.pushNamed(
|
Navigator.pushNamed(context, Routers.otherTypeKeyManagePage, arguments: {
|
||||||
context, Routers.otherTypeKeyManagePage,
|
"lockId": itemData.lockId,
|
||||||
arguments: 0);
|
"fromType": 0
|
||||||
|
});
|
||||||
},
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
'设置卡',
|
'设置卡',
|
||||||
@ -151,13 +152,12 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage> {
|
|||||||
side: BorderSide(width: 1, color: AppColors.mainColor)),
|
side: BorderSide(width: 1, color: AppColors.mainColor)),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Navigator.pushNamed(
|
Navigator.pushNamed(
|
||||||
context, Routers.otherTypeKeyManagePage,
|
context, Routers.otherTypeKeyManagePage,arguments: {
|
||||||
arguments: 1);
|
"lockId": itemData.lockId,
|
||||||
|
"fromType": 1
|
||||||
|
});
|
||||||
},
|
},
|
||||||
child: Text(
|
child: Text('设置指纹', style: TextStyle(color: AppColors.mainColor, fontSize: 24.sp),
|
||||||
'设置指纹',
|
|
||||||
style: TextStyle(
|
|
||||||
color: AppColors.mainColor, fontSize: 24.sp),
|
|
||||||
)),
|
)),
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
@ -171,9 +171,10 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage> {
|
|||||||
// backgroundColor: Colors.white,
|
// backgroundColor: Colors.white,
|
||||||
side: BorderSide(width: 1, color: AppColors.mainColor)),
|
side: BorderSide(width: 1, color: AppColors.mainColor)),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
Navigator.pushNamed(
|
Navigator.pushNamed(context, Routers.otherTypeKeyManagePage, arguments: {
|
||||||
context, Routers.otherTypeKeyManagePage,
|
"lockId": itemData.lockId,
|
||||||
arguments: 2);
|
"fromType": 2
|
||||||
|
});
|
||||||
},
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
'设置遥控',
|
'设置遥控',
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
|
||||||
import 'package:date_format/date_format.dart';
|
import 'package:date_format/date_format.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
@ -16,6 +17,7 @@ import 'package:star_lock/tools/toast.dart';
|
|||||||
|
|
||||||
import '../../../../appRouters.dart';
|
import '../../../../appRouters.dart';
|
||||||
import '../../../../tools/commonItem.dart';
|
import '../../../../tools/commonItem.dart';
|
||||||
|
|
||||||
import '../../../../tools/submitBtn.dart';
|
import '../../../../tools/submitBtn.dart';
|
||||||
import '../../../../translations/trans_lib.dart';
|
import '../../../../translations/trans_lib.dart';
|
||||||
import '../../../lockMian/entity/lockListInfo_entity.dart';
|
import '../../../lockMian/entity/lockListInfo_entity.dart';
|
||||||
@ -241,7 +243,7 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> {
|
|||||||
// 自定义是否永久
|
// 自定义是否永久
|
||||||
Widget keyIfPerpetualWidget() {
|
Widget keyIfPerpetualWidget() {
|
||||||
return Container(
|
return Container(
|
||||||
margin: EdgeInsets.only(left: 20.w, right: 20.w),
|
// margin: EdgeInsets.only(left: 20.w, right: 20.w),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
CommonItem(
|
CommonItem(
|
||||||
@ -262,7 +264,7 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> {
|
|||||||
// 循环
|
// 循环
|
||||||
Widget keyCirculationWidget() {
|
Widget keyCirculationWidget() {
|
||||||
return Container(
|
return Container(
|
||||||
margin: EdgeInsets.only(left: 20.w, right: 20.w),
|
// margin: EdgeInsets.only(left: 20.w, right: 20.w),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
CommonItem(
|
CommonItem(
|
||||||
@ -291,7 +293,7 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> {
|
|||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () {
|
action: () {
|
||||||
Pickers.showDatePicker(context, mode: DateMode.HM,
|
Pickers.showDatePicker(context, mode: DateMode.H,
|
||||||
onConfirm: (p) {
|
onConfirm: (p) {
|
||||||
setState(() {
|
setState(() {
|
||||||
_effectiveDateTime = DateTime.parse(
|
_effectiveDateTime = DateTime.parse(
|
||||||
@ -307,8 +309,7 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> {
|
|||||||
rightTitle: _selectFailureDate,
|
rightTitle: _selectFailureDate,
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () {
|
action: () {
|
||||||
Pickers.showDatePicker(context, mode: DateMode.HM,
|
Pickers.showDatePicker(context, mode: DateMode.H, onConfirm: (p) {
|
||||||
onConfirm: (p) {
|
|
||||||
setState(() {
|
setState(() {
|
||||||
_failureDateTime = DateTime.parse(
|
_failureDateTime = DateTime.parse(
|
||||||
'${_failureDateTime.year}-${intToStr(_failureDateTime.month)}-${intToStr(_failureDateTime.day)} ${intToStr(p.hour!)}:${intToStr(p.minute!)}');
|
'${_failureDateTime.year}-${intToStr(_failureDateTime.month)}-${intToStr(_failureDateTime.day)} ${intToStr(p.hour!)}:${intToStr(p.minute!)}');
|
||||||
@ -325,9 +326,7 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> {
|
|||||||
|
|
||||||
//底部选择pickerView
|
//底部选择pickerView
|
||||||
showPickerView(BuildContext context, List dataList) {
|
showPickerView(BuildContext context, List dataList) {
|
||||||
Pickers.showSinglePicker(context,
|
Pickers.showSinglePicker(context, data: dataList, pickerStyle: DefaultPickerStyle(), onConfirm: (p, position) {
|
||||||
data: dataList,
|
|
||||||
pickerStyle: DefaultPickerStyle(), onConfirm: (p, position) {
|
|
||||||
setState(() {
|
setState(() {
|
||||||
cyclicModeStr = p;
|
cyclicModeStr = p;
|
||||||
});
|
});
|
||||||
@ -482,7 +481,8 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> {
|
|||||||
getEffectiveDateTime,
|
getEffectiveDateTime,
|
||||||
'0',
|
'0',
|
||||||
startHours,
|
startHours,
|
||||||
endHours);
|
endHours,
|
||||||
|
1);
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
print('获取密码成功');
|
print('获取密码成功');
|
||||||
_isSendSuccess = true;
|
_isSendSuccess = true;
|
||||||
|
|||||||
@ -114,6 +114,7 @@ class LockListInfoItemEntity {
|
|||||||
int? keyRight;
|
int? keyRight;
|
||||||
int? keyStatus;
|
int? keyStatus;
|
||||||
int? isLockOwner;
|
int? isLockOwner;
|
||||||
|
int? sendDate;
|
||||||
Bluetooth? bluetooth;
|
Bluetooth? bluetooth;
|
||||||
LockFeature? lockFeature;
|
LockFeature? lockFeature;
|
||||||
LockSetting? lockSetting;
|
LockSetting? lockSetting;
|
||||||
@ -140,7 +141,8 @@ class LockListInfoItemEntity {
|
|||||||
this.isLockOwner,
|
this.isLockOwner,
|
||||||
this.bluetooth,
|
this.bluetooth,
|
||||||
this.lockFeature,
|
this.lockFeature,
|
||||||
this.lockSetting});
|
this.lockSetting,
|
||||||
|
this.sendDate});
|
||||||
|
|
||||||
LockListInfoItemEntity.fromJson(Map<String, dynamic> json) {
|
LockListInfoItemEntity.fromJson(Map<String, dynamic> json) {
|
||||||
keyId = json['keyId'];
|
keyId = json['keyId'];
|
||||||
@ -162,6 +164,7 @@ class LockListInfoItemEntity {
|
|||||||
keyRight = json['keyRight'];
|
keyRight = json['keyRight'];
|
||||||
keyStatus = json['keyStatus'];
|
keyStatus = json['keyStatus'];
|
||||||
isLockOwner = json['isLockOwner'];
|
isLockOwner = json['isLockOwner'];
|
||||||
|
sendDate = json['sendDate'];
|
||||||
bluetooth = json['bluetooth'] != null
|
bluetooth = json['bluetooth'] != null
|
||||||
? Bluetooth.fromJson(json['bluetooth'])
|
? Bluetooth.fromJson(json['bluetooth'])
|
||||||
: null;
|
: null;
|
||||||
@ -194,6 +197,7 @@ class LockListInfoItemEntity {
|
|||||||
data['keyRight'] = keyRight;
|
data['keyRight'] = keyRight;
|
||||||
data['keyStatus'] = keyStatus;
|
data['keyStatus'] = keyStatus;
|
||||||
data['isLockOwner'] = isLockOwner;
|
data['isLockOwner'] = isLockOwner;
|
||||||
|
data['sendDate'] = sendDate;
|
||||||
if (bluetooth != null) {
|
if (bluetooth != null) {
|
||||||
data['bluetooth'] = bluetooth!.toJson();
|
data['bluetooth'] = bluetooth!.toJson();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,206 @@
|
|||||||
|
class KeyListByUserEntity {
|
||||||
|
int? errorCode;
|
||||||
|
String? description;
|
||||||
|
String? errorMsg;
|
||||||
|
KeyListByUserData? data;
|
||||||
|
|
||||||
|
KeyListByUserEntity(
|
||||||
|
{this.errorCode, this.description, this.errorMsg, this.data});
|
||||||
|
|
||||||
|
KeyListByUserEntity.fromJson(Map<String, dynamic> json) {
|
||||||
|
errorCode = json['errorCode'];
|
||||||
|
description = json['description'];
|
||||||
|
errorMsg = json['errorMsg'];
|
||||||
|
data =
|
||||||
|
json['data'] != null ? KeyListByUserData.fromJson(json['data']) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
data['errorCode'] = errorCode;
|
||||||
|
data['description'] = description;
|
||||||
|
data['errorMsg'] = errorMsg;
|
||||||
|
if (this.data != null) {
|
||||||
|
data['data'] = this.data!.toJson();
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class KeyListByUserData {
|
||||||
|
List<KeyListItem>? keyList;
|
||||||
|
int? pageNo;
|
||||||
|
int? pageSize;
|
||||||
|
int? pages;
|
||||||
|
int? total;
|
||||||
|
|
||||||
|
KeyListByUserData(
|
||||||
|
{this.keyList, this.pageNo, this.pageSize, this.pages, this.total});
|
||||||
|
|
||||||
|
KeyListByUserData.fromJson(Map<String, dynamic> json) {
|
||||||
|
if (json['list'] != null) {
|
||||||
|
keyList = <KeyListItem>[];
|
||||||
|
json['list'].forEach((v) {
|
||||||
|
keyList!.add(KeyListItem.fromJson(v));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
pageNo = json['pageNo'];
|
||||||
|
pageSize = json['pageSize'];
|
||||||
|
pages = json['pages'];
|
||||||
|
total = json['total'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
if (keyList != null) {
|
||||||
|
data['list'] = keyList!.map((v) => v.toJson()).toList();
|
||||||
|
}
|
||||||
|
data['pageNo'] = pageNo;
|
||||||
|
data['pageSize'] = pageSize;
|
||||||
|
data['pages'] = pages;
|
||||||
|
data['total'] = total;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class KeyListItem {
|
||||||
|
String? clientId;
|
||||||
|
int? lockOwnerId;
|
||||||
|
int? lockId;
|
||||||
|
int? senderUserId;
|
||||||
|
String? keyName;
|
||||||
|
int? keyType;
|
||||||
|
int? startDate;
|
||||||
|
int? endDate;
|
||||||
|
List? weekDays;
|
||||||
|
String? remarks;
|
||||||
|
int? remoteEnable;
|
||||||
|
int? isCameraEnable;
|
||||||
|
int? faceAuthentication;
|
||||||
|
int? keyRight;
|
||||||
|
int? userType;
|
||||||
|
int? keyStatus;
|
||||||
|
int? groupId;
|
||||||
|
int? lockUserNo;
|
||||||
|
int? date;
|
||||||
|
String? createdAt;
|
||||||
|
String? updatedAt;
|
||||||
|
UserInfo? userInfo;
|
||||||
|
int? keyId;
|
||||||
|
int? uid;
|
||||||
|
String? lockAlias;
|
||||||
|
|
||||||
|
KeyListItem(
|
||||||
|
{this.clientId,
|
||||||
|
this.lockOwnerId,
|
||||||
|
this.lockId,
|
||||||
|
this.senderUserId,
|
||||||
|
this.keyName,
|
||||||
|
this.keyType,
|
||||||
|
this.startDate,
|
||||||
|
this.endDate,
|
||||||
|
this.weekDays,
|
||||||
|
this.remarks,
|
||||||
|
this.remoteEnable,
|
||||||
|
this.isCameraEnable,
|
||||||
|
this.faceAuthentication,
|
||||||
|
this.keyRight,
|
||||||
|
this.userType,
|
||||||
|
this.keyStatus,
|
||||||
|
this.groupId,
|
||||||
|
this.lockUserNo,
|
||||||
|
this.date,
|
||||||
|
this.createdAt,
|
||||||
|
this.updatedAt,
|
||||||
|
this.userInfo,
|
||||||
|
this.keyId,
|
||||||
|
this.uid,
|
||||||
|
this.lockAlias});
|
||||||
|
|
||||||
|
KeyListItem.fromJson(Map<String, dynamic> json) {
|
||||||
|
clientId = json['clientId'];
|
||||||
|
lockOwnerId = json['lockOwnerId'];
|
||||||
|
lockId = json['lockId'];
|
||||||
|
senderUserId = json['senderUserId'];
|
||||||
|
keyName = json['keyName'];
|
||||||
|
keyType = json['keyType'];
|
||||||
|
startDate = json['startDate'];
|
||||||
|
endDate = json['endDate'];
|
||||||
|
if (json['weekDays'] != null) {
|
||||||
|
weekDays = [];
|
||||||
|
json['weekDays'].forEach((v) {
|
||||||
|
weekDays!.add(v);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
remarks = json['remarks'];
|
||||||
|
remoteEnable = json['remoteEnable'];
|
||||||
|
isCameraEnable = json['isCameraEnable'];
|
||||||
|
faceAuthentication = json['faceAuthentication'];
|
||||||
|
keyRight = json['keyRight'];
|
||||||
|
userType = json['userType'];
|
||||||
|
keyStatus = json['keyStatus'];
|
||||||
|
groupId = json['groupId'];
|
||||||
|
lockUserNo = json['lockUserNo'];
|
||||||
|
date = json['date'];
|
||||||
|
createdAt = json['created_at'];
|
||||||
|
updatedAt = json['updated_at'];
|
||||||
|
userInfo =
|
||||||
|
json['user_info'] != null ? UserInfo.fromJson(json['user_info']) : null;
|
||||||
|
keyId = json['keyId'];
|
||||||
|
uid = json['uid'];
|
||||||
|
lockAlias = json['lockAlias'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
data['clientId'] = clientId;
|
||||||
|
data['lockOwnerId'] = lockOwnerId;
|
||||||
|
data['lockId'] = lockId;
|
||||||
|
data['senderUserId'] = senderUserId;
|
||||||
|
data['keyName'] = keyName;
|
||||||
|
data['keyType'] = keyType;
|
||||||
|
data['startDate'] = startDate;
|
||||||
|
data['endDate'] = endDate;
|
||||||
|
if (weekDays != null) {
|
||||||
|
data['weekDays'] = weekDays!.map((v) => v.toJson()).toList();
|
||||||
|
}
|
||||||
|
data['remarks'] = remarks;
|
||||||
|
data['remoteEnable'] = remoteEnable;
|
||||||
|
data['isCameraEnable'] = isCameraEnable;
|
||||||
|
data['faceAuthentication'] = faceAuthentication;
|
||||||
|
data['keyRight'] = keyRight;
|
||||||
|
data['userType'] = userType;
|
||||||
|
data['keyStatus'] = keyStatus;
|
||||||
|
data['groupId'] = groupId;
|
||||||
|
data['lockUserNo'] = lockUserNo;
|
||||||
|
data['date'] = date;
|
||||||
|
data['created_at'] = createdAt;
|
||||||
|
data['updated_at'] = updatedAt;
|
||||||
|
if (userInfo != null) {
|
||||||
|
data['user_info'] = userInfo!.toJson();
|
||||||
|
}
|
||||||
|
data['keyId'] = keyId;
|
||||||
|
data['uid'] = uid;
|
||||||
|
data['lockAlias'] = lockAlias;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class UserInfo {
|
||||||
|
int? id;
|
||||||
|
String? accountName;
|
||||||
|
|
||||||
|
UserInfo({this.id, this.accountName});
|
||||||
|
|
||||||
|
UserInfo.fromJson(Map<String, dynamic> json) {
|
||||||
|
id = json['id'];
|
||||||
|
accountName = json['account_name'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
data['id'] = id;
|
||||||
|
data['account_name'] = accountName;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,48 @@
|
|||||||
|
|
||||||
|
|
||||||
|
import '../../../../main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserListEntity.dart';
|
||||||
|
import '../../../../network/api_repository.dart';
|
||||||
|
import '../../../../tools/baseGetXController.dart';
|
||||||
|
import '../../../../tools/toast.dart';
|
||||||
|
import 'lockUserManageList_state.dart';
|
||||||
|
|
||||||
|
class LockUserManageListLogic extends BaseGetXController {
|
||||||
|
final LockUserManageListState state = LockUserManageListState();
|
||||||
|
|
||||||
|
//请求锁用户列表
|
||||||
|
void lockUserListRequest() async {
|
||||||
|
LockUserListEntity entity =
|
||||||
|
await ApiRepository.to.lockUserList('1', '20', state.searchController.text);
|
||||||
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
|
state.dataList.value = entity.data!;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//删除锁用户管理
|
||||||
|
Future<void> deletelockUserRequest(int uid) async {
|
||||||
|
var entity = await ApiRepository.to.deletLockUser(uid);
|
||||||
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
|
Toast.show(msg: "删除成功");
|
||||||
|
lockUserListRequest();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void onReady() {
|
||||||
|
// TODO: implement onReady
|
||||||
|
super.onReady();
|
||||||
|
|
||||||
|
lockUserListRequest();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void onInit() {
|
||||||
|
// TODO: implement onInit
|
||||||
|
super.onInit();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void onClose() {
|
||||||
|
// TODO: implement onClose
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,262 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserListEntity.dart';
|
||||||
|
import 'package:star_lock/tools/noData.dart';
|
||||||
|
|
||||||
|
import '../../../../../appRouters.dart';
|
||||||
|
import '../../../../../app_settings/app_colors.dart';
|
||||||
|
import '../../../../../tools/titleAppBar.dart';
|
||||||
|
import '../../../../../translations/trans_lib.dart';
|
||||||
|
import '../../../../tools/left_slide_actions.dart';
|
||||||
|
import '../../../../tools/showIosTipView.dart';
|
||||||
|
import 'lockUserManageList_logic.dart';
|
||||||
|
|
||||||
|
class LockUserManageListPage extends StatefulWidget {
|
||||||
|
const LockUserManageListPage({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<LockUserManageListPage> createState() => _LockUserManageListPageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _LockUserManageListPageState extends State<LockUserManageListPage> {
|
||||||
|
final logic = Get.put(LockUserManageListLogic());
|
||||||
|
final state = Get.find<LockUserManageListLogic>().state;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
backgroundColor: AppColors.mainBackgroundColor,
|
||||||
|
appBar: TitleAppBar(
|
||||||
|
barTitle: TranslationLoader.lanKeys!.lockUserManagement!.tr,
|
||||||
|
haveBack: true,
|
||||||
|
backgroundColor: AppColors.mainColor,
|
||||||
|
actionsList: [
|
||||||
|
TextButton(
|
||||||
|
child: Text(
|
||||||
|
TranslationLoader.lanKeys!.aboutToExpire!.tr,
|
||||||
|
style: TextStyle(color: Colors.white, fontSize: 24.sp),
|
||||||
|
),
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.pushNamed(context, Routers.expireLockListPage);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
body: Column(
|
||||||
|
children: [
|
||||||
|
_searchWidget(),
|
||||||
|
SizedBox(
|
||||||
|
height: 20.h,
|
||||||
|
),
|
||||||
|
Obx(() => Expanded(child: _buildMainUI())),
|
||||||
|
SizedBox(
|
||||||
|
width: ScreenUtil().screenWidth - 40.w,
|
||||||
|
height: 90.h,
|
||||||
|
child: ElevatedButton(
|
||||||
|
style: ElevatedButton.styleFrom(
|
||||||
|
backgroundColor: Colors.white,
|
||||||
|
),
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.pushNamed(
|
||||||
|
context, Routers.massSendElectronicKeyManagePage)
|
||||||
|
.then((value) {
|
||||||
|
logic.lockUserListRequest();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
child: Text(
|
||||||
|
TranslationLoader.lanKeys!.sendGroupKey!.tr,
|
||||||
|
style: TextStyle(
|
||||||
|
color: AppColors.mainColor,
|
||||||
|
fontSize: 24.sp,
|
||||||
|
fontWeight: FontWeight.w600),
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 64.h,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _searchWidget() {
|
||||||
|
return Container(
|
||||||
|
height: 60.h,
|
||||||
|
margin: EdgeInsets.only(top: 20.w, left: 20.w, right: 20.w),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.white, borderRadius: BorderRadius.circular(5)),
|
||||||
|
child: TextField(
|
||||||
|
//输入框一行
|
||||||
|
maxLines: 1,
|
||||||
|
controller: state.searchController,
|
||||||
|
autofocus: false,
|
||||||
|
onSubmitted: (value) {
|
||||||
|
logic.lockUserListRequest();
|
||||||
|
},
|
||||||
|
decoration: InputDecoration(
|
||||||
|
//输入里面输入文字内边距设置
|
||||||
|
contentPadding: const EdgeInsets.only(
|
||||||
|
top: 12.0, left: -19.0, right: -15.0, bottom: 8.0),
|
||||||
|
hintText: TranslationLoader.lanKeys!.pleaseEnter!.tr,
|
||||||
|
hintStyle: TextStyle(fontSize: 22.sp, height: 3.0),
|
||||||
|
//不需要输入框下划线
|
||||||
|
border: InputBorder.none,
|
||||||
|
//左边图标设置
|
||||||
|
icon: Padding(
|
||||||
|
padding: EdgeInsets.only(
|
||||||
|
top: 20.h, bottom: 20.h, right: 20.w, left: 10.w),
|
||||||
|
child: Image.asset(
|
||||||
|
'images/main/icon_main_search.png',
|
||||||
|
width: 40.w,
|
||||||
|
height: 40.w,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildMainUI() {
|
||||||
|
return state.dataList.isEmpty
|
||||||
|
? const NoData()
|
||||||
|
: ListView.separated(
|
||||||
|
itemCount: state.dataList.length,
|
||||||
|
itemBuilder: (c, index) {
|
||||||
|
LockUserData indexEntity = state.dataList[index];
|
||||||
|
if (index < state.dataList.length) {
|
||||||
|
return LeftSlideActions(
|
||||||
|
key: Key(indexEntity.userid!),
|
||||||
|
actionsWidth: 60,
|
||||||
|
actions: [
|
||||||
|
_buildDeleteBtn(indexEntity),
|
||||||
|
],
|
||||||
|
decoration: const BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(1)),
|
||||||
|
),
|
||||||
|
child: _electronicKeyItem(indexEntity),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return const SizedBox.shrink();
|
||||||
|
// return _electronicKeyItem(indexEntity);
|
||||||
|
},
|
||||||
|
separatorBuilder: (BuildContext context, int index) {
|
||||||
|
return const Divider(
|
||||||
|
height: 1,
|
||||||
|
color: AppColors.greyLineColor,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _electronicKeyItem(LockUserData itemData) {
|
||||||
|
return GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
Navigator.pushNamed(context, Routers.ownedKeyListPage,
|
||||||
|
arguments: {'uid': itemData.uid});
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
height: 90.h,
|
||||||
|
color: Colors.white,
|
||||||
|
// decoration: BoxDecoration(
|
||||||
|
// color: Colors.white,
|
||||||
|
// borderRadius: BorderRadius.circular(10.w),
|
||||||
|
// ),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
SizedBox(
|
||||||
|
width: 30.w,
|
||||||
|
),
|
||||||
|
Image.asset(
|
||||||
|
'images/controls_user.png',
|
||||||
|
width: 60.w,
|
||||||
|
height: 60.w,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: 20.w,
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
itemData.nickname ?? '',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 24.sp, color: AppColors.blackColor),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
SizedBox(height: 5.h),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
itemData.userid ?? '',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 18.sp,
|
||||||
|
color: AppColors.placeholderTextColor),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
SizedBox(width: 20.h),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Image.asset(
|
||||||
|
'images/icon_right_grey.png',
|
||||||
|
width: 12.w,
|
||||||
|
height: 21.w,
|
||||||
|
),
|
||||||
|
SizedBox(width: 20.w),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildDeleteBtn(LockUserData passwordKeyListItem) {
|
||||||
|
return GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
// 省略: 弹出是否删除的确认对话框。
|
||||||
|
showIosTipViewDialog(context, passwordKeyListItem);
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
width: 60,
|
||||||
|
color: const Color(0xFFF20101),
|
||||||
|
alignment: Alignment.center,
|
||||||
|
child: const Text(
|
||||||
|
'删除',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 16,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
color: Colors.white,
|
||||||
|
height: 1,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
void showIosTipViewDialog(BuildContext context, LockUserData lockUserData) {
|
||||||
|
showDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (BuildContext context) {
|
||||||
|
return ShowIosTipView(
|
||||||
|
title: "提示",
|
||||||
|
tipTitle: "确定要删除吗?",
|
||||||
|
sureClick: () {
|
||||||
|
Get.back();
|
||||||
|
logic.deletelockUserRequest(lockUserData.uid!);
|
||||||
|
},
|
||||||
|
cancelClick: () {
|
||||||
|
Get.back();
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,11 @@
|
|||||||
|
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
import '../../../../main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserListEntity.dart';
|
||||||
|
|
||||||
|
class LockUserManageListState {
|
||||||
|
final dataList = <LockUserData>[].obs;
|
||||||
|
final TextEditingController searchController = TextEditingController();
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,198 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
|
import 'package:get/get_utils/get_utils.dart';
|
||||||
|
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
|
||||||
|
import 'package:star_lock/mine/mineSet/lockUserManage/lockUserManageList/keyListByUserEntity.dart';
|
||||||
|
import 'package:star_lock/network/api_repository.dart';
|
||||||
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
|
import 'package:star_lock/translations/trans_lib.dart';
|
||||||
|
|
||||||
|
import '../../../../../app_settings/app_colors.dart';
|
||||||
|
import '../../../../../tools/titleAppBar.dart';
|
||||||
|
|
||||||
|
class OwnedKeyListPage extends StatefulWidget {
|
||||||
|
const OwnedKeyListPage({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<OwnedKeyListPage> createState() => _OwnedKeyListPageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _OwnedKeyListPageState extends State<OwnedKeyListPage> {
|
||||||
|
String getUidStr = '';
|
||||||
|
List dataList = [];
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
dynamic obj = ModalRoute.of(context)?.settings.arguments;
|
||||||
|
if (obj != null && (obj["uid"] != null)) {
|
||||||
|
getUidStr = obj["uid"].toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
return Scaffold(
|
||||||
|
backgroundColor: AppColors.mainBackgroundColor,
|
||||||
|
appBar: TitleAppBar(
|
||||||
|
barTitle: TranslationLoader.lanKeys!.ownedKey!.tr,
|
||||||
|
haveBack: true,
|
||||||
|
backgroundColor: AppColors.mainColor,
|
||||||
|
),
|
||||||
|
body: FutureBuilder<List<KeyListItem>>(
|
||||||
|
future: mockNetworkDataRequest(),
|
||||||
|
builder: (BuildContext context,
|
||||||
|
AsyncSnapshot<List<KeyListItem>> snapshot) {
|
||||||
|
//请求结束
|
||||||
|
if (snapshot.connectionState == ConnectionState.done) {
|
||||||
|
if (snapshot.hasError) {
|
||||||
|
//请求失败
|
||||||
|
return const Text('请求失败');
|
||||||
|
} else {
|
||||||
|
//请求成功
|
||||||
|
final List<KeyListItem> itemList = snapshot.data!;
|
||||||
|
|
||||||
|
return Column(
|
||||||
|
children: [
|
||||||
|
_topOwnedKeyText(),
|
||||||
|
Expanded(child: _buildMainUI(itemList)),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
//请求未结束 显示loading
|
||||||
|
return Container();
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _topOwnedKeyText() {
|
||||||
|
return Container(
|
||||||
|
color: Colors.white,
|
||||||
|
width: ScreenUtil().screenWidth,
|
||||||
|
// margin: EdgeInsets.only(left: 30.w, top: 30.w, right: 30.w, bottom: 30.w),
|
||||||
|
child: Padding(
|
||||||
|
padding:
|
||||||
|
EdgeInsets.only(left: 30.w, top: 20.w, right: 20.w, bottom: 10.w),
|
||||||
|
child: Text(
|
||||||
|
TranslationLoader.lanKeys!.ownedKey!.tr,
|
||||||
|
style: TextStyle(fontSize: 24.sp),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
//请求用户拥有的锁
|
||||||
|
Future<List<KeyListItem>> mockNetworkDataRequest() async {
|
||||||
|
KeyListByUserEntity entity =
|
||||||
|
await ApiRepository.to.keyListByUser('1', '20', getUidStr);
|
||||||
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
|
print("请求用户拥有的锁:${entity.data!.keyList}");
|
||||||
|
}
|
||||||
|
if (entity.data != null) {
|
||||||
|
return entity.data!.keyList!;
|
||||||
|
} else {
|
||||||
|
List<KeyListItem> dataList = [];
|
||||||
|
return dataList;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//使用期限
|
||||||
|
String getUseDateStr(KeyListItem indexEntity) {
|
||||||
|
String useDateStr = '';
|
||||||
|
if (indexEntity.keyType == XSConstantMacro.keyTypeTime) {
|
||||||
|
//限期
|
||||||
|
if (indexEntity.startDate != null && indexEntity.endDate != null) {
|
||||||
|
DateTime startDateStr =
|
||||||
|
DateTime.fromMillisecondsSinceEpoch(indexEntity.startDate!);
|
||||||
|
DateTime endDateStr =
|
||||||
|
DateTime.fromMillisecondsSinceEpoch(indexEntity.endDate!);
|
||||||
|
useDateStr =
|
||||||
|
'${startDateStr.toLocal().toString().substring(0, 16)}-${endDateStr.toLocal().toString().substring(0, 16)}';
|
||||||
|
} else {
|
||||||
|
useDateStr = '限期';
|
||||||
|
}
|
||||||
|
} else if (indexEntity.keyType == XSConstantMacro.keyTypeLong) {
|
||||||
|
//永久
|
||||||
|
useDateStr = '永久';
|
||||||
|
} else if (indexEntity.keyType == XSConstantMacro.keyTypeOnce) {
|
||||||
|
//单次
|
||||||
|
useDateStr = '单次';
|
||||||
|
} else if (indexEntity.keyType == XSConstantMacro.keyTypeLoop) {
|
||||||
|
//循环
|
||||||
|
useDateStr = '循环';
|
||||||
|
}
|
||||||
|
|
||||||
|
return useDateStr;
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildMainUI(List itemList) {
|
||||||
|
return ListView.builder(
|
||||||
|
itemCount: itemList.length,
|
||||||
|
itemBuilder: (c, index) {
|
||||||
|
KeyListItem itemData = itemList[index];
|
||||||
|
return _electronicKeyItem(itemData);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _electronicKeyItem(KeyListItem itemData) {
|
||||||
|
return GestureDetector(
|
||||||
|
onTap: () {},
|
||||||
|
child: Container(
|
||||||
|
height: 90.h,
|
||||||
|
margin: const EdgeInsets.only(top: 1),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.white,
|
||||||
|
borderRadius: BorderRadius.circular(10.w),
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
SizedBox(
|
||||||
|
width: 30.w,
|
||||||
|
),
|
||||||
|
Image.asset(
|
||||||
|
'images/icon_lockGroup_item.png',
|
||||||
|
width: 60.w,
|
||||||
|
height: 60.w,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: 20.w,
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
itemData.lockAlias ?? '',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 24.sp, color: AppColors.blackColor),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
SizedBox(height: 5.h),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
getUseDateStr(itemData),
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 18.sp,
|
||||||
|
color: AppColors.placeholderTextColor),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
SizedBox(width: 20.h),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(width: 20.h),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -8,6 +8,7 @@ import 'package:star_lock/tools/storage.dart';
|
|||||||
import '../../../../network/api_repository.dart';
|
import '../../../../network/api_repository.dart';
|
||||||
import '../../../../tools/baseGetXController.dart';
|
import '../../../../tools/baseGetXController.dart';
|
||||||
import '../../../tools/eventBusEventManage.dart';
|
import '../../../tools/eventBusEventManage.dart';
|
||||||
|
import '../../../tools/toast.dart';
|
||||||
|
|
||||||
class MineSetLogic extends BaseGetXController {
|
class MineSetLogic extends BaseGetXController {
|
||||||
final MineSetState state = MineSetState();
|
final MineSetState state = MineSetState();
|
||||||
@ -41,6 +42,7 @@ class MineSetLogic extends BaseGetXController {
|
|||||||
ExpireLockListEntity entity = await ApiRepository.to
|
ExpireLockListEntity entity = await ApiRepository.to
|
||||||
.setAlertMode('1', state.isPrompTone.value == true ? '1' : '2');
|
.setAlertMode('1', state.isPrompTone.value == true ? '1' : '2');
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
|
Toast.show(msg: "设置成功");
|
||||||
userSettingsInfoRequest();
|
userSettingsInfoRequest();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -64,6 +66,7 @@ class MineSetLogic extends BaseGetXController {
|
|||||||
ExpireLockListEntity entity = await ApiRepository.to
|
ExpireLockListEntity entity = await ApiRepository.to
|
||||||
.setTouchUnlockFlag(state.isTouchUnlock.value == true ? '1' : '2');
|
.setTouchUnlockFlag(state.isTouchUnlock.value == true ? '1' : '2');
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
|
Toast.show(msg: "设置成功");
|
||||||
userSettingsInfoRequest();
|
userSettingsInfoRequest();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -73,9 +73,7 @@ class _MineSetPageState extends State<MineSetPage> {
|
|||||||
width: 60.w,
|
width: 60.w,
|
||||||
height: 50.h,
|
height: 50.h,
|
||||||
child: Obx(() => _isPushNotificationSwitch()))),
|
child: Obx(() => _isPushNotificationSwitch()))),
|
||||||
SizedBox(
|
SizedBox(height: 10.h),
|
||||||
height: 10.h,
|
|
||||||
),
|
|
||||||
CommonItem(
|
CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.lockUserManagement!.tr,
|
leftTitel: TranslationLoader.lanKeys!.lockUserManagement!.tr,
|
||||||
rightTitle: "",
|
rightTitle: "",
|
||||||
|
|||||||
@ -49,18 +49,12 @@ abstract class Api {
|
|||||||
final String addlockGroupURL = '/keyGroup/add'; //创建锁分组
|
final String addlockGroupURL = '/keyGroup/add'; //创建锁分组
|
||||||
final String setlockGroupURL = '/keyGroup/setGroup'; //设置锁分组
|
final String setlockGroupURL = '/keyGroup/setGroup'; //设置锁分组
|
||||||
final String lockGroupListURL = '/authorizedAdmin/listGroup'; //锁分组列表
|
final String lockGroupListURL = '/authorizedAdmin/listGroup'; //锁分组列表
|
||||||
final String listLockByGroupURL =
|
final String listLockByGroupURL = '/authorizedAdmin/listLockByGroup'; //获取分组下的锁列表
|
||||||
'/authorizedAdmin/listLockByGroup'; //获取分组下的锁列表
|
final String setRoomStatusURL = '/lock/updateLockStatus'; //标记房态
|
||||||
final String updateSettingURL = '/room/updateSetting'; //标记房态
|
|
||||||
final String keyGroupListURL = '/keyGroup/list'; //分组列表
|
final String keyGroupListURL = '/keyGroup/list'; //分组列表
|
||||||
final String lockListByGroupURL = '/room/listByGroup'; //分组下的锁
|
final String lockListByGroupURL = '/room/listByGroup'; //分组下的锁
|
||||||
final String getWifiServiceIpURL = '/wifiLock/getWifiServiceIp'; // 获取Wifi锁服务器
|
final String getWifiServiceIpURL = '/wifiLock/getWifiServiceIp'; // 获取Wifi锁服务器
|
||||||
final String updateLockSettingUrl = '/lockSetting/updateLockSetting'; // 开启/关闭 远程开锁
|
final String updateLockSettingUrl = '/lockSetting/updateLockSetting'; // 锁设置里面所有的设置
|
||||||
final String setAutoLockTimeUrl = '/room/setAutoLockTime'; // 自动闭锁
|
|
||||||
|
|
||||||
final String getPassageModeConfigUrl = '/room/getPassageModeConfig'; // 获取锁的常开模式设置
|
|
||||||
final String configPassageModeUrl = '/room/configPassageMode'; // 配置锁的常开模式
|
|
||||||
final String updateSettingUrl = '/room/updateSetting'; // 锁声音/防撬报警/重置键/考勤
|
|
||||||
|
|
||||||
final String roomQueryDateUrl = '/room/queryDate'; // 获取网关时间
|
final String roomQueryDateUrl = '/room/queryDate'; // 获取网关时间
|
||||||
final String lockDiagnoseUrl = '/room/uploadLockInfo'; // 锁诊断
|
final String lockDiagnoseUrl = '/room/uploadLockInfo'; // 锁诊断
|
||||||
@ -70,8 +64,6 @@ abstract class Api {
|
|||||||
'/attendanceCompany/isExistenceCompany'; // 开启考勤获取是否有公司
|
'/attendanceCompany/isExistenceCompany'; // 开启考勤获取是否有公司
|
||||||
final String setCheckInCreateCompanyURL =
|
final String setCheckInCreateCompanyURL =
|
||||||
'/attendanceCompany/add'; // 设置考勤时创建公司
|
'/attendanceCompany/add'; // 设置考勤时创建公司
|
||||||
final String setLockPickingReminderDataURL =
|
|
||||||
'/key/updateMonitorFlag'; // 设置开锁提醒
|
|
||||||
|
|
||||||
final String getAttendanceRecordListByDateURL = '/attendanceRecord/listByDate'; // 获取考勤列表-早到榜日榜
|
final String getAttendanceRecordListByDateURL = '/attendanceRecord/listByDate'; // 获取考勤列表-早到榜日榜
|
||||||
final String getAttendanceRecordListByMonthURL = '/attendanceRecord/earlyListByMonth'; // 获取考勤列表-早到榜月榜
|
final String getAttendanceRecordListByMonthURL = '/attendanceRecord/earlyListByMonth'; // 获取考勤列表-早到榜月榜
|
||||||
@ -111,6 +103,7 @@ abstract class Api {
|
|||||||
|
|
||||||
final String getKeyDetailURL = '/key/get'; //获取单把钥匙详情信息
|
final String getKeyDetailURL = '/key/get'; //获取单把钥匙详情信息
|
||||||
final String lockUserListURL = '/keyUser/listKeyUser'; //锁用户列表
|
final String lockUserListURL = '/keyUser/listKeyUser'; //锁用户列表
|
||||||
|
final String deletLockUserURL = '/keyUser/deleteKeyUser'; //删除锁用户
|
||||||
final String canSendKeyURL = '/keyUser/canSendKey'; //群发钥匙检查
|
final String canSendKeyURL = '/keyUser/canSendKey'; //群发钥匙检查
|
||||||
final String batchSendKeyURL = '/key/batchSend'; //批处理群发钥匙
|
final String batchSendKeyURL = '/key/batchSend'; //批处理群发钥匙
|
||||||
final String addAuthorizedAdminURL = '/authorizedAdmin/add'; //增加授权管理员
|
final String addAuthorizedAdminURL = '/authorizedAdmin/add'; //增加授权管理员
|
||||||
|
|||||||
@ -376,7 +376,8 @@ class ApiProvider extends BaseProvider {
|
|||||||
String startDate,
|
String startDate,
|
||||||
String timezoneRawOffSet,
|
String timezoneRawOffSet,
|
||||||
int startHours,
|
int startHours,
|
||||||
int endHours) =>
|
int endHours,
|
||||||
|
int isCoerced) =>
|
||||||
post(
|
post(
|
||||||
passwordKeyGetURL.toUrl,
|
passwordKeyGetURL.toUrl,
|
||||||
jsonEncode({
|
jsonEncode({
|
||||||
@ -390,7 +391,8 @@ class ApiProvider extends BaseProvider {
|
|||||||
'startDate': startDate,
|
'startDate': startDate,
|
||||||
'timezoneRawOffSet': timezoneRawOffSet,
|
'timezoneRawOffSet': timezoneRawOffSet,
|
||||||
'hoursStart': startHours,
|
'hoursStart': startHours,
|
||||||
'hoursEnd': endHours
|
'hoursEnd': endHours,
|
||||||
|
'isCoerced': isCoerced,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
Future<Response> addKeyboardPwd(
|
Future<Response> addKeyboardPwd(
|
||||||
@ -495,9 +497,9 @@ class ApiProvider extends BaseProvider {
|
|||||||
'deleteType': deleteType
|
'deleteType': deleteType
|
||||||
}));
|
}));
|
||||||
|
|
||||||
Future<Response> updateSetting(String lockId, String isOn, String type) =>
|
// Future<Response> updateSetting(String lockId, String isOn, String type) =>
|
||||||
post(updateSettingURL.toUrl,
|
// post(updateSettingURL.toUrl,
|
||||||
jsonEncode({'lockId': lockId, 'isOn': isOn, 'type': type}));
|
// jsonEncode({'lockId': lockId, 'isOn': isOn, 'type': type}));
|
||||||
|
|
||||||
Future<Response> keyGroupList(String type) =>
|
Future<Response> keyGroupList(String type) =>
|
||||||
post(keyGroupListURL.toUrl, jsonEncode({'type': type}));
|
post(keyGroupListURL.toUrl, jsonEncode({'type': type}));
|
||||||
@ -508,13 +510,13 @@ class ApiProvider extends BaseProvider {
|
|||||||
|
|
||||||
/// 锁设置模块
|
/// 锁设置模块
|
||||||
// 自动闭锁
|
// 自动闭锁
|
||||||
Future<Response> setAutoUnlockLoadData(int lockId, int autoLockTime, int type) =>
|
Future<Response> setAutoUnlockLoadData(int lockId, int autoLock, int autoLockSecond) =>
|
||||||
post(
|
post(
|
||||||
setAutoLockTimeUrl.toUrl,
|
updateLockSettingUrl.toUrl,
|
||||||
jsonEncode({
|
jsonEncode({
|
||||||
'lockId': lockId,
|
'lockId': lockId,
|
||||||
'autoLockTime': autoLockTime,
|
'autoLock': autoLock,
|
||||||
'type': type,
|
'autoLockSecond': autoLockSecond,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// 锁声音
|
// 锁声音
|
||||||
@ -555,46 +557,32 @@ class ApiProvider extends BaseProvider {
|
|||||||
'resetSwitch': resetSwitch,
|
'resetSwitch': resetSwitch,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// 获取锁的常开模式设置
|
// 设置考勤
|
||||||
Future<Response> getPassageModeConfigLoadData(String lockId) => post(
|
Future<Response> setCheckInData(int lockId, int resetSwitch) =>
|
||||||
getPassageModeConfigUrl.toUrl,
|
|
||||||
jsonEncode({
|
|
||||||
'lockId': lockId,
|
|
||||||
}));
|
|
||||||
|
|
||||||
// 获取锁的常开模式设置
|
|
||||||
Future<Response> configPassageMode(
|
|
||||||
String lockId,
|
|
||||||
String passageMode,
|
|
||||||
String autoUnlock,
|
|
||||||
String type,
|
|
||||||
String startDate,
|
|
||||||
String endDate,
|
|
||||||
String isAllDay,
|
|
||||||
List weekDays) =>
|
|
||||||
post(
|
post(
|
||||||
configPassageModeUrl.toUrl,
|
updateLockSettingUrl.toUrl,
|
||||||
|
jsonEncode({
|
||||||
|
'lockId': lockId,
|
||||||
|
'attendance': resetSwitch,
|
||||||
|
}));
|
||||||
|
|
||||||
|
// 设置标记房态
|
||||||
|
Future<Response> setRoomStatusData(int lockId, int roomStatus) =>
|
||||||
|
post(
|
||||||
|
setRoomStatusURL.toUrl,
|
||||||
|
jsonEncode({
|
||||||
|
'lockId': lockId,
|
||||||
|
'roomStatus': roomStatus,
|
||||||
|
}));
|
||||||
|
|
||||||
|
// 设置常开模式
|
||||||
|
Future<Response> setNormallyModeData(int lockId, int passageMode, Map passageModeConfig) =>
|
||||||
|
post(
|
||||||
|
updateLockSettingUrl.toUrl,
|
||||||
jsonEncode({
|
jsonEncode({
|
||||||
'lockId': lockId,
|
'lockId': lockId,
|
||||||
'passageMode': passageMode,
|
'passageMode': passageMode,
|
||||||
'autoUnlock': autoUnlock,
|
'passageModeConfig': passageModeConfig,
|
||||||
'type': type,
|
|
||||||
'startDate': startDate,
|
|
||||||
'endDate': endDate,
|
|
||||||
'isAllDay': isAllDay,
|
|
||||||
'weekDays': weekDays,
|
|
||||||
}));
|
|
||||||
|
|
||||||
// 获取锁的常开模式设置
|
|
||||||
Future<Response> setLockSetGeneralSetting(
|
|
||||||
String lockId, String changeType, String isOn, String type) =>
|
|
||||||
post(
|
|
||||||
updateSettingUrl.toUrl,
|
|
||||||
jsonEncode({
|
|
||||||
'lockId': lockId,
|
|
||||||
'changeType': changeType,
|
|
||||||
'isOn': isOn,
|
|
||||||
'type': type,
|
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// 通过网关获取锁的时间
|
// 通过网关获取锁的时间
|
||||||
@ -680,14 +668,11 @@ class ApiProvider extends BaseProvider {
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
// 获取开锁提醒
|
// 获取开锁提醒
|
||||||
Future<Response> setLockPickingReminderData(
|
Future<Response> setLockPickingReminderData(int lockId, int unlockReminderPush) =>
|
||||||
String lockId, String keyId, String monitorFlag) =>
|
post(updateLockSettingUrl.toUrl,
|
||||||
post(
|
|
||||||
setLockPickingReminderDataURL.toUrl,
|
|
||||||
jsonEncode({
|
jsonEncode({
|
||||||
'lockId': lockId,
|
'lockId': lockId,
|
||||||
'keyId': keyId,
|
'unlockReminderPush': unlockReminderPush,
|
||||||
'monitorFlag': monitorFlag,
|
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// 获取员工列表
|
// 获取员工列表
|
||||||
@ -1096,6 +1081,13 @@ class ApiProvider extends BaseProvider {
|
|||||||
'searchStr': searchStr
|
'searchStr': searchStr
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
Future<Response> deletLockUser(int uid) =>
|
||||||
|
post(
|
||||||
|
deletLockUserURL.toUrl,
|
||||||
|
jsonEncode({
|
||||||
|
'uid': uid,
|
||||||
|
}));
|
||||||
|
|
||||||
Future<Response> keyListByUser(String pageNo, String pageSize, String uid) =>
|
Future<Response> keyListByUser(String pageNo, String pageSize, String uid) =>
|
||||||
post(keyListByUserURL.toUrl,
|
post(keyListByUserURL.toUrl,
|
||||||
jsonEncode({'pageNo': pageNo, 'pageSize': pageSize, 'uid': uid}));
|
jsonEncode({'pageNo': pageNo, 'pageSize': pageSize, 'uid': uid}));
|
||||||
|
|||||||
@ -15,7 +15,7 @@ import 'package:star_lock/mine/mineSet/appUnlockNeedMobileNetworkingLock/selectL
|
|||||||
import 'package:star_lock/mine/mineSet/authorizedAdministrator/administratorDetails/administratorDetailEntity.dart';
|
import 'package:star_lock/mine/mineSet/authorizedAdministrator/administratorDetails/administratorDetailEntity.dart';
|
||||||
import 'package:star_lock/mine/mineSet/authorizedAdministrator/authorizedAdminListEntity.dart';
|
import 'package:star_lock/mine/mineSet/authorizedAdministrator/authorizedAdminListEntity.dart';
|
||||||
import 'package:star_lock/mine/mineSet/lockUserManage/expireLockList/expireLockListEntity.dart';
|
import 'package:star_lock/mine/mineSet/lockUserManage/expireLockList/expireLockListEntity.dart';
|
||||||
import 'package:star_lock/mine/mineSet/lockUserManage/keyListByUserEntity.dart';
|
import 'package:star_lock/mine/mineSet/lockUserManage/lockUserManageList/keyListByUserEntity.dart';
|
||||||
import 'package:star_lock/mine/mineSet/mineSet/userSettingInfoEntity.dart';
|
import 'package:star_lock/mine/mineSet/mineSet/userSettingInfoEntity.dart';
|
||||||
import '../common/safetyVerification/entity/CheckSafetyVerificationEntity.dart';
|
import '../common/safetyVerification/entity/CheckSafetyVerificationEntity.dart';
|
||||||
import '../common/safetyVerification/entity/SafetyVerificationEntity.dart';
|
import '../common/safetyVerification/entity/SafetyVerificationEntity.dart';
|
||||||
@ -33,7 +33,6 @@ import '../main/lockDetail/lcokSet/configuringWifi/configuringWifiEntity.dart';
|
|||||||
import '../main/lockDetail/lcokSet/lockSet/checkingInInfoData_entity.dart';
|
import '../main/lockDetail/lcokSet/lockSet/checkingInInfoData_entity.dart';
|
||||||
import '../main/lockDetail/lcokSet/lockSet/lockSetInfo_entity.dart';
|
import '../main/lockDetail/lcokSet/lockSet/lockSetInfo_entity.dart';
|
||||||
import '../main/lockDetail/lcokSet/lockTime/getServerDatetime_entity.dart';
|
import '../main/lockDetail/lcokSet/lockTime/getServerDatetime_entity.dart';
|
||||||
import '../main/lockDetail/lcokSet/normallyOpenMode/getPassageModeConfig_entity.dart';
|
|
||||||
import '../main/lockDetail/lockOperatingRecord/lockOperatingRecordGetLastRecordTime_entity.dart';
|
import '../main/lockDetail/lockOperatingRecord/lockOperatingRecordGetLastRecordTime_entity.dart';
|
||||||
import '../main/lockDetail/otherTypeKey/addFingerprint/addFingerprint/addFingerprint_entity.dart';
|
import '../main/lockDetail/otherTypeKey/addFingerprint/addFingerprint/addFingerprint_entity.dart';
|
||||||
import '../main/lockDetail/otherTypeKey/addICCard/addICCard_entity.dart';
|
import '../main/lockDetail/otherTypeKey/addICCard/addICCard_entity.dart';
|
||||||
@ -380,7 +379,8 @@ class ApiRepository {
|
|||||||
String startDate,
|
String startDate,
|
||||||
String timezoneRawOffSet,
|
String timezoneRawOffSet,
|
||||||
int startHours,
|
int startHours,
|
||||||
int endHours) async {
|
int endHours,
|
||||||
|
int isCoerced) async {
|
||||||
final res = await apiProvider.getKeyboardPwd(
|
final res = await apiProvider.getKeyboardPwd(
|
||||||
endDate,
|
endDate,
|
||||||
isExclusive,
|
isExclusive,
|
||||||
@ -392,7 +392,8 @@ class ApiRepository {
|
|||||||
startDate,
|
startDate,
|
||||||
timezoneRawOffSet,
|
timezoneRawOffSet,
|
||||||
startHours,
|
startHours,
|
||||||
endHours);
|
endHours,
|
||||||
|
isCoerced);
|
||||||
return PasswordKeyEntity.fromJson(res.body);
|
return PasswordKeyEntity.fromJson(res.body);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -504,13 +505,6 @@ class ApiRepository {
|
|||||||
return PasswordKeyEntity.fromJson(res.body);
|
return PasswordKeyEntity.fromJson(res.body);
|
||||||
}
|
}
|
||||||
|
|
||||||
//标记房态
|
|
||||||
Future<PasswordKeyEntity> updateSetting(
|
|
||||||
String lockId, String isOn, String type) async {
|
|
||||||
final res = await apiProvider.updateSetting(lockId, isOn, type);
|
|
||||||
return PasswordKeyEntity.fromJson(res.body);
|
|
||||||
}
|
|
||||||
|
|
||||||
//分组列表
|
//分组列表
|
||||||
Future<PasswordKeyEntity> keyGroupList(String type) async {
|
Future<PasswordKeyEntity> keyGroupList(String type) async {
|
||||||
final res = await apiProvider.keyGroupList(type);
|
final res = await apiProvider.keyGroupList(type);
|
||||||
@ -534,11 +528,11 @@ class ApiRepository {
|
|||||||
// 自动闭锁
|
// 自动闭锁
|
||||||
Future<LoginEntity> setAutoUnlock({
|
Future<LoginEntity> setAutoUnlock({
|
||||||
required int lockId,
|
required int lockId,
|
||||||
required int autoLockTime,
|
required int autoLock,
|
||||||
required int type,
|
required int autoLockSecond,
|
||||||
}) async {
|
}) async {
|
||||||
final res =
|
final res =
|
||||||
await apiProvider.setAutoUnlockLoadData(lockId, autoLockTime, type);
|
await apiProvider.setAutoUnlockLoadData(lockId, autoLock, autoLockSecond);
|
||||||
return LoginEntity.fromJson(res.body);
|
return LoginEntity.fromJson(res.body);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -582,48 +576,53 @@ class ApiRepository {
|
|||||||
return LoginEntity.fromJson(res.body);
|
return LoginEntity.fromJson(res.body);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取锁的常开模式设置 configPassageMode
|
// 设置考勤
|
||||||
Future<GetPassageModeConfigEntity> getPassageModeConfig({
|
Future<LoginEntity> setCheckInData({
|
||||||
required String lockId,
|
required int lockId,
|
||||||
|
required int attendance,
|
||||||
}) async {
|
}) async {
|
||||||
final res = await apiProvider.getPassageModeConfigLoadData(lockId);
|
final res = await apiProvider.setCheckInData(lockId, attendance);
|
||||||
return GetPassageModeConfigEntity.fromJson(res.body);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 配置锁的常开模式
|
|
||||||
Future<GetPassageModeConfigEntity> configPassageModeLoadData({
|
|
||||||
required String lockId,
|
|
||||||
required String passageMode,
|
|
||||||
required String autoUnlock,
|
|
||||||
required String type,
|
|
||||||
required String startDate,
|
|
||||||
required String endDate,
|
|
||||||
required String isAllDay,
|
|
||||||
required List weekDays,
|
|
||||||
}) async {
|
|
||||||
final res = await apiProvider.configPassageMode(lockId, passageMode,
|
|
||||||
autoUnlock, type, startDate, endDate, isAllDay, weekDays);
|
|
||||||
return GetPassageModeConfigEntity.fromJson(res.body);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 配置锁的常规设置
|
|
||||||
Future<LoginEntity> setLockSetGeneralSettingData({
|
|
||||||
required String lockId,
|
|
||||||
required String changeType,
|
|
||||||
required String isOn,
|
|
||||||
required String type,
|
|
||||||
}) async {
|
|
||||||
final res = await apiProvider.setLockSetGeneralSetting(
|
|
||||||
lockId, changeType, isOn, type);
|
|
||||||
return LoginEntity.fromJson(res.body);
|
return LoginEntity.fromJson(res.body);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 设置房态
|
||||||
|
Future<LoginEntity> setRoomStatusData({
|
||||||
|
required int lockId,
|
||||||
|
required int roomStatus,
|
||||||
|
}) async {
|
||||||
|
final res = await apiProvider.setRoomStatusData(lockId, roomStatus);
|
||||||
|
return LoginEntity.fromJson(res.body);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 配置锁的常开模式
|
||||||
|
Future<LoginEntity> setNormallyModeData({
|
||||||
|
required int lockId,
|
||||||
|
required int passageMode,
|
||||||
|
required Map passageModeConfig,
|
||||||
|
}) async {
|
||||||
|
final res =
|
||||||
|
await apiProvider.setNormallyModeData(lockId, passageMode, passageModeConfig);
|
||||||
|
return LoginEntity.fromJson(res.body);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 配置锁的常规设置
|
||||||
|
// Future<LoginEntity> setLockSetGeneralSettingData({
|
||||||
|
// required String lockId,
|
||||||
|
// required String changeType,
|
||||||
|
// required String isOn,
|
||||||
|
// required String type,
|
||||||
|
// }) async {
|
||||||
|
// final res = await apiProvider.setLockSetGeneralSetting(
|
||||||
|
// lockId, changeType, isOn, type);
|
||||||
|
// return LoginEntity.fromJson(res.body);
|
||||||
|
// }
|
||||||
|
|
||||||
// 获取锁时间 通过网关
|
// 获取锁时间 通过网关
|
||||||
Future<GetPassageModeConfigEntity> getLockTimeFromGateway({
|
Future<GetServerDatetimeEntity> getLockTimeFromGateway({
|
||||||
required String lockId,
|
required String lockId,
|
||||||
}) async {
|
}) async {
|
||||||
final res = await apiProvider.getLockTimeFromGatewayLoadData(lockId);
|
final res = await apiProvider.getLockTimeFromGatewayLoadData(lockId);
|
||||||
return GetPassageModeConfigEntity.fromJson(res.body);
|
return GetServerDatetimeEntity.fromJson(res.body);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取服务器当前时间
|
// 获取服务器当前时间
|
||||||
@ -685,6 +684,12 @@ class ApiRepository {
|
|||||||
return LockUserListEntity.fromJson(res.body);
|
return LockUserListEntity.fromJson(res.body);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//锁用户列表
|
||||||
|
Future<LockUserListEntity> deletLockUser(int uid) async {
|
||||||
|
final res = await apiProvider.deletLockUser(uid);
|
||||||
|
return LockUserListEntity.fromJson(res.body);
|
||||||
|
}
|
||||||
|
|
||||||
//用户拥有的钥匙
|
//用户拥有的钥匙
|
||||||
Future<KeyListByUserEntity> keyListByUser(
|
Future<KeyListByUserEntity> keyListByUser(
|
||||||
String pageNo, String pageSize, String uid) async {
|
String pageNo, String pageSize, String uid) async {
|
||||||
@ -833,12 +838,10 @@ class ApiRepository {
|
|||||||
|
|
||||||
// 设置锁开锁提醒
|
// 设置锁开锁提醒
|
||||||
Future<LoginEntity> setLockPickingReminderData({
|
Future<LoginEntity> setLockPickingReminderData({
|
||||||
required String lockId,
|
required int lockId,
|
||||||
required String keyId,
|
required int unlockReminderPush,
|
||||||
required String monitorFlag,
|
|
||||||
}) async {
|
}) async {
|
||||||
final res = await apiProvider.setLockPickingReminderData(
|
final res = await apiProvider.setLockPickingReminderData(lockId, unlockReminderPush);
|
||||||
lockId, keyId, monitorFlag);
|
|
||||||
return LoginEntity.fromJson(res.body);
|
return LoginEntity.fromJson(res.body);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -41,7 +41,7 @@ class CommonItem extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
SizedBox(width: 20.w),
|
SizedBox(width: 20.w),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: isHaveRightWidget! ? 100.w : 300.w,
|
// width: isHaveRightWidget! ? 100.w : 300.w,
|
||||||
child: Text(leftTitel!, style: TextStyle(fontSize: 22.sp))
|
child: Text(leftTitel!, style: TextStyle(fontSize: 22.sp))
|
||||||
),
|
),
|
||||||
SizedBox(width: 6.w),
|
SizedBox(width: 6.w),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user