feat:完成循环日期大写
This commit is contained in:
parent
487ff04a8d
commit
d5db2db672
@ -337,7 +337,6 @@
|
|||||||
"customSMSTemplate": "Custom SMS Template",
|
"customSMSTemplate": "Custom SMS Template",
|
||||||
"customMailTemplate": "Custom Mail Template",
|
"customMailTemplate": "Custom Mail Template",
|
||||||
"record": "Record",
|
"record": "Record",
|
||||||
|
|
||||||
"forTheFirstTime": "For the first time",
|
"forTheFirstTime": "For the first time",
|
||||||
"onceDay": "once a day",
|
"onceDay": "once a day",
|
||||||
"weekOnce": "once a week",
|
"weekOnce": "once a week",
|
||||||
@ -789,53 +788,51 @@
|
|||||||
"文件校验失败 0x02": "File verification failed 0x02",
|
"文件校验失败 0x02": "File verification failed 0x02",
|
||||||
"文件校验失败 0x03": "File verification failed 0x03",
|
"文件校验失败 0x03": "File verification failed 0x03",
|
||||||
"固件升级完成": "Firmware upgrade completed",
|
"固件升级完成": "Firmware upgrade completed",
|
||||||
"记录":"Record",
|
"记录": "Record",
|
||||||
"开通高级功能后才可以对锁进行管理":"You can manage locks only after the advanced function is enabled",
|
"开通高级功能后才可以对锁进行管理": "You can manage locks only after the advanced function is enabled",
|
||||||
"去开通":"Go and Activate",
|
"去开通": "Go and Activate",
|
||||||
"实名认证":"Real-name authentication",
|
"实名认证": "Real-name authentication",
|
||||||
"当前剩余数量":"Current surplus quantity",
|
"当前剩余数量": "Current surplus quantity",
|
||||||
"购买":"Buy",
|
"购买": "Buy",
|
||||||
"实名认证为付费功能,请购买后再使用":"Real-name authentication is a paid function, please use it after purchase",
|
"实名认证为付费功能,请购买后再使用": "Real-name authentication is a paid function, please use it after purchase",
|
||||||
"密码不一致哦":"The passwords are inconsistent",
|
"密码不一致哦": "The passwords are inconsistent",
|
||||||
|
"退出添加": "Quit adding",
|
||||||
"退出添加":"Quit adding",
|
"管理员已满": "Admin full",
|
||||||
"管理员已满":"Admin full",
|
|
||||||
"用户已满": "The user is full",
|
"用户已满": "The user is full",
|
||||||
"锁上面添加指纹已满": "Add fingerprint on lock is full",
|
"锁上面添加指纹已满": "Add fingerprint on lock is full",
|
||||||
"指纹已存在": "The fingerprint already exists.",
|
"指纹已存在": "The fingerprint already exists.",
|
||||||
"锁上面添加人脸已满": "Lock above add face is full",
|
"锁上面添加人脸已满": "Lock above add face is full",
|
||||||
"人脸已存在": "The face already exists",
|
"人脸已存在": "The face already exists",
|
||||||
"锁上面添加卡已满":"Lock above add card is full",
|
"锁上面添加卡已满": "Lock above add card is full",
|
||||||
"卡已存在": "Card already exists",
|
"卡已存在": "Card already exists",
|
||||||
"锁上面添加密码已满": "Lock above add password is full",
|
"锁上面添加密码已满": "Lock above add password is full",
|
||||||
"密码已存在": "Password already exists",
|
"密码已存在": "Password already exists",
|
||||||
"请输入密码": "Please enter password",
|
"请输入密码": "Please enter password",
|
||||||
"暂无密码,无需重置": "No password, no need to reset",
|
"暂无密码,无需重置": "No password, no need to reset",
|
||||||
|
"真实姓名": "Real name",
|
||||||
"真实姓名":"Real name",
|
"身份证号": "ID number",
|
||||||
"身份证号":"ID number",
|
"请输入真实姓名": "Please enter your real name",
|
||||||
"请输入真实姓名":"Please enter your real name",
|
"请输入身份证号": "Please enter your ID number",
|
||||||
"请输入身份证号":"Please enter your ID number",
|
"请输入身份证号和真实姓名": "Please enter your ID number and real name",
|
||||||
"请输入身份证号和真实姓名":"Please enter your ID number and real name",
|
"点击返回设备配对": "Tap Back to device pairing",
|
||||||
"点击返回设备配对":"Tap Back to device pairing",
|
"无法连接?尝试升级": "Can't connect?Upgrade attempted",
|
||||||
"无法连接?尝试升级":"Can't connect?Upgrade attempted",
|
"固件升级提示": "Firmware upgrade prompt",
|
||||||
"固件升级提示":"Firmware upgrade prompt",
|
"请先获取固件文件到手机本地,再选择升级": "Please obtain the firmware file to the local phone first, and then select Upgrade",
|
||||||
"请先获取固件文件到手机本地,再选择升级":"Please obtain the firmware file to the local phone first, and then select Upgrade",
|
"固件升级中": "The firmware is being upgraded",
|
||||||
"固件升级中":"The firmware is being upgraded",
|
"取消升级": "Cancel the upgrade",
|
||||||
"取消升级":"Cancel the upgrade",
|
"固件传输中": "Firmware in transit",
|
||||||
"固件传输中":"Firmware in transit",
|
"关闭": "Shut down",
|
||||||
"关闭":"Shut down",
|
"传输中'": "In transit",
|
||||||
"传输中'":"In transit",
|
"操作记录": "Operation record",
|
||||||
"操作记录":"Operation record",
|
"修改姓名": "Modify name",
|
||||||
"修改姓名":"Modify name",
|
"传输中": "In transit",
|
||||||
"传输中":"In transit",
|
"发送人": "Sender",
|
||||||
"发送人":"Sender",
|
"发送时间": "Send time",
|
||||||
"发送时间":"Send time",
|
"钥匙详情": "Key details",
|
||||||
"钥匙详情":"Key details",
|
"姓名": "Name",
|
||||||
"姓名":"Name",
|
"发送": "Send",
|
||||||
"发送":"Send",
|
"请确认姓名全名和身份证号码是否正确": "Please confirm that the full name and ID number are correct",
|
||||||
"请确认姓名全名和身份证号码是否正确":"Please confirm that the full name and ID number are correct",
|
"传输期间请勿离开当前页面": "Do not leave the current page during transfer",
|
||||||
"传输期间请勿离开当前页面":"Do not leave the current page during transfer",
|
|
||||||
"机型": "models",
|
"机型": "models",
|
||||||
"硬件版本": "Hardware version",
|
"硬件版本": "Hardware version",
|
||||||
"固件版本": "Firmware version",
|
"固件版本": "Firmware version",
|
||||||
@ -846,16 +843,23 @@
|
|||||||
"操作失败,请确认锁是否在附近,或重启手机蓝牙后再试。": "The operation failed. Please confirm whether the lock is nearby, or restart your phone's Bluetooth and try again.",
|
"操作失败,请确认锁是否在附近,或重启手机蓝牙后再试。": "The operation failed. Please confirm whether the lock is nearby, or restart your phone's Bluetooth and try again.",
|
||||||
"如果是全自动锁,请使屏幕变亮": "If it is a fully automatic lock, please make the screen brighter",
|
"如果是全自动锁,请使屏幕变亮": "If it is a fully automatic lock, please make the screen brighter",
|
||||||
"正在尝试闭锁……": "Attempting to lock...",
|
"正在尝试闭锁……": "Attempting to lock...",
|
||||||
"清空记录":"Clear record",
|
"清空记录": "Clear record",
|
||||||
"是否要删除操作记录?":"Do you want to delete the operation record?",
|
"是否要删除操作记录?": "Do you want to delete the operation record?",
|
||||||
"被删除的记录不能恢复":"The deleted record cannot be restored",
|
"被删除的记录不能恢复": "The deleted record cannot be restored",
|
||||||
"全部事件":"All events",
|
"全部事件": "All events",
|
||||||
"开锁事件":"Unlock event",
|
"开锁事件": "Unlock event",
|
||||||
"异常事件":"Abnormal event",
|
"异常事件": "Abnormal event",
|
||||||
"门铃事件":"Doorbell event",
|
"门铃事件": "Doorbell event",
|
||||||
"视频事件":"Video event",
|
"视频事件": "Video event",
|
||||||
"请开启蓝牙":"Please turn on Bluetooth",
|
"请开启蓝牙": "Please turn on Bluetooth",
|
||||||
"请选择有效日":"Please select the effective day",
|
"请选择有效日": "Please select the effective day",
|
||||||
"公司名字长度不能小于 6 ": "The length of the company name cannot be less than 6",
|
"公司名字长度不能小于 6 ": "The length of the company name cannot be less than 6",
|
||||||
"已是最新版本": "It is the latest version"
|
"已是最新版本": "It is the latest version",
|
||||||
|
"一": "Mon",
|
||||||
|
"二": "Tue",
|
||||||
|
"三": "Wed",
|
||||||
|
"四": "Thu",
|
||||||
|
"五": "Fri",
|
||||||
|
"六": "Sat",
|
||||||
|
"日": "Sun"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -886,5 +886,12 @@
|
|||||||
"请开启蓝牙":"请开启蓝牙",
|
"请开启蓝牙":"请开启蓝牙",
|
||||||
"请选择有效日":"请选择有效日",
|
"请选择有效日":"请选择有效日",
|
||||||
"公司名字长度不能小于 6 ": "公司名字长度不能小于 6 ",
|
"公司名字长度不能小于 6 ": "公司名字长度不能小于 6 ",
|
||||||
"已是最新版本": "已是最新版本"
|
"已是最新版本": "已是最新版本",
|
||||||
|
"一":"一",
|
||||||
|
"二":"二",
|
||||||
|
"三":"三",
|
||||||
|
"四":"四",
|
||||||
|
"五":"五",
|
||||||
|
"六":"六",
|
||||||
|
"日":"日"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -856,5 +856,12 @@
|
|||||||
"请开启蓝牙": "请开启蓝牙",
|
"请开启蓝牙": "请开启蓝牙",
|
||||||
"请选择有效日": "请选择有效日",
|
"请选择有效日": "请选择有效日",
|
||||||
"公司名字长度不能小于 6 ": "公司名字长度不能小于 6 ",
|
"公司名字长度不能小于 6 ": "公司名字长度不能小于 6 ",
|
||||||
"已是最新版本": "已是最新版本"
|
"已是最新版本": "已是最新版本",
|
||||||
|
"一": "一",
|
||||||
|
"二": "二",
|
||||||
|
"三": "三",
|
||||||
|
"四": "四",
|
||||||
|
"五": "五",
|
||||||
|
"六": "六",
|
||||||
|
"日": "日"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
||||||
import 'package:star_lock/tools/baseGetXController.dart';
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
|
import 'package:star_lock/tools/pickers/time_picker/time_utils.dart';
|
||||||
|
|
||||||
import '../../../../appRouters.dart';
|
import '../../../../appRouters.dart';
|
||||||
import '../../../../network/api_repository.dart';
|
import '../../../../network/api_repository.dart';
|
||||||
@ -11,6 +12,10 @@ import 'addCardType_state.dart';
|
|||||||
class AddCardTypeLogic extends BaseGetXController{
|
class AddCardTypeLogic extends BaseGetXController{
|
||||||
AddCardTypeState state = AddCardTypeState();
|
AddCardTypeState state = AddCardTypeState();
|
||||||
|
|
||||||
|
List<dynamic> get weekDayStr {
|
||||||
|
return state.weekdaysList.map((e) => TimeUtils.translateWeekday(e)).toList();
|
||||||
|
}
|
||||||
|
|
||||||
// 添加卡数据
|
// 添加卡数据
|
||||||
Future<void> addCardData() async {
|
Future<void> addCardData() async {
|
||||||
int carType = 0; // 永久:1;限时2,单次3,循环:4
|
int carType = 0; // 永久:1;限时2,单次3,循环:4
|
||||||
|
|||||||
@ -210,7 +210,7 @@ class _AddCardPageState extends State<AddCardPage>
|
|||||||
visible: state.weekdaysList.isNotEmpty,
|
visible: state.weekdaysList.isNotEmpty,
|
||||||
child: CommonItem(
|
child: CommonItem(
|
||||||
leftTitel: '有效日'.tr,
|
leftTitel: '有效日'.tr,
|
||||||
rightTitle: state.weekdaysList.value.join(',').toString(),
|
rightTitle: logic.weekDayStr.join(',').toString(),
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
action: () async {
|
action: () async {
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
||||||
@ -7,6 +6,7 @@ import 'package:star_lock/blue/io_type.dart';
|
|||||||
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
||||||
import 'package:star_lock/tools/baseGetXController.dart';
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
import 'package:star_lock/tools/eventBusEventManage.dart';
|
import 'package:star_lock/tools/eventBusEventManage.dart';
|
||||||
|
import 'package:star_lock/tools/pickers/time_picker/time_utils.dart';
|
||||||
|
|
||||||
import '../../../../blue/blue_manage.dart';
|
import '../../../../blue/blue_manage.dart';
|
||||||
import '../../../../blue/io_protocol/io_addICCardWithTimeCycleCoercion.dart';
|
import '../../../../blue/io_protocol/io_addICCardWithTimeCycleCoercion.dart';
|
||||||
@ -19,15 +19,22 @@ import '../../../../tools/dateTool.dart';
|
|||||||
import '../../../../tools/storage.dart';
|
import '../../../../tools/storage.dart';
|
||||||
import 'cardDetail_state.dart';
|
import 'cardDetail_state.dart';
|
||||||
|
|
||||||
class CardDetailLogic extends BaseGetXController{
|
class CardDetailLogic extends BaseGetXController {
|
||||||
CardDetailState state = CardDetailState();
|
CardDetailState state = CardDetailState();
|
||||||
|
|
||||||
|
List<dynamic> get weekDayStr {
|
||||||
|
return state.weekDay.map((e) => TimeUtils.translateWeekday(e)).toList();
|
||||||
|
}
|
||||||
|
|
||||||
// 监听设备返回的数据
|
// 监听设备返回的数据
|
||||||
late StreamSubscription<Reply> _replySubscription;
|
late StreamSubscription<Reply> _replySubscription;
|
||||||
|
|
||||||
void _initReplySubscription() {
|
void _initReplySubscription() {
|
||||||
_replySubscription = EventBusManager().eventBus!.on<Reply>().listen((Reply reply) async {
|
_replySubscription =
|
||||||
|
EventBusManager().eventBus!.on<Reply>().listen((Reply reply) async {
|
||||||
// 添加卡片开始(重置锁里面所有卡)
|
// 添加卡片开始(重置锁里面所有卡)
|
||||||
if((reply is SenderAddICCardWithTimeCycleCoercionReply) && (state.ifCurrentScreen.value == true)) {
|
if ((reply is SenderAddICCardWithTimeCycleCoercionReply) &&
|
||||||
|
(state.ifCurrentScreen.value == true)) {
|
||||||
_replyAddICCardBegin(reply);
|
_replyAddICCardBegin(reply);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -37,23 +44,26 @@ class CardDetailLogic extends BaseGetXController{
|
|||||||
Future<void> _replyAddICCardBegin(Reply reply) async {
|
Future<void> _replyAddICCardBegin(Reply reply) async {
|
||||||
final int status = reply.data[2];
|
final int status = reply.data[2];
|
||||||
|
|
||||||
switch(status){
|
switch (status) {
|
||||||
case 0x00:
|
case 0x00:
|
||||||
//成功
|
//成功
|
||||||
cancelBlueConnetctToastTimer();
|
cancelBlueConnetctToastTimer();
|
||||||
dismissEasyLoading();
|
dismissEasyLoading();
|
||||||
if(state.isDeletCard.value == true){
|
if (state.isDeletCard.value == true) {
|
||||||
deletICCardData();
|
deletICCardData();
|
||||||
}else{
|
} else {
|
||||||
editICCardData();
|
editICCardData();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 0x06:
|
case 0x06:
|
||||||
//无权限
|
//无权限
|
||||||
final List<String>? privateKey = await Storage.getStringList(saveBluePrivateKey);
|
final List<String>? privateKey =
|
||||||
final List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
await Storage.getStringList(saveBluePrivateKey);
|
||||||
|
final List<int> getPrivateKeyList =
|
||||||
|
changeStringListToIntList(privateKey!);
|
||||||
|
|
||||||
final List<String>? signKey = await Storage.getStringList(saveBlueSignKey);
|
final List<String>? signKey =
|
||||||
|
await Storage.getStringList(saveBlueSignKey);
|
||||||
final List<int> signKeyDataList = changeStringListToIntList(signKey!);
|
final List<int> signKeyDataList = changeStringListToIntList(signKey!);
|
||||||
|
|
||||||
final List<int> token = reply.data.sublist(5, 9);
|
final List<int> token = reply.data.sublist(5, 9);
|
||||||
@ -61,25 +71,29 @@ class CardDetailLogic extends BaseGetXController{
|
|||||||
Storage.setStringList(saveBlueToken, saveStrList);
|
Storage.setStringList(saveBlueToken, saveStrList);
|
||||||
|
|
||||||
IoSenderManage.senderAddCardWithTimeCycleCoercionCommand(
|
IoSenderManage.senderAddCardWithTimeCycleCoercionCommand(
|
||||||
keyID:state.keyId.value.toString(),
|
keyID: state.keyId.value.toString(),
|
||||||
userID:await Storage.getUid(),
|
userID: await Storage.getUid(),
|
||||||
cardNo:int.parse(state.typeNumber.value),
|
cardNo: int.parse(state.typeNumber.value),
|
||||||
useCountLimit:0xffff,
|
useCountLimit: 0xffff,
|
||||||
operate:state.isDeletCard.value ? 2 : 1, // 0:注册 1:修改 2:删除 3:删除全部
|
operate: state.isDeletCard.value ? 2 : 1,
|
||||||
isAdmin:state.isAdministrator.value == true ? 1 : 0,
|
// 0:注册 1:修改 2:删除 3:删除全部
|
||||||
isForce:state.isStressCard.value == true ? 1 : 0, // 是否是胁迫
|
isAdmin: state.isAdministrator.value == true ? 1 : 0,
|
||||||
isRound:state.keyType.value == 4 ? 1: 0, // 是否是循环
|
isForce: state.isStressCard.value == true ? 1 : 0,
|
||||||
weekRound:DateTool().accordingTheCycleIntoTheCorrespondingNumber(state.weekDay.value), // 周循环
|
// 是否是胁迫
|
||||||
startDate: int.parse(state.startDate.value)~/1000,
|
isRound: state.keyType.value == 4 ? 1 : 0,
|
||||||
endDate: int.parse(state.endDate.value)~/1000,
|
// 是否是循环
|
||||||
startTime:DateTool().dateToHNString(state.starTime.value),
|
weekRound: DateTool().accordingTheCycleIntoTheCorrespondingNumber(
|
||||||
endTime:DateTool().dateToHNString(state.endTime.value),
|
state.weekDay.value),
|
||||||
needAuthor:1,
|
// 周循环
|
||||||
signKey:signKeyDataList,
|
startDate: int.parse(state.startDate.value) ~/ 1000,
|
||||||
privateKey:getPrivateKeyList,
|
endDate: int.parse(state.endDate.value) ~/ 1000,
|
||||||
token: token,
|
startTime: DateTool().dateToHNString(state.starTime.value),
|
||||||
isBeforeAddUser: false
|
endTime: DateTool().dateToHNString(state.endTime.value),
|
||||||
);
|
needAuthor: 1,
|
||||||
|
signKey: signKeyDataList,
|
||||||
|
privateKey: getPrivateKeyList,
|
||||||
|
token: token,
|
||||||
|
isBeforeAddUser: false);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
//失败
|
//失败
|
||||||
@ -89,52 +103,61 @@ class CardDetailLogic extends BaseGetXController{
|
|||||||
|
|
||||||
// 添加卡片
|
// 添加卡片
|
||||||
Future<void> senderAddICCard() async {
|
Future<void> senderAddICCard() async {
|
||||||
if(state.sureBtnState.value == 1){
|
if (state.sureBtnState.value == 1) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
state.sureBtnState.value = 1;
|
state.sureBtnState.value = 1;
|
||||||
|
|
||||||
showEasyLoading();
|
showEasyLoading();
|
||||||
showBlueConnetctToastTimer(action: (){
|
showBlueConnetctToastTimer(action: () {
|
||||||
dismissEasyLoading();
|
dismissEasyLoading();
|
||||||
state.sureBtnState.value = 0;
|
state.sureBtnState.value = 0;
|
||||||
});
|
});
|
||||||
BlueManage().blueSendData(BlueManage().connectDeviceName, (BluetoothConnectionState deviceConnectionState) async {
|
BlueManage().blueSendData(BlueManage().connectDeviceName,
|
||||||
if (deviceConnectionState == BluetoothConnectionState.connected){
|
(BluetoothConnectionState deviceConnectionState) async {
|
||||||
final List<String>? signKey = await Storage.getStringList(saveBlueSignKey);
|
if (deviceConnectionState == BluetoothConnectionState.connected) {
|
||||||
|
final List<String>? signKey =
|
||||||
|
await Storage.getStringList(saveBlueSignKey);
|
||||||
final List<int> signKeyDataList = changeStringListToIntList(signKey!);
|
final List<int> signKeyDataList = changeStringListToIntList(signKey!);
|
||||||
|
|
||||||
final List<String>? privateKey = await Storage.getStringList(saveBluePrivateKey);
|
final List<String>? privateKey =
|
||||||
final List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
await Storage.getStringList(saveBluePrivateKey);
|
||||||
|
final List<int> getPrivateKeyList =
|
||||||
|
changeStringListToIntList(privateKey!);
|
||||||
|
|
||||||
final List<String>? token = await Storage.getStringList(saveBlueToken);
|
final List<String>? token = await Storage.getStringList(saveBlueToken);
|
||||||
final List<int> getTokenList = changeStringListToIntList(token!);
|
final List<int> getTokenList = changeStringListToIntList(token!);
|
||||||
|
|
||||||
IoSenderManage.senderAddCardWithTimeCycleCoercionCommand(
|
IoSenderManage.senderAddCardWithTimeCycleCoercionCommand(
|
||||||
keyID:state.keyId.value.toString(),
|
keyID: state.keyId.value.toString(),
|
||||||
userID:await Storage.getUid(),
|
userID: await Storage.getUid(),
|
||||||
cardNo:int.parse(state.typeNumber.value),
|
cardNo: int.parse(state.typeNumber.value),
|
||||||
useCountLimit:0xffff,
|
useCountLimit: 0xffff,
|
||||||
operate:state.isDeletCard.value ? 2 : 1, // 0:注册 1:修改 2:删除 3:删除全部
|
operate: state.isDeletCard.value ? 2 : 1,
|
||||||
isAdmin:state.isAdministrator.value == true ? 1 : 0,
|
// 0:注册 1:修改 2:删除 3:删除全部
|
||||||
isForce:state.isStressCard.value == true ? 1 : 0, // 是否是胁迫
|
isAdmin: state.isAdministrator.value == true ? 1 : 0,
|
||||||
isRound:state.keyType.value == 4 ? 1: 0, // 是否是循环
|
isForce: state.isStressCard.value == true ? 1 : 0,
|
||||||
weekRound:DateTool().accordingTheCycleIntoTheCorrespondingNumber(state.weekDay.value), // 周循环
|
// 是否是胁迫
|
||||||
startDate: int.parse(state.startDate.value)~/1000,
|
isRound: state.keyType.value == 4 ? 1 : 0,
|
||||||
endDate: int.parse(state.endDate.value)~/1000,
|
// 是否是循环
|
||||||
startTime:DateTool().dateToHNString(state.starTime.value),
|
weekRound: DateTool().accordingTheCycleIntoTheCorrespondingNumber(
|
||||||
endTime:DateTool().dateToHNString(state.endTime.value),
|
state.weekDay.value),
|
||||||
needAuthor:1,
|
// 周循环
|
||||||
signKey:signKeyDataList,
|
startDate: int.parse(state.startDate.value) ~/ 1000,
|
||||||
privateKey:getPrivateKeyList,
|
endDate: int.parse(state.endDate.value) ~/ 1000,
|
||||||
token: getTokenList,
|
startTime: DateTool().dateToHNString(state.starTime.value),
|
||||||
isBeforeAddUser: false
|
endTime: DateTool().dateToHNString(state.endTime.value),
|
||||||
);
|
needAuthor: 1,
|
||||||
} else if (deviceConnectionState == BluetoothConnectionState.disconnected) {
|
signKey: signKeyDataList,
|
||||||
|
privateKey: getPrivateKeyList,
|
||||||
|
token: getTokenList,
|
||||||
|
isBeforeAddUser: false);
|
||||||
|
} else if (deviceConnectionState ==
|
||||||
|
BluetoothConnectionState.disconnected) {
|
||||||
dismissEasyLoading();
|
dismissEasyLoading();
|
||||||
cancelBlueConnetctToastTimer();
|
cancelBlueConnetctToastTimer();
|
||||||
state.sureBtnState.value = 0;
|
state.sureBtnState.value = 0;
|
||||||
if(state.ifCurrentScreen.value == true){
|
if (state.ifCurrentScreen.value == true) {
|
||||||
showBlueConnetctToast();
|
showBlueConnetctToast();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -142,7 +165,7 @@ class CardDetailLogic extends BaseGetXController{
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 编辑iC卡
|
// 编辑iC卡
|
||||||
Future<void> editICCardData() async{
|
Future<void> editICCardData() async {
|
||||||
final LoginEntity entity = await ApiRepository.to.editICCardData(
|
final LoginEntity entity = await ApiRepository.to.editICCardData(
|
||||||
cardId: state.keyId.value.toString(),
|
cardId: state.keyId.value.toString(),
|
||||||
lockId: state.fingerprintItemData.value.lockId.toString(),
|
lockId: state.fingerprintItemData.value.lockId.toString(),
|
||||||
@ -154,39 +177,40 @@ class CardDetailLogic extends BaseGetXController{
|
|||||||
changeType: '1',
|
changeType: '1',
|
||||||
startTime: int.parse(state.starTime.value),
|
startTime: int.parse(state.starTime.value),
|
||||||
endTime: int.parse(state.endTime.value),
|
endTime: int.parse(state.endTime.value),
|
||||||
cardType:state.keyType.value,
|
cardType: state.keyType.value,
|
||||||
cardRight: state.isAdministrator.value ? 1 : 0,
|
cardRight: state.isAdministrator.value ? 1 : 0,
|
||||||
);
|
);
|
||||||
if(entity.errorCode!.codeIsSuccessful){
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
showToast('修改成功'.tr, something: (){
|
showToast('修改成功'.tr, something: () {
|
||||||
eventBus.fire(OtherTypeRefreshListEvent());
|
eventBus.fire(OtherTypeRefreshListEvent());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除IC卡
|
// 删除IC卡
|
||||||
Future<void> deletICCardData() async{
|
Future<void> deletICCardData() async {
|
||||||
final LoginEntity entity = await ApiRepository.to.deletIcCardData(
|
final LoginEntity entity = await ApiRepository.to.deletIcCardData(
|
||||||
cardId: state.fingerprintItemData.value.cardId.toString(),
|
cardId: state.fingerprintItemData.value.cardId.toString(),
|
||||||
lockId: state.fingerprintItemData.value.lockId.toString(),
|
lockId: state.fingerprintItemData.value.lockId.toString(),
|
||||||
type: '0',
|
type: '0',
|
||||||
deleteType:'1'
|
deleteType: '1');
|
||||||
);
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
if(entity.errorCode!.codeIsSuccessful){
|
showToast('删除成功'.tr, something: () {
|
||||||
showToast('删除成功'.tr, something: (){
|
|
||||||
Get.back(result: 'addScuess');
|
Get.back(result: 'addScuess');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String getKeyTypeShowDateTime(){
|
String getKeyTypeShowDateTime() {
|
||||||
String useDateStr = '';
|
String useDateStr = '';
|
||||||
if(state.keyType.value == 1){
|
if (state.keyType.value == 1) {
|
||||||
useDateStr = '永久'.tr;
|
useDateStr = '永久'.tr;
|
||||||
}else if(state.keyType.value == 2){
|
} else if (state.keyType.value == 2) {
|
||||||
useDateStr = '${DateTool().dateToYMDHNString(state.startDate.value)}\n${DateTool().dateToYMDHNString(state.endDate.value)}';
|
useDateStr =
|
||||||
} else if(state.keyType.value == 4){
|
'${DateTool().dateToYMDHNString(state.startDate.value)}\n${DateTool().dateToYMDHNString(state.endDate.value)}';
|
||||||
useDateStr = '${DateTool().dateToYMDString(state.startDate.value)}\n${DateTool().dateToYMDString(state.endDate.value)}';
|
} else if (state.keyType.value == 4) {
|
||||||
|
useDateStr =
|
||||||
|
'${DateTool().dateToYMDString(state.startDate.value)}\n${DateTool().dateToYMDString(state.endDate.value)}';
|
||||||
}
|
}
|
||||||
return useDateStr;
|
return useDateStr;
|
||||||
}
|
}
|
||||||
@ -204,5 +228,4 @@ class CardDetailLogic extends BaseGetXController{
|
|||||||
|
|
||||||
_replySubscription.cancel();
|
_replySubscription.cancel();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
|
||||||
|
|||||||
@ -110,7 +110,7 @@ class _CardDetailPageState extends State<CardDetailPage> with RouteAware {
|
|||||||
visible: state.keyType.value == 4,
|
visible: state.keyType.value == 4,
|
||||||
child: Obx(() => CommonItem(
|
child: Obx(() => CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.effectiveDay!.tr,
|
leftTitel: TranslationLoader.lanKeys!.effectiveDay!.tr,
|
||||||
rightTitle: state.weekDay.value.join(','),
|
rightTitle: logic.weekDayStr.join(','),
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
action: () async {
|
action: () async {
|
||||||
|
|||||||
@ -14,6 +14,7 @@ import '../../../../../tools/commonDataManage.dart';
|
|||||||
import '../../../../../tools/custom_bottom_sheet.dart';
|
import '../../../../../tools/custom_bottom_sheet.dart';
|
||||||
import '../../../../../tools/dateTool.dart';
|
import '../../../../../tools/dateTool.dart';
|
||||||
import '../../../../../tools/eventBusEventManage.dart';
|
import '../../../../../tools/eventBusEventManage.dart';
|
||||||
|
import '../../../../../tools/pickers/time_picker/time_utils.dart';
|
||||||
import '../../../../../tools/showTipView.dart';
|
import '../../../../../tools/showTipView.dart';
|
||||||
import '../../../lockOperatingRecord/keyOperationRecord_entity.dart';
|
import '../../../lockOperatingRecord/keyOperationRecord_entity.dart';
|
||||||
|
|
||||||
@ -22,6 +23,10 @@ typedef BlockIsHaveAllDataCallback = void Function(bool isAllData);
|
|||||||
class ElectronicKeyDetailLogic extends BaseGetXController {
|
class ElectronicKeyDetailLogic extends BaseGetXController {
|
||||||
final ElectronicKeyDetailState state = ElectronicKeyDetailState();
|
final ElectronicKeyDetailState state = ElectronicKeyDetailState();
|
||||||
|
|
||||||
|
List<dynamic> get weekDayStr {
|
||||||
|
return state.weekDay.map((e) => TimeUtils.translateWeekday(e)).toList();
|
||||||
|
}
|
||||||
|
|
||||||
//修改钥匙名称请求
|
//修改钥匙名称请求
|
||||||
Future<void> modifyKeyNameRequest() async {
|
Future<void> modifyKeyNameRequest() async {
|
||||||
if (state.changeNameController.text.isEmpty) {
|
if (state.changeNameController.text.isEmpty) {
|
||||||
|
|||||||
@ -147,7 +147,7 @@ class _ElectronicKeyDetailPageState extends State<ElectronicKeyDetailPage> {
|
|||||||
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: state.weekDay.value.join(','),
|
rightTitle: logic.weekDayStr.join(','),
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
action: () async {
|
action: () async {
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:star_lock/tools/baseGetXController.dart';
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
|
import 'package:star_lock/tools/pickers/time_picker/time_utils.dart';
|
||||||
import '../../../../../common/XSConstantMacro/XSConstantMacro.dart';
|
import '../../../../../common/XSConstantMacro/XSConstantMacro.dart';
|
||||||
import '../../../../../network/api_repository.dart';
|
import '../../../../../network/api_repository.dart';
|
||||||
import '../../../../../tools/dateTool.dart';
|
import '../../../../../tools/dateTool.dart';
|
||||||
@ -9,6 +10,10 @@ import 'massSendElectronicKey_state.dart';
|
|||||||
class MassSendElectronicKeyLogic extends BaseGetXController {
|
class MassSendElectronicKeyLogic extends BaseGetXController {
|
||||||
MassSendElectronicKeyState state = MassSendElectronicKeyState();
|
MassSendElectronicKeyState state = MassSendElectronicKeyState();
|
||||||
|
|
||||||
|
List<dynamic> get weekDayStr {
|
||||||
|
return state.weekdaysList.map((e) => TimeUtils.translateWeekday(e)).toList();
|
||||||
|
}
|
||||||
|
|
||||||
//群发钥匙检查
|
//群发钥匙检查
|
||||||
Future<void> massKeyChecksRequest() async {
|
Future<void> massKeyChecksRequest() async {
|
||||||
String getFailureDateTime = '0';
|
String getFailureDateTime = '0';
|
||||||
|
|||||||
@ -176,7 +176,7 @@ class _MassSendElectronicKeyPageState extends State<MassSendElectronicKeyPage> {
|
|||||||
),
|
),
|
||||||
CommonItem(
|
CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.countryAndRegion!.tr,
|
leftTitel: TranslationLoader.lanKeys!.countryAndRegion!.tr,
|
||||||
rightTitle: "",
|
rightTitle: '',
|
||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
isHaveRightWidget: true,
|
isHaveRightWidget: true,
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
@ -261,7 +261,7 @@ class _MassSendElectronicKeyPageState extends State<MassSendElectronicKeyPage> {
|
|||||||
children: [
|
children: [
|
||||||
CommonItem(
|
CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.remoteUnlockingAllowed!.tr,
|
leftTitel: TranslationLoader.lanKeys!.remoteUnlockingAllowed!.tr,
|
||||||
rightTitle: "",
|
rightTitle: '',
|
||||||
isHaveRightWidget: true,
|
isHaveRightWidget: true,
|
||||||
rightWidget: SizedBox(width: 60.w, height: 50.h, child: _switch()),
|
rightWidget: SizedBox(width: 60.w, height: 50.h, child: _switch()),
|
||||||
action: () {}),
|
action: () {}),
|
||||||
@ -276,7 +276,7 @@ class _MassSendElectronicKeyPageState extends State<MassSendElectronicKeyPage> {
|
|||||||
children: [
|
children: [
|
||||||
Obx(() => CommonItem(
|
Obx(() => CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.periodValidity!.tr,
|
leftTitel: TranslationLoader.lanKeys!.periodValidity!.tr,
|
||||||
rightTitle: "${state.beginTime.value}\n${state.endTime.value}",
|
rightTitle: '${state.beginTime.value}\n${state.endTime.value}',
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
action: () async {
|
action: () async {
|
||||||
@ -297,10 +297,10 @@ class _MassSendElectronicKeyPageState extends State<MassSendElectronicKeyPage> {
|
|||||||
}
|
}
|
||||||
})),
|
})),
|
||||||
Obx(() => Visibility(
|
Obx(() => Visibility(
|
||||||
visible: state.weekdaysList.isNotEmpty ? true : false,
|
visible: state.weekdaysList.isNotEmpty,
|
||||||
child: CommonItem(
|
child: CommonItem(
|
||||||
leftTitel: "有效日".tr,
|
leftTitel: '有效日'.tr,
|
||||||
rightTitle: state.weekdaysList.value.join(",").toString(),
|
rightTitle: logic.weekDayStr.join(',').toString(),
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
action: () async {
|
action: () async {
|
||||||
@ -323,9 +323,9 @@ class _MassSendElectronicKeyPageState extends State<MassSendElectronicKeyPage> {
|
|||||||
Obx(() => Visibility(
|
Obx(() => Visibility(
|
||||||
visible: state.effectiveDateTime.value.isNotEmpty,
|
visible: state.effectiveDateTime.value.isNotEmpty,
|
||||||
child: CommonItem(
|
child: CommonItem(
|
||||||
leftTitel: "有效时间".tr,
|
leftTitel: '有效时间'.tr,
|
||||||
rightTitle:
|
rightTitle:
|
||||||
"${state.effectiveDateTime.value}-${state.failureDateTime.value}",
|
'${state.effectiveDateTime.value}-${state.failureDateTime.value}',
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () async {
|
action: () async {
|
||||||
var result = await Get.toNamed(
|
var result = await Get.toNamed(
|
||||||
|
|||||||
@ -6,12 +6,13 @@ import 'package:star_lock/main/lockDetail/authorizedAdmin/authorizedAdmin/author
|
|||||||
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';
|
||||||
import 'package:star_lock/mine/valueAddedServices/advancedFunctionRecord/advancedFunctionRecord_entity.dart';
|
import 'package:star_lock/mine/valueAddedServices/advancedFunctionRecord/advancedFunctionRecord_entity.dart';
|
||||||
import 'package:star_lock/network/api_repository.dart';
|
import 'package:star_lock/network/api_repository.dart';
|
||||||
import 'package:star_lock/tools/regularExpression.dart';
|
|
||||||
import 'package:star_lock/tools/showCupertinoAlertView.dart';
|
|
||||||
import 'package:star_lock/tools/baseGetXController.dart';
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
import 'package:star_lock/tools/commonDataManage.dart';
|
import 'package:star_lock/tools/commonDataManage.dart';
|
||||||
import 'package:star_lock/tools/dateTool.dart';
|
import 'package:star_lock/tools/dateTool.dart';
|
||||||
import 'package:star_lock/tools/eventBusEventManage.dart';
|
import 'package:star_lock/tools/eventBusEventManage.dart';
|
||||||
|
import 'package:star_lock/tools/pickers/time_picker/time_utils.dart';
|
||||||
|
import 'package:star_lock/tools/regularExpression.dart';
|
||||||
|
import 'package:star_lock/tools/showCupertinoAlertView.dart';
|
||||||
import 'package:star_lock/tools/showTipView.dart';
|
import 'package:star_lock/tools/showTipView.dart';
|
||||||
import 'package:star_lock/tools/storage.dart';
|
import 'package:star_lock/tools/storage.dart';
|
||||||
|
|
||||||
@ -20,6 +21,10 @@ class SendElectronicKeyViewLogic extends BaseGetXController {
|
|||||||
String type;
|
String type;
|
||||||
final SendElectronicKeyViewState state = SendElectronicKeyViewState();
|
final SendElectronicKeyViewState state = SendElectronicKeyViewState();
|
||||||
|
|
||||||
|
List<dynamic> get weekDayStr {
|
||||||
|
return state.weekdaysList.map((e) => TimeUtils.translateWeekday(e)).toList();
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void onInit() {
|
void onInit() {
|
||||||
super.onInit();
|
super.onInit();
|
||||||
|
|||||||
@ -257,7 +257,7 @@ class _SendElectronicKeyViewState extends State<SendElectronicKeyView>
|
|||||||
visible: logic.state.weekdaysList.isNotEmpty,
|
visible: logic.state.weekdaysList.isNotEmpty,
|
||||||
child: CommonItem(
|
child: CommonItem(
|
||||||
leftTitel: '有效日'.tr,
|
leftTitel: '有效日'.tr,
|
||||||
rightTitle: logic.state.weekdaysList.join(',').toString(),
|
rightTitle: logic.weekDayStr.join(',').toString(),
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
action: () async {
|
action: () async {
|
||||||
|
|||||||
@ -3,12 +3,17 @@ import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
|||||||
import 'package:star_lock/main/lockDetail/face/addFaceType/addFaceType_state.dart';
|
import 'package:star_lock/main/lockDetail/face/addFaceType/addFaceType_state.dart';
|
||||||
import 'package:star_lock/tools/baseGetXController.dart';
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
import 'package:star_lock/tools/dateTool.dart';
|
import 'package:star_lock/tools/dateTool.dart';
|
||||||
|
import 'package:star_lock/tools/pickers/time_picker/time_utils.dart';
|
||||||
import '../../../../appRouters.dart';
|
import '../../../../appRouters.dart';
|
||||||
import '../../../../network/api_repository.dart';
|
import '../../../../network/api_repository.dart';
|
||||||
|
|
||||||
class AddFaceTypeLogic extends BaseGetXController {
|
class AddFaceTypeLogic extends BaseGetXController {
|
||||||
AddFaceTypeState state = AddFaceTypeState();
|
AddFaceTypeState state = AddFaceTypeState();
|
||||||
|
|
||||||
|
List<dynamic> get weekDayStr {
|
||||||
|
return state.weekdaysList.map((e) => TimeUtils.translateWeekday(e)).toList();
|
||||||
|
}
|
||||||
|
|
||||||
// 添加指纹
|
// 添加指纹
|
||||||
Future<void> addFaceData() async {
|
Future<void> addFaceData() async {
|
||||||
int faceType = 0; // 永久:1;限时2,单次3,循环:4
|
int faceType = 0; // 永久:1;限时2,单次3,循环:4
|
||||||
|
|||||||
@ -209,7 +209,7 @@ class _AddFaceTypePageState extends State<AddFaceTypePage> with SingleTickerProv
|
|||||||
visible: state.weekdaysList.isNotEmpty,
|
visible: state.weekdaysList.isNotEmpty,
|
||||||
child: CommonItem(
|
child: CommonItem(
|
||||||
leftTitel: '有效日'.tr,
|
leftTitel: '有效日'.tr,
|
||||||
rightTitle: state.weekdaysList.value.join(',').toString(),
|
rightTitle: logic.weekDayStr.join(',').toString(),
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
action: () async {
|
action: () async {
|
||||||
|
|||||||
@ -2,12 +2,11 @@ import 'dart:async';
|
|||||||
|
|
||||||
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:star_lock/app_settings/app_settings.dart';
|
|
||||||
import 'package:star_lock/blue/io_protocol/io_addFace.dart';
|
import 'package:star_lock/blue/io_protocol/io_addFace.dart';
|
||||||
import 'package:star_lock/blue/io_type.dart';
|
|
||||||
import 'package:star_lock/main/lockDetail/face/faceDetail/faceDetail_state.dart';
|
import 'package:star_lock/main/lockDetail/face/faceDetail/faceDetail_state.dart';
|
||||||
import 'package:star_lock/tools/baseGetXController.dart';
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
import 'package:star_lock/tools/dateTool.dart';
|
import 'package:star_lock/tools/dateTool.dart';
|
||||||
|
import 'package:star_lock/tools/pickers/time_picker/time_utils.dart';
|
||||||
import '../../../../blue/blue_manage.dart';
|
import '../../../../blue/blue_manage.dart';
|
||||||
import '../../../../blue/io_reply.dart';
|
import '../../../../blue/io_reply.dart';
|
||||||
import '../../../../blue/io_tool/io_tool.dart';
|
import '../../../../blue/io_tool/io_tool.dart';
|
||||||
@ -19,6 +18,10 @@ import '../../../../tools/storage.dart';
|
|||||||
class FaceDetailLogic extends BaseGetXController {
|
class FaceDetailLogic extends BaseGetXController {
|
||||||
FaceDetailState state = FaceDetailState();
|
FaceDetailState state = FaceDetailState();
|
||||||
|
|
||||||
|
List<dynamic> get weekDayStr {
|
||||||
|
return state.weekDay.map((e) => TimeUtils.translateWeekday(e)).toList();
|
||||||
|
}
|
||||||
|
|
||||||
// 获取解析后的数据
|
// 获取解析后的数据
|
||||||
late StreamSubscription<Reply> _replySubscription;
|
late StreamSubscription<Reply> _replySubscription;
|
||||||
void _initReplySubscription() {
|
void _initReplySubscription() {
|
||||||
|
|||||||
@ -111,10 +111,10 @@ class _FaceDetailPageState extends State<FaceDetailPage> with RouteAware {
|
|||||||
}
|
}
|
||||||
}))),
|
}))),
|
||||||
Obx(() => Visibility(
|
Obx(() => Visibility(
|
||||||
visible: state.keyType.value == 4 ? true : false,
|
visible: state.keyType.value == 4,
|
||||||
child: Obx(() => CommonItem(
|
child: Obx(() => CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.effectiveDay!.tr,
|
leftTitel: TranslationLoader.lanKeys!.effectiveDay!.tr,
|
||||||
rightTitle: state.weekDay.value.join(','),
|
rightTitle: logic.weekDayStr.join(','),
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
action: () async {
|
action: () async {
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
||||||
import 'package:star_lock/tools/baseGetXController.dart';
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
|
import 'package:star_lock/tools/pickers/time_picker/time_utils.dart';
|
||||||
import '../../../../appRouters.dart';
|
import '../../../../appRouters.dart';
|
||||||
import '../../../../network/api_repository.dart';
|
import '../../../../network/api_repository.dart';
|
||||||
import '../../../../tools/dateTool.dart';
|
import '../../../../tools/dateTool.dart';
|
||||||
@ -10,6 +11,10 @@ import 'addFingerprintType_state.dart';
|
|||||||
class AddFingerprintTypeLogic extends BaseGetXController{
|
class AddFingerprintTypeLogic extends BaseGetXController{
|
||||||
AddFingerprintState state = AddFingerprintState();
|
AddFingerprintState state = AddFingerprintState();
|
||||||
|
|
||||||
|
List<dynamic> get weekDayStr {
|
||||||
|
return state.weekdaysList.map((e) => TimeUtils.translateWeekday(e)).toList();
|
||||||
|
}
|
||||||
|
|
||||||
// 添加指纹
|
// 添加指纹
|
||||||
Future<void> addFingerprintsData() async {
|
Future<void> addFingerprintsData() async {
|
||||||
int fingerprintType = 0; // 永久:1;限时2,单次3,循环:4
|
int fingerprintType = 0; // 永久:1;限时2,单次3,循环:4
|
||||||
|
|||||||
@ -202,7 +202,7 @@ class _AddFingerprintTypePageState extends State<AddFingerprintTypePage> with Si
|
|||||||
visible: state.weekdaysList.isNotEmpty,
|
visible: state.weekdaysList.isNotEmpty,
|
||||||
child: CommonItem(
|
child: CommonItem(
|
||||||
leftTitel: '有效日'.tr,
|
leftTitel: '有效日'.tr,
|
||||||
rightTitle: state.weekdaysList.value.join(',').toString(),
|
rightTitle: logic.weekDayStr.join(',').toString(),
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
action: () async {
|
action: () async {
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
import 'package:star_lock/login/login/entity/LoginEntity.dart';
|
||||||
import 'package:star_lock/tools/baseGetXController.dart';
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
|
import 'package:star_lock/tools/pickers/time_picker/time_utils.dart';
|
||||||
import '../../../../blue/blue_manage.dart';
|
import '../../../../blue/blue_manage.dart';
|
||||||
import '../../../../blue/io_protocol/io_addFingerprintWithTimeCycleCoercion.dart';
|
import '../../../../blue/io_protocol/io_addFingerprintWithTimeCycleCoercion.dart';
|
||||||
import '../../../../blue/io_reply.dart';
|
import '../../../../blue/io_reply.dart';
|
||||||
@ -20,6 +21,10 @@ import 'fingerprintDetail_state.dart';
|
|||||||
class FingerprintDetailLogic extends BaseGetXController{
|
class FingerprintDetailLogic extends BaseGetXController{
|
||||||
FingerprintDetailState state = FingerprintDetailState();
|
FingerprintDetailState state = FingerprintDetailState();
|
||||||
|
|
||||||
|
List<dynamic> get weekDayStr {
|
||||||
|
return state.weekDay.map((e) => TimeUtils.translateWeekday(e)).toList();
|
||||||
|
}
|
||||||
|
|
||||||
// 获取解析后的数据
|
// 获取解析后的数据
|
||||||
late StreamSubscription<Reply> _replySubscription;
|
late StreamSubscription<Reply> _replySubscription;
|
||||||
void _initReplySubscription() {
|
void _initReplySubscription() {
|
||||||
|
|||||||
@ -115,10 +115,10 @@ class _FingerprintDetailPageState extends State<FingerprintDetailPage>
|
|||||||
}
|
}
|
||||||
}))),
|
}))),
|
||||||
Obx(() => Visibility(
|
Obx(() => Visibility(
|
||||||
visible: state.keyType.value == 4 ? true : false,
|
visible: state.keyType.value == 4,
|
||||||
child: Obx(() => CommonItem(
|
child: Obx(() => CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.effectiveDay!.tr,
|
leftTitel: TranslationLoader.lanKeys!.effectiveDay!.tr,
|
||||||
rightTitle: state.weekDay.value.join(','),
|
rightTitle: logic.weekDayStr.join(','),
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
action: () async {
|
action: () async {
|
||||||
|
|||||||
@ -2,12 +2,17 @@ import 'package:get/get.dart';
|
|||||||
import 'package:star_lock/main/lockDetail/iris/addIrisType/addIrisType_state.dart';
|
import 'package:star_lock/main/lockDetail/iris/addIrisType/addIrisType_state.dart';
|
||||||
import 'package:star_lock/tools/baseGetXController.dart';
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
import 'package:star_lock/tools/dateTool.dart';
|
import 'package:star_lock/tools/dateTool.dart';
|
||||||
|
import 'package:star_lock/tools/pickers/time_picker/time_utils.dart';
|
||||||
import '../../../../appRouters.dart';
|
import '../../../../appRouters.dart';
|
||||||
import '../../../../network/api_repository.dart';
|
import '../../../../network/api_repository.dart';
|
||||||
|
|
||||||
class AddIrisTypeLogic extends BaseGetXController {
|
class AddIrisTypeLogic extends BaseGetXController {
|
||||||
AddIrisTypeState state = AddIrisTypeState();
|
AddIrisTypeState state = AddIrisTypeState();
|
||||||
|
|
||||||
|
List<dynamic> get weekDayStr {
|
||||||
|
return state.weekdaysList.map((e) => TimeUtils.translateWeekday(e)).toList();
|
||||||
|
}
|
||||||
|
|
||||||
// 添加虹膜
|
// 添加虹膜
|
||||||
void addIrisData() async {
|
void addIrisData() async {
|
||||||
var irisType = 0; // 永久:1;限时2,单次3,循环:4
|
var irisType = 0; // 永久:1;限时2,单次3,循环:4
|
||||||
|
|||||||
@ -57,14 +57,14 @@ class _AddIrisTypePageState extends State<AddIrisTypePage> {
|
|||||||
super.initState();
|
super.initState();
|
||||||
|
|
||||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||||
if (state.selectType.value == "1") {
|
if (state.selectType.value == '1') {
|
||||||
state.beginTime.value = DateTool().dateToYMDHNString(
|
state.beginTime.value = DateTool().dateToYMDHNString(
|
||||||
DateTime.now().millisecondsSinceEpoch.toString()); //默认为当前时间
|
DateTime.now().millisecondsSinceEpoch.toString()); //默认为当前时间
|
||||||
state.endTime.value = DateTool().dateToYMDHNString(
|
state.endTime.value = DateTool().dateToYMDHNString(
|
||||||
DateTime.now().millisecondsSinceEpoch.toString()); //默认为当前时间
|
DateTime.now().millisecondsSinceEpoch.toString()); //默认为当前时间
|
||||||
} else {
|
} else {
|
||||||
state.beginTime.value = ""; //默认为当前时间
|
state.beginTime.value = ''; //默认为当前时间
|
||||||
state.endTime.value = ""; //默认为当前时间
|
state.endTime.value = ''; //默认为当前时间
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -126,7 +126,7 @@ class _AddIrisTypePageState extends State<AddIrisTypePage> {
|
|||||||
Container(height: 10.h),
|
Container(height: 10.h),
|
||||||
CommonItem(
|
CommonItem(
|
||||||
leftTitel: titleStr,
|
leftTitel: titleStr,
|
||||||
rightTitle: "",
|
rightTitle: '',
|
||||||
isHaveRightWidget: true,
|
isHaveRightWidget: true,
|
||||||
rightWidget: getTFWidget(rightTitle)),
|
rightWidget: getTFWidget(rightTitle)),
|
||||||
Container(height: 10.h),
|
Container(height: 10.h),
|
||||||
@ -174,7 +174,7 @@ class _AddIrisTypePageState extends State<AddIrisTypePage> {
|
|||||||
children: [
|
children: [
|
||||||
Obx(() => CommonItem(
|
Obx(() => CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.periodValidity!.tr,
|
leftTitel: TranslationLoader.lanKeys!.periodValidity!.tr,
|
||||||
rightTitle: "${state.beginTime.value}\n${state.endTime.value}",
|
rightTitle: '${state.beginTime.value}\n${state.endTime.value}',
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
action: () async {
|
action: () async {
|
||||||
@ -197,8 +197,8 @@ class _AddIrisTypePageState extends State<AddIrisTypePage> {
|
|||||||
Obx(() => Visibility(
|
Obx(() => Visibility(
|
||||||
visible: state.weekdaysList.isNotEmpty ? true : false,
|
visible: state.weekdaysList.isNotEmpty ? true : false,
|
||||||
child: CommonItem(
|
child: CommonItem(
|
||||||
leftTitel: "有效日",
|
leftTitel: '有效日'.tr,
|
||||||
rightTitle: state.weekdaysList.value.join(",").toString(),
|
rightTitle: logic.weekDayStr.join(',').toString(),
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
action: () async {
|
action: () async {
|
||||||
@ -221,9 +221,9 @@ class _AddIrisTypePageState extends State<AddIrisTypePage> {
|
|||||||
Obx(() => Visibility(
|
Obx(() => Visibility(
|
||||||
visible: state.effectiveDateTime.value.isNotEmpty,
|
visible: state.effectiveDateTime.value.isNotEmpty,
|
||||||
child: CommonItem(
|
child: CommonItem(
|
||||||
leftTitel: "有效时间".tr,
|
leftTitel: '有效时间'.tr,
|
||||||
rightTitle:
|
rightTitle:
|
||||||
"${state.effectiveDateTime.value}-${state.failureDateTime.value}",
|
'${state.effectiveDateTime.value}-${state.failureDateTime.value}',
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () async {
|
action: () async {
|
||||||
var result = await Get.toNamed(Routers.seletKeyCyclicDatePage,
|
var result = await Get.toNamed(Routers.seletKeyCyclicDatePage,
|
||||||
@ -255,8 +255,8 @@ 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,
|
||||||
rightWidget: SizedBox(
|
rightWidget: SizedBox(
|
||||||
@ -268,13 +268,13 @@ class _AddIrisTypePageState extends State<AddIrisTypePage> {
|
|||||||
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||||
if (isDemoMode == false) {
|
if (isDemoMode == false) {
|
||||||
if (state.nameController.text.isEmpty) {
|
if (state.nameController.text.isEmpty) {
|
||||||
logic.showToast("请输入姓名");
|
logic.showToast('请输入姓名');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
logic.checkIrisNameDuplicated(state.nameController.text);
|
logic.checkIrisNameDuplicated(state.nameController.text);
|
||||||
} else {
|
} else {
|
||||||
// Get.toNamed(Routers.selectLockTypePage);
|
// Get.toNamed(Routers.selectLockTypePage);
|
||||||
logic.showToast("演示模式");
|
logic.showToast('演示模式');
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import 'package:star_lock/blue/io_type.dart';
|
|||||||
import 'package:star_lock/main/lockDetail/iris/irisDetail/irisDetail_state.dart';
|
import 'package:star_lock/main/lockDetail/iris/irisDetail/irisDetail_state.dart';
|
||||||
import 'package:star_lock/tools/baseGetXController.dart';
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
import 'package:star_lock/tools/eventBusEventManage.dart';
|
import 'package:star_lock/tools/eventBusEventManage.dart';
|
||||||
|
import 'package:star_lock/tools/pickers/time_picker/time_utils.dart';
|
||||||
|
|
||||||
import '../../../../blue/blue_manage.dart';
|
import '../../../../blue/blue_manage.dart';
|
||||||
// import '../../../../blue/io_protocol/io_addICCard.dart';
|
// import '../../../../blue/io_protocol/io_addICCard.dart';
|
||||||
@ -20,6 +21,10 @@ import '../../../../tools/storage.dart';
|
|||||||
class IrisDetailLogic extends BaseGetXController {
|
class IrisDetailLogic extends BaseGetXController {
|
||||||
IrisDetailState state = IrisDetailState();
|
IrisDetailState state = IrisDetailState();
|
||||||
|
|
||||||
|
List<dynamic> get weekDayStr {
|
||||||
|
return state.weekDay.map((e) => TimeUtils.translateWeekday(e)).toList();
|
||||||
|
}
|
||||||
|
|
||||||
// 监听设备返回的数据
|
// 监听设备返回的数据
|
||||||
late StreamSubscription<Reply> _replySubscription;
|
late StreamSubscription<Reply> _replySubscription;
|
||||||
void _initReplySubscription() {
|
void _initReplySubscription() {
|
||||||
|
|||||||
@ -108,7 +108,7 @@ class _CardDetailPageState extends State<CardDetailPage> with RouteAware {
|
|||||||
visible: state.keyType.value == 4 ? true : false,
|
visible: state.keyType.value == 4 ? true : false,
|
||||||
child: Obx(() => CommonItem(
|
child: Obx(() => CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.effectiveDay!.tr,
|
leftTitel: TranslationLoader.lanKeys!.effectiveDay!.tr,
|
||||||
rightTitle: state.weekDay.value.join(','),
|
rightTitle: logic.weekDayStr.join(','),
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
action: () async {
|
action: () async {
|
||||||
|
|||||||
@ -1,21 +1,31 @@
|
|||||||
|
|
||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:star_lock/app_settings/app_settings.dart';
|
import 'package:star_lock/app_settings/app_settings.dart';
|
||||||
|
import 'package:star_lock/tools/pickers/time_picker/time_utils.dart';
|
||||||
|
|
||||||
import '../../../../../tools/baseGetXController.dart';
|
import '../../../../../tools/baseGetXController.dart';
|
||||||
import '../../../../../tools/eventBusEventManage.dart';
|
import '../../../../../tools/eventBusEventManage.dart';
|
||||||
import '../../lockSet/lockSet_logic.dart';
|
import '../../lockSet/lockSet_logic.dart';
|
||||||
import 'basicInformation_state.dart';
|
import 'basicInformation_state.dart';
|
||||||
|
|
||||||
class BasicInformationLogic extends BaseGetXController{
|
class BasicInformationLogic extends BaseGetXController {
|
||||||
final BasicInformationState state = BasicInformationState();
|
final BasicInformationState state = BasicInformationState();
|
||||||
|
|
||||||
|
List<dynamic> get weekDayStr {
|
||||||
|
return state.lockBasicInfo.value.weekDays
|
||||||
|
?.map((e) => TimeUtils.translateWeekday(e))
|
||||||
|
.toList() ??
|
||||||
|
[];
|
||||||
|
}
|
||||||
|
|
||||||
// 下级界面修改成功后传递数据
|
// 下级界面修改成功后传递数据
|
||||||
StreamSubscription? _passCurrentLockInformationEvent;
|
StreamSubscription? _passCurrentLockInformationEvent;
|
||||||
|
|
||||||
void initLoadDataAction(BlockSetStateCallback blockSetStateCallback) {
|
void initLoadDataAction(BlockSetStateCallback blockSetStateCallback) {
|
||||||
// 蓝牙协议通知传输跟蓝牙之外的数据传输类不一样 eventBus
|
// 蓝牙协议通知传输跟蓝牙之外的数据传输类不一样 eventBus
|
||||||
_passCurrentLockInformationEvent = eventBus.on<PassCurrentLockInformationEvent>().listen((PassCurrentLockInformationEvent event) {
|
_passCurrentLockInformationEvent = eventBus
|
||||||
|
.on<PassCurrentLockInformationEvent>()
|
||||||
|
.listen((PassCurrentLockInformationEvent event) {
|
||||||
state.lockSetInfoData.value = event.lockSetInfoData;
|
state.lockSetInfoData.value = event.lockSetInfoData;
|
||||||
blockSetStateCallback();
|
blockSetStateCallback();
|
||||||
});
|
});
|
||||||
@ -25,7 +35,8 @@ class BasicInformationLogic extends BaseGetXController{
|
|||||||
void onReady() {
|
void onReady() {
|
||||||
super.onReady();
|
super.onReady();
|
||||||
|
|
||||||
AppLog.log('厂商 vendor:${state.lockBasicInfo.value.vendor} 型号 model:${state.lockBasicInfo.value.model}');
|
AppLog.log(
|
||||||
|
'厂商 vendor:${state.lockBasicInfo.value.vendor} 型号 model:${state.lockBasicInfo.value.model}');
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -33,5 +44,4 @@ class BasicInformationLogic extends BaseGetXController{
|
|||||||
super.onClose();
|
super.onClose();
|
||||||
_passCurrentLockInformationEvent?.cancel();
|
_passCurrentLockInformationEvent?.cancel();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
|
||||||
|
|||||||
@ -89,7 +89,7 @@ class _BasicInformationPageState extends State<BasicInformationPage> {
|
|||||||
visible: (state.lockBasicInfo.value.keyType ?? 0) == 4,
|
visible: (state.lockBasicInfo.value.keyType ?? 0) == 4,
|
||||||
child: CommonItem(
|
child: CommonItem(
|
||||||
leftTitel: '有效日'.tr,
|
leftTitel: '有效日'.tr,
|
||||||
rightTitle: (state.lockBasicInfo.value.weekDays ?? []).join(',').toString(),
|
rightTitle: logic.weekDayStr.join(',').toString(),
|
||||||
allHeight: 70.h,
|
allHeight: 70.h,
|
||||||
isHaveLine: true),
|
isHaveLine: true),
|
||||||
)),
|
)),
|
||||||
|
|||||||
@ -2,12 +2,17 @@ import 'package:get/get.dart';
|
|||||||
import 'package:star_lock/main/lockDetail/palm/addPalmType/addPalmType_state.dart';
|
import 'package:star_lock/main/lockDetail/palm/addPalmType/addPalmType_state.dart';
|
||||||
import 'package:star_lock/tools/baseGetXController.dart';
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
import 'package:star_lock/tools/dateTool.dart';
|
import 'package:star_lock/tools/dateTool.dart';
|
||||||
|
import 'package:star_lock/tools/pickers/time_picker/time_utils.dart';
|
||||||
import '../../../../appRouters.dart';
|
import '../../../../appRouters.dart';
|
||||||
import '../../../../network/api_repository.dart';
|
import '../../../../network/api_repository.dart';
|
||||||
|
|
||||||
class AddPalmTypeLogic extends BaseGetXController {
|
class AddPalmTypeLogic extends BaseGetXController {
|
||||||
AddPalmTypeState state = AddPalmTypeState();
|
AddPalmTypeState state = AddPalmTypeState();
|
||||||
|
|
||||||
|
List<dynamic> get weekDayStr {
|
||||||
|
return state.weekdaysList.map((e) => TimeUtils.translateWeekday(e)).toList();
|
||||||
|
}
|
||||||
|
|
||||||
// 添加指纹
|
// 添加指纹
|
||||||
void addPalmData() async {
|
void addPalmData() async {
|
||||||
var palmType = 0; // 永久:1;限时2,单次3,循环:4
|
var palmType = 0; // 永久:1;限时2,单次3,循环:4
|
||||||
|
|||||||
@ -57,14 +57,14 @@ class _AddPalmTypePageState extends State<AddPalmTypePage> {
|
|||||||
super.initState();
|
super.initState();
|
||||||
|
|
||||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||||
if (state.selectType.value == "1") {
|
if (state.selectType.value == '1') {
|
||||||
state.beginTime.value = DateTool().dateToYMDHNString(
|
state.beginTime.value = DateTool().dateToYMDHNString(
|
||||||
DateTime.now().millisecondsSinceEpoch.toString()); //默认为当前时间
|
DateTime.now().millisecondsSinceEpoch.toString()); //默认为当前时间
|
||||||
state.endTime.value = DateTool().dateToYMDHNString(
|
state.endTime.value = DateTool().dateToYMDHNString(
|
||||||
DateTime.now().millisecondsSinceEpoch.toString()); //默认为当前时间
|
DateTime.now().millisecondsSinceEpoch.toString()); //默认为当前时间
|
||||||
} else {
|
} else {
|
||||||
state.beginTime.value = ""; //默认为当前时间
|
state.beginTime.value = ''; //默认为当前时间
|
||||||
state.endTime.value = ""; //默认为当前时间
|
state.endTime.value = ''; //默认为当前时间
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -126,7 +126,7 @@ class _AddPalmTypePageState extends State<AddPalmTypePage> {
|
|||||||
Container(height: 10.h),
|
Container(height: 10.h),
|
||||||
CommonItem(
|
CommonItem(
|
||||||
leftTitel: titleStr,
|
leftTitel: titleStr,
|
||||||
rightTitle: "",
|
rightTitle: '',
|
||||||
isHaveRightWidget: true,
|
isHaveRightWidget: true,
|
||||||
rightWidget: getTFWidget(rightTitle)),
|
rightWidget: getTFWidget(rightTitle)),
|
||||||
Container(height: 10.h),
|
Container(height: 10.h),
|
||||||
@ -174,7 +174,7 @@ class _AddPalmTypePageState extends State<AddPalmTypePage> {
|
|||||||
children: [
|
children: [
|
||||||
Obx(() => CommonItem(
|
Obx(() => CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.periodValidity!.tr,
|
leftTitel: TranslationLoader.lanKeys!.periodValidity!.tr,
|
||||||
rightTitle: "${state.beginTime.value}\n${state.endTime.value}",
|
rightTitle: '${state.beginTime.value}\n${state.endTime.value}',
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
action: () async {
|
action: () async {
|
||||||
@ -195,10 +195,10 @@ class _AddPalmTypePageState extends State<AddPalmTypePage> {
|
|||||||
}
|
}
|
||||||
})),
|
})),
|
||||||
Obx(() => Visibility(
|
Obx(() => Visibility(
|
||||||
visible: state.weekdaysList.isNotEmpty ? true : false,
|
visible: state.weekdaysList.isNotEmpty,
|
||||||
child: CommonItem(
|
child: CommonItem(
|
||||||
leftTitel: "有效日",
|
leftTitel: '有效日'.tr,
|
||||||
rightTitle: state.weekdaysList.value.join(",").toString(),
|
rightTitle: logic.weekDayStr.join(',').toString(),
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
action: () async {
|
action: () async {
|
||||||
@ -221,9 +221,9 @@ class _AddPalmTypePageState extends State<AddPalmTypePage> {
|
|||||||
Obx(() => Visibility(
|
Obx(() => Visibility(
|
||||||
visible: state.effectiveDateTime.value.isNotEmpty,
|
visible: state.effectiveDateTime.value.isNotEmpty,
|
||||||
child: CommonItem(
|
child: CommonItem(
|
||||||
leftTitel: "有效时间".tr,
|
leftTitel: '有效时间'.tr,
|
||||||
rightTitle:
|
rightTitle:
|
||||||
"${state.effectiveDateTime.value}-${state.failureDateTime.value}",
|
'${state.effectiveDateTime.value}-${state.failureDateTime.value}',
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () async {
|
action: () async {
|
||||||
var result = await Get.toNamed(Routers.seletKeyCyclicDatePage,
|
var result = await Get.toNamed(Routers.seletKeyCyclicDatePage,
|
||||||
@ -255,8 +255,8 @@ 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,
|
||||||
rightWidget: SizedBox(
|
rightWidget: SizedBox(
|
||||||
@ -268,13 +268,13 @@ class _AddPalmTypePageState extends State<AddPalmTypePage> {
|
|||||||
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||||
if (isDemoMode == false) {
|
if (isDemoMode == false) {
|
||||||
if (state.nameController.text.isEmpty) {
|
if (state.nameController.text.isEmpty) {
|
||||||
logic.showToast("请输入姓名");
|
logic.showToast('请输入姓名');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
logic.checkPalmNameDuplicated(state.nameController.text);
|
logic.checkPalmNameDuplicated(state.nameController.text);
|
||||||
} else {
|
} else {
|
||||||
// Get.toNamed(Routers.selectLockTypePage);
|
// Get.toNamed(Routers.selectLockTypePage);
|
||||||
logic.showToast("演示模式");
|
logic.showToast('演示模式');
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
|
|||||||
@ -6,13 +6,12 @@ import 'package:star_lock/blue/io_type.dart';
|
|||||||
import 'package:star_lock/main/lockDetail/palm/palmDetail/palmDetail_state.dart';
|
import 'package:star_lock/main/lockDetail/palm/palmDetail/palmDetail_state.dart';
|
||||||
import 'package:star_lock/tools/baseGetXController.dart';
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
import 'package:star_lock/tools/eventBusEventManage.dart';
|
import 'package:star_lock/tools/eventBusEventManage.dart';
|
||||||
|
import 'package:star_lock/tools/pickers/time_picker/time_utils.dart';
|
||||||
|
|
||||||
import '../../../../blue/blue_manage.dart';
|
import '../../../../blue/blue_manage.dart';
|
||||||
// import '../../../../blue/io_protocol/io_addICCard.dart';
|
|
||||||
import '../../../../blue/io_reply.dart';
|
import '../../../../blue/io_reply.dart';
|
||||||
import '../../../../blue/io_tool/io_tool.dart';
|
import '../../../../blue/io_tool/io_tool.dart';
|
||||||
import '../../../../blue/io_tool/manager_event_bus.dart';
|
import '../../../../blue/io_tool/manager_event_bus.dart';
|
||||||
import '../../../../blue/sender_manage.dart';
|
|
||||||
import '../../../../network/api_repository.dart';
|
import '../../../../network/api_repository.dart';
|
||||||
import '../../../../tools/dateTool.dart';
|
import '../../../../tools/dateTool.dart';
|
||||||
import '../../../../tools/storage.dart';
|
import '../../../../tools/storage.dart';
|
||||||
@ -20,6 +19,10 @@ import '../../../../tools/storage.dart';
|
|||||||
class PalmDetailLogic extends BaseGetXController {
|
class PalmDetailLogic extends BaseGetXController {
|
||||||
PalmDetailState state = PalmDetailState();
|
PalmDetailState state = PalmDetailState();
|
||||||
|
|
||||||
|
List<dynamic> get weekDayStr {
|
||||||
|
return state.weekDay.map((e) => TimeUtils.translateWeekday(e)).toList();
|
||||||
|
}
|
||||||
|
|
||||||
// 监听设备返回的数据
|
// 监听设备返回的数据
|
||||||
late StreamSubscription<Reply> _replySubscription;
|
late StreamSubscription<Reply> _replySubscription;
|
||||||
void _initReplySubscription() {
|
void _initReplySubscription() {
|
||||||
|
|||||||
@ -34,14 +34,14 @@ class _PalmDetailPageState extends State<PalmDetailPage> with RouteAware {
|
|||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: AppColors.mainBackgroundColor,
|
backgroundColor: AppColors.mainBackgroundColor,
|
||||||
appBar: TitleAppBar(
|
appBar: TitleAppBar(
|
||||||
barTitle: "手掌详情",
|
barTitle: '手掌详情',
|
||||||
haveBack: true,
|
haveBack: true,
|
||||||
backgroundColor: AppColors.mainColor,
|
backgroundColor: AppColors.mainColor,
|
||||||
),
|
),
|
||||||
body: ListView(
|
body: ListView(
|
||||||
children: [
|
children: [
|
||||||
Obx(() => CommonItem(
|
Obx(() => CommonItem(
|
||||||
leftTitel: "手掌号",
|
leftTitel: '手掌号',
|
||||||
rightTitle: state.typeNumber.value,
|
rightTitle: state.typeNumber.value,
|
||||||
isHaveDirection: false,
|
isHaveDirection: false,
|
||||||
isHaveLine: true)),
|
isHaveLine: true)),
|
||||||
@ -72,14 +72,14 @@ class _PalmDetailPageState extends State<PalmDetailPage> with RouteAware {
|
|||||||
var data = await Get.toNamed(
|
var data = await Get.toNamed(
|
||||||
Routers.otherTypeKeyChangeDatePage,
|
Routers.otherTypeKeyChangeDatePage,
|
||||||
arguments: {
|
arguments: {
|
||||||
"pushType": 0,
|
'pushType': 0,
|
||||||
"fingerprintItemData":
|
'fingerprintItemData':
|
||||||
state.fingerprintItemData.value,
|
state.fingerprintItemData.value,
|
||||||
});
|
});
|
||||||
if (data != null) {
|
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;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -88,68 +88,68 @@ class _PalmDetailPageState extends State<PalmDetailPage> with RouteAware {
|
|||||||
var data = await Get.toNamed(
|
var data = await Get.toNamed(
|
||||||
Routers.otherTypeKeyChangeValidityDatePage,
|
Routers.otherTypeKeyChangeValidityDatePage,
|
||||||
arguments: {
|
arguments: {
|
||||||
"pushType": 0,
|
'pushType': 0,
|
||||||
"fingerprintItemData":
|
'fingerprintItemData':
|
||||||
state.fingerprintItemData.value,
|
state.fingerprintItemData.value,
|
||||||
});
|
});
|
||||||
if (data != null) {
|
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'];
|
||||||
state.starTime.value = data["starTime"];
|
state.starTime.value = data['starTime'];
|
||||||
state.endTime.value = data["endTime"];
|
state.endTime.value = data['endTime'];
|
||||||
state.weekDay.value = data["weekDay"];
|
state.weekDay.value = data['weekDay'];
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}))),
|
}))),
|
||||||
Obx(() => Visibility(
|
Obx(() => Visibility(
|
||||||
visible: state.keyType.value == 4 ? true : false,
|
visible: state.keyType.value == 4 ,
|
||||||
child: Obx(() => CommonItem(
|
child: Obx(() => CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.effectiveDay!.tr,
|
leftTitel: TranslationLoader.lanKeys!.effectiveDay!.tr,
|
||||||
rightTitle: state.weekDay.value.join(','),
|
rightTitle: logic.weekDayStr.join(','),
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
action: () async {
|
action: () async {
|
||||||
var data = await Get.toNamed(
|
var data = await Get.toNamed(
|
||||||
Routers.otherTypeKeyChangeValidityDatePage,
|
Routers.otherTypeKeyChangeValidityDatePage,
|
||||||
arguments: {
|
arguments: {
|
||||||
"pushType": 0,
|
'pushType': 0,
|
||||||
"fingerprintItemData":
|
'fingerprintItemData':
|
||||||
state.fingerprintItemData.value,
|
state.fingerprintItemData.value,
|
||||||
});
|
});
|
||||||
if (data != null) {
|
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'];
|
||||||
state.starTime.value = data["starTime"];
|
state.starTime.value = data['starTime'];
|
||||||
state.endTime.value = data["endTime"];
|
state.endTime.value = data['endTime'];
|
||||||
state.weekDay.value = data["weekDay"];
|
state.weekDay.value = data['weekDay'];
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
})))),
|
})))),
|
||||||
Obx(() => Visibility(
|
Obx(() => Visibility(
|
||||||
visible: state.keyType.value == 4 ? true : false,
|
visible: state.keyType.value == 4 ? true : false,
|
||||||
child: Obx(() => CommonItem(
|
child: Obx(() => CommonItem(
|
||||||
leftTitel: "有效时间",
|
leftTitel: '有效时间',
|
||||||
rightTitle:
|
rightTitle:
|
||||||
"${DateTool().dateToHNString(state.starTime.value)}-${DateTool().dateToHNString(state.endTime.value)}",
|
'${DateTool().dateToHNString(state.starTime.value)}-${DateTool().dateToHNString(state.endTime.value)}',
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () async {
|
action: () async {
|
||||||
var data = await Get.toNamed(
|
var data = await Get.toNamed(
|
||||||
Routers.otherTypeKeyChangeValidityDatePage,
|
Routers.otherTypeKeyChangeValidityDatePage,
|
||||||
arguments: {
|
arguments: {
|
||||||
"pushType": 0,
|
'pushType': 0,
|
||||||
"fingerprintItemData":
|
'fingerprintItemData':
|
||||||
state.fingerprintItemData.value,
|
state.fingerprintItemData.value,
|
||||||
});
|
});
|
||||||
if (data != null) {
|
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'];
|
||||||
state.starTime.value = data["starTime"];
|
state.starTime.value = data['starTime'];
|
||||||
state.endTime.value = data["endTime"];
|
state.endTime.value = data['endTime'];
|
||||||
state.weekDay.value = data["validityValue"];
|
state.weekDay.value = data['validityValue'];
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
})))),
|
})))),
|
||||||
@ -166,7 +166,7 @@ class _PalmDetailPageState extends State<PalmDetailPage> with RouteAware {
|
|||||||
SizedBox(height: 10.h),
|
SizedBox(height: 10.h),
|
||||||
CommonItem(
|
CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.operatingRecord!.tr,
|
leftTitel: TranslationLoader.lanKeys!.operatingRecord!.tr,
|
||||||
rightTitle: "",
|
rightTitle: '',
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () {
|
action: () {
|
||||||
// Get.toNamed(Routers.keyOperationRecordPage, arguments: {
|
// Get.toNamed(Routers.keyOperationRecordPage, arguments: {
|
||||||
@ -199,11 +199,11 @@ class _PalmDetailPageState extends State<PalmDetailPage> with RouteAware {
|
|||||||
return ShowTFView(
|
return ShowTFView(
|
||||||
title:
|
title:
|
||||||
"${TranslationLoader.lanKeys!.amend!.tr}${TranslationLoader.lanKeys!.name!.tr}",
|
"${TranslationLoader.lanKeys!.amend!.tr}${TranslationLoader.lanKeys!.name!.tr}",
|
||||||
tipTitle: "",
|
tipTitle: '',
|
||||||
controller: state.changeNameController,
|
controller: state.changeNameController,
|
||||||
sureClick: () {
|
sureClick: () {
|
||||||
if (state.changeNameController.text.isEmpty) {
|
if (state.changeNameController.text.isEmpty) {
|
||||||
logic.showToast("请输入姓名");
|
logic.showToast('请输入姓名');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Get.back();
|
Get.back();
|
||||||
@ -222,8 +222,8 @@ class _PalmDetailPageState extends State<PalmDetailPage> with RouteAware {
|
|||||||
context: context,
|
context: context,
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
return ShowIosTipView(
|
return ShowIosTipView(
|
||||||
title: "提示",
|
title: '提示',
|
||||||
tipTitle: "确定要删除吗?",
|
tipTitle: '确定要删除吗?',
|
||||||
sureClick: () async {
|
sureClick: () async {
|
||||||
Get.back();
|
Get.back();
|
||||||
String? idStr = await Storage.getUid();
|
String? idStr = await Storage.getUid();
|
||||||
|
|||||||
@ -355,7 +355,7 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage>
|
|||||||
return Column(
|
return Column(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
CommonItem(
|
CommonItem(
|
||||||
leftTitel: '有效日',
|
leftTitel: '有效日'.tr,
|
||||||
rightTitle: state.loopModeStr.value,
|
rightTitle: state.loopModeStr.value,
|
||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
|
|||||||
@ -1,11 +1,16 @@
|
|||||||
|
|
||||||
import 'package:star_lock/tools/baseGetXController.dart';
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
|
import 'package:star_lock/tools/pickers/time_picker/time_utils.dart';
|
||||||
|
|
||||||
import 'addRemoteControl_state.dart';
|
import 'addRemoteControl_state.dart';
|
||||||
|
|
||||||
class AddRemoteControlLoigc extends BaseGetXController{
|
class AddRemoteControlLoigc extends BaseGetXController{
|
||||||
AddRemoteControlState state = AddRemoteControlState();
|
AddRemoteControlState state = AddRemoteControlState();
|
||||||
|
|
||||||
|
List<dynamic> get weekDayStr {
|
||||||
|
return state.weekdaysList.map((e) => TimeUtils.translateWeekday(e)).toList();
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void onInit() {
|
void onInit() {
|
||||||
|
|
||||||
|
|||||||
@ -130,7 +130,7 @@ class _AddRemoteControlPageState extends State<AddRemoteControlPage>
|
|||||||
children: [
|
children: [
|
||||||
CommonItem(
|
CommonItem(
|
||||||
leftTitel: titleStr,
|
leftTitel: titleStr,
|
||||||
rightTitle: "",
|
rightTitle: '',
|
||||||
isHaveRightWidget: true,
|
isHaveRightWidget: true,
|
||||||
rightWidget: getTFWidget(rightTitle)),
|
rightWidget: getTFWidget(rightTitle)),
|
||||||
Container(height: 10.h),
|
Container(height: 10.h),
|
||||||
@ -161,8 +161,8 @@ class _AddRemoteControlPageState extends State<AddRemoteControlPage>
|
|||||||
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 =
|
||||||
@ -181,7 +181,7 @@ class _AddRemoteControlPageState extends State<AddRemoteControlPage>
|
|||||||
Obx(() => CommonItem(
|
Obx(() => CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.periodValidity!.tr,
|
leftTitel: TranslationLoader.lanKeys!.periodValidity!.tr,
|
||||||
rightTitle:
|
rightTitle:
|
||||||
"${state.cycleBeginTime.value}\n${state.cycleEndTime.value}",
|
'${state.cycleBeginTime.value}\n${state.cycleEndTime.value}',
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
action: () async {
|
action: () async {
|
||||||
@ -202,10 +202,10 @@ class _AddRemoteControlPageState extends State<AddRemoteControlPage>
|
|||||||
}
|
}
|
||||||
})),
|
})),
|
||||||
Obx(() => Visibility(
|
Obx(() => Visibility(
|
||||||
visible: state.weekdaysList.isNotEmpty ? true : false,
|
visible: state.weekdaysList.isNotEmpty,
|
||||||
child: CommonItem(
|
child: CommonItem(
|
||||||
leftTitel: "有效日".tr,
|
leftTitel: '有效日'.tr,
|
||||||
rightTitle: state.weekdaysList.value.join(",").toString(),
|
rightTitle: logic.weekDayStr.join(',').toString(),
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
action: () async {
|
action: () async {
|
||||||
@ -228,9 +228,9 @@ class _AddRemoteControlPageState extends State<AddRemoteControlPage>
|
|||||||
Obx(() => Visibility(
|
Obx(() => Visibility(
|
||||||
visible: state.effectiveDateTime.value.isNotEmpty,
|
visible: state.effectiveDateTime.value.isNotEmpty,
|
||||||
child: CommonItem(
|
child: CommonItem(
|
||||||
leftTitel: "有效时间".tr,
|
leftTitel: '有效时间'.tr,
|
||||||
rightTitle:
|
rightTitle:
|
||||||
"${state.effectiveDateTime.value}-${state.failureDateTime.value}",
|
'${state.effectiveDateTime.value}-${state.failureDateTime.value}',
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () async {
|
action: () async {
|
||||||
var result = await Get.toNamed(Routers.seletKeyCyclicDatePage,
|
var result = await Get.toNamed(Routers.seletKeyCyclicDatePage,
|
||||||
@ -270,14 +270,14 @@ class _AddRemoteControlPageState extends State<AddRemoteControlPage>
|
|||||||
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||||
if (isDemoMode == false) {
|
if (isDemoMode == false) {
|
||||||
if (state.nameController.text.isEmpty) {
|
if (state.nameController.text.isEmpty) {
|
||||||
logic.showToast("请输入姓名");
|
logic.showToast('请输入姓名');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
logic.showToast("请确保在设备附近");
|
logic.showToast('请确保在设备附近');
|
||||||
// logic.addFingerprintsData();
|
// logic.addFingerprintsData();
|
||||||
} else {
|
} else {
|
||||||
// Get.toNamed(Routers.selectLockTypePage);
|
// Get.toNamed(Routers.selectLockTypePage);
|
||||||
logic.showToast("演示模式");
|
logic.showToast('演示模式');
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
@ -307,7 +307,7 @@ class _AddRemoteControlPageState extends State<AddRemoteControlPage>
|
|||||||
height: 20.h,
|
height: 20.h,
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
"操作成功,密码为",
|
'操作成功,密码为',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 32.sp,
|
fontSize: 32.sp,
|
||||||
color: Colors.black,
|
color: Colors.black,
|
||||||
@ -317,7 +317,7 @@ class _AddRemoteControlPageState extends State<AddRemoteControlPage>
|
|||||||
height: 10.h,
|
height: 10.h,
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
"62689876",
|
'62689876',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 60.sp,
|
fontSize: 60.sp,
|
||||||
color: Colors.black,
|
color: Colors.black,
|
||||||
@ -423,15 +423,15 @@ class _AddRemoteControlPageState extends State<AddRemoteControlPage>
|
|||||||
}
|
}
|
||||||
|
|
||||||
final List<ItemView> _itemTabs = <ItemView>[
|
final List<ItemView> _itemTabs = <ItemView>[
|
||||||
ItemView(title: TranslationLoader.lanKeys!.permanent!.tr, selectType: "0"),
|
ItemView(title: TranslationLoader.lanKeys!.permanent!.tr, selectType: '0'),
|
||||||
ItemView(title: TranslationLoader.lanKeys!.timeLimit!.tr, selectType: "1"),
|
ItemView(title: TranslationLoader.lanKeys!.timeLimit!.tr, selectType: '1'),
|
||||||
ItemView(
|
ItemView(
|
||||||
title: TranslationLoader.lanKeys!.circulation!.tr, selectType: "2"),
|
title: TranslationLoader.lanKeys!.circulation!.tr, selectType: '2'),
|
||||||
];
|
];
|
||||||
|
|
||||||
final List<ItemView> _fromCheckInTypeItemTabs = <ItemView>[
|
final List<ItemView> _fromCheckInTypeItemTabs = <ItemView>[
|
||||||
ItemView(title: TranslationLoader.lanKeys!.permanent!.tr, selectType: "0"),
|
ItemView(title: TranslationLoader.lanKeys!.permanent!.tr, selectType: '0'),
|
||||||
ItemView(title: TranslationLoader.lanKeys!.timeLimit!.tr, selectType: "1"),
|
ItemView(title: TranslationLoader.lanKeys!.timeLimit!.tr, selectType: '1'),
|
||||||
];
|
];
|
||||||
|
|
||||||
TabBar _tabBar() {
|
TabBar _tabBar() {
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
import 'package:get/get_utils/get_utils.dart';
|
||||||
|
|
||||||
class TimeUtils {
|
class TimeUtils {
|
||||||
/// 年
|
/// 年
|
||||||
static List calcYears({int begin = 1900, int end = 2100}) =>
|
static List calcYears({int begin = 1900, int end = 2100}) =>
|
||||||
@ -14,7 +16,7 @@ class TimeUtils {
|
|||||||
static List calcDay(int year, int month, {int begin = 1, int end = 31}) {
|
static List calcDay(int year, int month, {int begin = 1, int end = 31}) {
|
||||||
begin = begin < 1 ? 1 : begin;
|
begin = begin < 1 ? 1 : begin;
|
||||||
|
|
||||||
int days = _calcDateCount(year, month);
|
final int days = _calcDateCount(year, month);
|
||||||
if (end > days) {
|
if (end > days) {
|
||||||
end = days;
|
end = days;
|
||||||
}
|
}
|
||||||
@ -36,11 +38,15 @@ class TimeUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static List _calcCount(begin, end) {
|
static List _calcCount(begin, end) {
|
||||||
int length = end - begin + 1;
|
final int length = end - begin + 1;
|
||||||
if (length == 0) return [begin];
|
if (length == 0) {
|
||||||
if (length < 0) return [];
|
return [begin];
|
||||||
|
}
|
||||||
|
if (length < 0) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
return List.generate(length, (index) => begin + index);
|
return List.generate(length, (int index) => begin + index);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 计算月份所对应天数
|
// 计算月份所对应天数
|
||||||
@ -67,7 +73,22 @@ class TimeUtils {
|
|||||||
return (v < 10) ? "0$v" : "$v";
|
return (v < 10) ? "0$v" : "$v";
|
||||||
}
|
}
|
||||||
|
|
||||||
// String _checkStr(String v) {
|
|
||||||
// return v == null ? "" : v;
|
static String translateWeekday(int number,[int index=1]) {
|
||||||
// }
|
final List<String> weekDays = <String>[
|
||||||
|
'一'.tr,
|
||||||
|
'二'.tr,
|
||||||
|
'三'.tr,
|
||||||
|
'四'.tr,
|
||||||
|
'五'.tr,
|
||||||
|
'六'.tr,
|
||||||
|
'日'.tr
|
||||||
|
];
|
||||||
|
final String days = weekDays[number- index];
|
||||||
|
return days; //
|
||||||
|
}
|
||||||
|
|
||||||
|
// String _checkStr(String v) {
|
||||||
|
// return v == null ? "" : v;
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user