立即分享

This commit is contained in:
czz
2025-07-15 15:46:29 +08:00
parent 8fae793f61
commit f10963a172
2 changed files with 84 additions and 61 deletions

View File

@@ -16,6 +16,7 @@ import 'package:vbvs_app/controller/main_bottom/global_controller.dart';
import 'package:vbvs_app/controller/person/person_controller.dart';
import 'package:vbvs_app/controller/theme_controller/ThemeController.dart';
import 'package:vbvs_app/controller/user_info_controller.dart';
import 'package:vbvs_app/pages/mh_page/device/model/BlueToothDataModel.dart';
import 'package:vbvs_app/pages/mh_page/homepage/controller/mht_home_controller.dart';
class MHTBindDeviceSuccess extends StatefulWidget {
@@ -241,39 +242,43 @@ class _MHTBindDeviceSuccessState extends State<MHTBindDeviceSuccess> {
borderRadius:
AppConstants().normal_container_radius, // 圆角半径
onTap: () async {
var data = blueteethBindController.shareDevice;
// TopSlideNotification.show(
// context,
// text: "功能开发中...",
// );
// return;
PersonController personController = Get.find();
String deviceID =
personController.currentPersonId.value;
Map editeData;
BlueToothDataModel data =
blueteethBindController.shareDevice;
editeData = {"mac": data.mac};
Get.toNamed("/deviceSharePage", arguments: editeData);
// // TopSlideNotification.show(
// // context,
// // text: "功能开发中...",
// // );
// // return;
// PersonController personController = Get.find();
// String deviceID =
// personController.currentPersonId.value;
BodyDeviceController bodyDeviceController =
Get.find();
await bodyDeviceController.getDeviceList();
List deviceList =
bodyDeviceController.deviceList.value;
// BodyDeviceController bodyDeviceController =
// Get.find();
// await bodyDeviceController.getDeviceList();
// List deviceList =
// bodyDeviceController.deviceList.value;
if (deviceList != null && deviceList.isNotEmpty) {
// 查找第一个 _id 匹配的设备
final matchedDevice = deviceList.firstWhere(
(element) => element['_id'] == deviceID,
orElse: () => null,
);
// if (deviceList != null && deviceList.isNotEmpty) {
// // 查找第一个 _id 匹配的设备
// final matchedDevice = deviceList.firstWhere(
// (element) => element['_id'] == deviceID,
// orElse: () => null,
// );
if (matchedDevice != null) {
// 跳转并传入设备
Get.toNamed("/deviceSharePage",
arguments: matchedDevice);
} else {
print("未找到匹配的设备");
}
} else {
print("设备列表为空");
}
// if (matchedDevice != null) {
// // 跳转并传入设备
// Get.toNamed("/deviceSharePage",
// arguments: matchedDevice);
// } else {
// print("未找到匹配的设备");
// }
// } else {
// print("设备列表为空");
// }
},
colors: AppConstants().mhtButtongradientColors,
gradientDirection: GradientDirection.vertical,