From ed0975440621ad27a303d04b07afc5eaab51aa94 Mon Sep 17 00:00:00 2001 From: "sky.min" Date: Thu, 25 Dec 2025 11:21:41 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BC=98=E5=8C=96=E7=BD=91=E7=BB=9C=E8=AE=BF?= =?UTF-8?q?=E9=97=AE=E5=A4=B1=E8=B4=A5=E7=9A=84=E6=97=B6=E9=97=B4=E4=B8=BA?= =?UTF-8?q?6s=202.=E7=BD=91=E5=85=B3=E9=94=81=E5=92=8Cwifi=E9=94=81?= =?UTF-8?q?=E5=88=A4=E6=96=AD=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lockDetail/lockDetail_logic.dart | 50 +++++++++---------- lib/network/api_provider_base.dart | 2 +- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/lib/main/lockDetail/lockDetail/lockDetail_logic.dart b/lib/main/lockDetail/lockDetail/lockDetail_logic.dart index 6a0cde09..291d88cd 100755 --- a/lib/main/lockDetail/lockDetail/lockDetail_logic.dart +++ b/lib/main/lockDetail/lockDetail/lockDetail_logic.dart @@ -707,34 +707,34 @@ class LockDetailLogic extends BaseGetXController { if (entity.errorCode!.codeIsSuccessful) { showToast('已开锁'.tr); } - } + } else { + // WiFi锁 + final LockListInfoItemEntity currentKeyInfo = CommonDataManage().currentKeyInfo; + final network = currentKeyInfo.network; + if (network != null && (network.peerId != null && network.peerId != '' && network.peerId!.isNotEmpty)){ + final network = currentKeyInfo.network; + var lockPeerId = ''; + if (network != null && network.peerId != null && network.peerId!.isNotEmpty) { + lockPeerId = network.peerId!; + StartChartManage().lockPeerId = lockPeerId; + } - // WiFi锁 - final LockListInfoItemEntity currentKeyInfo = CommonDataManage().currentKeyInfo; - final network = currentKeyInfo.network; - if (network != null && (network.peerId != null && network.peerId!.isNotEmpty)){ - final network = currentKeyInfo.network; - var lockPeerId = ''; - if (network != null && network.peerId != null && network.peerId!.isNotEmpty) { - lockPeerId = network.peerId!; - StartChartManage().lockPeerId = lockPeerId; - } + if (lockPeerId.isEmpty) { + AppLog.log('远程服务未连接,无法进行远程开锁'); + return; + } - if (lockPeerId.isEmpty) { - AppLog.log('远程服务未连接,无法进行远程开锁'); - return; + final response = await StartChartApi.to.analyzeInformationOtherEnd(peerId: lockPeerId); + if (response.statusCode == 200) { + AppLog.log('成功分析对端信息'); + } else { + AppLog.log('分析对端信息失败,状态码: ${response.statusCode}'); + return; + } + // 发送蓝牙透传开锁指令 + await _sendUnlockViaBluetooth(); + } } - - final response = await StartChartApi.to.analyzeInformationOtherEnd(peerId: lockPeerId); - if (response.statusCode == 200) { - AppLog.log('成功分析对端信息'); - } else { - AppLog.log('分析对端信息失败,状态码: ${response.statusCode}'); - return; - } - // 发送蓝牙透传开锁指令 - await _sendUnlockViaBluetooth(); - } } // 通过蓝牙透传发送开锁命令 diff --git a/lib/network/api_provider_base.dart b/lib/network/api_provider_base.dart index 951905d4..be8d0fdf 100755 --- a/lib/network/api_provider_base.dart +++ b/lib/network/api_provider_base.dart @@ -61,7 +61,7 @@ class BaseProvider extends GetConnect with Api { if (res.body == null) { // EasyLoading.showToast("Network Error!", duration: 2000.milliseconds); if (res.statusCode == null && isShowErrMsg!) { - EasyLoading.showToast('网络访问失败,请检查网络是否正常'.tr, duration: 2000.milliseconds); + EasyLoading.showToast('网络访问失败,请检查网络是否正常'.tr, duration: 6000.milliseconds); // EasyLoading.showToast("Network Error!", duration: 2000.milliseconds); } var rs = {'errorMsg': 'Network Error!', 'errorCode': -1, 'data': null, 'description': '表示成功或是。'};