根据厂商类型添加离线限时密码是否选择开始时间
This commit is contained in:
parent
c505fcd2f3
commit
edd99cbe48
@ -290,25 +290,6 @@ class _AddCardPageState extends State<AddCardPage> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
String getAppBarTitle(int type) {
|
|
||||||
String title;
|
|
||||||
switch (type) {
|
|
||||||
case 0:
|
|
||||||
title = TranslationLoader.lanKeys!.stressCard!.tr;
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
title = TranslationLoader.lanKeys!.stressFingerprint!.tr;
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
title = TranslationLoader.lanKeys!.remoteControl!.tr;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
title = "";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return title;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 接受者信息输入框
|
// 接受者信息输入框
|
||||||
Widget getTFWidget(String tfStr) {
|
Widget getTFWidget(String tfStr) {
|
||||||
return Container(
|
return Container(
|
||||||
|
|||||||
@ -16,6 +16,7 @@ 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';
|
||||||
import '../../../../tools/baseGetXController.dart';
|
import '../../../../tools/baseGetXController.dart';
|
||||||
|
import '../../../../tools/commonDataManage.dart';
|
||||||
import '../../../../tools/dateTool.dart';
|
import '../../../../tools/dateTool.dart';
|
||||||
import '../../../../tools/storage.dart';
|
import '../../../../tools/storage.dart';
|
||||||
|
|
||||||
@ -46,31 +47,34 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
|
|||||||
String lockId = state.keyInfo.value.lockId.toString();
|
String lockId = state.keyInfo.value.lockId.toString();
|
||||||
String getKeyType = state.widgetType.value.toString();
|
String getKeyType = state.widgetType.value.toString();
|
||||||
|
|
||||||
if (state.nameController.text.isEmpty) {
|
if (state.nameController.text.isEmpty) {
|
||||||
showToast("请输入姓名".tr);
|
showToast("请输入姓名".tr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//循环密码
|
|
||||||
if (state.widgetType.value == 4) {
|
|
||||||
if (startDate < DateTool().dateToTimestamp(DateTool().getNowDateWithType(3), 1)) {
|
|
||||||
showToast("生效时间不能小于当前时间".tr);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (state.widgetType.value == 0) {
|
if (state.widgetType.value == 0) {
|
||||||
//永久
|
//永久
|
||||||
getKeyType = '2';
|
getKeyType = '2';
|
||||||
} else if (state.widgetType.value == 1) {
|
} else if (state.widgetType.value == 1) {
|
||||||
//限时
|
//限时
|
||||||
if (startDate < DateTool().dateToTimestamp(DateTool().getNowDateWithType(3), 1)) {
|
if(CommonDataManage().currentKeyInfo.vendor == "XL"){
|
||||||
showToast("生效时间不能小于当前时间".tr);
|
// 鑫鸿佳
|
||||||
return;
|
//限时
|
||||||
}
|
if (startDate < DateTool().dateToTimestamp(DateTool().getNowDateWithType(3), 1)) {
|
||||||
|
showToast("生效时间不能小于当前时间".tr);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (startDate >= endDate) {
|
if (startDate >= endDate) {
|
||||||
showToast("失效时间要大于生效时间".tr);
|
showToast("失效时间要大于生效时间".tr);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
if (endDate < DateTool().dateToTimestamp(DateTool().getNowDateWithType(3), 1)) {
|
||||||
|
showToast("生效时间不能小于当前时间".tr);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
startDate = 0;
|
||||||
}
|
}
|
||||||
getKeyType = '3';
|
getKeyType = '3';
|
||||||
} else if (state.widgetType.value == 2) {
|
} else if (state.widgetType.value == 2) {
|
||||||
@ -80,7 +84,11 @@ class PasswordKeyPerpetualLogic extends BaseGetXController {
|
|||||||
//自定义
|
//自定义
|
||||||
} else if (state.widgetType.value == 4) {
|
} else if (state.widgetType.value == 4) {
|
||||||
//循环
|
//循环
|
||||||
//限时
|
if (startDate < DateTool().dateToTimestamp(DateTool().getNowDateWithType(3), 1)) {
|
||||||
|
showToast("生效时间不能小于当前时间".tr);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (endDate < DateTool().dateToTimestamp(DateTool().getNowDateWithType(3), 1)) {
|
if (endDate < DateTool().dateToTimestamp(DateTool().getNowDateWithType(3), 1)) {
|
||||||
showToast("结束时间不能小于当前时间".tr);
|
showToast("结束时间不能小于当前时间".tr);
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -7,6 +7,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:star_lock/app_settings/app_colors.dart';
|
import 'package:star_lock/app_settings/app_colors.dart';
|
||||||
import 'package:star_lock/main/lockDetail/passwordKey/passwordKey_perpetual/passwordKey_perpetual_logic.dart';
|
import 'package:star_lock/main/lockDetail/passwordKey/passwordKey_perpetual/passwordKey_perpetual_logic.dart';
|
||||||
|
import 'package:star_lock/tools/commonDataManage.dart';
|
||||||
import 'package:star_lock/tools/pickers/pickers.dart';
|
import 'package:star_lock/tools/pickers/pickers.dart';
|
||||||
import 'package:star_lock/tools/pickers/style/default_style.dart';
|
import 'package:star_lock/tools/pickers/style/default_style.dart';
|
||||||
import 'package:star_lock/tools/pickers/time_picker/model/date_mode.dart';
|
import 'package:star_lock/tools/pickers/time_picker/model/date_mode.dart';
|
||||||
@ -193,22 +194,25 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> wit
|
|||||||
Widget keyTimeLimitWidget() {
|
Widget keyTimeLimitWidget() {
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
CommonItem(
|
Visibility(
|
||||||
leftTitel: TranslationLoader.lanKeys!.effectiveTime!.tr,
|
visible: CommonDataManage().currentKeyInfo.vendor == "XHJ" ? false : true,
|
||||||
rightTitle: state.beginTime.value,
|
child: CommonItem(
|
||||||
isHaveLine: true,
|
leftTitel: TranslationLoader.lanKeys!.effectiveTime!.tr,
|
||||||
isHaveDirection: true,
|
rightTitle: state.beginTime.value,
|
||||||
action: () {
|
isHaveLine: true,
|
||||||
Pickers.showDatePicker(context, mode: state.widgetType.value == 3 ? DateMode.YMDHM:DateMode.YMDH, onConfirm: (p) {
|
isHaveDirection: true,
|
||||||
if (state.widgetType.value == 3) {
|
action: () {
|
||||||
// 自定义
|
Pickers.showDatePicker(context, mode: state.widgetType.value == 3 ? DateMode.YMDHM:DateMode.YMDH, onConfirm: (p) {
|
||||||
state.beginTime.value = DateTool().getYMDHNDateString(p, 1);
|
if (state.widgetType.value == 3) {
|
||||||
} else {
|
// 自定义
|
||||||
state.beginTime.value = DateTool().getYMDHNDateString(p, 4);
|
state.beginTime.value = DateTool().getYMDHNDateString(p, 1);
|
||||||
}
|
} else {
|
||||||
Get.log("beginTime:${state.beginTime.value}");
|
state.beginTime.value = DateTool().getYMDHNDateString(p, 4);
|
||||||
});
|
}
|
||||||
}),
|
Get.log("beginTime:${state.beginTime.value}");
|
||||||
|
});
|
||||||
|
}),
|
||||||
|
),
|
||||||
CommonItem(
|
CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.failureTime!.tr,
|
leftTitel: TranslationLoader.lanKeys!.failureTime!.tr,
|
||||||
rightTitle: state.endTime.value,
|
rightTitle: state.endTime.value,
|
||||||
|
|||||||
@ -122,6 +122,10 @@ class LockListInfoItemEntity {
|
|||||||
int? senderUserId;
|
int? senderUserId;
|
||||||
int? electricQuantityDate;
|
int? electricQuantityDate;
|
||||||
int? electricQuantityStandby;
|
int? electricQuantityStandby;
|
||||||
|
int? isOnlyManageSelf;
|
||||||
|
int? restoreCount;
|
||||||
|
String? model;
|
||||||
|
String? vendor;
|
||||||
Bluetooth? bluetooth;
|
Bluetooth? bluetooth;
|
||||||
LockFeature? lockFeature;
|
LockFeature? lockFeature;
|
||||||
LockSetting? lockSetting;
|
LockSetting? lockSetting;
|
||||||
@ -153,7 +157,11 @@ class LockListInfoItemEntity {
|
|||||||
this.lockUserNo,
|
this.lockUserNo,
|
||||||
this.electricQuantityDate,
|
this.electricQuantityDate,
|
||||||
this.electricQuantityStandby,
|
this.electricQuantityStandby,
|
||||||
this.senderUserId});
|
this.senderUserId,
|
||||||
|
this.isOnlyManageSelf,
|
||||||
|
this.restoreCount,
|
||||||
|
this.model,
|
||||||
|
this.vendor});
|
||||||
|
|
||||||
LockListInfoItemEntity.fromJson(Map<String, dynamic> json) {
|
LockListInfoItemEntity.fromJson(Map<String, dynamic> json) {
|
||||||
keyId = json['keyId'];
|
keyId = json['keyId'];
|
||||||
@ -180,6 +188,10 @@ class LockListInfoItemEntity {
|
|||||||
senderUserId = json['senderUserId'];
|
senderUserId = json['senderUserId'];
|
||||||
electricQuantityDate = json['electricQuantityDate'];
|
electricQuantityDate = json['electricQuantityDate'];
|
||||||
electricQuantityStandby = json['electricQuantityStandby'];
|
electricQuantityStandby = json['electricQuantityStandby'];
|
||||||
|
isOnlyManageSelf = json['isOnlyManageSelf'];
|
||||||
|
restoreCount = json['restoreCount'];
|
||||||
|
model = json['model'];
|
||||||
|
vendor = json['vendor'];
|
||||||
bluetooth = json['bluetooth'] != null
|
bluetooth = json['bluetooth'] != null
|
||||||
? Bluetooth.fromJson(json['bluetooth'])
|
? Bluetooth.fromJson(json['bluetooth'])
|
||||||
: null;
|
: null;
|
||||||
@ -217,6 +229,10 @@ class LockListInfoItemEntity {
|
|||||||
data['senderUserId'] = senderUserId;
|
data['senderUserId'] = senderUserId;
|
||||||
data['electricQuantityDate'] = electricQuantityDate;
|
data['electricQuantityDate'] = electricQuantityDate;
|
||||||
data['electricQuantityStandby'] = electricQuantityStandby;
|
data['electricQuantityStandby'] = electricQuantityStandby;
|
||||||
|
data['isOnlyManageSelf'] = isOnlyManageSelf;
|
||||||
|
data['restoreCount'] = restoreCount;
|
||||||
|
data['model'] = model;
|
||||||
|
data['vendor'] = vendor;
|
||||||
if (bluetooth != null) {
|
if (bluetooth != null) {
|
||||||
data['bluetooth'] = bluetooth!.toJson();
|
data['bluetooth'] = bluetooth!.toJson();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user