diff --git a/assets/images/explore1.png b/assets/images/explore1.png new file mode 100644 index 000000000..9a81a96ca Binary files /dev/null and b/assets/images/explore1.png differ diff --git a/assets/images/explore2.jpg b/assets/images/explore2.jpg new file mode 100644 index 000000000..8b23189b7 Binary files /dev/null and b/assets/images/explore2.jpg differ diff --git a/assets/images/glasses_light.jpg b/assets/images/glasses_light.jpg new file mode 100644 index 000000000..3d1189d21 Binary files /dev/null and b/assets/images/glasses_light.jpg differ diff --git a/assets/images/robot_dark.png b/assets/images/robot_dark.png new file mode 100644 index 000000000..527741d19 Binary files /dev/null and b/assets/images/robot_dark.png differ diff --git a/assets/images/robot_light.png b/assets/images/robot_light.png new file mode 100644 index 000000000..762d0eee0 Binary files /dev/null and b/assets/images/robot_light.png differ diff --git a/lib/core/translations/language/en_us.dart b/lib/core/translations/language/en_us.dart index 848034b24..05c972cb8 100644 --- a/lib/core/translations/language/en_us.dart +++ b/lib/core/translations/language/en_us.dart @@ -84,6 +84,8 @@ const Map enUS = { // 发现页 "searchAi": "Search AI features...", "exploreSlogan": "Smart Earbuds, Infinite Possibilities", + "exploreSlogan1": "Intelligent companion, Infinite Possibilities", + "exploreSlogan2": "Smart glasses, Infinite Possibilities", "exploreAi": "Explore AI features provided by DeepSound", "aiFunction": "AI Features", "allRoundAssistant": "All-round Assistant", diff --git a/lib/core/translations/language/zh_cn.dart b/lib/core/translations/language/zh_cn.dart index 6f46f6276..4fe55b616 100644 --- a/lib/core/translations/language/zh_cn.dart +++ b/lib/core/translations/language/zh_cn.dart @@ -83,6 +83,8 @@ const Map zhCN = { // 发现页 "searchAi": "搜索AI功能...", "exploreSlogan": "智能耳机,无限可能", + "exploreSlogan1": "智能陪伴,无限可能", + "exploreSlogan2": "智能眼镜,无限可能", "exploreAi": "探索DeepSound提供的AI功能", "aiFunction": "AI功能", "allRoundAssistant": "全能助理", diff --git a/lib/data/services/speech_impl/voice_clone_tts_service.dart b/lib/data/services/speech_impl/voice_clone_tts_service.dart index 483102adf..2f57939a9 100644 --- a/lib/data/services/speech_impl/voice_clone_tts_service.dart +++ b/lib/data/services/speech_impl/voice_clone_tts_service.dart @@ -360,7 +360,7 @@ class VoiceCloneTtsService extends GetxService implements TtsService { Future stop() async { try { _textQueue.clear(); - _player.stop(); + await _player.stop(); _playlist.clear(); _audioBytes = BytesBuilder(); if (_isSpeaking.value) { @@ -382,10 +382,10 @@ class VoiceCloneTtsService extends GetxService implements TtsService { if (!_isInitialized) return; try { await stop(); + _player.dispose(); // 关闭事件流控制器 await _eventController.close(); _isInitialized = false; - _player.dispose(); } catch (e) { Logger.error('释放资源失败: $e'); } diff --git a/lib/modules/explore/views/explore_view.dart b/lib/modules/explore/views/explore_view.dart index 25101b6d3..ca4ae2ac7 100644 --- a/lib/modules/explore/views/explore_view.dart +++ b/lib/modules/explore/views/explore_view.dart @@ -30,7 +30,38 @@ class ExploreView extends GetView { crossAxisAlignment: CrossAxisAlignment.start, children: [ // 特色功能 - _buildFeaturedCard(), + Container( + height: 180.h, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(24.r), + boxShadow: [ + BoxShadow( + color: Colors.black.withOpacity(0.2), + blurRadius: 10, + offset: const Offset(0, 4), + ), + ], + ), + child: PageView( + children: [ + _buildFeaturedCard( + 'assets/images/explore.png', + 'exploreSlogan'.tr, // 智能耳机,无限可能 + 'exploreAi'.tr, // 探索DeepSound提供的AI功能 + ), + _buildFeaturedCard( + 'assets/images/explore1.png', + 'exploreSlogan1'.tr, // 智能陪伴,无限可能 + 'exploreAi'.tr, // 探索DeepSound提供的AI功能 + ), + _buildFeaturedCard( + 'assets/images/explore2.jpg', + 'exploreSlogan2'.tr, // 智能眼镜,无限可能 + 'exploreAi'.tr, // 探索DeepSound提供的AI功能 + ), + ], + ), + ), // AI功能列表 SizedBox(height: 24.h), @@ -132,90 +163,77 @@ class ExploreView extends GetView { } // 特色功能卡片 - Widget _buildFeaturedCard() { - return Container( - height: 180.h, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(24.r), - boxShadow: [ - BoxShadow( - color: Colors.black.withOpacity(0.2), - blurRadius: 10, - offset: const Offset(0, 4), - ), - ], - ), - child: Stack( - children: [ - // 背景图片 - ClipRRect( - borderRadius: BorderRadius.circular(24.r), - child: Container( - color: Colors.blue.shade900, // 预设颜色,图片加载失败时显示 - child: Image.asset( - 'assets/images/explore.png', - width: double.infinity, - height: 180.h, - fit: BoxFit.cover, - errorBuilder: (context, error, stackTrace) { - return Container( - color: Colors.blue.shade900, - width: double.infinity, - height: 180.h, - child: Icon( - Icons.image_not_supported, - color: Colors.white, - size: 40.sp, - ), - ); - }, - ), + Widget _buildFeaturedCard(String image, String title, String description) { + return Stack( + children: [ + // 背景图片 + ClipRRect( + borderRadius: BorderRadius.circular(24.r), + child: Container( + color: Colors.blue.shade900, // 预设颜色,图片加载失败时显示 + child: Image.asset( + image, + width: double.infinity, + height: 180.h, + fit: BoxFit.cover, + errorBuilder: (context, error, stackTrace) { + return Container( + color: Colors.blue.shade900, + width: double.infinity, + height: 180.h, + child: Icon( + Icons.image_not_supported, + color: Colors.white, + size: 40.sp, + ), + ); + }, ), ), + ), - // 渐变遮罩 - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(24.r), - gradient: LinearGradient( - begin: Alignment.topCenter, - end: Alignment.bottomCenter, - colors: [ - Colors.black.withOpacity(0.1), - Colors.black.withOpacity(0.6), - ], - ), + // 渐变遮罩 + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(24.r), + gradient: LinearGradient( + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + colors: [ + Colors.black.withOpacity(0.1), + Colors.black.withOpacity(0.6), + ], ), ), + ), - // 文本内容 - Padding( - padding: EdgeInsets.all(24.w), - child: Column( - mainAxisAlignment: MainAxisAlignment.end, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - 'exploreSlogan'.tr, // 智能耳机,无限可能 - style: TextStyle( - fontSize: 22.sp, - fontWeight: FontWeight.bold, - color: Colors.white, - ), + // 文本内容 + Padding( + padding: EdgeInsets.all(24.w), + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + title, + style: TextStyle( + fontSize: 22.sp, + fontWeight: FontWeight.bold, + color: Colors.white, ), - SizedBox(height: 4.h), - Text( - 'exploreAi'.tr, // 探索DeepSound提供的AI功能 - style: TextStyle( - fontSize: 14.sp, - color: Colors.white.withOpacity(0.8), - ), + ), + SizedBox(height: 4.h), + Text( + description, + style: TextStyle( + fontSize: 14.sp, + color: Colors.white.withOpacity(0.8), ), - ], - ), + ), + ], ), - ], - ), + ), + ], ); } diff --git a/lib/modules/home/views/home_view.dart b/lib/modules/home/views/home_view.dart index 12f90875b..a5fceef6f 100644 --- a/lib/modules/home/views/home_view.dart +++ b/lib/modules/home/views/home_view.dart @@ -89,9 +89,7 @@ class HomeView extends GetView { _buildAppBar(isDarkMode), // 顶部图片 - Center( - child: _buildEarbudsImage(), - ), + _buildEarbudsImage(), SizedBox(height: 20.h), // 设备状态卡片 @@ -102,8 +100,6 @@ class HomeView extends GetView { _buildSectionTitle(isDarkMode), SizedBox(height: 16.h), _buildPremiumAILayout(), - - ], ), ), @@ -156,15 +152,38 @@ class HomeView extends GetView { // 耳机图片 Widget _buildEarbudsImage() { final bool isDarkMode = Get.isDarkMode; - return Container( + return SizedBox( height: 220.h, - alignment: Alignment.center, - child: Image.asset( - isDarkMode - ? 'assets/images/headphone_dark.png' - : 'assets/images/headphone_light.png', - height: 180.h, - fit: BoxFit.contain, + child: PageView( + children: [ + Center( + child: Image.asset( + isDarkMode + ? 'assets/images/headphone_dark.png' + : 'assets/images/headphone_light.png', + height: 180.h, + fit: BoxFit.contain, + ), + ), + Center( + child: Image.asset( + isDarkMode + ? 'assets/images/robot_dark.png' + : 'assets/images/robot_light.png', + height: 180.h, + fit: BoxFit.contain, + ), + ), + Center( + child: Image.asset( + isDarkMode + ? 'assets/images/glasses_light.jpg' + : 'assets/images/glasses_light.jpg', + height: 180.h, + fit: BoxFit.contain, + ), + ), + ], ), ); } @@ -673,7 +692,8 @@ class HomeView extends GetView { child: Text( description, style: TextStyle( - color: isDarkMode ? Colors.grey[400] : Colors.grey[600], + color: + isDarkMode ? Colors.grey[400] : Colors.grey[600], fontSize: 12.sp, ), maxLines: 2, @@ -706,7 +726,8 @@ class HomeView extends GetView { child: Text( description, style: TextStyle( - color: isDarkMode ? Colors.grey[400] : Colors.grey[600], + color: + isDarkMode ? Colors.grey[400] : Colors.grey[600], fontSize: 10.sp, ), maxLines: 2, diff --git a/pubspec.yaml b/pubspec.yaml index 3b17bb70d..2daf529c7 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -72,7 +72,12 @@ flutter: assets: - assets/images/headphone_light.png - assets/images/headphone_dark.png + - assets/images/robot_light.png + - assets/images/robot_dark.png + - assets/images/glasses_light.jpg - assets/images/agents/ - assets/images/explore.png + - assets/images/explore1.png + - assets/images/explore2.jpg - assets/lottie/ - .env