refactor(contact): 渠道抽单源常量 + RedeemScreen 删去哪买引流卡(仅留兑换码)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
wangjia
2026-07-12 17:30:25 +08:00
parent 3a270cbeb0
commit c520449002
3 changed files with 51 additions and 42 deletions
+14 -37
View File
@@ -11,6 +11,7 @@ import '../l10n/app_text.dart';
import '../models/device.dart';
import '../pangolin_theme.dart';
import '../services/channel_launch.dart';
import '../services/contact_channels.dart';
import '../screens/settings_page.dart';
import '../services/device_identity.dart';
import 'adaptive_menu.dart';
@@ -374,11 +375,6 @@ class _RedeemScreenState extends ConsumerState<RedeemScreen> {
Widget build(BuildContext context) {
final c = context.pangolin;
final t = widget.t;
final channels = [
(icon: PangolinIcons.send, name: 'Telegram', sub: '@pangolin_app', accent: true),
(icon: PangolinIcons.mail, name: t.chEmail, sub: 'support@yanmeiai.com', accent: false),
(icon: PangolinIcons.globe, name: t.contactWebsite, sub: 'pangolin.yanmeiai.com', accent: false),
];
return _SubScaffold(
title: t.redeemTitle,
onBack: widget.onBack,
@@ -417,36 +413,9 @@ class _RedeemScreenState extends ConsumerState<RedeemScreen> {
],
]),
),
const SizedBox(height: 22),
Text(t.buyTitle, style: PangolinText.sm.copyWith(color: c.fg1, fontWeight: FontWeight.w700, fontSize: 14.5)),
const SizedBox(height: 6),
Text(t.buySub, style: PangolinText.caption.copyWith(color: c.fg3, fontWeight: FontWeight.w400, height: 1.5)),
const SizedBox(height: 14),
for (final ch in channels) Padding(padding: const EdgeInsets.only(bottom: 10), child: _channel(c, ch.icon, ch.name, ch.sub, ch.accent)),
]),
);
}
Widget _channel(PangolinScheme c, IconData icon, String name, String sub, bool accent) {
return InkWell(
borderRadius: BorderRadius.circular(PangolinRadius.lg),
onTap: () => launchChannel(sub),
child: Container(
padding: const EdgeInsets.all(14),
decoration: BoxDecoration(color: accent ? c.accentSubtle : c.surface, borderRadius: BorderRadius.circular(PangolinRadius.lg), border: Border.all(color: accent ? c.accentBorder : c.border), boxShadow: PangolinShadow.sm),
child: Row(children: [
Container(width: 40, height: 40, decoration: BoxDecoration(color: accent ? c.accent : c.bgSubtle, borderRadius: BorderRadius.circular(PangolinRadius.md)),
child: Icon(icon, size: 20, color: accent ? PangolinColors.white : c.accent)),
const SizedBox(width: 13),
Expanded(child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
Text(name, style: PangolinText.body.copyWith(color: c.fg1, fontWeight: FontWeight.w600)),
Text(sub, style: PangolinText.caption.copyWith(color: c.fg3, fontWeight: FontWeight.w400)),
])),
Icon(PangolinIcons.externalLink, size: 16, color: c.fg3),
]),
),
);
}
}
/// ── 联系我们 ──
@@ -458,11 +427,19 @@ class ContactScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
final c = context.pangolin;
final channels = [
(icon: PangolinIcons.send, name: 'Telegram', sub: '@pangolin_app', accent: true),
(icon: PangolinIcons.mail, name: t.contactEmail, sub: 'support@yanmeiai.com', accent: false),
(icon: PangolinIcons.globe, name: t.contactWebsite, sub: 'pangolin.yanmeiai.com', accent: false),
];
final channels = kContactChannels
.map((ch) => (
icon: ch.icon,
name: switch (ch.nameKey) {
'telegram' => 'Telegram',
'email' => t.contactEmail,
'website' => t.contactWebsite,
_ => ch.nameKey,
},
sub: ch.sub,
accent: ch.accent,
))
.toList();
return _SubScaffold(
title: t.contactTitle,
onBack: onBack,