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:
@@ -13,9 +13,9 @@ import 'package:pangolin_vpn/widgets/plan_card.dart';
|
||||
import '../helpers/harness.dart';
|
||||
|
||||
const _items = [
|
||||
PayCatalogItem(sku: 'pro_month', plan: 'pro', days: 31, priceMinor: 2999, currency: 'CNY'),
|
||||
PayCatalogItem(sku: 'pro_quarter', plan: 'pro', days: 92, priceMinor: 6888, currency: 'CNY'),
|
||||
PayCatalogItem(sku: 'pro_year', plan: 'pro', days: 366, priceMinor: 19999, currency: 'CNY'),
|
||||
PayCatalogItem(sku: 'pro_month', plan: 'pro', days: 31, priceMinor: 2999, currency: 'CNY', priceUsdtMicro: 4990000),
|
||||
PayCatalogItem(sku: 'pro_quarter', plan: 'pro', days: 92, priceMinor: 6888, currency: 'CNY', priceUsdtMicro: 12990000),
|
||||
PayCatalogItem(sku: 'pro_year', plan: 'pro', days: 366, priceMinor: 19999, currency: 'CNY', priceUsdtMicro: 34990000),
|
||||
];
|
||||
|
||||
/// 轮询生命周期测试专用假 API:记 orderStatus / cancel 调用次数,其余按最小实现返回。
|
||||
@@ -26,6 +26,9 @@ class _PollingFakePaymentApi implements PaymentApi {
|
||||
@override
|
||||
Future<List<PayCatalogItem>> catalog() async => const [];
|
||||
|
||||
@override
|
||||
Future<List<PayOrderSummary>> listOrders() async => const [];
|
||||
|
||||
@override
|
||||
Future<PayOrder> createOrder({required String sku, required String method, Map<String, String>? metadata}) async =>
|
||||
const PayOrder(
|
||||
@@ -66,9 +69,15 @@ void main() {
|
||||
));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.byType(PlanCard), findsNWidgets(3));
|
||||
expect(find.text(t.proQuarterly), findsOneWidget);
|
||||
// 默认支付渠道 = USDT → 套餐价显 USDT
|
||||
expect(find.text('\$4.99'), findsOneWidget);
|
||||
expect(find.text('\$34.99'), findsOneWidget);
|
||||
// 切到人民币渠道 → 套餐价改显 ¥
|
||||
await tester.tap(find.text(t.payChannelCny));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.text('¥29.99'), findsOneWidget);
|
||||
expect(find.text('¥199.99'), findsOneWidget);
|
||||
expect(find.text(t.proQuarterly), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('支付页 crypto_address:地址/金额/复制,金额用 mono', (tester) async {
|
||||
|
||||
Reference in New Issue
Block a user