From 8f88a634b38908906aba49e39ed115c92e6143b3 Mon Sep 17 00:00:00 2001 From: lxm <1274844347@qq.com> Date: Thu, 20 Mar 2025 20:40:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dhome=E9=A1=B5AI=E5=A5=B3?= =?UTF-8?q?=E5=8F=8B=E8=B7=B3=E8=BD=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/modules/home/bindings/home_binding.dart | 2 ++ lib/modules/home/controllers/home_controller.dart | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/modules/home/bindings/home_binding.dart b/lib/modules/home/bindings/home_binding.dart index d503413c7..9a67dfcc4 100644 --- a/lib/modules/home/bindings/home_binding.dart +++ b/lib/modules/home/bindings/home_binding.dart @@ -1,3 +1,4 @@ +import 'package:deep_voice/modules/explore/controllers/explore_controller.dart'; import 'package:get/get.dart'; import '../controllers/home_controller.dart'; @@ -5,5 +6,6 @@ class HomeBinding extends Bindings { @override void dependencies() { Get.lazyPut(() => HomeController()); + Get.lazyPut(()=>ExploreController());// 注册ExploreController } } \ No newline at end of file diff --git a/lib/modules/home/controllers/home_controller.dart b/lib/modules/home/controllers/home_controller.dart index 4cd0fdfa8..5e5ea4223 100644 --- a/lib/modules/home/controllers/home_controller.dart +++ b/lib/modules/home/controllers/home_controller.dart @@ -6,6 +6,7 @@ import 'package:flutter_blue_plus/flutter_blue_plus.dart' hide BluetoothDevice; import 'package:flutter/material.dart'; import '../../../data/services/voice_interaction_service.dart'; import 'package:permission_handler/permission_handler.dart'; +import '../../explore/controllers/explore_controller.dart'; // 连接状态枚举 enum ConnectionStatus { @@ -17,6 +18,7 @@ enum ConnectionStatus { class HomeController extends GetxController { static HomeController get to => Get.find(); + final ExploreController exploreController = Get.find(); // 经典蓝牙服务 late classic.ClassicBluetoothService _bluetoothService; @@ -186,13 +188,13 @@ class HomeController extends GetxController { // 打开AI伴侣功能 void openAIGirlfriend() { - Get.toNamed(Routes.chat); + exploreController.onAIFeatureTap(2);//进入AI女友页面 } // 展示AI功能 void exploreAIFeatures() { // 简单实现,直接跳转到AI聊天页面 - openAIGirlfriend(); + Get.toNamed(Routes.chat); } // 获取连接状态对应的颜色