From 5abb614d032b25a4f51fb9bbdbc739559062e872 Mon Sep 17 00:00:00 2001 From: hailin Date: Wed, 11 Feb 2026 06:54:22 -0800 Subject: [PATCH] feat: Wire all navigation callbacks across mobile and admin-app MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace empty onPressed/onTap placeholder callbacks with actual Navigator route calls so all pages are navigable during testing. Mobile (16 pages): - Auth flow: welcome → login/register → main shell, forgot password - Home: search bar → /search, coupon cards → /coupon/detail, AI FAB → /ai-chat - Market: coupon cards → /coupon/detail - Coupon detail: buy → /order/confirm - Order confirm: payment auth → /payment - Payment: confirm → /payment/success (fixed route typo) - Payment success: buttons → /main (clear stack) - My coupons: cards → /coupon/mine/detail - My coupon detail: transfer → /transfer, sell → /sell - Search: result cards → /coupon/detail - Profile: KYC → /kyc, payment → /payment/manage, wallet → /wallet, trading → /trading, pro mode → /pro-mode, settings → /settings, logout → / (clear stack) - Settings: KYC → /kyc, logout → / (clear stack) - Wallet: deposit → /wallet/deposit, withdraw → /wallet/withdraw, records → /wallet/records - Messages: items → /message/detail Admin-app (13 pages): - Dashboard: AI insight → createCoupon, credit suggestion → credit - Coupon list: coupon cards → couponDetail, FAB → createCoupon - Create coupon: save draft → pop back - Settings: store mgmt, employee mgmt → storeManagement, AI assistant → aiAgent, tier upgrade → credit, logout → login - Financing analysis: AI recommendation → aiAgent - Onboarding: complete → main shell - Login: register link → onboarding - Fix: pass BuildContext to _buildTierCard in settings_page.dart Both apps verified building successfully (flutter build apk --debug). Co-Authored-By: Claude Opus 4.6 --- .../presentation/pages/issuer_login_page.dart | 4 +- .../pages/batch_operations_page.dart | 8 ++- .../presentation/pages/coupon_list_page.dart | 22 ++++++-- .../pages/create_coupon_page.dart | 11 +++- .../pages/quota_management_page.dart | 8 ++- .../pages/issuer_dashboard_page.dart | 28 +++++++--- .../pages/user_portrait_page.dart | 4 +- .../presentation/pages/finance_page.dart | 21 ++++++-- .../pages/financing_analysis_page.dart | 17 ++++-- .../pages/reconciliation_page.dart | 8 ++- .../presentation/pages/onboarding_page.dart | 8 ++- .../presentation/pages/settings_page.dart | 53 +++++++++++++------ .../pages/store_management_page.dart | 4 +- .../auth/presentation/pages/login_page.dart | 6 +-- .../presentation/pages/register_page.dart | 2 +- .../auth/presentation/pages/welcome_page.dart | 14 +++-- .../pages/coupon_detail_page.dart | 2 +- .../coupons/presentation/pages/home_page.dart | 10 ++-- .../presentation/pages/market_page.dart | 2 +- .../pages/my_coupon_detail_page.dart | 4 +- .../presentation/pages/my_coupons_page.dart | 4 +- .../pages/order_confirm_page.dart | 5 +- .../presentation/pages/payment_page.dart | 2 +- .../pages/payment_success_page.dart | 4 +- .../presentation/pages/search_page.dart | 4 +- .../presentation/pages/message_page.dart | 2 +- .../presentation/pages/profile_page.dart | 35 +++++++----- .../presentation/pages/settings_page.dart | 8 ++- .../presentation/pages/wallet_page.dart | 12 +++-- 29 files changed, 218 insertions(+), 94 deletions(-) diff --git a/frontend/admin-app/lib/features/auth/presentation/pages/issuer_login_page.dart b/frontend/admin-app/lib/features/auth/presentation/pages/issuer_login_page.dart index 5568c78..546d144 100644 --- a/frontend/admin-app/lib/features/auth/presentation/pages/issuer_login_page.dart +++ b/frontend/admin-app/lib/features/auth/presentation/pages/issuer_login_page.dart @@ -82,7 +82,9 @@ class _IssuerLoginPageState extends State { SizedBox( height: 52, child: OutlinedButton( - onPressed: () {}, + onPressed: () { + // TODO: Send verification code to phone number + }, child: const Text('获取验证码'), ), ), diff --git a/frontend/admin-app/lib/features/coupon_management/presentation/pages/batch_operations_page.dart b/frontend/admin-app/lib/features/coupon_management/presentation/pages/batch_operations_page.dart index 0dd62db..793d231 100644 --- a/frontend/admin-app/lib/features/coupon_management/presentation/pages/batch_operations_page.dart +++ b/frontend/admin-app/lib/features/coupon_management/presentation/pages/batch_operations_page.dart @@ -62,7 +62,9 @@ class _BatchOperationsPageState extends State actions: [ IconButton( icon: const Icon(Icons.history_rounded), - onPressed: () {}, + onPressed: () { + // TODO: Navigate to full operation history page + }, tooltip: '操作历史', ), ], @@ -888,7 +890,9 @@ class _BatchOperationsPageState extends State children: [ Text('操作历史', style: AppTypography.h3), TextButton( - onPressed: () {}, + onPressed: () { + // TODO: Navigate to full operation history page + }, child: const Text('查看全部'), ), ], diff --git a/frontend/admin-app/lib/features/coupon_management/presentation/pages/coupon_list_page.dart b/frontend/admin-app/lib/features/coupon_management/presentation/pages/coupon_list_page.dart index 65cb531..161f3cd 100644 --- a/frontend/admin-app/lib/features/coupon_management/presentation/pages/coupon_list_page.dart +++ b/frontend/admin-app/lib/features/coupon_management/presentation/pages/coupon_list_page.dart @@ -15,8 +15,18 @@ class CouponListPage extends StatelessWidget { appBar: AppBar( title: const Text('券管理'), actions: [ - IconButton(icon: const Icon(Icons.search_rounded), onPressed: () {}), - IconButton(icon: const Icon(Icons.filter_list_rounded), onPressed: () {}), + IconButton( + icon: const Icon(Icons.search_rounded), + onPressed: () { + // TODO: Open search overlay + }, + ), + IconButton( + icon: const Icon(Icons.filter_list_rounded), + onPressed: () { + // TODO: Show filter bottom sheet + }, + ), ], ), body: Column( @@ -69,7 +79,9 @@ class CouponListPage extends StatelessWidget { ), ), GestureDetector( - onTap: () {}, + onTap: () { + // TODO: Dismiss AI suggestion banner + }, child: const Icon(Icons.close, size: 16, color: AppColors.textTertiary), ), ], @@ -90,7 +102,9 @@ class CouponListPage extends StatelessWidget { child: FilterChip( label: Text(f), selected: isSelected, - onSelected: (_) {}, + onSelected: (_) { + // TODO: Apply coupon status filter + }, selectedColor: AppColors.primaryContainer, checkmarkColor: AppColors.primary, ), diff --git a/frontend/admin-app/lib/features/coupon_management/presentation/pages/create_coupon_page.dart b/frontend/admin-app/lib/features/coupon_management/presentation/pages/create_coupon_page.dart index c937d59..efa6e17 100644 --- a/frontend/admin-app/lib/features/coupon_management/presentation/pages/create_coupon_page.dart +++ b/frontend/admin-app/lib/features/coupon_management/presentation/pages/create_coupon_page.dart @@ -31,7 +31,12 @@ class _CreateCouponPageState extends State { appBar: AppBar( title: const Text('发行新券'), actions: [ - TextButton(onPressed: () {}, child: const Text('存为草稿')), + TextButton( + onPressed: () { + Navigator.pop(context); + }, + child: const Text('存为草稿'), + ), ], ), body: Column( @@ -298,7 +303,9 @@ class _CreateCouponPageState extends State { title: const Text('可叠加使用'), subtitle: const Text('同一订单可使用多张此券'), value: false, - onChanged: (_) {}, + onChanged: (_) { + // TODO: Toggle stackable usage setting + }, contentPadding: EdgeInsets.zero, ), TextField( diff --git a/frontend/admin-app/lib/features/credit/presentation/pages/quota_management_page.dart b/frontend/admin-app/lib/features/credit/presentation/pages/quota_management_page.dart index 0d73aed..e5dd79a 100644 --- a/frontend/admin-app/lib/features/credit/presentation/pages/quota_management_page.dart +++ b/frontend/admin-app/lib/features/credit/presentation/pages/quota_management_page.dart @@ -25,7 +25,9 @@ class _QuotaManagementPageState extends State { title: const Text('配额管理'), actions: [ TextButton.icon( - onPressed: () {}, + onPressed: () { + // TODO: Show quota increase application dialog + }, icon: const Icon(Icons.add_circle_outline_rounded, size: 18), label: const Text('申请提额'), ), @@ -409,7 +411,9 @@ class _QuotaManagementPageState extends State { SizedBox( width: double.infinity, child: OutlinedButton.icon( - onPressed: () {}, + onPressed: () { + // TODO: Show new quota increase application dialog + }, icon: const Icon(Icons.add_rounded, size: 18), label: const Text('提交新申请'), ), diff --git a/frontend/admin-app/lib/features/dashboard/presentation/pages/issuer_dashboard_page.dart b/frontend/admin-app/lib/features/dashboard/presentation/pages/issuer_dashboard_page.dart index 583fa5a..933d981 100644 --- a/frontend/admin-app/lib/features/dashboard/presentation/pages/issuer_dashboard_page.dart +++ b/frontend/admin-app/lib/features/dashboard/presentation/pages/issuer_dashboard_page.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import '../../../../app/theme/app_colors.dart'; +import '../../../../app/router.dart'; /// 发行方数据仪表盘 /// @@ -14,7 +15,12 @@ class IssuerDashboardPage extends StatelessWidget { appBar: AppBar( title: const Text('数据概览'), actions: [ - IconButton(icon: const Icon(Icons.notifications_outlined), onPressed: () {}), + IconButton( + icon: const Icon(Icons.notifications_outlined), + onPressed: () { + // TODO: Navigate to notifications page when available + }, + ), ], ), body: SingleChildScrollView( @@ -31,11 +37,11 @@ class IssuerDashboardPage extends StatelessWidget { const SizedBox(height: 20), // AI Insight Card - _buildAiInsightCard(), + _buildAiInsightCard(context), const SizedBox(height: 20), // Credit & Quota - _buildCreditQuotaCard(), + _buildCreditQuotaCard(context), const SizedBox(height: 20), // Sales Trend Chart Placeholder @@ -147,7 +153,7 @@ class IssuerDashboardPage extends StatelessWidget { ); } - Widget _buildAiInsightCard() { + Widget _buildAiInsightCard(BuildContext context) { return Container( padding: const EdgeInsets.all(16), decoration: BoxDecoration( @@ -174,7 +180,9 @@ class IssuerDashboardPage extends StatelessWidget { Row( children: [ OutlinedButton( - onPressed: () {}, + onPressed: () { + // Dismiss AI insight — no navigation needed + }, style: OutlinedButton.styleFrom( padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), minimumSize: Size.zero, @@ -183,7 +191,9 @@ class IssuerDashboardPage extends StatelessWidget { ), const SizedBox(width: 8), ElevatedButton( - onPressed: () {}, + onPressed: () { + Navigator.pushNamed(context, AppRouter.createCoupon); + }, style: ElevatedButton.styleFrom( padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), minimumSize: Size.zero, @@ -197,7 +207,7 @@ class IssuerDashboardPage extends StatelessWidget { ); } - Widget _buildCreditQuotaCard() { + Widget _buildCreditQuotaCard(BuildContext context) { return Container( padding: const EdgeInsets.all(16), decoration: BoxDecoration( @@ -232,7 +242,9 @@ class IssuerDashboardPage extends StatelessWidget { ), ), TextButton( - onPressed: () {}, + onPressed: () { + Navigator.pushNamed(context, AppRouter.credit); + }, child: const Text('提升建议'), ), ], diff --git a/frontend/admin-app/lib/features/dashboard/presentation/pages/user_portrait_page.dart b/frontend/admin-app/lib/features/dashboard/presentation/pages/user_portrait_page.dart index bc0318a..0d7181d 100644 --- a/frontend/admin-app/lib/features/dashboard/presentation/pages/user_portrait_page.dart +++ b/frontend/admin-app/lib/features/dashboard/presentation/pages/user_portrait_page.dart @@ -20,7 +20,9 @@ class UserPortraitPage extends StatelessWidget { title: const Text('用户画像'), actions: [ TextButton.icon( - onPressed: () {}, + onPressed: () { + // TODO: Export user portrait data + }, icon: const Icon(Icons.file_download_outlined, size: 18), label: const Text('导出'), ), diff --git a/frontend/admin-app/lib/features/finance/presentation/pages/finance_page.dart b/frontend/admin-app/lib/features/finance/presentation/pages/finance_page.dart index 518c45f..4a658a4 100644 --- a/frontend/admin-app/lib/features/finance/presentation/pages/finance_page.dart +++ b/frontend/admin-app/lib/features/finance/presentation/pages/finance_page.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import '../../../../app/theme/app_colors.dart'; +import '../../../../app/router.dart'; /// 财务管理页面 /// @@ -81,7 +82,9 @@ class _OverviewTab extends StatelessWidget { SizedBox( width: double.infinity, child: ElevatedButton( - onPressed: () {}, + onPressed: () { + // TODO: Show withdrawal dialog or navigate to withdrawal flow + }, style: ElevatedButton.styleFrom( backgroundColor: Colors.white, foregroundColor: AppColors.primary, @@ -200,7 +203,9 @@ class _OverviewTab extends StatelessWidget { title: const Text('自动冻结销售款', style: TextStyle(fontSize: 14)), subtitle: const Text('开启后自动冻结20%销售额以提升信用'), value: true, - onChanged: (_) {}, + onChanged: (_) { + // TODO: Toggle auto-freeze setting + }, activeColor: AppColors.primary, contentPadding: EdgeInsets.zero, ), @@ -273,7 +278,9 @@ class _ReconciliationTab extends StatelessWidget { children: [ // Generate New OutlinedButton.icon( - onPressed: () {}, + onPressed: () { + // TODO: Trigger reconciliation report generation + }, icon: const Icon(Icons.add_rounded), label: const Text('生成新对账单'), style: OutlinedButton.styleFrom( @@ -315,12 +322,16 @@ class _ReconciliationTab extends StatelessWidget { Row( children: [ TextButton.icon( - onPressed: () {}, + onPressed: () { + // TODO: Navigate to reconciliation detail view + }, icon: const Icon(Icons.visibility_rounded, size: 16), label: const Text('查看'), ), TextButton.icon( - onPressed: () {}, + onPressed: () { + // TODO: Export reconciliation report + }, icon: const Icon(Icons.download_rounded, size: 16), label: const Text('导出'), ), diff --git a/frontend/admin-app/lib/features/finance/presentation/pages/financing_analysis_page.dart b/frontend/admin-app/lib/features/finance/presentation/pages/financing_analysis_page.dart index c586969..04b7d2a 100644 --- a/frontend/admin-app/lib/features/finance/presentation/pages/financing_analysis_page.dart +++ b/frontend/admin-app/lib/features/finance/presentation/pages/financing_analysis_page.dart @@ -2,6 +2,7 @@ import 'package:flutter/material.dart'; import '../../../../app/theme/app_colors.dart'; import '../../../../app/theme/app_typography.dart'; import '../../../../app/theme/app_spacing.dart'; +import '../../../../app/router.dart'; /// 融资效果分析页面 /// @@ -18,12 +19,16 @@ class FinancingAnalysisPage extends StatelessWidget { actions: [ IconButton( icon: const Icon(Icons.refresh_rounded), - onPressed: () {}, + onPressed: () { + // TODO: Refresh financing analysis data + }, tooltip: '刷新数据', ), IconButton( icon: const Icon(Icons.download_rounded), - onPressed: () {}, + onPressed: () { + // TODO: Export financing analysis report + }, tooltip: '导出报告', ), ], @@ -54,7 +59,7 @@ class FinancingAnalysisPage extends StatelessWidget { const SizedBox(height: 24), // AI Recommendation - _buildAiRecommendation(), + _buildAiRecommendation(context), ], ), ), @@ -650,7 +655,7 @@ class FinancingAnalysisPage extends StatelessWidget { // AI Recommendation // ============================================================ - Widget _buildAiRecommendation() { + Widget _buildAiRecommendation(BuildContext context) { final recommendations = [ ( '优化融资结构', @@ -763,7 +768,9 @@ class FinancingAnalysisPage extends StatelessWidget { SizedBox( width: double.infinity, child: OutlinedButton.icon( - onPressed: () {}, + onPressed: () { + Navigator.pushNamed(context, AppRouter.aiAgent); + }, icon: const Icon(Icons.auto_awesome_rounded, size: 18), label: const Text('获取详细融资方案'), ), diff --git a/frontend/admin-app/lib/features/finance/presentation/pages/reconciliation_page.dart b/frontend/admin-app/lib/features/finance/presentation/pages/reconciliation_page.dart index 9a52307..9457dea 100644 --- a/frontend/admin-app/lib/features/finance/presentation/pages/reconciliation_page.dart +++ b/frontend/admin-app/lib/features/finance/presentation/pages/reconciliation_page.dart @@ -489,7 +489,9 @@ class _ReconciliationPageState extends State { children: [ Expanded( child: OutlinedButton.icon( - onPressed: () {}, + onPressed: () { + // TODO: Export reconciliation report as PDF + }, icon: const Icon(Icons.picture_as_pdf_rounded, size: 18), label: const Text('导出 PDF'), style: OutlinedButton.styleFrom( @@ -502,7 +504,9 @@ class _ReconciliationPageState extends State { const SizedBox(width: 12), Expanded( child: OutlinedButton.icon( - onPressed: () {}, + onPressed: () { + // TODO: Export reconciliation report as Excel + }, icon: const Icon(Icons.table_chart_rounded, size: 18), label: const Text('导出 Excel'), style: OutlinedButton.styleFrom( diff --git a/frontend/admin-app/lib/features/onboarding/presentation/pages/onboarding_page.dart b/frontend/admin-app/lib/features/onboarding/presentation/pages/onboarding_page.dart index 7f70de8..e178ca9 100644 --- a/frontend/admin-app/lib/features/onboarding/presentation/pages/onboarding_page.dart +++ b/frontend/admin-app/lib/features/onboarding/presentation/pages/onboarding_page.dart @@ -165,7 +165,9 @@ class _OnboardingPageState extends State { DropdownMenuItem(value: 'entertainment', child: Text('娱乐/文旅')), DropdownMenuItem(value: 'other', child: Text('其他')), ], - onChanged: (_) {}, + onChanged: (_) { + // TODO: Update selected company type + }, ), const SizedBox(height: 16), TextField( @@ -238,7 +240,9 @@ class _OnboardingPageState extends State { const Text('*必填', style: TextStyle(fontSize: 11, color: AppColors.error)), const SizedBox(height: 8), OutlinedButton.icon( - onPressed: () {}, + onPressed: () { + // TODO: Open file picker for document upload + }, icon: const Icon(Icons.upload_rounded, size: 18), label: const Text('点击上传'), ), diff --git a/frontend/admin-app/lib/features/settings/presentation/pages/settings_page.dart b/frontend/admin-app/lib/features/settings/presentation/pages/settings_page.dart index a8270c7..d5047ed 100644 --- a/frontend/admin-app/lib/features/settings/presentation/pages/settings_page.dart +++ b/frontend/admin-app/lib/features/settings/presentation/pages/settings_page.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import '../../../../app/theme/app_colors.dart'; +import '../../../../app/router.dart'; /// 发行方设置页面(我的) /// @@ -18,33 +19,51 @@ class SettingsPage extends StatelessWidget { _buildProfileCard(context), // Tier & Benefits - _buildTierCard(), + _buildTierCard(context), const SizedBox(height: 8), // Menu Groups _buildMenuGroup('企业管理', [ - _MenuItem('企业信息', Icons.business_rounded, () {}), - _MenuItem('门店管理', Icons.store_rounded, () { - Navigator.pushNamed(context, '/stores'); + _MenuItem('企业信息', Icons.business_rounded, () { + // TODO: Navigate to company info page when available + }), + _MenuItem('门店管理', Icons.store_rounded, () { + Navigator.pushNamed(context, AppRouter.storeManagement); + }), + _MenuItem('员工管理', Icons.people_rounded, () { + Navigator.pushNamed(context, AppRouter.storeManagement); + }), + _MenuItem('权限设置', Icons.admin_panel_settings_rounded, () { + // TODO: Navigate to permissions page when available }), - _MenuItem('员工管理', Icons.people_rounded, () {}), - _MenuItem('权限设置', Icons.admin_panel_settings_rounded, () {}), ]), _buildMenuGroup('服务支持', [ _MenuItem('AI 助手', Icons.auto_awesome_rounded, () { - Navigator.pushNamed(context, '/ai-agent'); + Navigator.pushNamed(context, AppRouter.aiAgent); + }), + _MenuItem('专属客服', Icons.headset_mic_rounded, () { + // TODO: Navigate to customer service page when available + }), + _MenuItem('帮助中心', Icons.help_outline_rounded, () { + // TODO: Navigate to help center page when available + }), + _MenuItem('意见反馈', Icons.feedback_rounded, () { + // TODO: Navigate to feedback page when available }), - _MenuItem('专属客服', Icons.headset_mic_rounded, () {}), - _MenuItem('帮助中心', Icons.help_outline_rounded, () {}), - _MenuItem('意见反馈', Icons.feedback_rounded, () {}), ]), _buildMenuGroup('安全与账号', [ - _MenuItem('修改密码', Icons.lock_outline_rounded, () {}), - _MenuItem('操作日志', Icons.history_rounded, () {}), - _MenuItem('关于 Genex', Icons.info_outline_rounded, () {}), + _MenuItem('修改密码', Icons.lock_outline_rounded, () { + // TODO: Navigate to change password page when available + }), + _MenuItem('操作日志', Icons.history_rounded, () { + // TODO: Navigate to operation log page when available + }), + _MenuItem('关于 Genex', Icons.info_outline_rounded, () { + // TODO: Navigate to about page when available + }), ]), // Logout @@ -54,7 +73,7 @@ class SettingsPage extends StatelessWidget { width: double.infinity, child: OutlinedButton( onPressed: () { - Navigator.pushNamedAndRemoveUntil(context, '/', (_) => false); + Navigator.pushNamedAndRemoveUntil(context, AppRouter.login, (_) => false); }, style: OutlinedButton.styleFrom( foregroundColor: AppColors.error, @@ -102,7 +121,7 @@ class SettingsPage extends StatelessWidget { ); } - Widget _buildTierCard() { + Widget _buildTierCard(BuildContext context) { return Container( margin: const EdgeInsets.fromLTRB(20, 12, 20, 0), padding: const EdgeInsets.all(16), @@ -126,7 +145,9 @@ class SettingsPage extends StatelessWidget { ), ), TextButton( - onPressed: () {}, + onPressed: () { + Navigator.pushNamed(context, AppRouter.credit); + }, child: const Text('升级', style: TextStyle(color: AppColors.tierGold)), ), ], diff --git a/frontend/admin-app/lib/features/store_management/presentation/pages/store_management_page.dart b/frontend/admin-app/lib/features/store_management/presentation/pages/store_management_page.dart index bc0375e..25935bf 100644 --- a/frontend/admin-app/lib/features/store_management/presentation/pages/store_management_page.dart +++ b/frontend/admin-app/lib/features/store_management/presentation/pages/store_management_page.dart @@ -29,7 +29,9 @@ class StoreManagementPage extends StatelessWidget { ], ), floatingActionButton: FloatingActionButton( - onPressed: () {}, + onPressed: () { + // TODO: Show add store / add employee dialog + }, backgroundColor: AppColors.primary, child: const Icon(Icons.add_rounded, color: Colors.white), ), diff --git a/frontend/mobile/lib/features/auth/presentation/pages/login_page.dart b/frontend/mobile/lib/features/auth/presentation/pages/login_page.dart index 3d88395..90b0b41 100644 --- a/frontend/mobile/lib/features/auth/presentation/pages/login_page.dart +++ b/frontend/mobile/lib/features/auth/presentation/pages/login_page.dart @@ -138,7 +138,7 @@ class _LoginPageState extends State with SingleTickerProviderStateMix alignment: Alignment.centerRight, child: GestureDetector( onTap: () { - // Navigator: → ForgotPasswordPage + Navigator.pushNamed(context, '/forgot-password'); }, child: Text('忘记密码?', style: AppTypography.labelSmall.copyWith( color: AppColors.primary, @@ -151,7 +151,7 @@ class _LoginPageState extends State with SingleTickerProviderStateMix GenexButton( label: '登录', onPressed: () { - // Auth: login with password + Navigator.pushReplacementNamed(context, '/main'); }, ), ], @@ -204,7 +204,7 @@ class _LoginPageState extends State with SingleTickerProviderStateMix GenexButton( label: '登录', onPressed: () { - // Auth: login with SMS code + Navigator.pushReplacementNamed(context, '/main'); }, ), ], diff --git a/frontend/mobile/lib/features/auth/presentation/pages/register_page.dart b/frontend/mobile/lib/features/auth/presentation/pages/register_page.dart index d2f0343..697fd2c 100644 --- a/frontend/mobile/lib/features/auth/presentation/pages/register_page.dart +++ b/frontend/mobile/lib/features/auth/presentation/pages/register_page.dart @@ -182,7 +182,7 @@ class _RegisterPageState extends State { GenexButton( label: '注册', onPressed: _agreeTerms ? () { - // Auth: register → silent MPC wallet creation + Navigator.pushReplacementNamed(context, '/main'); } : null, ), const SizedBox(height: 40), diff --git a/frontend/mobile/lib/features/auth/presentation/pages/welcome_page.dart b/frontend/mobile/lib/features/auth/presentation/pages/welcome_page.dart index aa44f48..c0800c5 100644 --- a/frontend/mobile/lib/features/auth/presentation/pages/welcome_page.dart +++ b/frontend/mobile/lib/features/auth/presentation/pages/welcome_page.dart @@ -62,7 +62,7 @@ class WelcomePage extends StatelessWidget { label: '手机号注册', icon: Icons.phone_android_rounded, onPressed: () { - // Navigator: → PhoneRegisterPage + Navigator.pushNamed(context, '/register'); }, ), const SizedBox(height: 12), @@ -73,7 +73,7 @@ class WelcomePage extends StatelessWidget { icon: Icons.email_outlined, variant: GenexButtonVariant.outline, onPressed: () { - // Navigator: → EmailRegisterPage + Navigator.pushNamed(context, '/register'); }, ), const SizedBox(height: 24), @@ -98,13 +98,17 @@ class WelcomePage extends StatelessWidget { _SocialLoginButton( icon: Icons.g_mobiledata_rounded, label: 'Google', - onTap: () {}, + onTap: () { + Navigator.pushReplacementNamed(context, '/main'); + }, ), const SizedBox(width: 24), _SocialLoginButton( icon: Icons.apple_rounded, label: 'Apple', - onTap: () {}, + onTap: () { + Navigator.pushReplacementNamed(context, '/main'); + }, ), ], ), @@ -119,7 +123,7 @@ class WelcomePage extends StatelessWidget { )), GestureDetector( onTap: () { - // Navigator: → LoginPage + Navigator.pushNamed(context, '/login'); }, child: Text('登录', style: AppTypography.labelMedium.copyWith( color: AppColors.primary, diff --git a/frontend/mobile/lib/features/coupons/presentation/pages/coupon_detail_page.dart b/frontend/mobile/lib/features/coupons/presentation/pages/coupon_detail_page.dart index 33e03bc..7484832 100644 --- a/frontend/mobile/lib/features/coupons/presentation/pages/coupon_detail_page.dart +++ b/frontend/mobile/lib/features/coupons/presentation/pages/coupon_detail_page.dart @@ -187,7 +187,7 @@ class CouponDetailPage extends StatelessWidget { child: GenexButton( label: '立即购买 \$21.25', onPressed: () { - // Navigator: → OrderConfirmPage + Navigator.pushNamed(context, '/order/confirm'); }, ), ), diff --git a/frontend/mobile/lib/features/coupons/presentation/pages/home_page.dart b/frontend/mobile/lib/features/coupons/presentation/pages/home_page.dart index ee0fdd9..e551760 100644 --- a/frontend/mobile/lib/features/coupons/presentation/pages/home_page.dart +++ b/frontend/mobile/lib/features/coupons/presentation/pages/home_page.dart @@ -25,7 +25,7 @@ class HomePage extends StatelessWidget { backgroundColor: AppColors.background, elevation: 0, toolbarHeight: 60, - title: _buildSearchBar(), + title: _buildSearchBar(context), actions: [ IconButton( icon: const Icon(Icons.qr_code_scanner_rounded, size: 24), @@ -78,7 +78,7 @@ class HomePage extends StatelessWidget { creditRating: _mockRatings[index % _mockRatings.length], expiryDate: DateTime.now().add(Duration(days: (index + 1) * 5)), onTap: () { - // Navigator: → CouponDetailPage + Navigator.pushNamed(context, '/coupon/detail'); }, ), ), @@ -98,7 +98,7 @@ class HomePage extends StatelessWidget { child: AiFab( unreadCount: 3, onTap: () { - // Show AI Chat Panel + Navigator.pushNamed(context, '/ai-chat'); }, ), ), @@ -107,10 +107,10 @@ class HomePage extends StatelessWidget { ); } - Widget _buildSearchBar() { + Widget _buildSearchBar(BuildContext context) { return GestureDetector( onTap: () { - // Navigator: → SearchPage + Navigator.pushNamed(context, '/search'); }, child: Container( height: 40, diff --git a/frontend/mobile/lib/features/coupons/presentation/pages/market_page.dart b/frontend/mobile/lib/features/coupons/presentation/pages/market_page.dart index 531e498..d6204dd 100644 --- a/frontend/mobile/lib/features/coupons/presentation/pages/market_page.dart +++ b/frontend/mobile/lib/features/coupons/presentation/pages/market_page.dart @@ -172,7 +172,7 @@ class _MarketPageState extends State with SingleTickerProviderStateM creditRating: index % 3 == 0 ? 'AAA' : (index % 3 == 1 ? 'AA' : 'A'), expiryDate: DateTime.now().add(Duration(days: (index + 1) * 10)), onTap: () { - // Navigator: → CouponDetailPage + Navigator.pushNamed(context, '/coupon/detail'); }, ); }, diff --git a/frontend/mobile/lib/features/coupons/presentation/pages/my_coupon_detail_page.dart b/frontend/mobile/lib/features/coupons/presentation/pages/my_coupon_detail_page.dart index 36a774c..0fef4df 100644 --- a/frontend/mobile/lib/features/coupons/presentation/pages/my_coupon_detail_page.dart +++ b/frontend/mobile/lib/features/coupons/presentation/pages/my_coupon_detail_page.dart @@ -154,7 +154,7 @@ class MyCouponDetailPage extends StatelessWidget { icon: Icons.card_giftcard_rounded, variant: GenexButtonVariant.secondary, onPressed: () { - // Navigator: → TransferPage + Navigator.pushNamed(context, '/transfer'); }, ), ), @@ -165,7 +165,7 @@ class MyCouponDetailPage extends StatelessWidget { icon: Icons.sell_rounded, variant: GenexButtonVariant.outline, onPressed: () { - // Navigator: → SellPage + Navigator.pushNamed(context, '/sell'); }, ), ), diff --git a/frontend/mobile/lib/features/coupons/presentation/pages/my_coupons_page.dart b/frontend/mobile/lib/features/coupons/presentation/pages/my_coupons_page.dart index 77a13f9..139db64 100644 --- a/frontend/mobile/lib/features/coupons/presentation/pages/my_coupons_page.dart +++ b/frontend/mobile/lib/features/coupons/presentation/pages/my_coupons_page.dart @@ -71,7 +71,7 @@ class _MyCouponsPageState extends State if (filter == CouponStatus.expired) { return EmptyState.noCoupons( onBrowse: () { - // Navigator: → MarketPage + // noop - market tab accessible from bottom nav }, ); } @@ -94,7 +94,7 @@ class _MyCouponsPageState extends State status: filter ?? CouponStatus.active, expiryDate: DateTime.now().add(Duration(days: (index + 1) * 7)), onTap: () { - // Navigator: → MyCouponDetailPage + Navigator.pushNamed(context, '/coupon/mine/detail'); }, ); }, diff --git a/frontend/mobile/lib/features/coupons/presentation/pages/order_confirm_page.dart b/frontend/mobile/lib/features/coupons/presentation/pages/order_confirm_page.dart index cc65e03..65ca215 100644 --- a/frontend/mobile/lib/features/coupons/presentation/pages/order_confirm_page.dart +++ b/frontend/mobile/lib/features/coupons/presentation/pages/order_confirm_page.dart @@ -363,7 +363,10 @@ class _OrderConfirmPageState extends State { GenexButton( label: '使用密码支付', variant: GenexButtonVariant.text, - onPressed: () {}, + onPressed: () { + Navigator.pop(ctx); + Navigator.pushNamed(context, '/payment'); + }, ), ], ), diff --git a/frontend/mobile/lib/features/coupons/presentation/pages/payment_page.dart b/frontend/mobile/lib/features/coupons/presentation/pages/payment_page.dart index 4688e06..a45e207 100644 --- a/frontend/mobile/lib/features/coupons/presentation/pages/payment_page.dart +++ b/frontend/mobile/lib/features/coupons/presentation/pages/payment_page.dart @@ -123,7 +123,7 @@ class _PaymentPageState extends State { child: ElevatedButton( onPressed: () { // 后端自动完成法币→稳定币→链上原子交换 - Navigator.pushNamed(context, '/payment-success'); + Navigator.pushNamed(context, '/payment/success'); }, child: const Text('确认支付 \$21.25'), ), diff --git a/frontend/mobile/lib/features/coupons/presentation/pages/payment_success_page.dart b/frontend/mobile/lib/features/coupons/presentation/pages/payment_success_page.dart index 935ed2d..27ae308 100644 --- a/frontend/mobile/lib/features/coupons/presentation/pages/payment_success_page.dart +++ b/frontend/mobile/lib/features/coupons/presentation/pages/payment_success_page.dart @@ -87,7 +87,7 @@ class PaymentSuccessPage extends StatelessWidget { GenexButton( label: '查看我的券', onPressed: () { - // Navigator: → MyCouponsPage + Navigator.pushNamedAndRemoveUntil(context, '/main', (route) => false); }, ), const SizedBox(height: 12), @@ -95,7 +95,7 @@ class PaymentSuccessPage extends StatelessWidget { label: '继续逛', variant: GenexButtonVariant.outline, onPressed: () { - // Navigator: → HomePage (popUntil) + Navigator.pushNamedAndRemoveUntil(context, '/main', (route) => false); }, ), const SizedBox(height: 24), diff --git a/frontend/mobile/lib/features/coupons/presentation/pages/search_page.dart b/frontend/mobile/lib/features/coupons/presentation/pages/search_page.dart index dae5fdd..3938fc7 100644 --- a/frontend/mobile/lib/features/coupons/presentation/pages/search_page.dart +++ b/frontend/mobile/lib/features/coupons/presentation/pages/search_page.dart @@ -139,7 +139,9 @@ class _SearchPageState extends State { currentPrice: [21.25, 85.0, 42.5, 24.0, 68.0][index], creditRating: 'AAA', expiryDate: DateTime.now().add(Duration(days: (index + 1) * 10)), - onTap: () {}, + onTap: () { + Navigator.pushNamed(context, '/coupon/detail'); + }, ), ); }, diff --git a/frontend/mobile/lib/features/message/presentation/pages/message_page.dart b/frontend/mobile/lib/features/message/presentation/pages/message_page.dart index 25b9fa9..e01960f 100644 --- a/frontend/mobile/lib/features/message/presentation/pages/message_page.dart +++ b/frontend/mobile/lib/features/message/presentation/pages/message_page.dart @@ -128,7 +128,7 @@ class _MessagePageState extends State ) : null, onTap: () { - // Navigator: → MessageDetailPage (with associated action) + Navigator.pushNamed(context, '/message/detail'); }, ); } diff --git a/frontend/mobile/lib/features/profile/presentation/pages/profile_page.dart b/frontend/mobile/lib/features/profile/presentation/pages/profile_page.dart index 69bdb91..aa90437 100644 --- a/frontend/mobile/lib/features/profile/presentation/pages/profile_page.dart +++ b/frontend/mobile/lib/features/profile/presentation/pages/profile_page.dart @@ -17,21 +17,26 @@ class ProfilePage extends StatelessWidget { body: CustomScrollView( slivers: [ // Profile Header - SliverToBoxAdapter(child: _buildProfileHeader()), + SliverToBoxAdapter(child: _buildProfileHeader(context)), // Quick Stats SliverToBoxAdapter(child: _buildQuickStats()), // Menu Sections SliverToBoxAdapter(child: _buildMenuSection('账户', [ - _MenuItem(Icons.verified_user_outlined, 'KYC 认证', '已完成 L1 认证', true), - _MenuItem(Icons.credit_card_rounded, '支付管理', '已绑定 2 张卡', true), - _MenuItem(Icons.account_balance_wallet_outlined, '我的余额', '\$1,234.56', true), + _MenuItem(Icons.verified_user_outlined, 'KYC 认证', '已完成 L1 认证', true, + onTap: () => Navigator.pushNamed(context, '/kyc')), + _MenuItem(Icons.credit_card_rounded, '支付管理', '已绑定 2 张卡', true, + onTap: () => Navigator.pushNamed(context, '/payment/manage')), + _MenuItem(Icons.account_balance_wallet_outlined, '我的余额', '\$1,234.56', true, + onTap: () => Navigator.pushNamed(context, '/wallet')), ])), SliverToBoxAdapter(child: _buildMenuSection('交易', [ - _MenuItem(Icons.receipt_long_rounded, '交易记录', '', true), - _MenuItem(Icons.storefront_rounded, '我的挂单', '2笔出售中', true), + _MenuItem(Icons.receipt_long_rounded, '交易记录', '', true, + onTap: () => Navigator.pushNamed(context, '/trading')), + _MenuItem(Icons.storefront_rounded, '我的挂单', '2笔出售中', true, + onTap: () => Navigator.pushNamed(context, '/trading')), _MenuItem(Icons.favorite_border_rounded, '我的收藏', '', true), ])), @@ -39,7 +44,8 @@ class ProfilePage extends StatelessWidget { _MenuItem(Icons.notifications_outlined, '通知设置', '', true), _MenuItem(Icons.language_rounded, '语言', '简体中文', true), _MenuItem(Icons.shield_outlined, '安全设置', '', true), - _MenuItem(Icons.tune_rounded, '高级设置', 'Pro模式', true), + _MenuItem(Icons.tune_rounded, '高级设置', 'Pro模式', true, + onTap: () => Navigator.pushNamed(context, '/pro-mode')), _MenuItem(Icons.info_outline_rounded, '关于 Genex', 'v1.0.0', true), ])), @@ -48,7 +54,9 @@ class ProfilePage extends StatelessWidget { child: Padding( padding: const EdgeInsets.fromLTRB(20, 8, 20, 40), child: TextButton( - onPressed: () {}, + onPressed: () { + Navigator.of(context).pushNamedAndRemoveUntil('/', (_) => false); + }, child: Text('退出登录', style: AppTypography.labelMedium.copyWith( color: AppColors.error, )), @@ -62,7 +70,7 @@ class ProfilePage extends StatelessWidget { ); } - Widget _buildProfileHeader() { + Widget _buildProfileHeader(BuildContext context) { return Container( padding: const EdgeInsets.fromLTRB(20, 60, 20, 24), decoration: const BoxDecoration( @@ -122,7 +130,9 @@ class ProfilePage extends StatelessWidget { // Settings icon IconButton( icon: const Icon(Icons.settings_outlined, color: Colors.white), - onPressed: () {}, + onPressed: () { + Navigator.pushNamed(context, '/settings'); + }, ), ], ), @@ -195,7 +205,7 @@ class ProfilePage extends StatelessWidget { ], ], ), - onTap: () {}, + onTap: item.onTap ?? () {}, ), if (!isLast) const Divider(indent: 56, height: 1), @@ -215,6 +225,7 @@ class _MenuItem { final String title; final String subtitle; final bool hasArrow; + final VoidCallback? onTap; - const _MenuItem(this.icon, this.title, this.subtitle, this.hasArrow); + const _MenuItem(this.icon, this.title, this.subtitle, this.hasArrow, {this.onTap}); } diff --git a/frontend/mobile/lib/features/profile/presentation/pages/settings_page.dart b/frontend/mobile/lib/features/profile/presentation/pages/settings_page.dart index 490c4d2..7249d8a 100644 --- a/frontend/mobile/lib/features/profile/presentation/pages/settings_page.dart +++ b/frontend/mobile/lib/features/profile/presentation/pages/settings_page.dart @@ -19,7 +19,9 @@ class SettingsPage extends StatelessWidget { _buildTile('手机号', subtitle: '138****8888', icon: Icons.phone_rounded), _buildTile('邮箱', subtitle: 'u***@email.com', icon: Icons.email_rounded), _buildTile('修改密码', icon: Icons.lock_rounded), - _buildTile('身份认证', subtitle: 'L1 基础认证', icon: Icons.verified_user_rounded, onTap: () {}), + _buildTile('身份认证', subtitle: 'L1 基础认证', icon: Icons.verified_user_rounded, onTap: () { + Navigator.pushNamed(context, '/kyc'); + }), ]), // Payment @@ -56,7 +58,9 @@ class SettingsPage extends StatelessWidget { Padding( padding: const EdgeInsets.all(20), child: OutlinedButton( - onPressed: () {}, + onPressed: () { + Navigator.of(context).pushNamedAndRemoveUntil('/', (_) => false); + }, style: OutlinedButton.styleFrom( foregroundColor: AppColors.error, side: const BorderSide(color: AppColors.error), diff --git a/frontend/mobile/lib/features/wallet/presentation/pages/wallet_page.dart b/frontend/mobile/lib/features/wallet/presentation/pages/wallet_page.dart index e85e476..00559ef 100644 --- a/frontend/mobile/lib/features/wallet/presentation/pages/wallet_page.dart +++ b/frontend/mobile/lib/features/wallet/presentation/pages/wallet_page.dart @@ -33,7 +33,9 @@ class WalletPage extends StatelessWidget { label: '充值', icon: Icons.add_rounded, variant: GenexButtonVariant.primary, - onPressed: () {}, + onPressed: () { + Navigator.pushNamed(context, '/wallet/deposit'); + }, ), ), const SizedBox(width: 12), @@ -42,7 +44,9 @@ class WalletPage extends StatelessWidget { label: '提现', icon: Icons.account_balance_rounded, variant: GenexButtonVariant.outline, - onPressed: () {}, + onPressed: () { + Navigator.pushNamed(context, '/wallet/withdraw'); + }, ), ), ], @@ -58,7 +62,9 @@ class WalletPage extends StatelessWidget { children: [ Text('交易记录', style: AppTypography.h3), GestureDetector( - onTap: () {}, + onTap: () { + Navigator.pushNamed(context, '/wallet/records'); + }, child: Row( children: [ Text('筛选', style: AppTypography.labelSmall.copyWith(