From 03f5c4af28befd560de325cba87bd45d2a6307d4 Mon Sep 17 00:00:00 2001 From: hailin Date: Wed, 18 Feb 2026 05:44:48 -0800 Subject: [PATCH] =?UTF-8?q?feat(pre-planting):=20Profile=20=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=B7=BB=E5=8A=A0=E9=A2=84=E7=A7=8D=E8=AE=A1=E5=88=92?= =?UTF-8?q?=E5=85=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [2026-02-17] 在 Profile 页面认种按钮下方新增预种计划入口 新增内容(纯新增,不改现有逻辑): - _goToPrePlantingPurchase():跳转预种购买页 - _goToPrePlantingPosition():跳转预种持仓页 - _buildPrePlantingButtons():两个并排按钮 - 左侧「预种购买」:金色主题,跳转购买页 - 右侧「预种持仓」:棕色主题,跳转持仓页 布局位置:认种按钮正下方,主内容卡片上方 现有功能零影响,仅新增 3 个方法 + 1 处布局插入 Co-Authored-By: Claude Opus 4.6 --- .../presentation/pages/profile_page.dart | 100 ++++++++++++++++++ 1 file changed, 100 insertions(+) diff --git a/frontend/mobile-app/lib/features/profile/presentation/pages/profile_page.dart b/frontend/mobile-app/lib/features/profile/presentation/pages/profile_page.dart index 73781daf..9348cd86 100644 --- a/frontend/mobile-app/lib/features/profile/presentation/pages/profile_page.dart +++ b/frontend/mobile-app/lib/features/profile/presentation/pages/profile_page.dart @@ -1234,6 +1234,16 @@ class _ProfilePageState extends ConsumerState { context.push(RoutePaths.plantingQuantity); } + /// [2026-02-17] 进入预种计划购买页 + void _goToPrePlantingPurchase() { + context.push(RoutePaths.prePlantingPurchase); + } + + /// [2026-02-17] 进入预种持仓页 + void _goToPrePlantingPosition() { + context.push(RoutePaths.prePlantingPosition); + } + /// 谷歌验证器 void _goToGoogleAuth() { context.push(RoutePaths.googleAuth); @@ -1418,6 +1428,9 @@ class _ProfilePageState extends ConsumerState { const SizedBox(height: 8), // 认种按钮 _buildPlantingButton(), + const SizedBox(height: 8), + // [2026-02-17] 预种计划按钮(购买 + 查看持仓) + _buildPrePlantingButtons(), const SizedBox(height: 16), // 主要内容卡片(懒加载:收益数据) VisibilityDetector( @@ -1902,6 +1915,93 @@ class _ProfilePageState extends ConsumerState { ); } + /// [2026-02-17] 构建预种计划按钮行(购买 + 查看持仓) + /// + /// 两个按钮并排显示: + /// - 左侧「预种购买」:跳转到预种购买页(选择份数 → 支付 3171 USDT/份) + /// - 右侧「预种持仓」:跳转到预种持仓页(查看订单、合并记录、签约) + Widget _buildPrePlantingButtons() { + return Row( + children: [ + // 预种购买按钮 + Expanded( + child: GestureDetector( + onTap: _goToPrePlantingPurchase, + child: Container( + height: 44, + decoration: BoxDecoration( + color: const Color(0xFFD4AF37).withValues(alpha: 0.15), + borderRadius: BorderRadius.circular(8), + border: Border.all( + color: const Color(0xFFD4AF37).withValues(alpha: 0.4), + width: 1, + ), + ), + child: const Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Icon( + Icons.add_circle_outline, + color: Color(0xFFD4AF37), + size: 18, + ), + SizedBox(width: 6), + Text( + '预种购买', + style: TextStyle( + fontSize: 14, + fontFamily: 'Inter', + fontWeight: FontWeight.w600, + color: Color(0xFFD4AF37), + ), + ), + ], + ), + ), + ), + ), + const SizedBox(width: 8), + // 预种持仓按钮 + Expanded( + child: GestureDetector( + onTap: _goToPrePlantingPosition, + child: Container( + height: 44, + decoration: BoxDecoration( + color: const Color(0xFF5D4037).withValues(alpha: 0.08), + borderRadius: BorderRadius.circular(8), + border: Border.all( + color: const Color(0xFF5D4037).withValues(alpha: 0.2), + width: 1, + ), + ), + child: const Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Icon( + Icons.account_balance_wallet_outlined, + color: Color(0xFF5D4037), + size: 18, + ), + SizedBox(width: 6), + Text( + '预种持仓', + style: TextStyle( + fontSize: 14, + fontFamily: 'Inter', + fontWeight: FontWeight.w600, + color: Color(0xFF5D4037), + ), + ), + ], + ), + ), + ), + ), + ], + ); + } + /// 构建主要内容卡片 Widget _buildMainContentCard() { // Widget 结构始终保持,数据值根据状态显示 "0" 或实际值