2023-12-13 11:54:34 +08:00
|
|
|
|
|
|
|
|
|
|
import 'dart:async';
|
|
|
|
|
|
|
2024-03-18 16:16:51 +08:00
|
|
|
|
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
|
2024-04-10 15:59:44 +08:00
|
|
|
|
import 'package:get/get.dart';
|
2023-12-13 11:54:34 +08:00
|
|
|
|
import 'package:star_lock/blue/io_type.dart';
|
|
|
|
|
|
import 'package:star_lock/tools/baseGetXController.dart';
|
2024-03-25 15:03:02 +08:00
|
|
|
|
import 'package:star_lock/tools/dateTool.dart';
|
2023-12-13 11:54:34 +08:00
|
|
|
|
import '../../../../blue/blue_manage.dart';
|
2024-04-16 17:44:38 +08:00
|
|
|
|
import '../../../../blue/io_protocol/io_addICCardWithTimeCycleCoercion.dart';
|
2023-12-13 11:54:34 +08:00
|
|
|
|
import '../../../../blue/io_protocol/io_checkingCardStatus.dart';
|
|
|
|
|
|
import '../../../../blue/io_protocol/io_checkingUserInfoCount.dart';
|
|
|
|
|
|
import '../../../../blue/io_reply.dart';
|
|
|
|
|
|
import '../../../../blue/io_tool/io_tool.dart';
|
|
|
|
|
|
import '../../../../blue/io_tool/manager_event_bus.dart';
|
|
|
|
|
|
import '../../../../blue/sender_manage.dart';
|
|
|
|
|
|
import '../../../../network/api_repository.dart';
|
|
|
|
|
|
import '../../../../tools/eventBusEventManage.dart';
|
|
|
|
|
|
import '../../../../tools/storage.dart';
|
2024-01-25 17:40:41 +08:00
|
|
|
|
import '../../fingerprint/fingerprintList/fingerprintListData_entity.dart';
|
2023-12-13 11:54:34 +08:00
|
|
|
|
import 'cardList_state.dart';
|
|
|
|
|
|
|
|
|
|
|
|
class CardListLogic extends BaseGetXController {
|
|
|
|
|
|
CardListState state = CardListState();
|
|
|
|
|
|
|
|
|
|
|
|
// 获取解析后的数据
|
|
|
|
|
|
late StreamSubscription<Reply> _replySubscription;
|
|
|
|
|
|
void _initReplySubscription() {
|
|
|
|
|
|
_replySubscription = EventBusManager().eventBus!.on<Reply>().listen((reply) {
|
|
|
|
|
|
|
|
|
|
|
|
// 添加卡片开始(重置锁里面所有卡)
|
2024-05-04 16:53:27 +08:00
|
|
|
|
if((reply is SenderAddICCardWithTimeCycleCoercionReply) && (state.ifCurrentScreen.value == true)) {
|
2023-12-13 11:54:34 +08:00
|
|
|
|
_replyAddICCardBegin(reply);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-05-15 16:56:05 +08:00
|
|
|
|
// if(reply is SenderCheckingCardStatusReply) {
|
|
|
|
|
|
// _replyReferEventRecordNumber(reply);
|
|
|
|
|
|
// }
|
|
|
|
|
|
//
|
|
|
|
|
|
// if(reply is SenderCheckingUserInfoCountReply){
|
|
|
|
|
|
// _replyCheckingUserInfoCount(reply);
|
|
|
|
|
|
// }
|
2023-12-13 11:54:34 +08:00
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 添加卡片开始(此处用作删除卡片)
|
|
|
|
|
|
Future<void> _replyAddICCardBegin(Reply reply) async {
|
|
|
|
|
|
int status = reply.data[2];
|
|
|
|
|
|
|
|
|
|
|
|
switch(status){
|
|
|
|
|
|
case 0x00:
|
2024-04-10 15:59:44 +08:00
|
|
|
|
//成功
|
2024-01-18 11:25:56 +08:00
|
|
|
|
cancelBlueConnetctToastTimer();
|
2023-12-13 11:54:34 +08:00
|
|
|
|
deletICCardData();
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 0x06:
|
2024-04-10 15:59:44 +08:00
|
|
|
|
//无权限
|
2023-12-13 11:54:34 +08:00
|
|
|
|
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
|
|
|
|
|
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
|
|
|
|
|
|
2024-04-15 16:30:00 +08:00
|
|
|
|
var signKey = await Storage.getStringList(saveBlueSignKey);
|
|
|
|
|
|
List<int> signKeyDataList = changeStringListToIntList(signKey!);
|
|
|
|
|
|
|
|
|
|
|
|
// var publicKey = await Storage.getStringList(saveBluePublicKey);
|
|
|
|
|
|
// List<int> publicKeyDataList = changeStringListToIntList(publicKey!);
|
2023-12-13 11:54:34 +08:00
|
|
|
|
|
2024-04-16 17:44:38 +08:00
|
|
|
|
var token = reply.data.sublist(5, 9);
|
|
|
|
|
|
var saveStrList = changeIntListToStringList(token);
|
|
|
|
|
|
Storage.setStringList(saveBlueToken, saveStrList);
|
2023-12-13 11:54:34 +08:00
|
|
|
|
|
2024-04-16 17:44:38 +08:00
|
|
|
|
IoSenderManage.senderAddCardWithTimeCycleCoercionCommand(
|
2023-12-16 11:20:36 +08:00
|
|
|
|
keyID:state.deletKeyID,
|
2024-05-04 16:53:27 +08:00
|
|
|
|
userID:(await Storage.getUid())!,
|
2023-12-16 11:20:36 +08:00
|
|
|
|
cardNo:state.deletCardNo,
|
2024-05-04 16:53:27 +08:00
|
|
|
|
useCountLimit:0xffff,
|
|
|
|
|
|
operate: state.isDeletAll == true ? 3 : 2, // 0:注册 1:修改 2:删除 3:删除全部
|
|
|
|
|
|
isAdmin:0,
|
2024-04-16 17:44:38 +08:00
|
|
|
|
isForce:0, // 是否是胁迫
|
|
|
|
|
|
isRound:0, // 是否是循环
|
|
|
|
|
|
weekRound:0, // 周循环
|
|
|
|
|
|
startDate: 0x11223344,
|
|
|
|
|
|
endDate: 0x11223344,
|
2024-04-19 18:13:34 +08:00
|
|
|
|
startTime:"0",
|
|
|
|
|
|
endTime:"0",
|
2023-12-13 11:54:34 +08:00
|
|
|
|
needAuthor:1,
|
2024-04-15 16:30:00 +08:00
|
|
|
|
signKey:signKeyDataList,
|
2023-12-13 11:54:34 +08:00
|
|
|
|
privateKey:getPrivateKeyList,
|
2024-04-16 17:44:38 +08:00
|
|
|
|
token: token,
|
2023-12-13 11:54:34 +08:00
|
|
|
|
);
|
|
|
|
|
|
break;
|
|
|
|
|
|
default:
|
2024-04-10 15:59:44 +08:00
|
|
|
|
//失败
|
2023-12-13 11:54:34 +08:00
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-05-15 16:56:05 +08:00
|
|
|
|
// // 获取卡片状态
|
|
|
|
|
|
// Future<void> _replyReferEventRecordNumber(Reply reply) async {
|
|
|
|
|
|
// int status = reply.data[2];
|
|
|
|
|
|
// switch(status){
|
|
|
|
|
|
// case 0x00:
|
|
|
|
|
|
// //成功
|
|
|
|
|
|
// // _getLockStatus();
|
|
|
|
|
|
// break;
|
|
|
|
|
|
// case 0x06:
|
|
|
|
|
|
// //无权限
|
|
|
|
|
|
// break;
|
|
|
|
|
|
// default:
|
|
|
|
|
|
// //失败
|
|
|
|
|
|
// break;
|
|
|
|
|
|
// }
|
|
|
|
|
|
// }
|
|
|
|
|
|
//
|
|
|
|
|
|
// // 查询用户、指纹、密码、卡片数量(用于判断是否同步)
|
|
|
|
|
|
// Future<void> _replyCheckingUserInfoCount(Reply reply) async {
|
|
|
|
|
|
// int status = reply.data[2];
|
|
|
|
|
|
//
|
|
|
|
|
|
// // 用户数量
|
|
|
|
|
|
// int userNum = reply.data[5];
|
|
|
|
|
|
//
|
|
|
|
|
|
// // 指纹数量
|
|
|
|
|
|
// int fingerNum = reply.data[6];
|
|
|
|
|
|
//
|
|
|
|
|
|
// // 密码数量
|
|
|
|
|
|
// int pwdNum = reply.data[7];
|
|
|
|
|
|
//
|
|
|
|
|
|
// // 卡片数量
|
|
|
|
|
|
// int cardNum = reply.data[8];
|
|
|
|
|
|
//
|
|
|
|
|
|
// // 记录数量
|
|
|
|
|
|
// int logsNum = reply.data[9];
|
|
|
|
|
|
//
|
|
|
|
|
|
// // 版本
|
|
|
|
|
|
// int verNo = reply.data[10];
|
|
|
|
|
|
//
|
|
|
|
|
|
// // 最大管理员指纹数量
|
|
|
|
|
|
// int maxAdminFingerNum = reply.data[11];
|
|
|
|
|
|
//
|
|
|
|
|
|
// // 最大用户指纹数量
|
|
|
|
|
|
// int maxUserFingerNum = reply.data[12];
|
|
|
|
|
|
//
|
|
|
|
|
|
// // 最大管理员密码数量
|
|
|
|
|
|
// int maxAdminPassNum = reply.data[13];
|
|
|
|
|
|
//
|
|
|
|
|
|
// // 最大用户密码数量
|
|
|
|
|
|
// int maxUserPassNum = reply.data[14];
|
|
|
|
|
|
//
|
|
|
|
|
|
// // 最大管理员卡片数量
|
|
|
|
|
|
// int maxAdminCardNum = reply.data[15];
|
|
|
|
|
|
//
|
|
|
|
|
|
// // 最大用户卡片数量
|
|
|
|
|
|
// int maxUserCardNum = reply.data[16];
|
|
|
|
|
|
//
|
|
|
|
|
|
// // 序列号
|
|
|
|
|
|
// var serialNo = reply.data.sublist(17, 21);
|
|
|
|
|
|
//
|
|
|
|
|
|
// switch(status){
|
|
|
|
|
|
// case 0x00:
|
|
|
|
|
|
// //成功
|
|
|
|
|
|
// // _getLockStatus();
|
|
|
|
|
|
// break;
|
|
|
|
|
|
// case 0x06:
|
|
|
|
|
|
// //需要鉴权
|
|
|
|
|
|
// break;
|
|
|
|
|
|
// default:
|
|
|
|
|
|
// //失败
|
|
|
|
|
|
// break;
|
|
|
|
|
|
// }
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
// // 查询卡片状态
|
|
|
|
|
|
// Future<void> senderCheckingCardStatus() async {
|
|
|
|
|
|
// BlueManage().bludSendData(BlueManage().connectDeviceName, (BluetoothConnectionState state) async {
|
|
|
|
|
|
// if (state == BluetoothConnectionState.connected) {
|
|
|
|
|
|
// var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
|
|
|
|
|
// List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
|
|
|
|
|
//
|
|
|
|
|
|
// var token = await Storage.getStringList(saveBlueToken);
|
|
|
|
|
|
// List<int> getTokenList = changeStringListToIntList(token!);
|
|
|
|
|
|
//
|
|
|
|
|
|
// var publicKey = await Storage.getStringList(saveBluePublicKey);
|
|
|
|
|
|
// List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
|
|
|
|
|
|
//
|
|
|
|
|
|
// IoSenderManage.senderCheckingCardStatusCommand(
|
|
|
|
|
|
// keyID:BlueManage().connectDeviceName,
|
|
|
|
|
|
// userID:await Storage.getUid(),
|
|
|
|
|
|
// role:0xff,
|
|
|
|
|
|
// cardCount:20,
|
|
|
|
|
|
// cardNo:1,
|
|
|
|
|
|
// token:getTokenList,
|
|
|
|
|
|
// needAuthor:1,
|
|
|
|
|
|
// publicKey:getPublicKeyList,
|
|
|
|
|
|
// privateKey:getPrivateKeyList,
|
|
|
|
|
|
// );
|
|
|
|
|
|
// }
|
|
|
|
|
|
// });
|
|
|
|
|
|
// }
|
|
|
|
|
|
//
|
|
|
|
|
|
// // 查询用户、指纹、密码、卡片数量(用于判断是否同步)
|
|
|
|
|
|
// Future<void> senderCheckingUserInfoCount() async {
|
|
|
|
|
|
// BlueManage().bludSendData(BlueManage().connectDeviceName, (BluetoothConnectionState state) async {
|
|
|
|
|
|
// if (state == BluetoothConnectionState.connected) {
|
|
|
|
|
|
// var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
|
|
|
|
|
// List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
|
|
|
|
|
//
|
|
|
|
|
|
// var token = await Storage.getStringList(saveBlueToken);
|
|
|
|
|
|
// List<int> getTokenList = changeStringListToIntList(token!);
|
|
|
|
|
|
//
|
|
|
|
|
|
// var publicKey = await Storage.getStringList(saveBluePublicKey);
|
|
|
|
|
|
// List<int> getPublicKeyList = changeStringListToIntList(publicKey!);
|
|
|
|
|
|
//
|
|
|
|
|
|
// IoSenderManage.senderCheckingUserInfoCountCommand(
|
|
|
|
|
|
// keyID:BlueManage().connectDeviceName,
|
|
|
|
|
|
// userID:await Storage.getUid(),
|
|
|
|
|
|
// role:0xff,
|
|
|
|
|
|
// nowTime:DateTime.now().millisecondsSinceEpoch~/1000,
|
|
|
|
|
|
// token:getTokenList,
|
|
|
|
|
|
// needAuthor:1,
|
|
|
|
|
|
// publicKey:getPublicKeyList,
|
|
|
|
|
|
// privateKey:getPrivateKeyList,
|
|
|
|
|
|
// );
|
|
|
|
|
|
// }
|
|
|
|
|
|
// });
|
|
|
|
|
|
// }
|
2023-12-13 11:54:34 +08:00
|
|
|
|
|
|
|
|
|
|
// 删除卡片
|
2023-12-16 11:20:36 +08:00
|
|
|
|
Future<void> senderAddICCard() async {
|
2024-01-12 19:05:44 +08:00
|
|
|
|
showEasyLoading();
|
|
|
|
|
|
showBlueConnetctToastTimer(action: (){
|
|
|
|
|
|
dismissEasyLoading();
|
|
|
|
|
|
});
|
2024-05-21 15:33:06 +08:00
|
|
|
|
BlueManage().blueSendData(BlueManage().connectDeviceName, (BluetoothConnectionState deviceConnectionState) async {
|
2024-03-18 16:16:51 +08:00
|
|
|
|
if (deviceConnectionState == BluetoothConnectionState.connected){
|
2024-04-15 16:30:00 +08:00
|
|
|
|
// var publicKey = await Storage.getStringList(saveBluePublicKey);
|
|
|
|
|
|
// List<int> publicKeyDataList = changeStringListToIntList(publicKey!);
|
|
|
|
|
|
|
|
|
|
|
|
var signKey = await Storage.getStringList(saveBlueSignKey);
|
|
|
|
|
|
List<int> signKeyDataList = changeStringListToIntList(signKey!);
|
2023-12-13 11:54:34 +08:00
|
|
|
|
|
|
|
|
|
|
var privateKey = await Storage.getStringList(saveBluePrivateKey);
|
|
|
|
|
|
List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
|
|
|
|
|
|
|
|
|
|
|
|
var token = await Storage.getStringList(saveBlueToken);
|
|
|
|
|
|
List<int> getTokenList = changeStringListToIntList(token!);
|
|
|
|
|
|
|
2024-04-16 17:44:38 +08:00
|
|
|
|
IoSenderManage.senderAddCardWithTimeCycleCoercionCommand(
|
2023-12-16 11:20:36 +08:00
|
|
|
|
keyID:state.deletKeyID,
|
2024-05-04 16:53:27 +08:00
|
|
|
|
userID:(await Storage.getUid())!,
|
2023-12-16 11:20:36 +08:00
|
|
|
|
cardNo:state.deletCardNo,
|
2024-05-04 16:53:27 +08:00
|
|
|
|
useCountLimit:0xffff,
|
|
|
|
|
|
operate: state.isDeletAll == true ? 3 : 2, // 0:注册 1:修改 2:删除 3:删除全部
|
|
|
|
|
|
isAdmin:0,
|
2024-04-16 17:44:38 +08:00
|
|
|
|
isForce:0, // 是否是胁迫
|
|
|
|
|
|
isRound:0, // 是否是循环
|
|
|
|
|
|
weekRound:0, // 周循环
|
|
|
|
|
|
startDate: 0x11223344,
|
|
|
|
|
|
endDate: 0x11223344,
|
2024-04-19 18:13:34 +08:00
|
|
|
|
startTime:"0",
|
|
|
|
|
|
endTime:"0",
|
2023-12-13 11:54:34 +08:00
|
|
|
|
needAuthor:1,
|
2024-04-15 16:30:00 +08:00
|
|
|
|
signKey:signKeyDataList,
|
2023-12-13 11:54:34 +08:00
|
|
|
|
privateKey:getPrivateKeyList,
|
|
|
|
|
|
token: getTokenList,
|
|
|
|
|
|
);
|
2024-03-18 16:16:51 +08:00
|
|
|
|
} else if (deviceConnectionState == BluetoothConnectionState.disconnected) {
|
2024-01-12 19:05:44 +08:00
|
|
|
|
dismissEasyLoading();
|
|
|
|
|
|
cancelBlueConnetctToastTimer();
|
|
|
|
|
|
if(state.ifCurrentScreen.value == true){
|
|
|
|
|
|
showBlueConnetctToast();
|
|
|
|
|
|
}
|
2023-12-13 11:54:34 +08:00
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 获取IC卡列表
|
2024-01-25 17:40:41 +08:00
|
|
|
|
Future<FingerprintListDataEntity> getICCardListData() async{
|
|
|
|
|
|
FingerprintListDataEntity entity = await ApiRepository.to.getICCardListData(
|
2023-12-13 11:54:34 +08:00
|
|
|
|
lockId: state.lockId.value.toString(),
|
2024-01-25 17:40:41 +08:00
|
|
|
|
pageNo: pageNo.toString(),
|
|
|
|
|
|
pageSize: pageSize,
|
2023-12-13 11:54:34 +08:00
|
|
|
|
searchStr: state.searchController.text,
|
|
|
|
|
|
);
|
|
|
|
|
|
if(entity.errorCode!.codeIsSuccessful){
|
2024-01-25 17:40:41 +08:00
|
|
|
|
if (pageNo == 1) {
|
|
|
|
|
|
state.fingerprintItemListData.value = entity.data!.list!;
|
|
|
|
|
|
pageNo++;
|
|
|
|
|
|
} else {
|
|
|
|
|
|
if (entity.data!.list!.isNotEmpty) {
|
|
|
|
|
|
state.fingerprintItemListData.value.addAll(entity.data!.list!);
|
|
|
|
|
|
pageNo++;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2023-12-13 11:54:34 +08:00
|
|
|
|
}
|
2024-01-25 17:40:41 +08:00
|
|
|
|
return entity;
|
2023-12-13 11:54:34 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 删除所有IC卡
|
|
|
|
|
|
void deletICCardData() async{
|
2023-12-16 11:20:36 +08:00
|
|
|
|
var cardId = "";
|
|
|
|
|
|
var type = "1";
|
|
|
|
|
|
if(state.isDeletAll == false){
|
|
|
|
|
|
cardId = state.deletKeyID;
|
|
|
|
|
|
type = "0";
|
|
|
|
|
|
}
|
2023-12-13 11:54:34 +08:00
|
|
|
|
var entity = await ApiRepository.to.deletIcCardData(
|
2023-12-16 11:20:36 +08:00
|
|
|
|
cardId: cardId,
|
2023-12-13 11:54:34 +08:00
|
|
|
|
lockId: state.lockId.value.toString(),
|
2023-12-16 11:20:36 +08:00
|
|
|
|
type: type,
|
2023-12-13 11:54:34 +08:00
|
|
|
|
deleteType:"1"
|
|
|
|
|
|
);
|
|
|
|
|
|
if(entity.errorCode!.codeIsSuccessful){
|
2023-12-16 11:20:36 +08:00
|
|
|
|
if(state.isDeletAll == false){
|
2024-04-11 17:06:06 +08:00
|
|
|
|
showToast("删除成功".tr, something: (){
|
2024-03-19 18:04:51 +08:00
|
|
|
|
pageNo = 1;
|
|
|
|
|
|
getICCardListData();
|
|
|
|
|
|
});
|
2023-12-16 11:20:36 +08:00
|
|
|
|
}else{
|
2024-04-11 17:06:06 +08:00
|
|
|
|
showToast("重置成功".tr, something: (){
|
2024-03-19 18:04:51 +08:00
|
|
|
|
pageNo = 1;
|
|
|
|
|
|
getICCardListData();
|
|
|
|
|
|
});
|
2023-12-16 11:20:36 +08:00
|
|
|
|
}
|
2023-12-13 11:54:34 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 监听修改完详情之后刷新列表
|
|
|
|
|
|
late StreamSubscription _teamEvent;
|
|
|
|
|
|
void _initRefreshAction() {
|
|
|
|
|
|
_teamEvent = eventBus.on<OtherTypeRefreshListEvent>().listen((event) {
|
2024-02-26 11:07:09 +08:00
|
|
|
|
pageNo = 1;
|
2023-12-13 11:54:34 +08:00
|
|
|
|
getICCardListData();
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-04-02 17:30:44 +08:00
|
|
|
|
String getKeyType(FingerprintItemData fingerprintItemData){
|
|
|
|
|
|
var keyTypeStr = "";//
|
|
|
|
|
|
if(fingerprintItemData.cardStatus == 1){
|
|
|
|
|
|
if(fingerprintItemData.startDate! > DateTime.now().millisecondsSinceEpoch){
|
2024-04-11 17:06:06 +08:00
|
|
|
|
keyTypeStr = "未生效".tr;
|
2024-04-02 17:30:44 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}else if(fingerprintItemData.cardStatus == 2){
|
2024-04-11 17:06:06 +08:00
|
|
|
|
keyTypeStr = "已失效".tr;
|
2024-04-02 17:30:44 +08:00
|
|
|
|
}
|
|
|
|
|
|
return keyTypeStr;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-03-25 15:03:02 +08:00
|
|
|
|
String getKeyDateType(FingerprintItemData fingerprintItemData){
|
|
|
|
|
|
var keyDateTypeStr = "";// 永久:1;限时2,单次3,循环:4
|
|
|
|
|
|
if(fingerprintItemData.cardType! == 1){
|
|
|
|
|
|
keyDateTypeStr = "${DateTool().dateToYMDHNString(fingerprintItemData.createDate.toString())} 永久";
|
|
|
|
|
|
}else if(fingerprintItemData.cardType! == 2){
|
|
|
|
|
|
keyDateTypeStr = "${DateTool().dateToYMDHNString(fingerprintItemData.startDate.toString())} - ${DateTool().dateToYMDHNString(fingerprintItemData.endDate.toString())} 限时";
|
|
|
|
|
|
}else if(fingerprintItemData.cardType! == 4){
|
2024-04-01 16:21:46 +08:00
|
|
|
|
keyDateTypeStr = "${DateTool().dateToYMDString(fingerprintItemData.startDate.toString())}-${DateTool().dateToYMDString(fingerprintItemData.endDate.toString())} 循环";
|
2024-03-25 15:03:02 +08:00
|
|
|
|
}
|
|
|
|
|
|
return keyDateTypeStr;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2023-12-13 11:54:34 +08:00
|
|
|
|
@override
|
|
|
|
|
|
Future<void> onReady() async {
|
|
|
|
|
|
// TODO: implement onReady
|
|
|
|
|
|
super.onReady();
|
|
|
|
|
|
|
|
|
|
|
|
// 获取是否是演示模式 演示模式不获取接口
|
|
|
|
|
|
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
|
|
|
|
|
if(isDemoMode == false){
|
|
|
|
|
|
_initReplySubscription();
|
|
|
|
|
|
|
|
|
|
|
|
_initRefreshAction();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
|
Future<void> onInit() async {
|
|
|
|
|
|
// TODO: implement onInit
|
|
|
|
|
|
super.onInit();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
|
Future<void> onClose() async {
|
|
|
|
|
|
// TODO: implement onClose
|
|
|
|
|
|
super.onClose();
|
|
|
|
|
|
|
|
|
|
|
|
var isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
|
|
|
|
|
if(isDemoMode == false) {
|
|
|
|
|
|
_replySubscription.cancel();
|
|
|
|
|
|
_teamEvent.cancel();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|