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:
parent
efb428ef31
commit
1b237778ee
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Reference in New Issue