Merge branch 'release' into develop_address_book

This commit is contained in:
DaisyWu 2025-05-28 11:04:10 +08:00
commit 600212aee5
5 changed files with 25 additions and 8 deletions

View File

@ -123,14 +123,18 @@ class BlueManage {
.eventBus! .eventBus!
.on<EventSendModel>() .on<EventSendModel>()
.listen((EventSendModel model) { .listen((EventSendModel model) {
AppLog.log('eventBus接收发送数据:${model}');
if (model.sendChannel == DataChannel.ble) { if (model.sendChannel == DataChannel.ble) {
FlutterBluePlus.isSupported.then((bool isAvailable) async { FlutterBluePlus.isSupported.then((bool isAvailable) async {
if (isAvailable) { if (isAvailable) {
if (_adapterState == BluetoothAdapterState.on) { if (_adapterState == BluetoothAdapterState.on) {
// //
AppLog.log('蓝牙已开启,开始收发送数据:${model.data}');
writeCharacteristicWithResponse(model.data); writeCharacteristicWithResponse(model.data);
} else { } else {
try {} catch (e) { try {
AppLog.log('蓝牙已关闭,停止发送数据:${model.data}');
} catch (e) {
AppLog.log('蓝牙打开失败'); AppLog.log('蓝牙打开失败');
} }
} }
@ -315,8 +319,10 @@ class BlueManage {
} }
/// uuid /// uuid
bool _isMatch(List<String> serviceUuids, {DeviceType deviceType = DeviceType.blue}) { bool _isMatch(List<String> serviceUuids,
final List<String> prefixes = getDeviceType(deviceType).map((e) => e.toLowerCase()).toList(); {DeviceType deviceType = DeviceType.blue}) {
final List<String> prefixes =
getDeviceType(deviceType).map((e) => e.toLowerCase()).toList();
for (String uuid in serviceUuids) { for (String uuid in serviceUuids) {
final String cleanUuid = uuid.replaceAll('-', '').toLowerCase(); final String cleanUuid = uuid.replaceAll('-', '').toLowerCase();
if (cleanUuid.length == 8) { if (cleanUuid.length == 8) {

View File

@ -59,7 +59,7 @@ class LockDetailLogic extends BaseGetXController {
// //
if (reply is SenderReferEventRecordTimeReply && if (reply is SenderReferEventRecordTimeReply &&
state.ifCurrentScreen.value == true) { state.ifCurrentScreen.value == true) {
_replyReferEventRecordTime(reply); await _replyReferEventRecordTime(reply);
} }
}); });
} }
@ -116,7 +116,9 @@ class LockDetailLogic extends BaseGetXController {
state.animationController!.stop(); state.animationController!.stop();
// //
AppLog.log('开锁成功,开始同步所记录:getLockRecordLastUploadDataTime');
getLockRecordLastUploadDataTime(); getLockRecordLastUploadDataTime();
AppLog.log('开锁成功,结束同步所记录:getLockRecordLastUploadDataTime');
// //
if (StartChartManage().talkStatus.status == if (StartChartManage().talkStatus.status ==
TalkStatus.answeredSuccessfully) { TalkStatus.answeredSuccessfully) {
@ -338,6 +340,7 @@ class LockDetailLogic extends BaseGetXController {
reply.data.removeRange(0, 7); reply.data.removeRange(0, 7);
// 17 // 17
if (reply.data.length < 17) { if (reply.data.length < 17) {
AppLog.log('数据长度不够17:${reply.data}');
return; return;
} }
final List<List<int>> getList = splitList(reply.data, 17); final List<List<int>> getList = splitList(reply.data, 17);
@ -378,12 +381,13 @@ class LockDetailLogic extends BaseGetXController {
if (i == getList.length - 1) { if (i == getList.length - 1) {
// //
state.operateDate = operateDate; state.operateDate = time;
} }
} catch (e) { } catch (e) {
AppLog.log('操作记录:$indexList,解析失败,跳过该跳记录,进行下一条记录解析。'); AppLog.log('操作记录:$indexList,解析失败,跳过该跳记录,进行下一条记录解析。');
} }
} }
AppLog.log('上传数据长度:${uploadList.length}');
lockRecordUploadData(uploadList); lockRecordUploadData(uploadList);
if (dataLength == state.logCountPage) { if (dataLength == state.logCountPage) {
@ -510,6 +514,8 @@ class LockDetailLogic extends BaseGetXController {
}); });
BlueManage().blueSendData(BlueManage().connectDeviceName, BlueManage().blueSendData(BlueManage().connectDeviceName,
(BluetoothConnectionState connectionState) async { (BluetoothConnectionState connectionState) async {
AppLog.log(
'开始发送同步锁记录命令,蓝牙状态是否链接:${connectionState == BluetoothConnectionState.connected}');
if (connectionState == BluetoothConnectionState.connected) { if (connectionState == BluetoothConnectionState.connected) {
final List<String>? privateKey = final List<String>? privateKey =
await Storage.getStringList(saveBluePrivateKey); await Storage.getStringList(saveBluePrivateKey);
@ -524,6 +530,8 @@ class LockDetailLogic extends BaseGetXController {
final List<int> getPublicKeyList = final List<int> getPublicKeyList =
changeStringListToIntList(publicKey!); changeStringListToIntList(publicKey!);
AppLog.log(
'发送同步锁记录命令:${BlueManage().connectDeviceName}');
IoSenderManage.senderReferEventRecordTimeCommand( IoSenderManage.senderReferEventRecordTimeCommand(
keyID: BlueManage().connectDeviceName, keyID: BlueManage().connectDeviceName,
userID: await Storage.getUid(), userID: await Storage.getUid(),
@ -602,11 +610,14 @@ class LockDetailLogic extends BaseGetXController {
final LockOperatingRecordGetLastRecordTimeEntity entity = final LockOperatingRecordGetLastRecordTimeEntity entity =
await ApiRepository.to.getLockRecordLastUploadDataTime( await ApiRepository.to.getLockRecordLastUploadDataTime(
lockId: state.keyInfos.value.lockId.toString()); lockId: state.keyInfos.value.lockId.toString());
AppLog.log('开始获取服务端所记录更新时间:${entity}');
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
state.operateDate = entity.data!.operateDate! ~/ 1000; state.operateDate = entity.data!.operateDate! ~/ 1000;
state.currentDate = entity.data!.currentDate! ~/ 1000; state.currentDate = entity.data!.currentDate! ~/ 1000;
AppLog.log('发送同步所记录命令:---');
senderReferEventRecordTime(); senderReferEventRecordTime();
} }
AppLog.log('结束获取服务端所记录更新时间:${entity}');
} }
// //

View File

@ -4,7 +4,7 @@ import 'flavors.dart';
import 'main.dart' as runner; import 'main.dart' as runner;
Future<void> main() async { Future<void> main() async {
F.appFlavor = Flavor.xhj; F.appFlavor = Flavor.xhj_pre;
// AppLog.log('local调用了main函数'); // AppLog.log('local调用了main函数');
await runner.main(); await runner.main();
} }

View File

@ -4,7 +4,7 @@ import 'package:star_lock/talk/starChart/constant/talk_status.dart';
class StartChartTalkStatus { class StartChartTalkStatus {
// //
TalkStatus _status = TalkStatus.uninitialized; TalkStatus _status = TalkStatus.none;
// //
StartChartTalkStatus._(); StartChartTalkStatus._();

View File

@ -155,7 +155,7 @@ dependencies:
# 选择日期时间 # 选择日期时间
flutter_cupertino_datetime_picker: ^3.0.0 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 flutter_picker: ^2.1.0
#生成二维码 #生成二维码