diff --git a/lib/appRouters.dart b/lib/appRouters.dart index 79b55992..39a39eee 100755 --- a/lib/appRouters.dart +++ b/lib/appRouters.dart @@ -470,10 +470,10 @@ abstract class Routers { static const String addIrisTypeManagePage = '/AddIrisTypeManagePage'; // 添加虹膜 static const String addIrisPage = '/AddIrisPage'; // 添加虹膜过程 - static const String palmListPage = '/PalmListPage'; // 手掌列表 - static const String addPalmTypePage = '/AddPalmTypePage'; // 添加手掌 - static const String addPalmPage = '/AddPalmPage'; // 添加手掌过程 - static const String palmDetailPage = '/PalmDetailPage'; // 手掌详情 + static const String palmListPage = '/PalmListPage'; // 掌静脉列表 + static const String addPalmTypePage = '/AddPalmTypePage'; // 添加掌静脉 + static const String addPalmPage = '/AddPalmPage'; // 添加掌静脉过程 + static const String palmDetailPage = '/PalmDetailPage'; // 掌静脉详情 static const String passwordKeyDetailChangeDatePage = '/passwordKeyDetailChangeDatePage'; //密码更改时间 diff --git a/lib/blue/blue_manage.dart b/lib/blue/blue_manage.dart index bfb0cbd0..6943a336 100755 --- a/lib/blue/blue_manage.dart +++ b/lib/blue/blue_manage.dart @@ -285,8 +285,7 @@ class BlueManage { {bool isAddEquipment = false}) async { FlutterBluePlus.isSupported.then((bool isAvailable) async { if (isAvailable) { - AppLog.log( - '蓝牙状态 系统蓝牙状态:$_adapterState 蓝牙连接状态:$bluetoothConnectionState'); + // AppLog.log('蓝牙状态 系统蓝牙状态:$_adapterState 蓝牙连接状态:$bluetoothConnectionState'); if (_adapterState == BluetoothAdapterState.on) { // 蓝牙已开启,可以进行蓝牙操作 if (bluetoothConnectionState != BluetoothConnectionState.connected) { @@ -336,11 +335,13 @@ class BlueManage { }); } else if (isAddEquipment == false && isExistDevice == false) { //取消缓存直接使用,存在配对场景设备信息会更变 + // AppLog.log('无存在设备需要扫描 deviceName:$deviceName isAddEquipment:$isAddEquipment'); startScanSingle(deviceName, 15, (List scanDevices) { _connectDevice(scanDevices, deviceName, connectStateCallBack, isAddEquipment: isAddEquipment); }); } else { + // AppLog.log('安卓或者iOS 存在设备不需要扫描 deviceName:$deviceName isAddEquipment:$isAddEquipment'); _connectDevice(devicesList, deviceName, connectStateCallBack, isAddEquipment: isAddEquipment); } @@ -372,8 +373,8 @@ class BlueManage { : devicesList[knownDeviceIndex].device.platformName; bluetoothConnectDevice = devicesList[knownDeviceIndex].device; - // AppLog.log('bluetoothConnectDevice: $bluetoothConnectDevice'); scanResult = devicesList[knownDeviceIndex]; + // AppLog.log('bluetoothConnectDevice: $bluetoothConnectDevice scanResult:$scanResult'); _initGetMtuSubscription(); _initListenConnectionState(); @@ -381,7 +382,7 @@ class BlueManage { if (scanResult == null || connectDeviceMacAddress.isEmpty) { return; } - // AppLog.log("调用了停止扫描的方法"); + AppLog.log('调用了停止扫描的方法'); await stopScan(); if ((scanResult.advertisementData.serviceUuids[0].toString()[31] == '0') && @@ -389,6 +390,11 @@ class BlueManage { connectStateCallBack(BluetoothConnectionState.disconnected); EasyLoading.showToast('该锁已被重置'.tr, duration: 2000.milliseconds); scanDevices.clear(); + + startScanSingle(deviceName, 15, (List scanDevices) { + _connectDevice(scanDevices, deviceName, connectStateCallBack, + isAddEquipment: isAddEquipment); + }); return; } //尝试连接设备 diff --git a/lib/main/lockDetail/lockDetail/lockDetail_page.dart b/lib/main/lockDetail/lockDetail/lockDetail_page.dart index c8d98550..d3b922db 100755 --- a/lib/main/lockDetail/lockDetail/lockDetail_page.dart +++ b/lib/main/lockDetail/lockDetail/lockDetail_page.dart @@ -1125,7 +1125,7 @@ class _LockDetailPageState extends State if (state.keyInfos.value.lockFeature!.palmVein == 1) { showWidgetArr.add( bottomItem( - 'images/main/icon_palm.png', '手掌'.tr, state.bottomBtnisEable.value, + 'images/main/icon_palm.png', '掌静脉'.tr, state.bottomBtnisEable.value, () { Get.toNamed(Routers.palmListPage, arguments: { 'lockId': state.keyInfos.value.lockId, diff --git a/lib/mine/addLock/saveLock/saveLock_logic.dart b/lib/mine/addLock/saveLock/saveLock_logic.dart index 0852f91f..68232ed1 100755 --- a/lib/mine/addLock/saveLock/saveLock_logic.dart +++ b/lib/mine/addLock/saveLock/saveLock_logic.dart @@ -469,7 +469,9 @@ class SaveLockLogic extends BaseGetXController { void backAction() { eventBus.fire(RefreshLockListInfoDataEvent(clearScanDevices: true)); BlueManage().disconnect(); - Get.close(state.isFromMap == 1 ? (CommonDataManage().seletLockType == 0 ? 4 : 5) : (CommonDataManage().seletLockType == 0 ? 5 : 6)); + Future.delayed(const Duration(seconds: 1), () { + Get.close(state.isFromMap == 1 ? (CommonDataManage().seletLockType == 0 ? 4 : 5) : (CommonDataManage().seletLockType == 0 ? 5 : 6)); + }); //刚刚配对完,需要对开锁页锁死 2 秒 Future.delayed(const Duration(milliseconds: 200), () { if (Get.isRegistered()) {