feat(pre-planting): Profile 页面添加预种计划入口
[2026-02-17] 在 Profile 页面认种按钮下方新增预种计划入口 新增内容(纯新增,不改现有逻辑): - _goToPrePlantingPurchase():跳转预种购买页 - _goToPrePlantingPosition():跳转预种持仓页 - _buildPrePlantingButtons():两个并排按钮 - 左侧「预种购买」:金色主题,跳转购买页 - 右侧「预种持仓」:棕色主题,跳转持仓页 布局位置:认种按钮正下方,主内容卡片上方 现有功能零影响,仅新增 3 个方法 + 1 处布局插入 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
d248f92443
commit
03f5c4af28
|
|
@ -1234,6 +1234,16 @@ class _ProfilePageState extends ConsumerState<ProfilePage> {
|
|||
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<ProfilePage> {
|
|||
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<ProfilePage> {
|
|||
);
|
||||
}
|
||||
|
||||
/// [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" 或实际值
|
||||
|
|
|
|||
Loading…
Reference in New Issue