修改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/.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/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/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> </content>
<orderEntry type="inheritedJdk" /> <orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,6 +1,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:star_lock/tools/dateTool.dart';
import '../../../../../appRouters.dart'; import '../../../../../appRouters.dart';
import '../../../../../app_settings/app_colors.dart'; import '../../../../../app_settings/app_colors.dart';
@ -71,7 +72,23 @@ class _BasicInformationPageState extends State<BasicInformationPage> {
state.lockBasicInfo.value.endDate, state.lockBasicInfo.value.endDate,
state.lockBasicInfo.value.keyType), state.lockBasicInfo.value.keyType),
allHeight: 70.h, 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), SizedBox(height: 10.h),
Obx(() => Visibility( Obx(() => Visibility(
visible: (state.lockBasicInfo.value.isLockOwner == 1 || visible: (state.lockBasicInfo.value.isLockOwner == 1 ||

View File

@ -334,6 +334,7 @@ class LockBasicInfo {
int? keyRight; int? keyRight;
int? senderUserId; int? senderUserId;
int? lockUserNo; int? lockUserNo;
List? weekDays;
LockBasicInfo( LockBasicInfo(
{this.lockId, {this.lockId,
@ -355,7 +356,8 @@ class LockBasicInfo {
this.mac, this.mac,
this.keyRight, this.keyRight,
this.senderUserId, this.senderUserId,
this.lockUserNo}); this.lockUserNo,
this.weekDays});
LockBasicInfo.fromJson(Map<String, dynamic> json) { LockBasicInfo.fromJson(Map<String, dynamic> json) {
lockId = json['lockId']; lockId = json['lockId'];
@ -383,6 +385,7 @@ class LockBasicInfo {
keyRight = json['keyRight']; keyRight = json['keyRight'];
senderUserId = json['senderUserId']; senderUserId = json['senderUserId'];
lockUserNo = json['lockUserNo']; lockUserNo = json['lockUserNo'];
weekDays = json['weekDays'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -409,6 +412,7 @@ class LockBasicInfo {
data['keyRight'] = keyRight; data['keyRight'] = keyRight;
data['senderUserId'] = senderUserId; data['senderUserId'] = senderUserId;
data['lockUserNo'] = lockUserNo; data['lockUserNo'] = lockUserNo;
data['weekDays'] = weekDays;
return data; 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(); logic.senderCustomPasswords();
} else { } else {
if (state.nameController.text.isEmpty) { if (state.nameController.text.isEmpty) {

View File

@ -99,14 +99,29 @@ class _LockListPageState extends State<LockListPage> {
} }
// print("lockItemList.length:${lockItemList.length} == ${index+1} $isLast"); // print("lockItemList.length:${lockItemList.length} == ${index+1} $isLast");
return lockInfoListItem(keyInfo, isLast, () { return lockInfoListItem(keyInfo, isLast, () {
if(DateTool().compareTimeIsOvertime(keyInfo.endDate!) && keyInfo.keyType == XSConstantMacro.keyTypeTime){ // if(DateTool().compareTimeIsOvertime(keyInfo.endDate!) && keyInfo.keyType == XSConstantMacro.keyTypeTime){
logic.showToast("钥匙已过期"); // logic.showToast("钥匙已过期");
return; // return;
} // }
// var lockCount = 0; // var lockCount = 0;
// for(GroupList itemData in groupDataList){ // for(GroupList itemData in groupDataList){
// lockCount+=itemData.lockList!.length; // 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: { Get.toNamed(Routers.lockDetailMainPage, arguments: {
// "lockMainEntity": widget.lockMainEntity, // "lockMainEntity": widget.lockMainEntity,
"keyInfo": keyInfo, "keyInfo": keyInfo,
@ -124,7 +139,9 @@ class _LockListPageState extends State<LockListPage> {
// height: 122.h, // 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), 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( 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), borderRadius: BorderRadius.circular(20.w),
), ),
child: Column( child: Column(
@ -194,7 +211,11 @@ class _LockListPageState extends State<LockListPage> {
)), )),
SizedBox(height: 20.h), SizedBox(height: 20.h),
Visibility( 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, // visible: true,
child:Row( child:Row(
children: [ children: [
@ -216,7 +237,7 @@ class _LockListPageState extends State<LockListPage> {
children: [ children: [
SizedBox(width: 30.w), SizedBox(width: 30.w),
Text( 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( style: TextStyle(
fontSize: 18.sp, color: AppColors.darkGrayTextColor), fontSize: 18.sp, color: AppColors.darkGrayTextColor),
), ),

View File

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

View File

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