feat(client): pay v2 支付渠道 switch + 订单列表/详情端到端
购买/支付(Phase B): - 新 SegSwitch 段控 widget(镜像 .segswitch 原子) - 购买页重构:顶部支付渠道 switch(默认 USDT→加密货币 / 人民币→支付宝),套餐价随渠道分币种显示,删底部弹窗选方式;点购买直达支付页 - 支付页加订单信息卡(套餐/渠道/金额按币种) - models:PayChannel + PayCatalogItem.priceUsdtMicro/priceLabel(ch)/perMonthLabel(ch) 订单(P0,全新): - payment_api.listOrders() + orders_provider(列表 + 详情 family) - OrdersScreen 列表→详情(状态 pill / 可复制订单号 / 继续支付·重新购买) - 导航:NavView.orders + desktop_shell 分支 + account 入口 配套: - l10n +19 getter(支付渠道 4 + 订单 15)×6 语言,l10n 闸绿 - 图标单源迁移 lucide_icons_flutter + pangolin_icons.dart(codegen) - 联系渠道订正(Telegram/邮件 support@yanmeiai.com/官网) + 前端去广告&时长 - 测试:购买 switch 分币种 + 订单列表/空态/详情 + 假 API listOrders;golden 重录 - flutter analyze 0 error,flutter test 226 全绿 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013nMthbVEmQquxBRKb9Fj8u
This commit is contained in:
@@ -9,6 +9,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
import '../l10n/app_text.dart';
|
||||
import '../models/payment.dart';
|
||||
import '../pangolin_theme.dart';
|
||||
import '../state/payment_provider.dart';
|
||||
import '../widgets/pangolin_button.dart';
|
||||
@@ -132,6 +133,48 @@ class _PaymentScreenState extends ConsumerState<PaymentScreen> {
|
||||
);
|
||||
}
|
||||
|
||||
String _planName(String sku) => switch (sku) {
|
||||
'pro_month' => t.proMonthly,
|
||||
'pro_quarter' => t.proQuarterly,
|
||||
'pro_year' => t.proYearly,
|
||||
_ => sku,
|
||||
};
|
||||
|
||||
// 订单信息卡:套餐名 + 支付渠道 + 金额(金额按所选渠道币种显价)。
|
||||
Widget _orderCard(BuildContext context, PaymentFlowState s) {
|
||||
final c = context.pangolin;
|
||||
final ch = s.method == 'crypto' ? PayChannel.usdt : PayChannel.cny;
|
||||
final chanLabel = ch == PayChannel.usdt ? t.payChannelUsdt : t.payChannelCny;
|
||||
final item = s.item;
|
||||
return _card(c, child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
|
||||
Text(t.orderDetailTitle.toUpperCase(),
|
||||
style: PangolinText.caption
|
||||
.copyWith(color: c.fg3, fontWeight: FontWeight.w700, letterSpacing: 0.6)),
|
||||
const SizedBox(height: 10),
|
||||
if (item != null) _orderRow(c, t.orderPlanLabel, _planName(item.sku)),
|
||||
_orderRow(c, t.payChannel, chanLabel),
|
||||
if (item != null) _orderRow(c, t.orderAmountLabel, item.priceLabel(ch), amount: true),
|
||||
]));
|
||||
}
|
||||
|
||||
Widget _orderRow(PangolinScheme c, String k, String v, {bool amount = false}) => Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 4),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.baseline,
|
||||
textBaseline: TextBaseline.alphabetic,
|
||||
children: [
|
||||
Text(k, style: PangolinText.sm.copyWith(color: c.fg3)),
|
||||
Flexible(
|
||||
child: Text(v,
|
||||
textAlign: TextAlign.right,
|
||||
style: (amount ? PangolinText.mono : PangolinText.sm).copyWith(
|
||||
color: amount ? c.accent : c.fg1, fontWeight: FontWeight.w700)),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
Widget _awaiting(BuildContext context, WidgetRef ref, PaymentFlowState s) {
|
||||
final c = context.pangolin;
|
||||
final session = s.order!.session;
|
||||
@@ -171,6 +214,8 @@ class _PaymentScreenState extends ConsumerState<PaymentScreen> {
|
||||
}
|
||||
|
||||
return ListView(padding: const EdgeInsets.fromLTRB(20, 14, 20, 24), children: [
|
||||
_orderCard(context, s),
|
||||
const SizedBox(height: 14),
|
||||
renderBody,
|
||||
const SizedBox(height: 16),
|
||||
Row(children: [
|
||||
|
||||
Reference in New Issue
Block a user