From 707ad9dd9c644a29f07805107c53b1efe9298be2 Mon Sep 17 00:00:00 2001 From: czz <862977248@qq.com> Date: Thu, 10 Jul 2025 17:33:50 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E7=BB=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/pages/mh_page/bluetooth.dart | 55 +++++++++++++++++++++++++++++++- pubspec.yaml | 3 +- 2 files changed, 56 insertions(+), 2 deletions(-) diff --git a/lib/pages/mh_page/bluetooth.dart b/lib/pages/mh_page/bluetooth.dart index c754326..1f89e7c 100644 --- a/lib/pages/mh_page/bluetooth.dart +++ b/lib/pages/mh_page/bluetooth.dart @@ -247,7 +247,60 @@ class _BluetoothPageState extends State { context, obsData['bind_type'] == 1 ? '解绑' : '删除', "", - onTap: () {/*...*/}, + onTap: () { + 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: () { + // 点击取消后的逻辑 + }, + ); + } + }, ), ], ], diff --git a/pubspec.yaml b/pubspec.yaml index c262154..2704ba8 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -61,6 +61,8 @@ dependencies: video_player: ^2.9.5 chewie: ^1.10.0 map_launcher: ^3.5.0 + flutter_bmflocation: ^3.8.0 + gif: ^2.3.0 easyweb: git: @@ -68,7 +70,6 @@ dependencies: ref: main archive: ^4.0.0 - dev_dependencies: flutter_test: sdk: flutter