From e4649655b43128af318fd49c99ebfae03ce47fda Mon Sep 17 00:00:00 2001 From: Liuyf Date: Mon, 26 May 2025 16:27:35 +0800 Subject: [PATCH 1/3] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=93=9D=E7=89=99?= =?UTF-8?q?=E5=BC=80=E9=94=81=E6=88=90=E5=8A=9F=E5=90=8E=EF=BC=8C=E9=94=81?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E5=90=8C=E6=AD=A5=E4=B8=8D=E5=AE=8C=E6=95=B4?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/main/lockDetail/lockDetail/lockDetail_logic.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/main/lockDetail/lockDetail/lockDetail_logic.dart b/lib/main/lockDetail/lockDetail/lockDetail_logic.dart index f3668a2c..5355f785 100755 --- a/lib/main/lockDetail/lockDetail/lockDetail_logic.dart +++ b/lib/main/lockDetail/lockDetail/lockDetail_logic.dart @@ -378,7 +378,7 @@ class LockDetailLogic extends BaseGetXController { if (i == getList.length - 1) { //设置最后的时间戳 - state.operateDate = operateDate; + state.operateDate = time; } } catch (e) { AppLog.log('操作记录:$indexList,解析失败,跳过该跳记录,进行下一条记录解析。'); From 9135f6f2a903464eec18f3ea771b040f910e7d00 Mon Sep 17 00:00:00 2001 From: Liuyf Date: Tue, 27 May 2025 10:33:54 +0800 Subject: [PATCH 2/3] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=93=9D=E7=89=99?= =?UTF-8?q?=E5=BC=80=E9=94=81=E6=88=90=E5=8A=9F=E5=90=8E=EF=BC=8C=E6=9C=80?= =?UTF-8?q?=E5=90=8E=E4=B8=80=E6=9D=A1=E9=94=81=E8=AE=B0=E5=BD=95=E5=81=B6?= =?UTF-8?q?=E5=B0=94=E4=B8=8D=E5=90=8C=E6=AD=A5bug=E8=AF=8A=E6=96=AD?= =?UTF-8?q?=E5=9F=8B=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/blue/blue_manage.dart | 12 +++++++++--- .../lockDetail/lockDetail/lockDetail_logic.dart | 13 ++++++++++++- lib/main_local.dart | 2 +- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/lib/blue/blue_manage.dart b/lib/blue/blue_manage.dart index 6f258b2c..f90753b4 100755 --- a/lib/blue/blue_manage.dart +++ b/lib/blue/blue_manage.dart @@ -123,14 +123,18 @@ class BlueManage { .eventBus! .on() .listen((EventSendModel model) { + AppLog.log('eventBus接收发送数据:${model}'); if (model.sendChannel == DataChannel.ble) { FlutterBluePlus.isSupported.then((bool isAvailable) async { if (isAvailable) { if (_adapterState == BluetoothAdapterState.on) { // 蓝牙已开启,可以进行蓝牙操作 + AppLog.log('蓝牙已开启,开始收发送数据:${model.data}'); writeCharacteristicWithResponse(model.data); } else { - try {} catch (e) { + try { + AppLog.log('蓝牙已关闭,停止发送数据:${model.data}'); + } catch (e) { AppLog.log('蓝牙打开失败'); } } @@ -315,8 +319,10 @@ class BlueManage { } /// 判断是否包含指定的uuid - bool _isMatch(List serviceUuids, {DeviceType deviceType = DeviceType.blue}) { - final List prefixes = getDeviceType(deviceType).map((e) => e.toLowerCase()).toList(); + bool _isMatch(List serviceUuids, + {DeviceType deviceType = DeviceType.blue}) { + final List prefixes = + getDeviceType(deviceType).map((e) => e.toLowerCase()).toList(); for (String uuid in serviceUuids) { final String cleanUuid = uuid.replaceAll('-', '').toLowerCase(); if (cleanUuid.length == 8) { diff --git a/lib/main/lockDetail/lockDetail/lockDetail_logic.dart b/lib/main/lockDetail/lockDetail/lockDetail_logic.dart index 5355f785..3cf6e155 100755 --- a/lib/main/lockDetail/lockDetail/lockDetail_logic.dart +++ b/lib/main/lockDetail/lockDetail/lockDetail_logic.dart @@ -59,7 +59,7 @@ class LockDetailLogic extends BaseGetXController { // 开完锁之后上传记录 if (reply is SenderReferEventRecordTimeReply && state.ifCurrentScreen.value == true) { - _replyReferEventRecordTime(reply); + await _replyReferEventRecordTime(reply); } }); } @@ -116,7 +116,9 @@ class LockDetailLogic extends BaseGetXController { state.animationController!.stop(); //锁数据更新 + AppLog.log('开锁成功,开始同步所记录:getLockRecordLastUploadDataTime'); getLockRecordLastUploadDataTime(); + AppLog.log('开锁成功,结束同步所记录:getLockRecordLastUploadDataTime'); // 只有接听状态时才可以重发开门指令 if (StartChartManage().talkStatus.status == TalkStatus.answeredSuccessfully) { @@ -338,6 +340,7 @@ class LockDetailLogic extends BaseGetXController { reply.data.removeRange(0, 7); // 把得到的数据按17个字节分割成数组 然后塞进一个新的数组里面 if (reply.data.length < 17) { + AppLog.log('数据长度不够17:${reply.data}'); return; } final List> getList = splitList(reply.data, 17); @@ -384,6 +387,7 @@ class LockDetailLogic extends BaseGetXController { AppLog.log('操作记录:$indexList,解析失败,跳过该跳记录,进行下一条记录解析。'); } } + AppLog.log('上传数据长度:${uploadList.length}'); lockRecordUploadData(uploadList); if (dataLength == state.logCountPage) { @@ -510,6 +514,8 @@ class LockDetailLogic extends BaseGetXController { }); BlueManage().blueSendData(BlueManage().connectDeviceName, (BluetoothConnectionState connectionState) async { + AppLog.log( + '开始发送同步锁记录命令,蓝牙状态是否链接:${connectionState == BluetoothConnectionState.connected}'); if (connectionState == BluetoothConnectionState.connected) { final List? privateKey = await Storage.getStringList(saveBluePrivateKey); @@ -524,6 +530,8 @@ class LockDetailLogic extends BaseGetXController { final List getPublicKeyList = changeStringListToIntList(publicKey!); + AppLog.log( + '发送同步锁记录命令:${BlueManage().connectDeviceName}'); IoSenderManage.senderReferEventRecordTimeCommand( keyID: BlueManage().connectDeviceName, userID: await Storage.getUid(), @@ -602,11 +610,14 @@ class LockDetailLogic extends BaseGetXController { final LockOperatingRecordGetLastRecordTimeEntity entity = await ApiRepository.to.getLockRecordLastUploadDataTime( lockId: state.keyInfos.value.lockId.toString()); + AppLog.log('开始获取服务端所记录更新时间:${entity}'); if (entity.errorCode!.codeIsSuccessful) { state.operateDate = entity.data!.operateDate! ~/ 1000; state.currentDate = entity.data!.currentDate! ~/ 1000; + AppLog.log('发送同步所记录命令:---'); senderReferEventRecordTime(); } + AppLog.log('结束获取服务端所记录更新时间:${entity}'); } // 操作记录上传 diff --git a/lib/main_local.dart b/lib/main_local.dart index 9e30d007..f56b6d65 100755 --- a/lib/main_local.dart +++ b/lib/main_local.dart @@ -4,7 +4,7 @@ import 'flavors.dart'; import 'main.dart' as runner; Future main() async { - F.appFlavor = Flavor.xhj; + F.appFlavor = Flavor.xhj_pre; // AppLog.log('local调用了main函数'); await runner.main(); } From dc77d6e318b18613af13303fa963ae50987241e9 Mon Sep 17 00:00:00 2001 From: Liuyf Date: Tue, 27 May 2025 14:14:51 +0800 Subject: [PATCH 3/3] =?UTF-8?q?fix:=20=E5=8F=91=E9=80=81=E7=94=B5=E5=AD=90?= =?UTF-8?q?=E9=92=A5=E5=8C=99=E7=9B=B4=E6=8E=A5=E7=82=B9=E9=80=9A=E8=AE=AF?= =?UTF-8?q?=E5=BD=95=E8=8E=B7=E5=8F=96=E4=B8=8D=E5=88=B0=E7=94=B5=E8=AF=9D?= =?UTF-8?q?=E5=8F=B7=E7=A0=81=EF=BC=8C=E8=A6=81=E6=89=8B=E5=8A=A8=E8=BE=93?= =?UTF-8?q?=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../status/star_chart_talk_status.dart | 2 +- pubspec.lock | 80 ++----------------- pubspec.yaml | 2 +- 3 files changed, 10 insertions(+), 74 deletions(-) diff --git a/lib/talk/starChart/status/star_chart_talk_status.dart b/lib/talk/starChart/status/star_chart_talk_status.dart index 54ee1751..939c130b 100644 --- a/lib/talk/starChart/status/star_chart_talk_status.dart +++ b/lib/talk/starChart/status/star_chart_talk_status.dart @@ -4,7 +4,7 @@ import 'package:star_lock/talk/starChart/constant/talk_status.dart'; class StartChartTalkStatus { // 私有字段,用于存储当前状态 - TalkStatus _status = TalkStatus.uninitialized; + TalkStatus _status = TalkStatus.none; // 私有化默认构造函数,防止外部创建实例 StartChartTalkStatus._(); diff --git a/pubspec.lock b/pubspec.lock index b1ead27d..b099b594 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -24,30 +24,6 @@ packages: relative: true source: path version: "0.0.1" - amap_flutter_base: - dependency: transitive - description: - name: amap_flutter_base - sha256: "9ef2439b8de7100cdd1b4357701b8ca8c059c0f2d9d0257b81750bbf0c6f53bb" - url: "https://pub.dev" - source: hosted - version: "3.0.0" - amap_flutter_location: - dependency: "direct main" - description: - name: amap_flutter_location - sha256: f35ff00e196d579608e0bc28ccbc1f6f53787644702f947de941f775769cc701 - url: "https://pub.dev" - source: hosted - version: "3.0.0" - amap_flutter_map: - dependency: "direct main" - description: - name: amap_flutter_map - sha256: "9cebb0b2f5fc7d3ae0427e99c41edc883e8f5459f6a28bc850f0f9e16918cf2f" - url: "https://pub.dev" - source: hosted - version: "3.0.0" app_settings: dependency: "direct main" description: @@ -573,6 +549,14 @@ packages: description: flutter source: sdk version: "0.0.0" + flutter_app_badger: + dependency: "direct main" + description: + name: flutter_app_badger + sha256: "64d4a279bab862ed28850431b9b446b9820aaae0bf363322d51077419f930fa8" + url: "https://pub.dev" + source: hosted + version: "1.5.0" flutter_blue_plus: dependency: "direct main" description: @@ -788,30 +772,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.1" - google_maps: - dependency: transitive - description: - name: google_maps - sha256: "47eef3836b49bb030d5cb3afc60b8451408bf34cf753e571b645d6529eb4251a" - url: "https://pub.dev" - source: hosted - version: "7.1.0" - google_maps_flutter: - dependency: "direct main" - description: - name: google_maps_flutter - sha256: c1972cbad779bc5346c49045f26ae45550a0958b1cbca5b524dd3c8954995d28 - url: "https://pub.dev" - source: hosted - version: "2.6.1" - google_maps_flutter_android: - dependency: transitive - description: - name: google_maps_flutter_android - sha256: "0bcadb80eba39afda77dede89a6caafd3b68f2786b90491eceea4a01c3db181c" - url: "https://pub.dev" - source: hosted - version: "2.8.0" google_maps_flutter_ios: dependency: "direct overridden" description: @@ -828,14 +788,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.9.5" - google_maps_flutter_web: - dependency: transitive - description: - name: google_maps_flutter_web - sha256: f3155c12119d8a5c2732fdf39ceb5cc095bc662059a03b4ea23294ecebe1d199 - url: "https://pub.dev" - source: hosted - version: "0.5.8" html: dependency: transitive description: @@ -973,14 +925,6 @@ packages: url: "https://pub.dev" source: hosted version: "0.6.7" - js_wrapping: - dependency: transitive - description: - name: js_wrapping - sha256: e385980f7c76a8c1c9a560dfb623b890975841542471eade630b2871d243851c - url: "https://pub.dev" - source: hosted - version: "0.7.4" json_annotation: dependency: transitive description: @@ -1381,14 +1325,6 @@ packages: url: "https://pub.dev" source: hosted version: "0.27.7" - sanitize_html: - dependency: transitive - description: - name: sanitize_html - sha256: "12669c4a913688a26555323fb9cec373d8f9fbe091f2d01c40c723b33caa8989" - url: "https://pub.dev" - source: hosted - version: "2.1.0" scrollable_positioned_list: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 7819d6e8..0cdf858a 100755 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -155,7 +155,7 @@ dependencies: # 选择日期时间 flutter_cupertino_datetime_picker: ^3.0.0 # 选择原生通讯录 - flutter_native_contact_picker: ^0.0.4 + flutter_native_contact_picker: 0.0.7 #底部弹出选择器 flutter_picker: ^2.1.0 #生成二维码