From 5fff07ebff1ea0371a862498d6c0f13d57bb4cd1 Mon Sep 17 00:00:00 2001 From: lxm <1274844347@qq.com> Date: Tue, 28 Apr 2026 20:27:40 +0800 Subject: [PATCH] =?UTF-8?q?feat(explore):=20=E6=96=B0=E5=A2=9E=E7=B2=BE?= =?UTF-8?q?=E7=AE=80=E5=B8=83=E5=B1=80=EF=BC=8C=E9=9A=90=E8=97=8F=20AI=20?= =?UTF-8?q?=E5=85=A8=E8=83=BD=E5=8A=A9=E6=89=8B=E6=97=B6=E4=BD=BF=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 按 AppConfig.hideAiAssistant 分发:true 时显示翻译/会议助手上下堆叠 banner 卡, 图标右上角、标题/描述左下角,复用 controller.aiFeatures[1] 与 [2] 数据。 --- lib/modules/explore/views/explore_view.dart | 113 +++++++++++++++++++- 1 file changed, 112 insertions(+), 1 deletion(-) diff --git a/lib/modules/explore/views/explore_view.dart b/lib/modules/explore/views/explore_view.dart index 45e6c9cde..464aa67e8 100644 --- a/lib/modules/explore/views/explore_view.dart +++ b/lib/modules/explore/views/explore_view.dart @@ -4,6 +4,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; //import 'dart:ui'; import '../controllers/explore_controller.dart'; import '../../../core/widgets/common_bottom_nav.dart'; +import '../../../data/models/appconfig.dart'; class ExploreView extends GetView { const ExploreView({Key? key}) : super(key: key); @@ -65,7 +66,9 @@ class ExploreView extends GetView { // AI功能列表 SizedBox(height: 24.h), - _buildCustomAILayout(isDarkMode), + AppConfig.hideAiAssistant + ? _buildSimplifiedAILayout(isDarkMode) + : _buildCustomAILayout(isDarkMode), ], ), ), @@ -439,4 +442,112 @@ class ExploreView extends GetView { ), ); } + + // 精简布局:隐藏"AI全能助手",仅保留翻译 + 会议助手,上下堆叠 banner 卡 + // 复用 controller.aiFeatures 中索引 1(翻译)和 2(会议助手)的数据 + Widget _buildSimplifiedAILayout(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), + // 翻译(banner 卡) + _buildSimplifiedBannerCard(controller.aiFeatures[1], 1, isDarkMode), + SizedBox(height: 12.h), + // 会议助手(banner 卡) + _buildSimplifiedBannerCard(controller.aiFeatures[2], 2, isDarkMode), + ], + ); + } + + // 精简布局下的 banner 卡(图标右上角,标题/描述左下角) + Widget _buildSimplifiedBannerCard( + AIFeature feature, int index, bool isDarkMode) { + return GestureDetector( + onTap: () => controller.onAIFeatureTap(index), + child: Container( + height: 130.h, + padding: EdgeInsets.all(16.w), + decoration: BoxDecoration( + gradient: LinearGradient( + begin: Alignment.topLeft, + end: Alignment.bottomRight, + colors: [ + feature.startColor.withOpacity(0.3), + feature.endColor.withOpacity(0.3), + ], + ), + borderRadius: BorderRadius.circular(20.r), + boxShadow: [ + BoxShadow( + color: isDarkMode + ? Colors.black.withOpacity(0.2) + : Colors.grey.withOpacity(0.1), + blurRadius: 8, + offset: const Offset(0, 4), + ), + ], + ), + child: Stack( + children: [ + // 图标右上角 + Positioned( + top: 0, + right: 0, + child: Container( + width: 44.w, + height: 44.w, + decoration: BoxDecoration( + color: feature.iconColor.withOpacity(0.2), + shape: BoxShape.circle, + ), + child: Icon( + feature.icon, + size: 22.sp, + color: feature.iconColor, + ), + ), + ), + // 标题 + 描述左下角 + Align( + alignment: Alignment.bottomLeft, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + Text( + feature.title, + style: TextStyle( + fontSize: 16.sp, + fontWeight: FontWeight.w600, + color: isDarkMode ? Colors.white : Colors.grey[800], + ), + maxLines: 1, + overflow: TextOverflow.ellipsis, + ), + SizedBox(height: 4.h), + Text( + feature.description, + style: TextStyle( + fontSize: 12.sp, + color: isDarkMode ? Colors.grey[400] : Colors.grey[600], + ), + maxLines: 2, + overflow: TextOverflow.ellipsis, + ), + ], + ), + ), + ], + ), + ), + ); + } }