This commit is contained in:
wyf
2025-05-15 13:57:42 +08:00
parent fb5c3864a3
commit 75ddfca402
51 changed files with 2451 additions and 1233 deletions

View File

@@ -7,7 +7,9 @@ import 'package:vbvs_app/common/util/FitTool.dart';
import 'package:vbvs_app/common/util/MyUtils.dart';
import 'package:vbvs_app/component/tool/CustomCard.dart';
import 'package:vbvs_app/controller/device/blueteeth_bind_controller.dart';
import 'package:vbvs_app/controller/device/body_device_controller.dart';
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';
@@ -176,9 +178,34 @@ class _EPageState extends State<BindDeviceSuccess> {
child: CustomCard(
borderRadius:
AppConstants().button_container_radius, // 圆角半径
onTap: () {
print('Button pressed ...');
Get.toNamed("/deviceType");
onTap: () async {
PersonController personController = Get.find();
String deviceID =
personController.currentPersonId.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 (matchedDevice != null) {
// 跳转并传入设备
Get.toNamed("/deviceSharePage",
arguments: matchedDevice);
} else {
print("未找到匹配的设备");
}
} else {
print("设备列表为空");
}
},
colors: [
// 渐变色