From 42a771db83cc0b8c27e60be61fcb25c11f886e3d Mon Sep 17 00:00:00 2001 From: lxm <1274844347@qq.com> Date: Sun, 20 Jul 2025 14:47:20 +0800 Subject: [PATCH] =?UTF-8?q?feat(explore):=20=E6=B7=BB=E5=8A=A0=E7=BF=BB?= =?UTF-8?q?=E8=AF=91=E7=BB=9F=E8=AE=A1=E9=A1=B5=E9=9D=A2=E8=B7=B3=E8=BD=AC?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在探索控制器中添加跳转到翻译统计页面的方法 - 将设置页面的翻译统计入口移动到探索页面 - 修改探索页面图标并绑定跳转事件 --- .../controllers/explore_controller.dart | 5 ++ lib/modules/explore/views/explore_view.dart | 72 ++++++++++--------- lib/modules/settings/views/settings_view.dart | 23 +----- 3 files changed, 44 insertions(+), 56 deletions(-) diff --git a/lib/modules/explore/controllers/explore_controller.dart b/lib/modules/explore/controllers/explore_controller.dart index f09d1e1bd..e03ed7d1d 100644 --- a/lib/modules/explore/controllers/explore_controller.dart +++ b/lib/modules/explore/controllers/explore_controller.dart @@ -263,6 +263,11 @@ class ExploreController extends GetxController { // 实际应用中,这里应该跳转到新功能页面 } + // 跳转到翻译统计页面 + void goToTranslationStats() { + Get.toNamed(Routes.translationStats); + } + @override void onClose() { searchController.dispose(); diff --git a/lib/modules/explore/views/explore_view.dart b/lib/modules/explore/views/explore_view.dart index 3f0fee73c..60779feed 100644 --- a/lib/modules/explore/views/explore_view.dart +++ b/lib/modules/explore/views/explore_view.dart @@ -115,12 +115,12 @@ class ExploreView extends GetView { ), child: IconButton( icon: Icon( - Icons.more_vert, + Icons.analytics_outlined, size: 16.sp, color: isDarkMode ? Colors.white : Colors.grey[700], ), padding: EdgeInsets.zero, - onPressed: () {}, + onPressed: controller.goToTranslationStats, ), ), ], @@ -419,37 +419,38 @@ class ExploreView extends GetView { //整行布局 Widget _buildAIFeaturesWideSection(bool isDarkMode) { - return Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - // Text( - // 'aiFunction'.tr, // AI功能 - // style: TextStyle( - // fontSize: 18.sp, - // fontWeight: FontWeight.w600, - // color: isDarkMode ? Colors.white : Colors.grey[800], - // ), - // ), - // SizedBox(height: 16.h), - // 直接使用 Column 包裹宽版卡片 - Column( - children: controller.aiFeaturesWide.map((feature) { - return Padding( - padding: EdgeInsets.only(bottom: 16.h), // 卡片间距 - child: _buildAIFeatureItemWide( - feature, - controller.aiFeatures.indexOf(feature), - isDarkMode, - ), - ); - }).toList(), - ), - ], - ); -} + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // Text( + // 'aiFunction'.tr, // AI功能 + // style: TextStyle( + // fontSize: 18.sp, + // fontWeight: FontWeight.w600, + // color: isDarkMode ? Colors.white : Colors.grey[800], + // ), + // ), + // SizedBox(height: 16.h), + // 直接使用 Column 包裹宽版卡片 + Column( + children: controller.aiFeaturesWide.map((feature) { + return Padding( + padding: EdgeInsets.only(bottom: 16.h), // 卡片间距 + child: _buildAIFeatureItemWide( + feature, + controller.aiFeatures.indexOf(feature), + isDarkMode, + ), + ); + }).toList(), + ), + ], + ); + } - // AI功能项(宽版本,用于横跨整行的AI全能助手) - Widget _buildAIFeatureItemWide(AIFeature feature, int index, bool isDarkMode) { + // AI功能项(宽版本,用于横跨整行的AI全能助手) + Widget _buildAIFeatureItemWide( + AIFeature feature, int index, bool isDarkMode) { return GestureDetector( onTap: () => controller.onAIFeatureTap(index), child: Container( @@ -529,7 +530,8 @@ class ExploreView extends GetView { } // AI功能项(宽版本,专门用于商务会议助手) - Widget _buildAIFeatureItemWideForMeeting(AIFeature feature, int index, bool isDarkMode) { + Widget _buildAIFeatureItemWideForMeeting( + AIFeature feature, int index, bool isDarkMode) { return GestureDetector( onTap: () => controller.onAIFeatureWideTap(index), child: Container( @@ -646,7 +648,9 @@ class ExploreView extends GetView { child: Container( padding: EdgeInsets.all(16.w), decoration: BoxDecoration( - color: isDarkMode ? Colors.white.withValues(alpha: 0.05) : Colors.grey[100], + color: isDarkMode + ? Colors.white.withValues(alpha: 0.05) + : Colors.grey[100], borderRadius: BorderRadius.circular(16.r), boxShadow: [ BoxShadow( diff --git a/lib/modules/settings/views/settings_view.dart b/lib/modules/settings/views/settings_view.dart index b6fd93d6f..a65d7e441 100644 --- a/lib/modules/settings/views/settings_view.dart +++ b/lib/modules/settings/views/settings_view.dart @@ -407,28 +407,7 @@ class SettingsView extends GetView { ? Colors.white.withOpacity(0.1) : Colors.grey[200]), - // 翻译统计 - _buildSimpleNavigationSetting( - title: '翻译统计', // translationStats - subtitle: '查看翻译使用量和成本统计', // translationStatsInfo - icon: Icons.analytics_outlined, - iconBgColor: isDarkMode - ? Colors.green[900]!.withOpacity(0.3) - : Colors.green[100]!, - iconColor: - isDarkMode ? Colors.green[300]! : Colors.green[600]!, - titleColor: isDarkMode ? Colors.white : null, - subtitleColor: isDarkMode ? Colors.white70 : null, - onTap: () { - Get.toNamed(Routes.translationStats); - }, - isDarkMode: isDarkMode, - ), - Divider( - height: 1, - color: isDarkMode - ? Colors.white.withOpacity(0.1) - : Colors.grey[200]), + // 用户反馈 _buildSimpleNavigationSetting(