feat(mobile-app): 添加联系客服功能

在个人中心设置菜单中添加"联系客服"入口,点击后显示弹窗,
用户可以查看客服的QQ号和微信号,并支持一键复制到剪贴板。

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
hailin 2026-01-06 23:56:59 -08:00
parent efb428ef31
commit 1b237778ee
1 changed files with 202 additions and 0 deletions

View File

@ -3996,6 +3996,11 @@ class _ProfilePageState extends ConsumerState<ProfilePage> {
title: '自助申请授权',
onTap: _goToAuthorizationApply,
),
_buildSettingItem(
icon: Icons.headset_mic,
title: '联系客服',
onTap: _showCustomerServiceDialog,
),
],
),
);
@ -4238,6 +4243,203 @@ class _ProfilePageState extends ConsumerState<ProfilePage> {
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(