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 af678e9a..4e0efa69 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 @@ -3996,6 +3996,11 @@ class _ProfilePageState extends ConsumerState { title: '自助申请授权', onTap: _goToAuthorizationApply, ), + _buildSettingItem( + icon: Icons.headset_mic, + title: '联系客服', + onTap: _showCustomerServiceDialog, + ), ], ), ); @@ -4238,6 +4243,203 @@ class _ProfilePageState extends ConsumerState { context.push(RoutePaths.accountSwitch); } + /// 显示客服联系方式弹窗 + void _showCustomerServiceDialog() { + showDialog( + context: context, + builder: (context) => Dialog( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(16), + ), + child: Container( + padding: const EdgeInsets.all(24), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(16), + ), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + // 标题 + const Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Icon( + Icons.headset_mic, + size: 28, + color: Color(0xFFD4AF37), + ), + SizedBox(width: 8), + Text( + '联系客服', + style: TextStyle( + fontSize: 20, + fontFamily: 'Inter', + fontWeight: FontWeight.w700, + color: Color(0xFF5D4037), + ), + ), + ], + ), + const SizedBox(height: 24), + // QQ客服 + _buildContactItem( + icon: 'assets/icons/qq_icon.png', + iconFallback: Icons.chat_bubble, + label: 'QQ客服', + value: '123456789', + onCopy: () => _copyToClipboard('123456789', 'QQ号'), + ), + const SizedBox(height: 16), + // 微信客服 + _buildContactItem( + icon: 'assets/icons/wechat_icon.png', + iconFallback: Icons.message, + label: '微信客服', + value: 'durian_service', + onCopy: () => _copyToClipboard('durian_service', '微信号'), + ), + const SizedBox(height: 24), + // 关闭按钮 + SizedBox( + width: double.infinity, + child: TextButton( + onPressed: () => Navigator.of(context).pop(), + style: TextButton.styleFrom( + backgroundColor: const Color(0xFFFFF5E6), + padding: const EdgeInsets.symmetric(vertical: 12), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(8), + ), + ), + child: const Text( + '关闭', + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + color: Color(0xFF5D4037), + ), + ), + ), + ), + ], + ), + ), + ), + ); + } + + /// 构建联系方式项 + Widget _buildContactItem({ + required String icon, + required IconData iconFallback, + required String label, + required String value, + required VoidCallback onCopy, + }) { + return Container( + padding: const EdgeInsets.all(16), + decoration: BoxDecoration( + color: const Color(0xFFFFF5E6), + borderRadius: BorderRadius.circular(12), + border: Border.all( + color: const Color(0x33D4AF37), + width: 1, + ), + ), + child: Row( + children: [ + // 图标 + Container( + width: 40, + height: 40, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8), + ), + child: Center( + child: Icon( + iconFallback, + size: 24, + color: const Color(0xFFD4AF37), + ), + ), + ), + const SizedBox(width: 12), + // 标签和值 + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + label, + style: const TextStyle( + fontSize: 12, + fontFamily: 'Inter', + fontWeight: FontWeight.w500, + color: Color(0xFF8B5A2B), + ), + ), + const SizedBox(height: 2), + Text( + value, + style: const TextStyle( + fontSize: 16, + fontFamily: 'Inter', + fontWeight: FontWeight.w600, + color: Color(0xFF5D4037), + ), + ), + ], + ), + ), + // 复制按钮 + GestureDetector( + onTap: onCopy, + child: Container( + padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 6), + decoration: BoxDecoration( + color: const Color(0xFFD4AF37), + borderRadius: BorderRadius.circular(16), + ), + child: const Row( + mainAxisSize: MainAxisSize.min, + children: [ + Icon( + Icons.copy, + size: 14, + color: Colors.white, + ), + SizedBox(width: 4), + Text( + '复制', + style: TextStyle( + fontSize: 12, + fontWeight: FontWeight.w600, + color: Colors.white, + ), + ), + ], + ), + ), + ), + ], + ), + ); + } + + /// 复制到剪贴板 + void _copyToClipboard(String text, String label) { + Clipboard.setData(ClipboardData(text: text)); + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text('$label已复制到剪贴板'), + backgroundColor: const Color(0xFF5D4037), + duration: const Duration(seconds: 2), + ), + ); + } + /// 退出登录 void _onLogout() { showDialog(