272eca04ce
购买/支付(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
86 lines
3.2 KiB
Dart
86 lines
3.2 KiB
Dart
// tablet_shell.dart — 平板外壳(侧栏 4 项触控 + 内容区),对照 ui_kits/tablet/tabapp.jsx
|
|
//
|
|
// 与 desktop 区别:侧栏 232 触控尺寸、4 项(无联系/设置)、顶栏无主题切换;
|
|
// 连接页自动走双栏(connect_page 在 formFactor==tablet 时进 isWide 分支)。
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
|
|
import '../pangolin_theme.dart';
|
|
import '../screens/account_page.dart';
|
|
import '../screens/connect_page.dart';
|
|
import '../screens/contact_page.dart';
|
|
import '../screens/nodes_page.dart';
|
|
import '../screens/settings_page.dart';
|
|
import '../screens/stats_page.dart';
|
|
import '../state/app_providers.dart';
|
|
import '../state/navigation_provider.dart';
|
|
import '../widgets/content_top_bar.dart';
|
|
import '../widgets/nav_sidebar.dart';
|
|
import '../widgets/pangolin_icons.dart';
|
|
|
|
class TabletShell extends ConsumerWidget {
|
|
const TabletShell({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context, WidgetRef ref) {
|
|
final c = context.pangolin;
|
|
final t = ref.watch(appTextProvider);
|
|
final view = ref.watch(navViewProvider);
|
|
|
|
// 「我的」移到侧栏顶部品牌按钮(见 NavSidebar);设置/联系我们对齐桌面侧栏。
|
|
final items = <NavSidebarItem>[
|
|
(icon: PangolinIcons.power, label: t.tabConnect, view: NavView.connect),
|
|
(icon: PangolinIcons.globe, label: t.tabServers, view: NavView.servers),
|
|
(icon: PangolinIcons.chartNoAxesColumn, label: t.tabStats, view: NavView.stats),
|
|
(icon: PangolinIcons.settings, label: t.settingsTitle, view: NavView.settings),
|
|
(icon: PangolinIcons.messageCircle, label: t.contactTitle, view: NavView.contact),
|
|
];
|
|
|
|
final titles = <NavView, String>{
|
|
NavView.connect: t.tabConnect,
|
|
NavView.servers: t.tabServers,
|
|
NavView.stats: t.tabStats,
|
|
NavView.account: t.tabMe,
|
|
NavView.settings: t.settingsTitle,
|
|
NavView.contact: t.contactTitle,
|
|
};
|
|
|
|
void go(NavView v) => ref.read(navViewProvider.notifier).state = v;
|
|
|
|
Widget content() {
|
|
switch (view) {
|
|
case NavView.connect:
|
|
return ConnectPage(isWide: true, onOpenNodes: () => go(NavView.servers));
|
|
case NavView.servers:
|
|
return NodesPage(isWide: true, onPicked: () => go(NavView.connect));
|
|
case NavView.stats:
|
|
return const StatsPage(isWide: true);
|
|
case NavView.settings:
|
|
return const SettingsPage();
|
|
case NavView.contact:
|
|
return const ContactPage();
|
|
default: // account / plans / redeem / devices → 账户(其余下钻在账户页内)
|
|
return const AccountPage(isWide: true);
|
|
}
|
|
}
|
|
|
|
return ColoredBox(
|
|
color: c.bg,
|
|
// iPad 上内容会顶到状态栏(时间/电量/notch)。SafeArea 加顶部安全区,避开重叠;
|
|
// 底部留给页面自行处理(home indicator)。
|
|
child: SafeArea(
|
|
bottom: false,
|
|
child: Row(children: [
|
|
NavSidebar(items: items, width: 232, dense: false),
|
|
Expanded(
|
|
child: Column(children: [
|
|
ContentTopBar(title: titles[view] ?? t.tabMe, showThemeToggle: false, titleSize: 19),
|
|
Expanded(child: content()),
|
|
]),
|
|
),
|
|
]),
|
|
),
|
|
);
|
|
}
|
|
}
|