From 4adac4a6bf2edd22aa0dad19aef018badfa70626 Mon Sep 17 00:00:00 2001 From: czz <862977248@qq.com> Date: Thu, 24 Jul 2025 17:56:24 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E7=BB=91=E5=88=A0=E9=99=A4=E5=BC=B9?= =?UTF-8?q?=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/pages/mh_page/bluetooth.dart | 83 ++++++++++++++++++++++++++------ 1 file changed, 68 insertions(+), 15 deletions(-) diff --git a/lib/pages/mh_page/bluetooth.dart b/lib/pages/mh_page/bluetooth.dart index 7572f62..9cdaf40 100644 --- a/lib/pages/mh_page/bluetooth.dart +++ b/lib/pages/mh_page/bluetooth.dart @@ -234,23 +234,76 @@ class _BluetoothPageState extends State { obsData['bind_type'] == 1 ? '解绑' : '删除', "", onTap: () async { - await deviceListController - .unbindDevice(obsData); - await deviceListController - .getDeviceList(); + // await deviceListController + // .unbindDevice(obsData); + // await deviceListController + // .getDeviceList(); - MHTHomeController homeController = - Get.find(); - homeController.selectDevcie.value = ""; - try { - WebviewTestController - webviewTestController = Get.find(); - webviewTestController.web.jsbridge?.dart - .unBindDevice(); - } catch (e) { - ef.log("[h5]通知列表更新报错:$e"); + // MHTHomeController homeController = + // Get.find(); + // homeController.selectDevcie.value = ""; + // try { + // WebviewTestController + // webviewTestController = Get.find(); + // webviewTestController.web.jsbridge?.dart + // .unBindDevice(); + // } catch (e) { + // ef.log("[h5]通知列表更新报错:$e"); + // } + // Get.toNamed("/mianPageBottomChange"); + if (obsData['bind_type'] == 1) { + // 解绑弹窗 + showUnbindConfirmDialog( + context: context, + title: "是否进行解绑?", + onConfirm: () async { + await deviceListController + .unbindDevice(obsData); + await deviceListController + .getDeviceList(); + + MHTHomeController homeController = + Get.find(); + homeController.selectDevcie.value = + ""; + try { + WebviewTestController + webviewTestController = + Get.find(); + webviewTestController + .web.jsbridge?.dart + .unBindDevice(); + } catch (e) { + ef.log("[h5]通知列表更新报错:$e"); + } + Get.toNamed( + "/mianPageBottomChange"); + // 执行解绑逻辑 + }, + onCancel: () { + // 点击取消后的逻辑 + }, + ); + } else if (obsData['bind_type'] == 2) { + // 删除弹窗 + showDeleteDeviceConfirmDialog( + context: context, + title: "是否进行删除?", + onConfirm: () async { + await deviceListController + .unbindDevice( + obsData, + ); + await deviceListController + .getDeviceList(); + Get.toNamed( + "/mianPageBottomChange"); + }, + onCancel: () { + // 点击取消后的逻辑 + }, + ); } - Get.toNamed("/mianPageBottomChange"); }, ), _buildMenuButton(