fix: 修复蓝牙记录问题

This commit is contained in:
魏少阳 2024-10-28 11:53:57 +08:00
parent c36fb4b27e
commit 9ea328968a
2 changed files with 8 additions and 14 deletions

View File

@ -138,9 +138,8 @@ class DoorLockLogLogic extends BaseGetXController {
privateKey: getPrivateKeyList, privateKey: getPrivateKeyList,
).toString(); ).toString();
showEasyLoading(); showBlueConnetctToastTimer(isShowBlueConnetctToast:false, action: () async {
showBlueConnetctToastTimer(action: () async { cancelBlueConnetctToastTimer();
dismissEasyLoading();
final String getMobile = (await Storage.getMobile())!; final String getMobile = (await Storage.getMobile())!;
UmengCommonSdk.onEvent('check_doorLockLog', { UmengCommonSdk.onEvent('check_doorLockLog', {
@ -156,10 +155,8 @@ class DoorLockLogLogic extends BaseGetXController {
eventStr: '查询锁记录事件超时', eventStr: '查询锁记录事件超时',
upload: true upload: true
); );
}); });
BlueManage().blueSendData(BlueManage().connectDeviceName, BlueManage().blueSendData(BlueManage().connectDeviceName, (BluetoothConnectionState connectionStateState) async {
(BluetoothConnectionState connectionStateState) async {
if (connectionStateState == BluetoothConnectionState.connected) { if (connectionStateState == BluetoothConnectionState.connected) {
final List<String>? privateKey = await Storage.getStringList(saveBluePrivateKey); final List<String>? privateKey = await Storage.getStringList(saveBluePrivateKey);
final List<int> getPrivateKeyList = changeStringListToIntList(privateKey!); final List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
@ -182,9 +179,7 @@ class DoorLockLogLogic extends BaseGetXController {
publicKey: getPublicKeyList, publicKey: getPublicKeyList,
privateKey: getPrivateKeyList, privateKey: getPrivateKeyList,
); );
} else if (connectionStateState == } else if (connectionStateState == BluetoothConnectionState.disconnected) {
BluetoothConnectionState.disconnected) {
dismissEasyLoading();
cancelBlueConnetctToastTimer(); cancelBlueConnetctToastTimer();
final String getMobile = (await Storage.getMobile())!; final String getMobile = (await Storage.getMobile())!;
@ -201,9 +196,6 @@ class DoorLockLogLogic extends BaseGetXController {
eventStr: '查询锁记录事件断开连接', eventStr: '查询锁记录事件断开连接',
upload: true upload: true
); );
if (state.ifCurrentScreen.value == true) {
showBlueConnetctToast();
}
} }
}); });
} }
@ -254,6 +246,7 @@ class DoorLockLogLogic extends BaseGetXController {
.millisecondsSinceEpoch; .millisecondsSinceEpoch;
pageNo = 1; pageNo = 1;
AppLog.log('_getDoorLockLogListRefreshUIAction');
mockNetworkDataRequest(isRefresh: true); mockNetworkDataRequest(isRefresh: true);
}); });
} }
@ -336,9 +329,10 @@ class DoorLockLogLogic extends BaseGetXController {
// //
final bool? isDemoMode = await Storage.getBool(ifIsDemoModeOrNot); final bool? isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
if (isDemoMode == false) { if (isDemoMode == false) {
mockNetworkDataRequest(isRefresh: true);
getLockRecordLastUploadDataTime(); getLockRecordLastUploadDataTime();
_initReplySubscription(); _initReplySubscription();
mockNetworkDataRequest(isRefresh: true);
} }
} }

View File

@ -124,7 +124,7 @@ class _DoorLockLogPageState extends State<DoorLockLogPage> with RouteAware {
switch (value) { switch (value) {
case '读取记录': case '读取记录':
{ {
logic.mockNetworkDataRequest(isRefresh: true); logic.getLockRecordLastUploadDataTime();
} }
break; break;
case '清空记录': case '清空记录':