1,首页锁详情页新增是否有网关相关处理

2,首页锁详情页面新增远程开门且关联锁设置远程开门选项
3,自定义密码、指纹、卡、人脸、掌静脉、虹膜详情模块管理员权限不可更改
This commit is contained in:
Daisy 2024-05-13 17:43:44 +08:00
parent 4b6ae01e9a
commit c2fc2956c6
28 changed files with 298 additions and 233 deletions

View File

@ -581,7 +581,7 @@
"您好,您的电子钥匙生成成功": "Hello, your electronic key is generated successfully",
"生效时间不能小于当前时间": "The effective time cannot be less than the current time",
"结束时间不能小于当前时间": "The end time cannot be less than the current time",
"是否管理员": "Is it an administrator",
"是否管理员": "Is it an administrator",
"已连接到锁,请将卡靠近锁的读卡区": "Connected to the lock, please put the card close to the card reading area of the lock",
"尝试连接设备...": "Trying to connect to the device...",
"地理位置": "Geographical location",

View File

@ -605,7 +605,7 @@
"您好,您的电子钥匙生成成功": "您好,您的电子钥匙生成成功",
"生效时间不能小于当前时间": "生效时间不能小于当前时间",
"结束时间不能小于当前时间": "结束时间不能小于当前时间",
"是否是管理员": "是否是管理员",
"是否为管理员": "是否为管理员",
"已连接到锁,请将卡靠近锁的读卡区": "已连接到锁,请将卡靠近锁的读卡区",
"尝试连接设备...": "尝试连接设备...",
"地理位置": "地理位置",

View File

@ -580,7 +580,7 @@
"您好,您的电子钥匙生成成功": "您好,您的电子钥匙生成成功",
"生效时间不能小于当前时间": "生效时间不能小于当前时间",
"结束时间不能小于当前时间": "结束时间不能小于当前时间",
"是否是管理员": "是否是管理员",
"是否为管理员": "是否为管理员",
"已连接到锁,请将卡靠近锁的读卡区": "已连接到锁,请将卡靠近锁的读卡区",
"尝试连接设备...": "尝试连接设备...",
"地理位置": "地理位置",

View File

@ -265,7 +265,7 @@ class _AddCardPageState extends State<AddCardPage>
? true
: false,
child: CommonItem(
leftTitel: "是否管理员".tr,
leftTitel: "是否管理员".tr,
rightTitle: "",
isTipsImg: false,
isHaveRightWidget: true,
@ -374,7 +374,7 @@ class _AddCardPageState extends State<AddCardPage>
);
}
//
//
CupertinoSwitch _isAdmin() {
return CupertinoSwitch(
activeColor: CupertinoColors.activeBlue,

View File

@ -1,4 +1,3 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
@ -41,7 +40,8 @@ class _CardDetailPageState extends State<CardDetailPage> with RouteAware {
body: ListView(
children: [
Obx(() => CommonItem(
leftTitel: "${TranslationLoader.lanKeys!.card!.tr}${TranslationLoader.lanKeys!.number!.tr}",
leftTitel:
"${TranslationLoader.lanKeys!.card!.tr}${TranslationLoader.lanKeys!.number!.tr}",
rightTitle: state.typeNumber.value,
isHaveDirection: false,
isHaveLine: true)),
@ -54,8 +54,8 @@ class _CardDetailPageState extends State<CardDetailPage> with RouteAware {
ShowTipView().showTFViewAlertDialog(
state.changeNameController,
"${TranslationLoader.lanKeys!.amend!.tr}${TranslationLoader.lanKeys!.name!.tr}",
"", (){
if(state.changeNameController.text.isEmpty){
"", () {
if (state.changeNameController.text.isEmpty) {
logic.showToast("请输入姓名".tr);
return;
}
@ -65,7 +65,11 @@ class _CardDetailPageState extends State<CardDetailPage> with RouteAware {
});
})),
Obx(() => Visibility(
visible: (state.keyType.value == 4 || state.keyType.value == 2 || state.keyType.value == 1) ? true : false,
visible: (state.keyType.value == 4 ||
state.keyType.value == 2 ||
state.keyType.value == 1)
? true
: false,
child: CommonItem(
leftTitel: TranslationLoader.lanKeys!.periodValidity!.tr,
allHeight: 70.h,
@ -162,13 +166,15 @@ class _CardDetailPageState extends State<CardDetailPage> with RouteAware {
isTipsImg: false,
isHaveLine: true,
isHaveRightWidget: true,
rightWidget: SizedBox(width: 60.w, height: 50.h, child: _isStressFingerprint()))),
rightWidget: SizedBox(
width: 60.w, height: 50.h, child: _isStressFingerprint()))),
Obx(() => CommonItem(
leftTitel: "是否管理员".tr,
leftTitel: "是否管理员".tr,
rightTitle: "",
isTipsImg: false,
isHaveRightWidget: true,
rightWidget: SizedBox(width: 60.w, height: 50.h, child: _isAdmin()))),
rightWidget:
SizedBox(width: 60.w, height: 50.h, child: _isAdmin()))),
Container(height: 10.h),
CommonItem(
leftTitel: TranslationLoader.lanKeys!.operatingRecord!.tr,
@ -217,7 +223,7 @@ class _CardDetailPageState extends State<CardDetailPage> with RouteAware {
);
}
//
//
CupertinoSwitch _isAdmin() {
return CupertinoSwitch(
activeColor: CupertinoColors.activeBlue,
@ -225,9 +231,9 @@ class _CardDetailPageState extends State<CardDetailPage> with RouteAware {
thumbColor: CupertinoColors.white,
value: state.isAdministrator.value,
onChanged: (value) {
state.isAdministrator.value = value;
state.isDeletCard.value = false;
logic.senderAddICCard();
// state.isAdministrator.value = value;
// state.isDeletCard.value = false;
// logic.senderAddICCard();
},
);
}
@ -282,5 +288,4 @@ class _CardDetailPageState extends State<CardDetailPage> with RouteAware {
state.ifCurrentScreen.value = false;
state.sureBtnState.value = 0;
}
}

View File

@ -1,32 +1,30 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../../fingerprint/fingerprintList/fingerprintListData_entity.dart';
class CardDetailState{
class CardDetailState {
final fingerprintItemData = FingerprintItemData().obs;
final TextEditingController changeNameController = TextEditingController();
var ifCurrentScreen = true.obs; // ,
var sureBtnState = 0.obs;// 0() 1()
var isDeletCard = true.obs;//
var isStressCard = false.obs;//
var isAdministrator = false.obs;//
var sureBtnState = 0.obs; // 0() 1()
var isDeletCard = true.obs; //
var isStressCard = false.obs; //
var isAdministrator = false.obs; //
final typeNumber = "".obs;//
final typeName = "".obs;//
var startDate = "".obs;//
var endDate = "".obs;//
var starTime = "".obs;//
var endTime = "".obs;//
final keyType = 0.obs;// :1;23:4
var weekDay = [].obs;//
var adder = "".obs;//
var addTime = 0.obs;//
var keyId = 0.obs;// id
final typeNumber = "".obs; //
final typeName = "".obs; //
var startDate = "".obs; //
var endDate = "".obs; //
var starTime = "".obs; //
var endTime = "".obs; //
final keyType = 0.obs; // :1;23:4
var weekDay = [].obs; //
var adder = "".obs; //
var addTime = 0.obs; //
var keyId = 0.obs; // id
CardDetailState() {
Map map = Get.arguments;
@ -43,9 +41,11 @@ class CardDetailState{
keyType.value = fingerprintItemData.value.cardType!;
adder.value = fingerprintItemData.value.senderUsername!;
addTime.value = fingerprintItemData.value.createDate!;
isStressCard.value = fingerprintItemData.value.isCoerced! == 2 ? true : false;
isStressCard.value =
fingerprintItemData.value.isCoerced! == 2 ? true : false;
weekDay.value = fingerprintItemData.value.weekDay!;
isAdministrator.value = fingerprintItemData.value.cardRight! == 1 ? true : false;
isAdministrator.value =
fingerprintItemData.value.cardRight! == 1 ? true : false;
}
}
}
}

View File

@ -22,7 +22,7 @@ class DoorLockLogPage extends StatefulWidget {
State<DoorLockLogPage> createState() => _DoorLockLogPageState();
}
class _DoorLockLogPageState extends State<DoorLockLogPage> with RouteAware {
class _DoorLockLogPageState extends State<DoorLockLogPage> with RouteAware {
final logic = Get.put(DoorLockLogLogic());
final state = Get.find<DoorLockLogLogic>().state;
@ -162,19 +162,11 @@ class _DoorLockLogPageState extends State<DoorLockLogPage> with RouteAware {
child: Stack(
children: [
timelineData.imagesUrl!.isNotEmpty
?
Image.network(
timelineData.imagesUrl!,
width: 260.w,
height: 260.h,
)
// Image(
// image: const AssetImage(
// 'images/main/icon_lockDetail_monitoringvoiceFrist.png'),
// width: 240.w,
// height: 180.h,
// fit: BoxFit.contain,
// )
? Image.network(
timelineData.imagesUrl!,
width: 260.w,
height: 260.h,
)
: Container(),
Positioned(
top: 150.h,
@ -263,5 +255,4 @@ class _DoorLockLogPageState extends State<DoorLockLogPage> with RouteAware {
if (EasyLoading.isShow) EasyLoading.dismiss(animation: true);
state.ifCurrentScreen.value = false;
}
}

View File

@ -216,11 +216,10 @@ class _ElectronicKeyDetailPageState extends State<ElectronicKeyDetailPage> {
() => Visibility(
// (state.keyInfo.value.lockSetting!.remoteUnlock == 1 ? true : false
visible: CommonDataManage()
.currentKeyInfo
.lockSetting!
.remoteUnlock ==
1 &&
state.itemData.value.keyRight != 1
.currentKeyInfo
.lockSetting!
.remoteUnlock ==
1
? true
: false,
child: CommonItem(

View File

@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:get_storage/get_storage.dart';
import 'package:star_lock/appRouters.dart';
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
import 'package:star_lock/main/lockDetail/electronicKey/sendElectronicKey/sendElectronicKey/view/sendElectronicKeyView_state.dart';
@ -144,7 +145,7 @@ class SendElectronicKeyViewLogic extends BaseGetXController {
endDate: int.parse(endDate),
faceAuthentication: state.isAuthentication.value == true ? '1' : '2',
isCameraEnable: '2',
isRemoteUnlock: state.isRemoteUnlock == true ? '1' : '2',
isRemoteUnlock: state.isRemoteUnlock.value == true ? '1' : '2',
keyNameForAdmin: state.keyNameController.text,
keyRight: '0',
keyType: getKeyType,

View File

@ -525,13 +525,13 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
: false),
child: Column(
children: [
CommonItem(
Obx(() => CommonItem(
leftTitel: TranslationLoader.lanKeys!.remoteUnlockingAllowed!.tr,
rightTitle: "",
isHaveRightWidget: true,
rightWidget: SizedBox(
width: 60.w, height: 50.h, child: _remoteSwitch(true, logic)),
action: () {}),
action: () {})),
Container(height: 10.h),
],
),
@ -546,11 +546,11 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
trackColor: CupertinoColors.systemGrey5,
thumbColor: CupertinoColors.white,
value: isRemote
? logic.state.isRemoteUnlock
? logic.state.isRemoteUnlock.value
: logic.state.isAuthentication.value,
onChanged: (value) {
if (isRemote) {
logic.state.isRemoteUnlock = !logic.state.isRemoteUnlock;
logic.state.isRemoteUnlock.value = !logic.state.isRemoteUnlock.value;
} else {
logic.state.isAuthentication.value =
!logic.state.isAuthentication.value;

View File

@ -13,7 +13,7 @@ class SendElectronicKeyViewState {
final FlutterContactPicker contactPicker = FlutterContactPicker();
late Contact contact;
bool isRemoteUnlock = false; //
var isRemoteUnlock = false.obs; //
var isAuthentication = false.obs; //
var timeLimitBeginTime = DateTool().dateToYMDHNString(

View File

@ -165,8 +165,8 @@ class _AddFaceTypePageState extends State<AddFaceTypePage>
rightTitle: state.timeLimitEndTime.value,
isHaveDirection: true,
action: () {
PDuration selectDate =
PDuration.parse(DateTime.tryParse(state.timeLimitEndTime.value));
PDuration selectDate = PDuration.parse(
DateTime.tryParse(state.timeLimitEndTime.value));
Pickers.showDatePicker(context,
selectDate: selectDate, mode: DateMode.YMDHM, onConfirm: (p) {
state.timeLimitEndTime.value =
@ -265,7 +265,7 @@ class _AddFaceTypePageState extends State<AddFaceTypePage>
? true
: false,
child: CommonItem(
leftTitel: "是否管理员".tr,
leftTitel: "是否管理员".tr,
rightTitle: "",
isTipsImg: false,
isHaveRightWidget: true,
@ -344,7 +344,7 @@ class _AddFaceTypePageState extends State<AddFaceTypePage>
);
}
//
//
CupertinoSwitch _isAdmin() {
return CupertinoSwitch(
activeColor: CupertinoColors.activeBlue,

View File

@ -8,15 +8,19 @@ class AddFaceTypeState {
final selectType = "0".obs; // 0 1 2
final fromType = 1.obs; // // 1 2
final isStressFingerprint = false.obs;
final isAdministrator = false.obs; //
final isAdministrator = false.obs; //
var timeLimitBeginTime = DateTool().dateToYMDHNString(DateTime.now().millisecondsSinceEpoch.toString()).obs;//
var timeLimitEndTime = DateTool().dateToYMDHNString(DateTime.now().millisecondsSinceEpoch.toString()).obs;//
var timeLimitBeginTime = DateTool()
.dateToYMDHNString(DateTime.now().millisecondsSinceEpoch.toString())
.obs; //
var timeLimitEndTime = DateTool()
.dateToYMDHNString(DateTime.now().millisecondsSinceEpoch.toString())
.obs; //
var cycleBeginTime = "".obs;//
var cycleEndTime = "".obs;//
var effectiveDateTime = "".obs;//
var failureDateTime = "".obs;//
var cycleBeginTime = "".obs; //
var cycleEndTime = "".obs; //
var effectiveDateTime = "".obs; //
var failureDateTime = "".obs; //
var weekdaysList = [].obs;
var fromTypeTwoStaffName = "".obs; //
@ -27,8 +31,9 @@ class AddFaceTypeState {
lockId.value = map["lockId"];
fromType.value = map["fromType"];
// 1 2
if(fromType.value == 2){
fromTypeTwoStaffName.value = map["fromTypeTwoStaffName"]; //
if (fromType.value == 2) {
fromTypeTwoStaffName.value =
map["fromTypeTwoStaffName"]; //
}
}
}

View File

@ -52,8 +52,8 @@ class _FaceDetailPageState extends State<FaceDetailPage> with RouteAware {
ShowTipView().showTFViewAlertDialog(
state.changeNameController,
"${TranslationLoader.lanKeys!.amend!.tr}${TranslationLoader.lanKeys!.name!.tr}",
"", (){
if(state.changeNameController.text.isEmpty){
"", () {
if (state.changeNameController.text.isEmpty) {
logic.showToast("请输入姓名".tr);
return;
}
@ -177,12 +177,12 @@ class _FaceDetailPageState extends State<FaceDetailPage> with RouteAware {
// isHaveLine: true,
// rightWidget: SizedBox(width: 60.w, height: 50.h, child: _isStressFace()))),
Obx(() => CommonItem(
leftTitel: "是否管理员".tr,
leftTitel: "是否管理员".tr,
rightTitle: "",
isTipsImg: false,
isHaveRightWidget: true,
rightWidget: SizedBox(
width: 60.w, height: 50.h, child: _isAdmin()))),
rightWidget:
SizedBox(width: 60.w, height: 50.h, child: _isAdmin()))),
Container(height: 10.h),
CommonItem(
leftTitel: TranslationLoader.lanKeys!.operatingRecord!.tr,
@ -205,7 +205,8 @@ class _FaceDetailPageState extends State<FaceDetailPage> with RouteAware {
left: 30.w, right: 30.w, top: 30.w, bottom: 30.w),
padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
onClick: () {
ShowTipView().showIosTipWithContentDialog("确定要删除吗?".tr, () async {
ShowTipView().showIosTipWithContentDialog("确定要删除吗?".tr,
() async {
state.isDeletFace.value = true;
logic.senderAddFace();
});
@ -231,7 +232,7 @@ class _FaceDetailPageState extends State<FaceDetailPage> with RouteAware {
);
}
//
//
CupertinoSwitch _isAdmin() {
return CupertinoSwitch(
activeColor: CupertinoColors.activeBlue,
@ -239,9 +240,9 @@ class _FaceDetailPageState extends State<FaceDetailPage> with RouteAware {
thumbColor: CupertinoColors.white,
value: state.isAdministrator.value,
onChanged: (value) {
state.isAdministrator.value = value;
state.isDeletFace.value = false;
logic.senderAddFace();
// state.isAdministrator.value = value;
// state.isDeletFace.value = false;
// logic.senderAddFace();
},
);
}

View File

@ -21,9 +21,9 @@ class FaceDetailState {
var ifCurrentScreen = true.obs; // ,
var sureBtnState = 0.obs; // 0() 1()
var isDeletFace = true.obs;//
var isStressFace = false.obs;//
var isAdministrator = false.obs;//
var isDeletFace = true.obs; //
var isStressFace = false.obs; //
var isAdministrator = false.obs; //
FaceDetailState() {
Map map = Get.arguments;

View File

@ -255,7 +255,7 @@ class _AddFingerprintTypePageState extends State<AddFingerprintTypePage> with Si
? true
: false,
child: CommonItem(
leftTitel: "是否管理员".tr,
leftTitel: "是否管理员".tr,
rightTitle: "",
isTipsImg: false,
isHaveRightWidget: true,
@ -429,7 +429,7 @@ class _AddFingerprintTypePageState extends State<AddFingerprintTypePage> with Si
);
}
//
//
CupertinoSwitch _isAdmin() {
return CupertinoSwitch(
activeColor: CupertinoColors.activeBlue,

View File

@ -1,22 +1,25 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../../../../tools/dateTool.dart';
class AddFingerprintState{
class AddFingerprintState {
final lockId = 0.obs;
final selectType = "0".obs;// 0 1 2
final selectType = "0".obs; // 0 1 2
final fromType = 1.obs; // // 1 2
final isStressFingerprint = false.obs;
final isAdministrator = false.obs;//
final isAdministrator = false.obs; //
var timeLimitBeginTime = DateTool().dateToYMDHNString(DateTime.now().millisecondsSinceEpoch.toString()).obs;//
var timeLimitEndTime = DateTool().dateToYMDHNString(DateTime.now().millisecondsSinceEpoch.toString()).obs;//
var cycleBeginTime = "".obs;//
var cycleEndTime = "".obs;//
var effectiveDateTime = "".obs;//
var failureDateTime = "".obs;//
var timeLimitBeginTime = DateTool()
.dateToYMDHNString(DateTime.now().millisecondsSinceEpoch.toString())
.obs; //
var timeLimitEndTime = DateTool()
.dateToYMDHNString(DateTime.now().millisecondsSinceEpoch.toString())
.obs; //
var cycleBeginTime = "".obs; //
var cycleEndTime = "".obs; //
var effectiveDateTime = "".obs; //
var failureDateTime = "".obs; //
var weekdaysList = [].obs;
var fromTypeTwoStaffName = "".obs; //
@ -27,8 +30,9 @@ class AddFingerprintState{
lockId.value = map["lockId"];
fromType.value = map["fromType"];
// 1 2
if(fromType.value == 2){
fromTypeTwoStaffName.value = map["fromTypeTwoStaffName"]; //
if (fromType.value == 2) {
fromTypeTwoStaffName.value =
map["fromTypeTwoStaffName"]; //
}
}
}

View File

@ -1,4 +1,3 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
@ -26,7 +25,8 @@ class FingerprintDetailPage extends StatefulWidget {
State<FingerprintDetailPage> createState() => _FingerprintDetailPageState();
}
class _FingerprintDetailPageState extends State<FingerprintDetailPage> with RouteAware {
class _FingerprintDetailPageState extends State<FingerprintDetailPage>
with RouteAware {
final logic = Get.put(FingerprintDetailLogic());
final state = Get.find<FingerprintDetailLogic>().state;
@ -42,7 +42,8 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage> with Rout
body: Column(
children: [
Obx(() => CommonItem(
leftTitel: "${TranslationLoader.lanKeys!.fingerprint!.tr}${TranslationLoader.lanKeys!.number!.tr}",
leftTitel:
"${TranslationLoader.lanKeys!.fingerprint!.tr}${TranslationLoader.lanKeys!.number!.tr}",
rightTitle: state.typeNumber.value,
isHaveDirection: false,
isHaveLine: true)),
@ -55,8 +56,8 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage> with Rout
ShowTipView().showTFViewAlertDialog(
state.changeNameController,
"${TranslationLoader.lanKeys!.amend!.tr}${TranslationLoader.lanKeys!.name!.tr}",
"", (){
if(state.changeNameController.text.isEmpty){
"", () {
if (state.changeNameController.text.isEmpty) {
logic.showToast("请输入姓名".tr);
return;
}
@ -64,10 +65,13 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage> with Rout
state.typeName.value = state.changeNameController.text;
logic.editFingerprintsData();
});
})),
Obx(() => Visibility(
visible: (state.keyType.value == 4 || state.keyType.value == 2 || state.keyType.value == 1) ? true : false,
visible: (state.keyType.value == 4 ||
state.keyType.value == 2 ||
state.keyType.value == 1)
? true
: false,
child: CommonItem(
leftTitel: TranslationLoader.lanKeys!.periodValidity!.tr,
allHeight: 70.h,
@ -76,26 +80,32 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage> with Rout
isHaveDirection: true,
isHaveLine: true,
action: () async {
if(state.keyType.value == 2 || state.keyType.value == 1){
if (state.keyType.value == 2 || state.keyType.value == 1) {
//
var data = await Get.toNamed(Routers.otherTypeKeyChangeDatePage, arguments: {
"pushType": 1,
"fingerprintItemData": state.fingerprintItemData.value,
});
if(data != null) {
var data = await Get.toNamed(
Routers.otherTypeKeyChangeDatePage,
arguments: {
"pushType": 1,
"fingerprintItemData":
state.fingerprintItemData.value,
});
if (data != null) {
setState(() {
state.starDate.value = data["beginTimeTimestamp"];
state.endDate.value = data["endTimeTimestamp"];
state.keyType.value = 2;
});
}
}else if(state.keyType.value == 4){
} else if (state.keyType.value == 4) {
//
var data = await Get.toNamed(Routers.otherTypeKeyChangeValidityDatePage, arguments: {
"pushType": 1,
"fingerprintItemData": state.fingerprintItemData.value,
});
if(data != null) {
var data = await Get.toNamed(
Routers.otherTypeKeyChangeValidityDatePage,
arguments: {
"pushType": 1,
"fingerprintItemData":
state.fingerprintItemData.value,
});
if (data != null) {
setState(() {
state.starDate.value = data["starDate"];
state.endDate.value = data["endDate"];
@ -114,11 +124,14 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage> with Rout
isHaveDirection: true,
isHaveLine: true,
action: () async {
var data = await Get.toNamed(Routers.otherTypeKeyChangeValidityDatePage, arguments: {
"pushType": 1,
"fingerprintItemData": state.fingerprintItemData.value,
});
if(data != null) {
var data = await Get.toNamed(
Routers.otherTypeKeyChangeValidityDatePage,
arguments: {
"pushType": 1,
"fingerprintItemData":
state.fingerprintItemData.value,
});
if (data != null) {
setState(() {
state.starDate.value = data["starDate"];
state.endDate.value = data["endDate"];
@ -132,14 +145,18 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage> with Rout
visible: state.keyType.value == 4 ? true : false,
child: Obx(() => CommonItem(
leftTitel: "有效时间".tr,
rightTitle: "${DateTool().dateToHNString(state.startDate.value)}-${DateTool().dateToHNString(state.endTime.value)}",
rightTitle:
"${DateTool().dateToHNString(state.startDate.value)}-${DateTool().dateToHNString(state.endTime.value)}",
isHaveDirection: true,
action: () async {
var data = await Get.toNamed(Routers.otherTypeKeyChangeValidityDatePage, arguments: {
"pushType": 1,
"fingerprintItemData": state.fingerprintItemData.value,
});
if(data != null) {
var data = await Get.toNamed(
Routers.otherTypeKeyChangeValidityDatePage,
arguments: {
"pushType": 1,
"fingerprintItemData":
state.fingerprintItemData.value,
});
if (data != null) {
setState(() {
state.starDate.value = data["starDate"];
state.endDate.value = data["endDate"];
@ -154,12 +171,11 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage> with Rout
leftTitel: TranslationLoader.lanKeys!.additive!.tr,
rightTitle: state.adder.value,
isHaveLine: true,
action: () {
})),
action: () {})),
Obx(() => CommonItem(
leftTitel: TranslationLoader.lanKeys!.addTime!.tr,
rightTitle: DateTool().dateToYMDHNString(state.addTime.value.toString()),
leftTitel: TranslationLoader.lanKeys!.addTime!.tr,
rightTitle: DateTool()
.dateToYMDHNString(state.addTime.value.toString()),
)),
SizedBox(height: 10.h),
Obx(() => CommonItem(
@ -171,11 +187,12 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage> with Rout
rightWidget: SizedBox(
width: 60.w, height: 50.h, child: _isStressFingerprint()))),
Obx(() => CommonItem(
leftTitel: "是否管理员".tr,
leftTitel: "是否管理员".tr,
rightTitle: "",
isTipsImg: false,
isHaveRightWidget: true,
rightWidget: SizedBox(width: 60.w, height: 50.h, child: _isAdmin()))),
rightWidget:
SizedBox(width: 60.w, height: 50.h, child: _isAdmin()))),
Container(height: 10.h),
CommonItem(
leftTitel: TranslationLoader.lanKeys!.operatingRecord!.tr,
@ -185,7 +202,8 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage> with Rout
//
Get.toNamed(Routers.keyOperationRecordPage, arguments: {
'lockId': state.fingerprintItemData.value.lockId.toString(),
'fingerprintId': state.fingerprintItemData.value.fingerprintId.toString()
'fingerprintId':
state.fingerprintItemData.value.fingerprintId.toString()
});
}),
// SizedBox(height: 40.h),
@ -195,10 +213,12 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage> with Rout
btnName: TranslationLoader.lanKeys!.delete!.tr,
isDelete: true,
borderRadius: 20.w,
margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w, bottom: 30.w),
margin: EdgeInsets.only(
left: 30.w, right: 30.w, top: 30.w, bottom: 30.w),
padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
onClick: () {
ShowTipView().showIosTipWithContentDialog("确定要删除吗?".tr, () async {
ShowTipView().showIosTipWithContentDialog("确定要删除吗?".tr,
() async {
state.isDeletFingerprint.value = true;
logic.senderAddFingerprint();
});
@ -225,7 +245,7 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage> with Rout
);
}
//
//
CupertinoSwitch _isAdmin() {
return CupertinoSwitch(
activeColor: CupertinoColors.activeBlue,
@ -233,9 +253,9 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage> with Rout
thumbColor: CupertinoColors.white,
value: state.isAdministrator.value,
onChanged: (value) {
state.isAdministrator.value = value;
state.isDeletFingerprint.value = false;
logic.senderAddFingerprint();
// state.isAdministrator.value = value;
// state.isDeletFingerprint.value = false;
// logic.senderAddFingerprint();
},
);
}
@ -290,5 +310,4 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage> with Rout
state.ifCurrentScreen.value = false;
state.sureBtnState.value = 0;
}
}

View File

@ -1,31 +1,30 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../fingerprintList/fingerprintListData_entity.dart';
class FingerprintDetailState{
class FingerprintDetailState {
final fingerprintItemData = FingerprintItemData().obs;
final TextEditingController changeNameController = TextEditingController();
final typeNumber = "".obs;//
final typeName = "".obs;//
var starDate = "".obs;//
var endDate = "".obs;//
var startDate = "".obs;//
var endTime = "".obs;//
final keyType = 0.obs;// :1;23:4
var weekDay = [].obs;//
var adder = "".obs;//
var addTime = 0.obs;//
final typeNumber = "".obs; //
final typeName = "".obs; //
var starDate = "".obs; //
var endDate = "".obs; //
var startDate = "".obs; //
var endTime = "".obs; //
final keyType = 0.obs; // :1;23:4
var weekDay = [].obs; //
var adder = "".obs; //
var addTime = 0.obs; //
var keyId = 0.obs;
var ifCurrentScreen = true.obs; // ,
var sureBtnState = 0.obs;// 0() 1()
var isDeletFingerprint = true.obs;//
var sureBtnState = 0.obs; // 0() 1()
var isDeletFingerprint = true.obs; //
final isStressFingerprint = false.obs;
var isAdministrator = false.obs;//
var isAdministrator = false.obs; //
FingerprintDetailState() {
Map map = Get.arguments;
@ -42,9 +41,11 @@ class FingerprintDetailState{
keyType.value = fingerprintItemData.value.fingerprintType!;
adder.value = fingerprintItemData.value.senderUsername!;
addTime.value = fingerprintItemData.value.createDate!;
isStressFingerprint.value = fingerprintItemData.value.isCoerced! == 2 ? true : false;
isStressFingerprint.value =
fingerprintItemData.value.isCoerced! == 2 ? true : false;
weekDay.value = fingerprintItemData.value.weekDay!;
isAdministrator.value = fingerprintItemData.value.fingerRight! == 1 ? true : false;
isAdministrator.value =
fingerprintItemData.value.fingerRight! == 1 ? true : false;
}
}
}
}

View File

@ -255,7 +255,7 @@ class _AddIrisTypePageState extends State<AddIrisTypePage> {
? true
: false,
child: CommonItem(
leftTitel: "是否管理员".tr,
leftTitel: "是否管理员".tr,
rightTitle: "",
isTipsImg: false,
isHaveRightWidget: true,
@ -334,7 +334,7 @@ class _AddIrisTypePageState extends State<AddIrisTypePage> {
);
}
//
//
CupertinoSwitch _isAdmin() {
return CupertinoSwitch(
activeColor: CupertinoColors.activeBlue,

View File

@ -7,7 +7,7 @@ class AddIrisTypeState {
final fromType = 1.obs; // // 1 2
var fromTypeTwoStaffName = "".obs; //
final isStressFingerprint = false.obs;
final isAdministrator = false.obs; //
final isAdministrator = false.obs; //
var beginTime = "".obs; //
var endTime = "".obs; //
@ -24,6 +24,5 @@ class AddIrisTypeState {
// fromTypeTwoStaffName = map["fromTypeTwoStaffName"]; //
// // nameController.text = fromTypeTwoStaffName.value;
// }
}
}

View File

@ -1,10 +1,8 @@
import 'dart:async';
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:get_storage/get_storage.dart';
import 'package:intl/intl.dart';
import 'package:star_lock/app_settings/app_colors.dart';
import 'package:star_lock/flavors.dart';
@ -182,7 +180,7 @@ class _LockDetailPageState extends State<LockDetailPage>
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.15),
offset: Offset(0, 0),
offset: const Offset(0, 0),
blurRadius: 10.r,
spreadRadius: 0,
),
@ -257,7 +255,7 @@ class _LockDetailPageState extends State<LockDetailPage>
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.3),
offset: Offset(0, 0),
offset: const Offset(0, 0),
blurRadius: 10.r,
spreadRadius: 0,
),
@ -631,6 +629,26 @@ class _LockDetailPageState extends State<LockDetailPage>
],
),
)),
Positioned(
right: 90.w,
bottom: 1,
child: Obx(() => Visibility(
visible: state.keyInfos.value.lockSetting!.remoteUnlock == 1
? true
: false,
child: GestureDetector(
onTap: () {},
child: Align(
alignment: const Alignment(0.6, 1),
child: FlavorsImg(
child: Image.asset(
'images/main/icon_main_remoteUnlocking.png',
width: 50.w,
height: 52.w,
),
)),
))),
)
],
),
),
@ -652,7 +670,9 @@ class _LockDetailPageState extends State<LockDetailPage>
SizedBox(
height: 30.h,
),
F.sw(defaultCall: () => adminInfoView(), xhjCall: () => SizedBox()),
F.sw(
defaultCall: () => adminInfoView(),
xhjCall: () => const SizedBox()),
SizedBox(
height: 20.h,
),
@ -691,7 +711,7 @@ class _LockDetailPageState extends State<LockDetailPage>
if (add) SizedBox(width: 20.w) else SizedBox(width: 40.w),
FlavorsImg(
child: Image.asset(
state.keyInfos.value.remoteEnable == 1
state.keyInfos.value.hasGateway == 1
? 'images/main/icon_main_remoteUnlocking.png'
: 'images/main/icon_main_remoteUnlocking_grey.png',
width: 24.w,
@ -703,7 +723,7 @@ class _LockDetailPageState extends State<LockDetailPage>
TranslationLoader.lanKeys!.gatewayDevice!.tr,
style: TextStyle(
fontSize: 20.sp,
color: state.keyInfos.value.remoteEnable == 1
color: state.keyInfos.value.hasGateway == 1
? AppColors.mainColor
: AppColors.btnDisableColor),
),

View File

@ -255,7 +255,7 @@ class _AddPalmTypePageState extends State<AddPalmTypePage> {
? true
: false,
child: CommonItem(
leftTitel: "是否管理员".tr,
leftTitel: "是否管理员".tr,
rightTitle: "",
isTipsImg: false,
isHaveRightWidget: true,
@ -334,7 +334,7 @@ class _AddPalmTypePageState extends State<AddPalmTypePage> {
);
}
//
//
CupertinoSwitch _isAdmin() {
return CupertinoSwitch(
activeColor: CupertinoColors.activeBlue,

View File

@ -7,7 +7,7 @@ class AddPalmTypeState {
final fromType = 1.obs; // // 1 2
var fromTypeTwoStaffName = "".obs; //
final isStressFingerprint = false.obs;
final isAdministrator = false.obs; //
final isAdministrator = false.obs; //
var beginTime = "".obs; //
var endTime = "".obs; //

View File

@ -25,7 +25,8 @@ class PasswordKeyDetailPage extends StatefulWidget {
State<PasswordKeyDetailPage> createState() => _PasswordKeyDetailPageState();
}
class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage> with RouteAware {
class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage>
with RouteAware {
final logic = Get.put(PasswordKeyDetailLogic());
final state = Get.find<PasswordKeyDetailLogic>().state;
@ -56,13 +57,15 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage> with Rout
Obx(() => CommonItem(
leftTitel: TranslationLoader.lanKeys!.password!.tr,
rightTitle: state.keyboardPwd.value,
isHaveDirection: state.itemData.value.isCustom! == 1 ? true : false,
isHaveDirection:
state.itemData.value.isCustom! == 1 ? true : false,
isHaveLine: true,
action: () {
if (state.itemData.value.isCustom! != 1) {
return;
} else {
showCupertinoAlertDialog(context, state.inputPwdController);
showCupertinoAlertDialog(
context, state.inputPwdController);
}
})),
Obx(() => CommonItem(
@ -78,31 +81,37 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage> with Rout
leftTitel: "有效期",
rightTitle: logic.getUseDateStr(),
isHaveLine: state.isCirculation.value,
isHaveDirection: state.itemData.value.isCustom! == 1 ? true : false,
isHaveDirection:
state.itemData.value.isCustom! == 1 ? true : false,
allHeight:
state.itemData.value.keyboardPwdType == 3 ? 90.h : 65.h,
state.itemData.value.keyboardPwdType == 3 ? 90.h : 65.h,
action: () async {
if (state.itemData.value.isCustom! != 1) {
return;
}
var backData = await Get.toNamed(Routers.passwordKeyDetailChangeDatePage, arguments: {
'itemData': state.itemData.value,
});
var backData = await Get.toNamed(
Routers.passwordKeyDetailChangeDatePage,
arguments: {
'itemData': state.itemData.value,
});
if (backData != null) {
state.itemData.value.startDate = int.parse(backData["beginTimeTimestamp"])*1000;
state.itemData.value.endDate = int.parse(backData["endTimeTimestamp"])*1000;
state.itemData.value.startDate =
int.parse(backData["beginTimeTimestamp"]) * 1000;
state.itemData.value.endDate =
int.parse(backData["endTimeTimestamp"]) * 1000;
//
state.itemData.value.keyboardPwdType = 3;
setState(() {});
}
})),
Obx(() => Visibility(
visible: state.isCirculation.value,
child: CommonItem(
leftTitel: "结束时间",
rightTitle: DateTool().dateToYMDHNString(state.itemData.value.endDate.toString()),
isHaveLine: true),
)),
visible: state.isCirculation.value,
child: CommonItem(
leftTitel: "结束时间",
rightTitle: DateTool().dateToYMDHNString(
state.itemData.value.endDate.toString()),
isHaveLine: true),
)),
Container(height: 10.h),
CommonItem(
leftTitel: TranslationLoader.lanKeys!.sender!.tr,
@ -115,19 +124,20 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage> with Rout
action: () {}),
Container(height: 10.h),
Obx(() => Visibility(
visible: state.itemData.value.isCustom! == 1,
child: Column(
children: [
CommonItem(
leftTitel: "管理员".tr,
rightTitle: "",
isTipsImg: false,
isHaveRightWidget: true,
rightWidget: SizedBox(width: 60.w, height: 50.h, child: _isAdmin())),
Container(height: 10.h),
],
),
)),
visible: state.itemData.value.isCustom! == 1,
child: Column(
children: [
CommonItem(
leftTitel: "是否为管理员".tr,
rightTitle: "",
isTipsImg: false,
isHaveRightWidget: true,
rightWidget: SizedBox(
width: 60.w, height: 50.h, child: _isAdmin())),
Container(height: 10.h),
],
),
)),
CommonItem(
leftTitel: TranslationLoader.lanKeys!.operatingRecord!.tr,
rightTitle: "",
@ -215,7 +225,7 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage> with Rout
left: 30.w, right: 30.w, top: 30.w, bottom: 30.w),
padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
onClick: () {
ShowTipView().showIosTipWithContentDialog("确定要删除吗?".tr, (){
ShowTipView().showIosTipWithContentDialog("确定要删除吗?".tr, () {
state.isDeletPasswordKey.value = true;
logic.senderCustomPasswords();
});
@ -225,7 +235,7 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage> with Rout
));
}
//
//
CupertinoSwitch _isAdmin() {
return CupertinoSwitch(
activeColor: CupertinoColors.activeBlue,
@ -233,9 +243,9 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage> with Rout
thumbColor: CupertinoColors.white,
value: state.isAdministrator.value,
onChanged: (value) {
state.isAdministrator.value = value;
state.isDeletPasswordKey.value = false;
logic.senderCustomPasswords();
// state.isAdministrator.value = value;
// state.isDeletPasswordKey.value = false;
// logic.senderCustomPasswords();
},
);
}
@ -243,7 +253,8 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage> with Rout
//
String getSenderDate(PasswordKeyListItem indexEntity) {
String senderDate = '';
DateTime dateStr = DateTime.fromMillisecondsSinceEpoch(indexEntity.sendDate!);
DateTime dateStr =
DateTime.fromMillisecondsSinceEpoch(indexEntity.sendDate!);
senderDate = dateStr.toLocal().toString().substring(0, 16);
return senderDate;
}
@ -257,28 +268,33 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage> with Rout
title: inputController == state.inputNameController
? "${TranslationLoader.lanKeys!.amend!.tr}${TranslationLoader.lanKeys!.name!.tr}"
: "${TranslationLoader.lanKeys!.amend!.tr}${TranslationLoader.lanKeys!.password!.tr}",
tipTitle: inputController.text.isNotEmpty ? inputController.text : "请输入6-9位密码",
tipTitle: inputController.text.isNotEmpty
? inputController.text
: "请输入6-9位密码",
controller: inputController,
keyboardType: inputController == state.inputNameController
? TextInputType.text
: TextInputType.number,
inputFormatters: <TextInputFormatter>[
FilteringTextInputFormatter.deny('\n'),
LengthLimitingTextInputFormatter(inputController == state.inputNameController ? 50 : 9),
],
inputFormatters: <TextInputFormatter>[
FilteringTextInputFormatter.deny('\n'),
LengthLimitingTextInputFormatter(
inputController == state.inputNameController ? 50 : 9),
],
sureClick: () {
//
if(inputController == state.inputPwdController){
if (inputController.text.isEmpty || inputController.text.length < 6 || inputController.text.length > 9) {
if (inputController == state.inputPwdController) {
if (inputController.text.isEmpty ||
inputController.text.length < 6 ||
inputController.text.length > 9) {
logic.showToast("请输入6-9位密码");
return;
}
}
state.isDeletPasswordKey.value = false;
if(inputController == state.inputNameController){
if (inputController == state.inputNameController) {
//
logic.updatePwdRequest(1);
}else{
} else {
//
logic.senderCustomPasswords();
}
@ -378,13 +394,13 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage> with Rout
case 0:
//
{
NativeInteractionTool().loadNativeShare(shareText:pwdShareStr);
NativeInteractionTool().loadNativeShare(shareText: pwdShareStr);
}
break;
case 1:
//
{
NativeInteractionTool().loadNativeShare(shareText:pwdShareStr);
NativeInteractionTool().loadNativeShare(shareText: pwdShareStr);
}
break;
case 2:
@ -396,7 +412,7 @@ class _PasswordKeyDetailPageState extends State<PasswordKeyDetailPage> with Rout
case 3:
//
{
NativeInteractionTool().loadNativeShare(shareText:pwdShareStr);
NativeInteractionTool().loadNativeShare(shareText: pwdShareStr);
}
break;
default:

View File

@ -342,7 +342,7 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage>
children: [
// SizedBox(height: 10.h),
Obx(() => CommonItem(
leftTitel: "是否管理员".tr,
leftTitel: "是否管理员".tr,
rightTitle: "",
isTipsImg: false,
isHaveRightWidget: true,
@ -633,7 +633,7 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage>
);
}
//
//
CupertinoSwitch _isAdministrator() {
return CupertinoSwitch(
activeColor: CupertinoColors.activeBlue,

View File

@ -12,7 +12,7 @@ class PasswordKeyPerpetualState {
final isPermanent = true.obs; //
var getPwdStr = ''.obs;
var pwdNameStr = '';
final isAdministrator = false.obs; //
final isAdministrator = false.obs; //
var beginTime = DateTool().getNowDateWithType(3).obs; //
var endTime = DateTool().getNowDateWithType(3).obs; //

View File

@ -130,6 +130,7 @@ class LockListInfoItemEntity {
Bluetooth? bluetooth;
LockFeature? lockFeature;
LockSetting? lockSetting;
int? hasGateway;
LockListInfoItemEntity(
{this.keyId,
@ -163,7 +164,8 @@ class LockListInfoItemEntity {
this.isOnlyManageSelf,
this.restoreCount,
this.model,
this.vendor});
this.vendor,
this.hasGateway});
LockListInfoItemEntity.fromJson(Map<String, dynamic> json) {
keyId = json['keyId'];
@ -204,6 +206,7 @@ class LockListInfoItemEntity {
lockSetting = json['lockSetting'] != null
? LockSetting.fromJson(json['lockSetting'])
: null;
hasGateway = json['hasGateway'];
}
Map<String, dynamic> toJson() {
@ -246,6 +249,7 @@ class LockListInfoItemEntity {
if (lockSetting != null) {
data['lockSetting'] = lockSetting!.toJson();
}
data['hasGateway'] = hasGateway;
return data;
}
}