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