From 09e66cef10127c1604f4caa469b0a2053e6b3ec0 Mon Sep 17 00:00:00 2001 From: hailin Date: Mon, 15 Dec 2025 01:43:47 -0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E5=A4=9A=E9=A1=B9UI=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E5=92=8C=E5=93=81=E7=89=8C=E6=9B=B4=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 品牌更名: 将"榴莲女皇"全部替换为"榴莲皇后"(前端+后端共15处) - 导航优化: 将"交易"Tab改名为"兑换" - 创建钱包页: 添加返回按钮,可返回向导页第5页(仅账号未创建时显示) - 兑换页面: 禁用"一键结算"和"卖出DST"按钮,提款按钮在余额为0时禁用 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .claude/settings.local.json | 8 +- .../DEVELOPMENT_GUIDE.md | 2 +- .../blockchain-service/DEVELOPMENT_GUIDE.md | 2 +- .../src/shared/utils/random-identity.util.ts | 4 +- .../leaderboard-service/DEVELOPMENT_GUIDE.md | 2 +- .../planting-service/DEVELOPMENT_GUIDE.md | 2 +- backend/services/planting-service/src/main.ts | 2 +- .../referral-service/DEVELOPMENT_GUIDE.md | 2 +- .../reporting-service/DEVELOPMENT_GUIDE.md | 2 +- .../reward-service/DEVELOPMENT_GUIDE.md | 2 +- backend/services/reward-service/src/main.ts | 2 +- frontend/mobile-app/CLAUDE.md | 2 +- .../lib/core/constants/app_constants.dart | 2 +- .../pages/backup_mnemonic_page.dart | 2 +- .../auth/presentation/pages/guide_page.dart | 12 ++- .../presentation/pages/onboarding_page.dart | 46 ++++++++- .../presentation/pages/home_shell_page.dart | 4 +- .../presentation/widgets/bottom_nav_bar.dart | 4 +- .../presentation/pages/trading_page.dart | 95 ++++++++++--------- .../mobile-app/lib/routes/app_router.dart | 6 +- frontend/mobile-app/pubspec.yaml | 2 +- 21 files changed, 133 insertions(+), 72 deletions(-) diff --git a/.claude/settings.local.json b/.claude/settings.local.json index 6669a458..78aad904 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -186,7 +186,13 @@ "Bash(node -e \"\nconst { ethers } = require(''ethers'');\n\nconst KAVA_TESTNET_RPC = ''https://evm.testnet.kava.io'';\nconst privateKey = ''0xd42a6e6021ebd884f3f179d3793a32e97b9f1001db6ff44441ec455d748b9aa6'';\nconst USDT_CONTRACT = ''0xc12f6A4A7Fd0965085B044A67a39CcA2ff7fe0dF'';\nconst TO_ADDRESS = ''0x132883f6d80786109cf64004f6b5c4de99c1b3db'';\n\nasync function transfer() {\n const provider = new ethers.JsonRpcProvider(KAVA_TESTNET_RPC);\n const wallet = new ethers.Wallet(privateKey, provider);\n \n const abi = [''function transfer(address to, uint256 amount) returns (bool)'', ''function balanceOf(address) view returns (uint256)''];\n const contract = new ethers.Contract(USDT_CONTRACT, abi, wallet);\n \n const amount = BigInt(1000000) * BigInt(1000000);\n \n console.log(''Transferring 1,000,000 USDT to'', TO_ADDRESS);\n const tx = await contract.transfer(TO_ADDRESS, amount, { gasLimit: 100000 });\n console.log(''TX Hash:'', tx.hash);\n await tx.wait();\n \n const newBalance = await contract.balanceOf(TO_ADDRESS);\n console.log(''New balance:'', Number(newBalance) / 1e6, ''USDT'');\n}\n\ntransfer().catch(e => console.error(''Error:'', e.message));\n\")", "Bash(node -e \"\nconst { ethers } = require(''ethers'');\n\nconst KAVA_TESTNET_RPC = ''https://evm.testnet.kava.io'';\nconst privateKey = ''0xd42a6e6021ebd884f3f179d3793a32e97b9f1001db6ff44441ec455d748b9aa6'';\nconst USDT_CONTRACT = ''0xc12f6A4A7Fd0965085B044A67a39CcA2ff7fe0dF'';\nconst TO_ADDRESS = ''0x14fcc4cad17f65ed4060ac6e89dd6dcbe8464b70'';\n\nasync function transfer() {\n const provider = new ethers.JsonRpcProvider(KAVA_TESTNET_RPC);\n const wallet = new ethers.Wallet(privateKey, provider);\n \n const abi = [''function transfer(address to, uint256 amount) returns (bool)'', ''function balanceOf(address) view returns (uint256)''];\n const contract = new ethers.Contract(USDT_CONTRACT, abi, wallet);\n \n const amount = BigInt(1000000) * BigInt(1000000);\n \n console.log(''Transferring 1,000,000 USDT to'', TO_ADDRESS);\n const tx = await contract.transfer(TO_ADDRESS, amount, { gasLimit: 100000 });\n console.log(''TX Hash:'', tx.hash);\n await tx.wait();\n \n const newBalance = await contract.balanceOf(TO_ADDRESS);\n console.log(''New balance:'', Number(newBalance) / 1e6, ''USDT'');\n}\n\ntransfer().catch(e => console.error(''Error:'', e.message));\n\")", "Bash(dir /s /b c:UsersdongDesktoprwadurianbackend*.env*)", - "Bash(echo:*)" + "Bash(echo:*)", + "Bash(git commit -m \"$(cat <<''EOF''\nfeat(profile): 添加市团队/省团队/市区域/省区域权益考核显示\n\n在\"我的\"页面社区权益考核下方,根据用户拥有的角色显示对应的权益考核组件:\n- 市团队:每新增认种1棵可获得30 USDT\n- 省团队:每新增认种1棵可获得10 USDT \n- 市区域:每新增认种1棵可获得20 USDT\n- 省区域:每新增认种1棵可获得10 USDT\n\n🤖 Generated with [Claude Code](https://claude.com/claude-code)\n\nCo-Authored-By: Claude Opus 4.5 \nEOF\n)\")", + "Bash(git commit -m \"$(cat <<''EOF''\nfix(guide): 修复向导页5导入助记词按钮导航问题\n\n将 Navigator.of(context).pushNamed() 改为 context.push(),\n使用 go_router 进行页面导航,与 onboarding_page 保持一致。\n\n🤖 Generated with [Claude Code](https://claude.com/claude-code)\n\nCo-Authored-By: Claude Opus 4.5 \nEOF\n)\")", + "Bash(git commit -m \"$(cat <<''EOF''\nfeat(profile): 添加我的伞下功能 - 展示下级用户树形结构\n\n- 后端新增 GET /referral/user/:accountSequence/direct-referrals API\n- 前端新增伞下树组件,支持懒加载、缓存、展开/收起\n- 使用 CustomPaint 绘制父子节点连接线\n- 超出屏幕宽度时显示省略号,点击弹出底部列表\n\n🤖 Generated with [Claude Code](https://claude.com/claude-code)\n\nCo-Authored-By: Claude Opus 4.5 \nEOF\n)\")", + "Bash(git tag -a v1.0.0-beta1 -m \"$(cat <<''EOF''\nv1.0.0-beta1: 用户首次测试通过\n\n主要修复:\n- fix(reward): 修复 accountSequence 转 userId 时字母前缀导致的 BigInt 转换失败\n- fix(authorization): 修复下级团队认种数重复减去自己认种数的 BUG\n- fix(frontend): 修正权益金额显示与后端实际配置一致\n\n功能完善:\n- 社区权益激活正常\n- 市团队/省团队/市区域/省区域权益考核显示\n- 我的伞下功能 - 展示下级用户树形结构\n\n此版本可作为回滚基准点\nEOF\n)\")", + "Bash(ls -la \"c:\\Users\\dong\\Desktop\\rwadurian\\frontend\\mobile-app\\assets\\images\\splash_frames\"\" 2>/dev/null || dir \"c:UsersdongDesktoprwadurianfrontendmobile-appassetsimagessplash_frames\" 2>nul || echo \"目录不存在 \")", + "Bash(ls -la \"c:\\Users\\dong\\Desktop\\rwadurian\\frontend\\mobile-app\\lib\\features\"\" | grep -E \"^d \")" ], "deny": [], "ask": [] diff --git a/backend/services/authorization-service/DEVELOPMENT_GUIDE.md b/backend/services/authorization-service/DEVELOPMENT_GUIDE.md index 9a00588f..23231645 100644 --- a/backend/services/authorization-service/DEVELOPMENT_GUIDE.md +++ b/backend/services/authorization-service/DEVELOPMENT_GUIDE.md @@ -2,7 +2,7 @@ ## 项目概述 -Authorization Service 是 RWA 榴莲女皇平台的授权管理微服务,负责社区授权、省/市公司授权、阶梯式考核管理、月度考核评估与排名、权益激活/失效管理等功能。 +Authorization Service 是 RWA 榴莲皇后平台的授权管理微服务,负责社区授权、省/市公司授权、阶梯式考核管理、月度考核评估与排名、权益激活/失效管理等功能。 ### 核心职责 ✅ - 社区/省公司/市公司授权管理 diff --git a/backend/services/blockchain-service/DEVELOPMENT_GUIDE.md b/backend/services/blockchain-service/DEVELOPMENT_GUIDE.md index 401f57ec..98e4c37b 100644 --- a/backend/services/blockchain-service/DEVELOPMENT_GUIDE.md +++ b/backend/services/blockchain-service/DEVELOPMENT_GUIDE.md @@ -4,7 +4,7 @@ ### 1.1 服务定位 -blockchain-service 是 RWA 榴莲女皇平台的区块链基础设施服务,负责: +blockchain-service 是 RWA 榴莲皇后平台的区块链基础设施服务,负责: - **公钥→地址派生**:从 MPC 公钥派生多链钱包地址 (EVM/Cosmos) - **链上事件监听**:监听 ERC20 Transfer 事件,检测用户充值 diff --git a/backend/services/identity-service/src/shared/utils/random-identity.util.ts b/backend/services/identity-service/src/shared/utils/random-identity.util.ts index 3c2ba5d6..a1f14150 100644 --- a/backend/services/identity-service/src/shared/utils/random-identity.util.ts +++ b/backend/services/identity-service/src/shared/utils/random-identity.util.ts @@ -2,7 +2,7 @@ * 用户名和头像生成器 */ -// 生成用户名: 榴莲女皇x号 +// 生成用户名: 榴莲皇后x号 // accountSequence 格式: D + YYMMDD + 5位序号 (如 D24121400001) // 提取后5位序号,去掉前导零 export function generateUsername(accountSequence: string): string { @@ -10,7 +10,7 @@ export function generateUsername(accountSequence: string): string { const serialPart = accountSequence.slice(-5); // 去掉前导零,转为数字再转回字符串 const serialNumber = parseInt(serialPart, 10).toString(); - return `榴莲女皇${serialNumber}号`; + return `榴莲皇后${serialNumber}号`; } // 预定义的柔和配色方案 diff --git a/backend/services/leaderboard-service/DEVELOPMENT_GUIDE.md b/backend/services/leaderboard-service/DEVELOPMENT_GUIDE.md index ab717338..65b1c574 100644 --- a/backend/services/leaderboard-service/DEVELOPMENT_GUIDE.md +++ b/backend/services/leaderboard-service/DEVELOPMENT_GUIDE.md @@ -2,7 +2,7 @@ ## 项目概述 -Leaderboard Service 是 RWA 榴莲女皇平台的龙虎榜微服务,负责管理用户排名计算、虚拟账户管理、榜单数据聚合与缓存、日/周/月榜单管理等功能。 +Leaderboard Service 是 RWA 榴莲皇后平台的龙虎榜微服务,负责管理用户排名计算、虚拟账户管理、榜单数据聚合与缓存、日/周/月榜单管理等功能。 ### 核心职责 ✅ - 龙虎榜排名计算(日榜、周榜、月榜) diff --git a/backend/services/planting-service/DEVELOPMENT_GUIDE.md b/backend/services/planting-service/DEVELOPMENT_GUIDE.md index 7b2f4961..84060d25 100644 --- a/backend/services/planting-service/DEVELOPMENT_GUIDE.md +++ b/backend/services/planting-service/DEVELOPMENT_GUIDE.md @@ -2,7 +2,7 @@ ## 项目概述 -Planting Service 是 RWA 榴莲女皇平台的认种微服务,负责管理认种订单生命周期、省市选择确认、资金分配规则计算、底池注入批次管理和挖矿资格管理。 +Planting Service 是 RWA 榴莲皇后平台的认种微服务,负责管理认种订单生命周期、省市选择确认、资金分配规则计算、底池注入批次管理和挖矿资格管理。 ## 技术栈 diff --git a/backend/services/planting-service/src/main.ts b/backend/services/planting-service/src/main.ts index 327a44f1..95e8f98e 100644 --- a/backend/services/planting-service/src/main.ts +++ b/backend/services/planting-service/src/main.ts @@ -31,7 +31,7 @@ async function bootstrap() { // Swagger API 文档 const config = new DocumentBuilder() .setTitle('Planting Service API') - .setDescription('RWA 榴莲女皇平台认种服务 API') + .setDescription('RWA 榴莲皇后平台认种服务 API') .setVersion('1.0.0') .addBearerAuth() .addTag('认种订单', '认种订单相关接口') diff --git a/backend/services/referral-service/DEVELOPMENT_GUIDE.md b/backend/services/referral-service/DEVELOPMENT_GUIDE.md index e8e8d2ae..d87067e0 100644 --- a/backend/services/referral-service/DEVELOPMENT_GUIDE.md +++ b/backend/services/referral-service/DEVELOPMENT_GUIDE.md @@ -2,7 +2,7 @@ ## 项目概述 -Referral Service 是 RWA 榴莲女皇平台的推荐团队微服务,负责管理推荐关系树、团队统计维护、龙虎榜分值计算、省市团队占比统计等功能。 +Referral Service 是 RWA 榴莲皇后平台的推荐团队微服务,负责管理推荐关系树、团队统计维护、龙虎榜分值计算、省市团队占比统计等功能。 ### 核心职责 ✅ - 推荐关系树构建(基于序列号/推荐码) diff --git a/backend/services/reporting-service/DEVELOPMENT_GUIDE.md b/backend/services/reporting-service/DEVELOPMENT_GUIDE.md index ec2cd6fc..fdd02459 100644 --- a/backend/services/reporting-service/DEVELOPMENT_GUIDE.md +++ b/backend/services/reporting-service/DEVELOPMENT_GUIDE.md @@ -2,7 +2,7 @@ ## 项目概述 -Reporting & Analytics Service 是 RWA 榴莲女皇平台的报表分析微服务,负责多维报表生成、数据统计与分析、报表导出、数据大屏支持等功能。 +Reporting & Analytics Service 是 RWA 榴莲皇后平台的报表分析微服务,负责多维报表生成、数据统计与分析、报表导出、数据大屏支持等功能。 ### 核心职责 ✅ - 多维报表生成(按时间/地域/权益类型等维度) diff --git a/backend/services/reward-service/DEVELOPMENT_GUIDE.md b/backend/services/reward-service/DEVELOPMENT_GUIDE.md index cb55262e..f41a7ecc 100644 --- a/backend/services/reward-service/DEVELOPMENT_GUIDE.md +++ b/backend/services/reward-service/DEVELOPMENT_GUIDE.md @@ -2,7 +2,7 @@ ## 项目概述 -Reward Service 是 RWA 榴莲女皇平台的权益奖励微服务,负责管理奖励计算与分配、24小时倒计时管理、收益状态流转、结算处理等功能。 +Reward Service 是 RWA 榴莲皇后平台的权益奖励微服务,负责管理奖励计算与分配、24小时倒计时管理、收益状态流转、结算处理等功能。 ### 核心职责 ✅ - 权益规则定义(6种权益类型) diff --git a/backend/services/reward-service/src/main.ts b/backend/services/reward-service/src/main.ts index 235af613..4a434be1 100644 --- a/backend/services/reward-service/src/main.ts +++ b/backend/services/reward-service/src/main.ts @@ -31,7 +31,7 @@ async function bootstrap() { // Swagger 配置 const config = new DocumentBuilder() .setTitle('Reward Service API') - .setDescription('RWA榴莲女皇平台 - 权益奖励微服务 API 文档') + .setDescription('RWA榴莲皇后平台 - 权益奖励微服务 API 文档') .setVersion('1.0') .addBearerAuth() .build(); diff --git a/frontend/mobile-app/CLAUDE.md b/frontend/mobile-app/CLAUDE.md index fcacbace..fd827e6a 100644 --- a/frontend/mobile-app/CLAUDE.md +++ b/frontend/mobile-app/CLAUDE.md @@ -502,7 +502,7 @@ rwa_android_app/ ```yaml name: rwa_android_app -description: RWA榴莲女皇移动应用 +description: RWA榴莲皇后移动应用 publish_to: 'none' version: 1.0.0+1 diff --git a/frontend/mobile-app/lib/core/constants/app_constants.dart b/frontend/mobile-app/lib/core/constants/app_constants.dart index a34a2500..21edaead 100644 --- a/frontend/mobile-app/lib/core/constants/app_constants.dart +++ b/frontend/mobile-app/lib/core/constants/app_constants.dart @@ -2,7 +2,7 @@ class AppConstants { AppConstants._(); // App Info - static const String appName = 'RWA榴莲女皇'; + static const String appName = 'RWA榴莲皇后'; static const String appVersion = '1.0.0'; // Animation Durations diff --git a/frontend/mobile-app/lib/features/auth/presentation/pages/backup_mnemonic_page.dart b/frontend/mobile-app/lib/features/auth/presentation/pages/backup_mnemonic_page.dart index 64d27445..4428e682 100644 --- a/frontend/mobile-app/lib/features/auth/presentation/pages/backup_mnemonic_page.dart +++ b/frontend/mobile-app/lib/features/auth/presentation/pages/backup_mnemonic_page.dart @@ -305,7 +305,7 @@ class _BackupMnemonicPageState extends ConsumerState { // 生成备份内容 final content = ''' ===================================== - RWA 榴莲女皇 - 助记词备份 + RWA 榴莲皇后 - 助记词备份 ===================================== 【重要警告】 diff --git a/frontend/mobile-app/lib/features/auth/presentation/pages/guide_page.dart b/frontend/mobile-app/lib/features/auth/presentation/pages/guide_page.dart index 2e2b2815..58044450 100644 --- a/frontend/mobile-app/lib/features/auth/presentation/pages/guide_page.dart +++ b/frontend/mobile-app/lib/features/auth/presentation/pages/guide_page.dart @@ -28,19 +28,25 @@ class GuidePageData { /// 向导页面 - 用户首次打开应用时展示 /// 支持左右滑动切换页面 class GuidePage extends ConsumerStatefulWidget { - const GuidePage({super.key}); + /// 初始页面索引(0-4,默认为0) + final int initialPage; + + const GuidePage({super.key, this.initialPage = 0}); @override ConsumerState createState() => _GuidePageState(); } class _GuidePageState extends ConsumerState { - final PageController _pageController = PageController(); - int _currentPage = 0; + late final PageController _pageController; + late int _currentPage; @override void initState() { super.initState(); + // 使用传入的初始页面索引 + _currentPage = widget.initialPage.clamp(0, 4); + _pageController = PageController(initialPage: _currentPage); // 延迟到 build 后获取屏幕信息 WidgetsBinding.instance.addPostFrameCallback((_) { _logScreenInfo(); diff --git a/frontend/mobile-app/lib/features/auth/presentation/pages/onboarding_page.dart b/frontend/mobile-app/lib/features/auth/presentation/pages/onboarding_page.dart index 808d7a4b..166ff2d4 100644 --- a/frontend/mobile-app/lib/features/auth/presentation/pages/onboarding_page.dart +++ b/frontend/mobile-app/lib/features/auth/presentation/pages/onboarding_page.dart @@ -276,11 +276,53 @@ class _OnboardingPageState extends ConsumerState { ); } + /// 返回向导页第5页(仅在账号未创建时可用) + void _goBackToGuide() { + debugPrint('[OnboardingPage] _goBackToGuide - 返回向导页第5页'); + // 返回向导页,传入初始页索引4(第5页) + context.go(RoutePaths.guide, extra: 4); + } + /// 构建顶部 Logo 和标题 Widget _buildHeader() { return Column( children: [ - const SizedBox(height: 32), + // 返回按钮行 - 仅在账号未创建时显示 + SizedBox( + height: 32, + child: (!_isLoading && !_isAccountCreated) + ? Align( + alignment: Alignment.centerLeft, + child: GestureDetector( + onTap: _goBackToGuide, + behavior: HitTestBehavior.opaque, + child: const Padding( + padding: EdgeInsets.symmetric(vertical: 4), + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + Icon( + Icons.arrow_back_ios, + size: 18, + color: Color(0xFF5D4037), + ), + SizedBox(width: 4), + Text( + '返回', + style: TextStyle( + fontSize: 14, + fontFamily: 'Inter', + fontWeight: FontWeight.w500, + color: Color(0xFF5D4037), + ), + ), + ], + ), + ), + ), + ) + : null, + ), // Logo 容器 Container( width: 100, @@ -310,7 +352,7 @@ class _OnboardingPageState extends ConsumerState { const SizedBox(height: 24), // 应用标题 const Text( - '榴莲女皇', + '榴莲皇后', style: TextStyle( fontSize: 32, fontFamily: 'Inter', diff --git a/frontend/mobile-app/lib/features/home/presentation/pages/home_shell_page.dart b/frontend/mobile-app/lib/features/home/presentation/pages/home_shell_page.dart index 518f532b..e2714e21 100644 --- a/frontend/mobile-app/lib/features/home/presentation/pages/home_shell_page.dart +++ b/frontend/mobile-app/lib/features/home/presentation/pages/home_shell_page.dart @@ -60,7 +60,7 @@ class _HomeShellPageState extends ConsumerState int _getCurrentIndex(BuildContext context) { final location = GoRouterState.of(context).uri.path; - // 矿机Tab暂时隐藏,索引调整为: 0-龙虎榜, 1-交易, 2-我 + // 矿机Tab暂时隐藏,索引调整为: 0-龙虎榜, 1-兑换, 2-我 if (location.startsWith(RoutePaths.ranking)) return 0; // if (location.startsWith(RoutePaths.mining)) return 1; // 矿机暂时隐藏 if (location.startsWith(RoutePaths.trading)) return 1; @@ -69,7 +69,7 @@ class _HomeShellPageState extends ConsumerState } void _onTabTapped(BuildContext context, int index) { - // 矿机Tab暂时隐藏,索引调整为: 0-龙虎榜, 1-交易, 2-我 + // 矿机Tab暂时隐藏,索引调整为: 0-龙虎榜, 1-兑换, 2-我 switch (index) { case 0: context.go(RoutePaths.ranking); diff --git a/frontend/mobile-app/lib/features/home/presentation/widgets/bottom_nav_bar.dart b/frontend/mobile-app/lib/features/home/presentation/widgets/bottom_nav_bar.dart index 6a90b73f..15f1567b 100644 --- a/frontend/mobile-app/lib/features/home/presentation/widgets/bottom_nav_bar.dart +++ b/frontend/mobile-app/lib/features/home/presentation/widgets/bottom_nav_bar.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; /// 底部导航栏组件 -/// 包含三个Tab:龙虎榜、交易、我 +/// 包含三个Tab:龙虎榜、兑换、我 /// 注意:矿机Tab暂时隐藏(未删除代码,方便后续恢复) /// 自定义设计风格,使用 LayoutBuilder 确保自适应 class BottomNavBar extends StatelessWidget { @@ -53,7 +53,7 @@ class BottomNavBar extends StatelessWidget { index: 1, // 原 index: 2 icon: Icons.swap_horiz_outlined, activeIcon: Icons.swap_horiz, - label: '交易', + label: '兑换', ), _buildNavItem( index: 2, // 原 index: 3 diff --git a/frontend/mobile-app/lib/features/trading/presentation/pages/trading_page.dart b/frontend/mobile-app/lib/features/trading/presentation/pages/trading_page.dart index f1044039..188c88fe 100644 --- a/frontend/mobile-app/lib/features/trading/presentation/pages/trading_page.dart +++ b/frontend/mobile-app/lib/features/trading/presentation/pages/trading_page.dart @@ -7,7 +7,7 @@ import '../../../../routes/route_paths.dart'; /// 结算币种枚举 enum SettlementCurrency { bnb, og, usdt, dst } -/// 交易页面 - 显示可结算收益和交易功能 +/// 兑换页面 - 显示可结算收益和兑换功能 /// 支持一键结算和DST转USDT class TradingPage extends ConsumerStatefulWidget { const TradingPage({super.key}); @@ -282,7 +282,7 @@ class _TradingPageState extends ConsumerState { padding: const EdgeInsets.symmetric(horizontal: 16), child: const Center( child: Text( - '交易', + '兑换', style: TextStyle( fontSize: 18, fontFamily: 'Inter', @@ -346,40 +346,33 @@ class _TradingPageState extends ConsumerState { } /// 构建一键结算按钮 + /// 注意:一键结算功能暂时禁用 Widget _buildSettlementButton() { - final bool canSettle = !_isLoading && !_isSettling && _settleableAmount > 0; + // 功能暂时禁用,始终不可点击 + const bool canSettle = false; return Padding( padding: const EdgeInsets.symmetric(horizontal: 16), child: GestureDetector( - onTap: canSettle ? _onSettlement : null, + onTap: null, // 功能暂时禁用 child: Container( width: double.infinity, height: 56, decoration: BoxDecoration( - color: canSettle ? const Color(0xFFD4AF37) : const Color(0x80D4AF37), + color: const Color(0x80D4AF37), // 禁用状态颜色 borderRadius: BorderRadius.circular(12), ), - child: Center( - child: _isSettling - ? const SizedBox( - width: 24, - height: 24, - child: CircularProgressIndicator( - strokeWidth: 2, - valueColor: AlwaysStoppedAnimation(Colors.white), - ), - ) - : const Text( - '一键结算', - style: TextStyle( - fontSize: 16, - fontFamily: 'Inter', - fontWeight: FontWeight.w700, - height: 1.5, - letterSpacing: 0.24, - color: Colors.white, - ), - ), + child: const Center( + child: Text( + '一键结算(暂未开放)', + style: TextStyle( + fontSize: 16, + fontFamily: 'Inter', + fontWeight: FontWeight.w700, + height: 1.5, + letterSpacing: 0.24, + color: Colors.white, + ), + ), ), ), ), @@ -468,32 +461,33 @@ class _TradingPageState extends ConsumerState { } /// 构建卖出DST按钮 + /// 注意:卖出DST功能暂时禁用 Widget _buildSellDstButton() { return Padding( padding: const EdgeInsets.symmetric(horizontal: 16), child: GestureDetector( - onTap: _onSellDst, + onTap: null, // 功能暂时禁用 child: Container( width: double.infinity, height: 56, decoration: BoxDecoration( - color: const Color(0x338B5A2B), + color: const Color(0x1A8B5A2B), // 禁用状态颜色更浅 borderRadius: BorderRadius.circular(12), border: Border.all( - color: const Color(0x808B5A2B), + color: const Color(0x408B5A2B), // 禁用状态边框更浅 width: 1, ), ), child: const Center( child: Text( - '卖出 DST 转换为 USDT', + '卖出 DST 转换为 USDT(暂未开放)', style: TextStyle( fontSize: 16, fontFamily: 'Inter', fontWeight: FontWeight.w700, height: 1.5, letterSpacing: 0.24, - color: Color(0xFF8B5A2B), + color: Color(0x808B5A2B), // 禁用状态文字颜色更浅 ), ), ), @@ -525,37 +519,46 @@ class _TradingPageState extends ConsumerState { } /// 构建提款/转账按钮 + /// 当 USDT 余额为 0 时禁用 Widget _buildWithdrawButton() { + // 余额为0时禁用 + final bool canWithdraw = !_isLoading && _usdtBalance > 0; return Padding( padding: const EdgeInsets.symmetric(horizontal: 16), child: GestureDetector( - onTap: () { - context.push(RoutePaths.withdrawUsdt); - }, + onTap: canWithdraw + ? () { + context.push(RoutePaths.withdrawUsdt); + } + : null, child: Container( width: double.infinity, height: 56, decoration: BoxDecoration( - color: const Color(0xFFD4AF37), + color: canWithdraw + ? const Color(0xFFD4AF37) + : const Color(0x80D4AF37), // 禁用状态颜色 borderRadius: BorderRadius.circular(12), - boxShadow: const [ - BoxShadow( - color: Color(0x4DD4AF37), - blurRadius: 14, - offset: Offset(0, 4), - ), - ], + boxShadow: canWithdraw + ? const [ + BoxShadow( + color: Color(0x4DD4AF37), + blurRadius: 14, + offset: Offset(0, 4), + ), + ] + : null, // 禁用时无阴影 ), - child: const Center( + child: Center( child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Icon( Icons.account_balance_wallet_outlined, - color: Colors.white, + color: canWithdraw ? Colors.white : Colors.white70, size: 20, ), - SizedBox(width: 8), + const SizedBox(width: 8), Text( '提款 / 转账', style: TextStyle( @@ -564,7 +567,7 @@ class _TradingPageState extends ConsumerState { fontWeight: FontWeight.w700, height: 1.5, letterSpacing: 0.24, - color: Colors.white, + color: canWithdraw ? Colors.white : Colors.white70, ), ), ], diff --git a/frontend/mobile-app/lib/routes/app_router.dart b/frontend/mobile-app/lib/routes/app_router.dart index ac5df7db..81270c65 100644 --- a/frontend/mobile-app/lib/routes/app_router.dart +++ b/frontend/mobile-app/lib/routes/app_router.dart @@ -106,7 +106,11 @@ final appRouterProvider = Provider((ref) { GoRoute( path: RoutePaths.guide, name: RouteNames.guide, - builder: (context, state) => const GuidePage(), + builder: (context, state) { + // 支持传入初始页索引 + final initialPage = state.extra as int? ?? 0; + return GuidePage(initialPage: initialPage); + }, ), // Onboarding / Create Account diff --git a/frontend/mobile-app/pubspec.yaml b/frontend/mobile-app/pubspec.yaml index 67ff23a5..1c3865a3 100644 --- a/frontend/mobile-app/pubspec.yaml +++ b/frontend/mobile-app/pubspec.yaml @@ -1,5 +1,5 @@ name: rwa_android_app -description: RWA榴莲女皇移动应用 +description: RWA榴莲皇后移动应用 publish_to: 'none' version: 1.0.0+1