修改TAPD问题

This commit is contained in:
魏少阳 2024-04-01 16:21:46 +08:00
parent 9f5d5b21a5
commit 496145a6b3
16 changed files with 197 additions and 62 deletions

84
.idea/starLock.iml generated
View File

@ -252,6 +252,90 @@
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/aliyun_push/example/.pub" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/aliyun_push/example/build" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/aliyun_push/example/.dart_tool" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/audio_session/build" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/audio_session/.dart_tool" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/audio_session/.pub" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/google_maps_flutter_ios/example/ios14/.pub" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/google_maps_flutter_ios/example/ios14/build" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/google_maps_flutter_ios/example/ios14/.dart_tool" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/flutter_pcm_sound/example/.dart_tool" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/flutter_pcm_sound/example/build" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/flutter_pcm_sound/example/.pub" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/flutter_pcm_sound/build" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/flutter_pcm_sound/.dart_tool" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/flutter_pcm_sound/.pub" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/flutter_blue_plus/example/.pub" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/flutter_blue_plus/example/.dart_tool" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/flutter_blue_plus/example/build" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/audio_service/example/build" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/audio_service/example/.pub" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/audio_service/example/.dart_tool" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/system_settings/example/.pub" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/system_settings/example/.dart_tool" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/system_settings/example/build" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/app_settings/build" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/app_settings/.dart_tool" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/app_settings/.pub" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/flutter_voice_processor/.dart_tool" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/flutter_voice_processor/build" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/flutter_voice_processor/.pub" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/connectivity_plus/example/.dart_tool" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/connectivity_plus/example/build" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/connectivity_plus/example/.pub" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/just_audio/example/.dart_tool" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/just_audio/example/.pub" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/just_audio/example/build" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/audioplayers_darwin/.dart_tool" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/audioplayers_darwin/build" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/audioplayers_darwin/.pub" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/flutter_blue_plus/.pub" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/flutter_blue_plus/build" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/flutter_blue_plus/.dart_tool" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/system_settings/build" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/system_settings/.pub" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/system_settings/.dart_tool" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/image_gallery_saver/.pub" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/image_gallery_saver/.dart_tool" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/image_gallery_saver/build" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/just_audio/.dart_tool" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/just_audio/build" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/just_audio/.pub" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/image_gallery_saver/example/build" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/image_gallery_saver/example/.dart_tool" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/image_gallery_saver/example/.pub" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/jpush_flutter/build" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/jpush_flutter/.pub" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/jpush_flutter/.dart_tool" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/jpush_flutter/example/.pub" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/jpush_flutter/example/.dart_tool" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/jpush_flutter/example/build" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/audio_service/build" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/audio_service/.dart_tool" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/audio_service/.pub" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/flutter_local_notifications/example/build" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/flutter_local_notifications/example/.pub" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/flutter_local_notifications/example/.dart_tool" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/flutter_local_notifications/build" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/flutter_local_notifications/.pub" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/flutter_local_notifications/.dart_tool" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/connectivity_plus/.dart_tool" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/connectivity_plus/.pub" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/connectivity_plus/build" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/app_settings/example/.dart_tool" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/app_settings/example/build" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/app_settings/example/.pub" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/flutter_voice_processor/example/.pub" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/flutter_voice_processor/example/.dart_tool" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/flutter_voice_processor/example/build" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/g711_flutter/.pub" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/g711_flutter/.dart_tool" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/g711_flutter/build" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/audio_session/example/.dart_tool" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/audio_session/example/.pub" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/audio_session/example/build" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/g711_flutter/example/build" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/g711_flutter/example/.dart_tool" />
<excludeFolder url="file://$MODULE_DIR$/star_lock/ios/.symlinks/plugins/g711_flutter/example/.pub" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />

View File

@ -559,9 +559,11 @@ class BlueManage {
//
Future<void> disconnect() async {
try {
connectDeviceMacAddress = "";
await bluetoothConnectDevice!.disconnect();
Get.log("断开连接成功");
// if(bluetoothConnectDevice != null && bluetoothConnectDevice!.connectionState == BluetoothConnectionState.connected){
connectDeviceMacAddress = "";
await bluetoothConnectDevice!.disconnect();
Get.log("断开连接成功");
// }
} on Exception catch (e, _) {
Get.log("Error disconnecting from a device: $e");
} finally {

View File

@ -186,7 +186,7 @@ class _StarLockForgetPasswordPageState
var result = await Navigator.pushNamed(
context, Routers.safetyVerificationPage,
arguments: {
"countryCode": "+86",
"countryCode": "86",
"account": state.phoneStr.value
});
logic.state.xWidth.value =

View File

@ -144,8 +144,8 @@ class CardDetailLogic extends BaseGetXController{
cardId: state.keyId.value.toString(),
lockId: state.fingerprintItemData.value.lockId.toString(),
weekDay: state.weekDay.value,
startDate: state.starDate.value,
endDate: state.endDate.value,
startDate: state.starDate.value*1000,
endDate: state.endDate.value*1000,
isCoerced: state.isStressFingerprint.value ? "2" : "1",
cardName: state.changeNameController.text,
changeType: "1",
@ -182,7 +182,7 @@ class CardDetailLogic extends BaseGetXController{
}else if(state.keyType.value == 2){
useDateStr = "${DateTool().dateToYMDHNString(state.starDate.value)}\n${DateTool().dateToYMDHNString(state.endDate.value)}";
} else if(state.keyType.value == 4){
useDateStr = "${DateTool().dateToYMDString(state.starDate.value)}-${DateTool().dateToYMDString(state.endDate.value)}";
useDateStr = "${DateTool().dateToYMDString(state.starDate.value)}\n${DateTool().dateToYMDString(state.endDate.value)}";
}
return useDateStr;
}

View File

@ -372,7 +372,7 @@ class CardListLogic extends BaseGetXController {
}else if(fingerprintItemData.cardType! == 2){
keyDateTypeStr = "${DateTool().dateToYMDHNString(fingerprintItemData.startDate.toString())} - ${DateTool().dateToYMDHNString(fingerprintItemData.endDate.toString())} 限时";
}else if(fingerprintItemData.cardType! == 4){
keyDateTypeStr = "循环";
keyDateTypeStr = "${DateTool().dateToYMDString(fingerprintItemData.startDate.toString())}-${DateTool().dateToYMDString(fingerprintItemData.endDate.toString())} 循环";
}
return keyDateTypeStr;
}

View File

@ -11,14 +11,14 @@ class OtherTypeKeyChangeDateLogic extends BaseGetXController{
//
void editFingerprintsData() async{
var beginTimeTimestamp = DateTool().dateToTimestamp(state.beginTime.value, 1) ~/ 1000;
var endTimeTimestamp = DateTool().dateToTimestamp(state.endTime.value, 1) ~/ 1000;
var beginTimeTimestamp = DateTool().dateToTimestamp(state.beginTime.value, 1);
var endTimeTimestamp = DateTool().dateToTimestamp(state.endTime.value, 1);
if (beginTimeTimestamp > endTimeTimestamp || beginTimeTimestamp == endTimeTimestamp) {
showToast("失效时间需大于生效时间");
return;
}
if (endTimeTimestamp < DateTime.now().millisecondsSinceEpoch ~/ 1000) {
if (endTimeTimestamp < DateTime.now().millisecondsSinceEpoch) {
showToast("生效时间需大于当前时间");
return;
}
@ -48,14 +48,14 @@ class OtherTypeKeyChangeDateLogic extends BaseGetXController{
// iC卡
void editICCardData() async{
var beginTimeTimestamp = DateTool().dateToTimestamp(state.beginTime.value, 1) ~/ 1000;
var endTimeTimestamp = DateTool().dateToTimestamp(state.endTime.value, 1) ~/ 1000;
var beginTimeTimestamp = DateTool().dateToTimestamp(state.beginTime.value, 1);
var endTimeTimestamp = DateTool().dateToTimestamp(state.endTime.value, 1);
if (beginTimeTimestamp > endTimeTimestamp || beginTimeTimestamp == endTimeTimestamp) {
showToast("失效时间需大于生效时间");
return;
}
if (endTimeTimestamp < DateTime.now().millisecondsSinceEpoch ~/ 1000) {
if (endTimeTimestamp < DateTime.now().millisecondsSinceEpoch) {
showToast("生效时间需大于当前时间");
return;
}

View File

@ -405,7 +405,7 @@ class FingerprintListLogic extends BaseGetXController{
}else if(fingerprintItemData.fingerprintType! == 2){
keyDateTypeStr = "${DateTool().dateToYMDHNString(fingerprintItemData.startDate.toString())} - ${DateTool().dateToYMDHNString(fingerprintItemData.endDate.toString())} 限时";
}else if(fingerprintItemData.fingerprintType! == 4){
keyDateTypeStr = "循环";
keyDateTypeStr = "${DateTool().dateToYMDString(fingerprintItemData.startDate.toString())}-${DateTool().dateToYMDString(fingerprintItemData.endDate.toString())} 循环";
}
return keyDateTypeStr;
}

View File

@ -117,7 +117,7 @@ class LockDetailLogic extends BaseGetXController {
IoSenderManage.senderOpenLock(
keyID: BlueManage().connectDeviceName,
userID: await Storage.getUid(),
openMode: 1,
openMode: state.openDoorModel,
openTime: DateTime.now().millisecondsSinceEpoch ~/ 1000,
onlineToken: state.lockNetToken,
token: tokenData,
@ -323,12 +323,12 @@ class LockDetailLogic extends BaseGetXController {
state.lockUserNo = reply.data[47];
_updateLockUserNo();
if (state.isOpenLockNeedOnline.value == 0) {
openDoorAction(1);
} else {
getLockNetToken();
}
eventBus.fire(RefreshLockDetailInfoDataEvent());
// if (state.isOpenLockNeedOnline.value == 0) {
// openDoorAction(1);
// } else {
// getLockNetToken();
// }
// eventBus.fire(RefreshLockDetailInfoDataEvent());
// clickPushBtnAction();
break;
case 0x06:
@ -428,7 +428,7 @@ class LockDetailLogic extends BaseGetXController {
}
//
Future<void> openDoorAction(int openMode) async {
Future<void> openDoorAction() async {
showBlueConnetctToastTimer(action: () {
state.openLockBtnState.value = 0;
BlueManage().stopScan();
@ -456,7 +456,7 @@ class LockDetailLogic extends BaseGetXController {
// privateKey: getPrivateKeyList,
// );
Get.log("openMode:$openMode");
Get.log("openMode:${state.openDoorModel}");
BlueManage()
.bludSendData(state.keyInfos.value.bluetooth!.bluetoothDeviceName!,
(BluetoothConnectionState deviceConnectionState) async {
@ -464,7 +464,7 @@ class LockDetailLogic extends BaseGetXController {
IoSenderManage.senderOpenLock(
keyID: BlueManage().connectDeviceName,
userID: await Storage.getUid(),
openMode: openMode,
openMode: state.openDoorModel,
openTime: DateTime.now().millisecondsSinceEpoch ~/ 1000,
onlineToken: state.lockNetToken,
token: getTokenList,
@ -647,7 +647,7 @@ class LockDetailLogic extends BaseGetXController {
if (entity.errorCode!.codeIsSuccessful) {
state.lockNetToken = entity.data!.token!;
Get.log("state.lockNetToken:${state.lockNetToken}");
openDoorAction(1);
openDoorAction();
}
}
@ -657,11 +657,15 @@ class LockDetailLogic extends BaseGetXController {
keyId: state.keyInfos.value.keyId.toString(),
lockUserNo: state.lockUserNo.toString());
if (entity.errorCode!.codeIsSuccessful) {
if (state.isOpenLockNeedOnline.value == 0) {
state.bottomBtnisEable.value = true;
eventBus.fire(RefreshLockDetailInfoDataEvent());
// state.keyInfos.value.lockUserNo = state.lockUserNo;
// state.bottomBtnisEable.value = true;
// print("state.bottomBtnisEable.value:${state.bottomBtnisEable.value} state.keyInfos.value.lockUserNo:${state.keyInfos.value.lockUserNo}");
eventBus.fire(RefreshLockDetailInfoDataEvent());
SchedulerBinding.instance.addPostFrameCallback((_) {
eventBus.fire(RefreshLockListInfoDataEvent());
openDoorAction(1);
});
if (state.isOpenLockNeedOnline.value == 0) {
openDoorAction();
} else {
getLockNetToken();
}

View File

@ -71,16 +71,12 @@ class _LockDetailPageState extends State<LockDetailPage>
StreamSubscription? _lockRefreshLockDetailInfoDataEvent;
void _initRefreshLockDetailInfoDataEventAction() {
// eventBus
_lockRefreshLockDetailInfoDataEvent =
eventBus.on<RefreshLockDetailInfoDataEvent>().listen((event) {
_lockRefreshLockDetailInfoDataEvent = eventBus.on<RefreshLockDetailInfoDataEvent>().listen((event) {
setState(() {});
});
}
void loadData() {
// print("widget.lockListInfoItemEntity.lockUserNo:${widget.lockListInfoItemEntity.lockUserNo}");
// print("state.lockUserNo:${state.lockUserNo}");
state.keyInfos.value = widget.lockListInfoItemEntity;
state.lockUserNo = state.keyInfos.value.lockUserNo!;
if (state.lockUserNo == 0) {
@ -146,10 +142,7 @@ class _LockDetailPageState extends State<LockDetailPage>
visible:
((state.keyInfos.value.keyType == XSConstantMacro.keyTypeTime || state.keyInfos.value.keyType == XSConstantMacro.keyTypeLoop) && //
(DateTool().compareTimeGetDaysFromNow(state.keyInfos.value.endDate!) <= 15 && DateTool().compareTimeGetDaysFromNow(state.keyInfos.value.endDate!) >= 0) && // 030
(state.keyInfos.value.keyStatus ==
XSConstantMacro.keyStatusNormalUse ||
state.keyInfos.value.keyStatus ==
XSConstantMacro.keyStatusWaitReceive) // 使
(state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusNormalUse || state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusWaitReceive) // 使
)
? true
: false,
@ -188,7 +181,7 @@ class _LockDetailPageState extends State<LockDetailPage>
controller: state.pageController,
// child: Row(
children: [
bottomWidget(),
Obx(() => bottomWidget()),
attachmentWidget(),
],
// ),
@ -272,16 +265,11 @@ class _LockDetailPageState extends State<LockDetailPage>
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Image.asset(showElectricIcon(state.electricQuantity.value),
width: 30.w, height: 24.w),
Image.asset(showElectricIcon(state.electricQuantity.value), width: 30.w, height: 24.w),
SizedBox(width: 2.w),
Text("--%",
style: TextStyle(
fontSize: 18.sp,
color: AppColors.darkGrayTextColor)),
Text("--%", style: TextStyle(fontSize: 18.sp, color: AppColors.darkGrayTextColor)),
SizedBox(width: 2.w),
Icon(
Icons.info, // 使 warning
Icon(Icons.info, // 使 warning
color: AppColors.mainColor, //
size: 25.w, // 30
),
@ -949,7 +937,9 @@ class _LockDetailPageState extends State<LockDetailPage>
// print("state.isOpenLockNeedOnline.value:${state.isOpenLockNeedOnline.value}");
if (state.isOpenLockNeedOnline.value == 0) {
//
logic.openDoorAction(1);
print("开锁开锁开锁开锁开锁开锁开锁开锁");
state.openDoorModel = 1;
logic.openDoorAction();
} else {
//
logic.getLockNetToken();
@ -971,7 +961,9 @@ class _LockDetailPageState extends State<LockDetailPage>
// lockUserNo为0
logic.addUserConnectBlue();
} else {
logic.openDoorAction(32);
print("闭锁闭锁闭锁闭锁闭锁闭锁闭锁闭锁");
state.openDoorModel = 32;
logic.openDoorAction();
}
}

View File

@ -22,7 +22,7 @@ class LockDetailState {
StreamSubscription? lockSetOpenOrCloseCheckInRefreshLockDetailWithAttendanceEvent;
String lockNetToken = "";
var lockUserNo = 0;
int lockUserNo = 0;
var senderUserId = 0;
var isOnlyOneData = false;
@ -42,6 +42,8 @@ class LockDetailState {
var bottomBtnisEable = true.obs; //
var openDoorBtnisUneable = true.obs; // 使使,
var openDoorModel = 0;
//
AnimationController? animationController;
// var lockState = 0.obs;// 0 1() 2 3 4 5

View File

@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:star_lock/tools/dateTool.dart';
import '../../../../../appRouters.dart';
import '../../../../../app_settings/app_colors.dart';
@ -71,7 +72,23 @@ class _BasicInformationPageState extends State<BasicInformationPage> {
state.lockBasicInfo.value.endDate,
state.lockBasicInfo.value.keyType),
allHeight: 70.h,
isHaveLine: false)),
isHaveLine: true)),
Obx(() => Visibility(
visible: state.lockBasicInfo.value.keyType == 4 ? true : false,
child: CommonItem(
leftTitel: "有效日".tr,
rightTitle: state.lockBasicInfo.value!.weekDays!.join(",").toString(),
allHeight: 70.h,
isHaveLine: true),
)),
Obx(() => Visibility(
visible: state.lockBasicInfo.value.keyType == 4 ? true : false,
child: CommonItem(
leftTitel: "有效时间",
rightTitle: "${DateTool().dateToHNString(state.lockBasicInfo.value.startDate.toString())}-${DateTool().dateToHNString(state.lockBasicInfo.value.endDate.toString())}",
allHeight: 70.h,
isHaveLine: true),
)),
SizedBox(height: 10.h),
Obx(() => Visibility(
visible: (state.lockBasicInfo.value.isLockOwner == 1 ||

View File

@ -334,6 +334,7 @@ class LockBasicInfo {
int? keyRight;
int? senderUserId;
int? lockUserNo;
List? weekDays;
LockBasicInfo(
{this.lockId,
@ -355,7 +356,8 @@ class LockBasicInfo {
this.mac,
this.keyRight,
this.senderUserId,
this.lockUserNo});
this.lockUserNo,
this.weekDays});
LockBasicInfo.fromJson(Map<String, dynamic> json) {
lockId = json['lockId'];
@ -383,6 +385,7 @@ class LockBasicInfo {
keyRight = json['keyRight'];
senderUserId = json['senderUserId'];
lockUserNo = json['lockUserNo'];
weekDays = json['weekDays'];
}
Map<String, dynamic> toJson() {
@ -409,6 +412,7 @@ class LockBasicInfo {
data['keyRight'] = keyRight;
data['senderUserId'] = senderUserId;
data['lockUserNo'] = lockUserNo;
data['weekDays'] = weekDays;
return data;
}
}

View File

@ -448,6 +448,11 @@ class _PasswordKeyPerpetualPageState extends State<PasswordKeyPerpetualPage> wit
}
}
if (state.pwdController.text.length < 6 || state.pwdController.text.length > 9) {
logic.showToast("请输入6-9位数字密码");
return;
}
logic.senderCustomPasswords();
} else {
if (state.nameController.text.isEmpty) {

View File

@ -99,14 +99,29 @@ class _LockListPageState extends State<LockListPage> {
}
// print("lockItemList.length:${lockItemList.length} == ${index+1} $isLast");
return lockInfoListItem(keyInfo, isLast, () {
if(DateTool().compareTimeIsOvertime(keyInfo.endDate!) && keyInfo.keyType == XSConstantMacro.keyTypeTime){
logic.showToast("钥匙已过期");
return;
}
// if(DateTool().compareTimeIsOvertime(keyInfo.endDate!) && keyInfo.keyType == XSConstantMacro.keyTypeTime){
// logic.showToast("钥匙已过期");
// return;
// }
// var lockCount = 0;
// for(GroupList itemData in groupDataList){
// lockCount+=itemData.lockList!.length;
// }
// || keyInfo.keyStatus == XSConstantMacro.keyStatusFrozen || keyInfo.keyStatus == XSConstantMacro.keyStatusExpired
if((keyInfo.keyType == XSConstantMacro.keyTypeTime || keyInfo.keyType == XSConstantMacro.keyTypeLoop) && (keyInfo.keyStatus == XSConstantMacro.keyStatusWaitIneffective)){
logic.showToast("您的钥匙未生效");
return;
}
if((keyInfo.keyType == XSConstantMacro.keyTypeTime || keyInfo.keyType == XSConstantMacro.keyTypeLoop) && (keyInfo.keyStatus == XSConstantMacro.keyStatusFrozen)){
logic.showToast("您的钥匙已冻结");
return;
}
if((keyInfo.keyType == XSConstantMacro.keyTypeTime || keyInfo.keyType == XSConstantMacro.keyTypeLoop) && (keyInfo.keyStatus == XSConstantMacro.keyStatusExpired)){
logic.showToast("您的钥匙已过期");
return;
}
Get.toNamed(Routers.lockDetailMainPage, arguments: {
// "lockMainEntity": widget.lockMainEntity,
"keyInfo": keyInfo,
@ -124,7 +139,9 @@ class _LockListPageState extends State<LockListPage> {
// height: 122.h,
margin: isLast ? EdgeInsets.only(left: 20.w, right: 20.w, top: 20.w, bottom: 20.w) : EdgeInsets.only(left: 20.w, right: 20.w, top: 20.w),
decoration: BoxDecoration(
color: (DateTool().compareTimeIsOvertime(keyInfo.endDate!) && keyInfo.keyType == XSConstantMacro.keyTypeTime) ? AppColors.greyBackgroundColor : Colors.white,
color: ((keyInfo.keyType == XSConstantMacro.keyTypeTime || keyInfo.keyType == XSConstantMacro.keyTypeLoop) &&
(keyInfo.keyStatus == XSConstantMacro.keyStatusWaitIneffective || keyInfo.keyStatus == XSConstantMacro.keyStatusFrozen || keyInfo.keyStatus == XSConstantMacro.keyStatusExpired))
? AppColors.greyBackgroundColor : Colors.white,
borderRadius: BorderRadius.circular(20.w),
),
child: Column(
@ -194,7 +211,11 @@ class _LockListPageState extends State<LockListPage> {
)),
SizedBox(height: 20.h),
Visibility(
visible: ((keyInfo.keyType == XSConstantMacro.keyTypeTime || keyInfo.keyType == XSConstantMacro.keyTypeLoop) && (DateTool().compareTimeGetDaysFromNow(keyInfo.endDate!) <= 15 && DateTool().compareTimeGetDaysFromNow(keyInfo.endDate!) >= 0)) ? true : false,
visible: (
(keyInfo.keyType == XSConstantMacro.keyTypeTime || keyInfo.keyType == XSConstantMacro.keyTypeLoop) &&
(keyInfo.keyStatus == XSConstantMacro.keyStatusWaitIneffective || keyInfo.keyStatus == XSConstantMacro.keyStatusFrozen || keyInfo.keyStatus == XSConstantMacro.keyStatusExpired))
? true
: false,
// visible: true,
child:Row(
children: [
@ -216,7 +237,7 @@ class _LockListPageState extends State<LockListPage> {
children: [
SizedBox(width: 30.w),
Text(
"${logic.getUseKeyTypeStr(keyInfo.startDate, keyInfo.endDate, keyInfo.keyType)}/${keyInfo.isLockOwner == 1 ? '超级管理员' : (keyInfo.keyRight == 1 ? "授权管理员" : "普通用户")}",
"${logic.getUseKeyTypeStr(keyInfo.startDate, keyInfo.endDate, keyInfo.keyType)} ${keyInfo.isLockOwner == 1 ? '超级管理员' : (keyInfo.keyRight == 1 ? "授权管理员" : "普通用户")}",
style: TextStyle(
fontSize: 18.sp, color: AppColors.darkGrayTextColor),
),

View File

@ -47,6 +47,7 @@ class _StarLockMainPageState extends State<StarLockMainPage> with BaseWidget {
void initState() {
super.initState();
WidgetsBinding.instance!.addPostFrameCallback((_) {
logic.pageNo = 1;
getHttpData();
});
@ -235,8 +236,10 @@ class _StarLockMainPageState extends State<StarLockMainPage> with BaseWidget {
late StreamSubscription _teamEvent;
void _initLoadDataAction() {
print("监听刷新首页数据消息");
_teamEvent = eventBus.on<RefreshLockListInfoDataEvent>().listen((event) {
// getLockInfo();
logic.pageNo = 1;
getHttpData();
print("收到刷新首页数据消息");
});

View File

@ -11,6 +11,7 @@ import 'package:url_launcher/url_launcher.dart';
import '../common/XSConstantMacro/XSConstantMacro.dart';
import 'NativeInteractionTool.dart';
import 'dateTool.dart';
import 'manager/client_manager.dart';
import 'showIosTipView.dart';
@ -172,7 +173,7 @@ class BaseGetXController extends GetxController {
DateTime startDateStr = DateTime.fromMillisecondsSinceEpoch(startDate!);
DateTime endDateStr = DateTime.fromMillisecondsSinceEpoch(endDate!);
useDateStr =
'${startDateStr.toLocal().toString().substring(0, 16)} - ${endDateStr.toLocal().toString().substring(0, 16)}';
'${startDateStr.toLocal().toString().substring(0, 16)}-${endDateStr.toLocal().toString().substring(0, 16)}';
} else if (keyType == XSConstantMacro.keyTypeLong) {
//
// DateTime dateStr = DateTime.fromMillisecondsSinceEpoch(indexEntity.date!);
@ -185,7 +186,7 @@ class BaseGetXController extends GetxController {
useDateStr = '单次';
} else if (keyType == XSConstantMacro.keyTypeLoop) {
//
useDateStr = '循环';
useDateStr = "${DateTool().dateToYMDString(startDate.toString())}-${DateTool().dateToYMDString(endDate.toString())}";
}
return useDateStr;