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", "您好,您的电子钥匙生成成功": "Hello, your electronic key is generated successfully",
"生效时间不能小于当前时间": "The effective time cannot be less than the current time", "生效时间不能小于当前时间": "The effective time cannot be less than the current time",
"结束时间不能小于当前时间": "The end 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", "已连接到锁,请将卡靠近锁的读卡区": "Connected to the lock, please put the card close to the card reading area of the lock",
"尝试连接设备...": "Trying to connect to the device...", "尝试连接设备...": "Trying to connect to the device...",
"地理位置": "Geographical location", "地理位置": "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 ? true
: false, : false,
child: CommonItem( child: CommonItem(
leftTitel: "是否管理员".tr, leftTitel: "是否管理员".tr,
rightTitle: "", rightTitle: "",
isTipsImg: false, isTipsImg: false,
isHaveRightWidget: true, isHaveRightWidget: true,
@ -374,7 +374,7 @@ class _AddCardPageState extends State<AddCardPage>
); );
} }
// //
CupertinoSwitch _isAdmin() { CupertinoSwitch _isAdmin() {
return CupertinoSwitch( return CupertinoSwitch(
activeColor: CupertinoColors.activeBlue, activeColor: CupertinoColors.activeBlue,

View File

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

View File

@ -1,32 +1,30 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import '../../fingerprint/fingerprintList/fingerprintListData_entity.dart'; import '../../fingerprint/fingerprintList/fingerprintListData_entity.dart';
class CardDetailState{ class CardDetailState {
final fingerprintItemData = FingerprintItemData().obs; final fingerprintItemData = FingerprintItemData().obs;
final TextEditingController changeNameController = TextEditingController(); final TextEditingController changeNameController = TextEditingController();
var ifCurrentScreen = true.obs; // , var ifCurrentScreen = true.obs; // ,
var sureBtnState = 0.obs;// 0() 1() var sureBtnState = 0.obs; // 0() 1()
var isDeletCard = true.obs;// var isDeletCard = true.obs; //
var isStressCard = false.obs;// var isStressCard = false.obs; //
var isAdministrator = false.obs;// var isAdministrator = false.obs; //
final typeNumber = "".obs;// final typeNumber = "".obs; //
final typeName = "".obs;// final typeName = "".obs; //
var startDate = "".obs;// var startDate = "".obs; //
var endDate = "".obs;// var endDate = "".obs; //
var starTime = "".obs;// var starTime = "".obs; //
var endTime = "".obs;// var endTime = "".obs; //
final keyType = 0.obs;// :1;23:4 final keyType = 0.obs; // :1;23:4
var weekDay = [].obs;// var weekDay = [].obs; //
var adder = "".obs;// var adder = "".obs; //
var addTime = 0.obs;// var addTime = 0.obs; //
var keyId = 0.obs;// id var keyId = 0.obs; // id
CardDetailState() { CardDetailState() {
Map map = Get.arguments; Map map = Get.arguments;
@ -43,9 +41,11 @@ class CardDetailState{
keyType.value = fingerprintItemData.value.cardType!; keyType.value = fingerprintItemData.value.cardType!;
adder.value = fingerprintItemData.value.senderUsername!; adder.value = fingerprintItemData.value.senderUsername!;
addTime.value = fingerprintItemData.value.createDate!; 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!; 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(); State<DoorLockLogPage> createState() => _DoorLockLogPageState();
} }
class _DoorLockLogPageState extends State<DoorLockLogPage> with RouteAware { class _DoorLockLogPageState extends State<DoorLockLogPage> with RouteAware {
final logic = Get.put(DoorLockLogLogic()); final logic = Get.put(DoorLockLogLogic());
final state = Get.find<DoorLockLogLogic>().state; final state = Get.find<DoorLockLogLogic>().state;
@ -162,19 +162,11 @@ class _DoorLockLogPageState extends State<DoorLockLogPage> with RouteAware {
child: Stack( child: Stack(
children: [ children: [
timelineData.imagesUrl!.isNotEmpty timelineData.imagesUrl!.isNotEmpty
? ? Image.network(
Image.network( timelineData.imagesUrl!,
timelineData.imagesUrl!, width: 260.w,
width: 260.w, height: 260.h,
height: 260.h, )
)
// Image(
// image: const AssetImage(
// 'images/main/icon_lockDetail_monitoringvoiceFrist.png'),
// width: 240.w,
// height: 180.h,
// fit: BoxFit.contain,
// )
: Container(), : Container(),
Positioned( Positioned(
top: 150.h, top: 150.h,
@ -263,5 +255,4 @@ class _DoorLockLogPageState extends State<DoorLockLogPage> with RouteAware {
if (EasyLoading.isShow) EasyLoading.dismiss(animation: true); if (EasyLoading.isShow) EasyLoading.dismiss(animation: true);
state.ifCurrentScreen.value = false; state.ifCurrentScreen.value = false;
} }
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,31 +1,30 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import '../fingerprintList/fingerprintListData_entity.dart'; import '../fingerprintList/fingerprintListData_entity.dart';
class FingerprintDetailState{ class FingerprintDetailState {
final fingerprintItemData = FingerprintItemData().obs; final fingerprintItemData = FingerprintItemData().obs;
final TextEditingController changeNameController = TextEditingController(); final TextEditingController changeNameController = TextEditingController();
final typeNumber = "".obs;// final typeNumber = "".obs; //
final typeName = "".obs;// final typeName = "".obs; //
var starDate = "".obs;// var starDate = "".obs; //
var endDate = "".obs;// var endDate = "".obs; //
var startDate = "".obs;// var startDate = "".obs; //
var endTime = "".obs;// var endTime = "".obs; //
final keyType = 0.obs;// :1;23:4 final keyType = 0.obs; // :1;23:4
var weekDay = [].obs;// var weekDay = [].obs; //
var adder = "".obs;// var adder = "".obs; //
var addTime = 0.obs;// var addTime = 0.obs; //
var keyId = 0.obs; var keyId = 0.obs;
var ifCurrentScreen = true.obs; // , var ifCurrentScreen = true.obs; // ,
var sureBtnState = 0.obs;// 0() 1() var sureBtnState = 0.obs; // 0() 1()
var isDeletFingerprint = true.obs;// var isDeletFingerprint = true.obs; //
final isStressFingerprint = false.obs; final isStressFingerprint = false.obs;
var isAdministrator = false.obs;// var isAdministrator = false.obs; //
FingerprintDetailState() { FingerprintDetailState() {
Map map = Get.arguments; Map map = Get.arguments;
@ -42,9 +41,11 @@ class FingerprintDetailState{
keyType.value = fingerprintItemData.value.fingerprintType!; keyType.value = fingerprintItemData.value.fingerprintType!;
adder.value = fingerprintItemData.value.senderUsername!; adder.value = fingerprintItemData.value.senderUsername!;
addTime.value = fingerprintItemData.value.createDate!; 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!; 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 ? true
: false, : false,
child: CommonItem( child: CommonItem(
leftTitel: "是否管理员".tr, leftTitel: "是否管理员".tr,
rightTitle: "", rightTitle: "",
isTipsImg: false, isTipsImg: false,
isHaveRightWidget: true, isHaveRightWidget: true,
@ -334,7 +334,7 @@ class _AddIrisTypePageState extends State<AddIrisTypePage> {
); );
} }
// //
CupertinoSwitch _isAdmin() { CupertinoSwitch _isAdmin() {
return CupertinoSwitch( return CupertinoSwitch(
activeColor: CupertinoColors.activeBlue, activeColor: CupertinoColors.activeBlue,

View File

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

View File

@ -1,10 +1,8 @@
import 'dart:async'; import 'dart:async';
import 'dart:io';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:get_storage/get_storage.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:star_lock/app_settings/app_colors.dart'; import 'package:star_lock/app_settings/app_colors.dart';
import 'package:star_lock/flavors.dart'; import 'package:star_lock/flavors.dart';
@ -182,7 +180,7 @@ class _LockDetailPageState extends State<LockDetailPage>
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
color: Colors.black.withOpacity(0.15), color: Colors.black.withOpacity(0.15),
offset: Offset(0, 0), offset: const Offset(0, 0),
blurRadius: 10.r, blurRadius: 10.r,
spreadRadius: 0, spreadRadius: 0,
), ),
@ -257,7 +255,7 @@ class _LockDetailPageState extends State<LockDetailPage>
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
color: Colors.black.withOpacity(0.3), color: Colors.black.withOpacity(0.3),
offset: Offset(0, 0), offset: const Offset(0, 0),
blurRadius: 10.r, blurRadius: 10.r,
spreadRadius: 0, 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( SizedBox(
height: 30.h, height: 30.h,
), ),
F.sw(defaultCall: () => adminInfoView(), xhjCall: () => SizedBox()), F.sw(
defaultCall: () => adminInfoView(),
xhjCall: () => const SizedBox()),
SizedBox( SizedBox(
height: 20.h, height: 20.h,
), ),
@ -691,7 +711,7 @@ class _LockDetailPageState extends State<LockDetailPage>
if (add) SizedBox(width: 20.w) else SizedBox(width: 40.w), if (add) SizedBox(width: 20.w) else SizedBox(width: 40.w),
FlavorsImg( FlavorsImg(
child: Image.asset( child: Image.asset(
state.keyInfos.value.remoteEnable == 1 state.keyInfos.value.hasGateway == 1
? 'images/main/icon_main_remoteUnlocking.png' ? 'images/main/icon_main_remoteUnlocking.png'
: 'images/main/icon_main_remoteUnlocking_grey.png', : 'images/main/icon_main_remoteUnlocking_grey.png',
width: 24.w, width: 24.w,
@ -703,7 +723,7 @@ class _LockDetailPageState extends State<LockDetailPage>
TranslationLoader.lanKeys!.gatewayDevice!.tr, TranslationLoader.lanKeys!.gatewayDevice!.tr,
style: TextStyle( style: TextStyle(
fontSize: 20.sp, fontSize: 20.sp,
color: state.keyInfos.value.remoteEnable == 1 color: state.keyInfos.value.hasGateway == 1
? AppColors.mainColor ? AppColors.mainColor
: AppColors.btnDisableColor), : AppColors.btnDisableColor),
), ),

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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