fix(client): created 单详情补「取消订单」按钮(原型 pending 双按钮早有规格,代码漏)+ 自动连接 toast 3s→1.5s
ci-pangolin / Redline Scan — 脱敏 (UI 文案) (pull_request) Successful in 19s
ci-pangolin / Cleartext Scan — Android 禁明文 (pull_request) Successful in 23s
ci-pangolin / Portable SQL — 可移植性 (mysql/sqlite) (pull_request) Successful in 19s
ci-pangolin / Lint — shellcheck (pull_request) Successful in 6s
ci-pangolin / OpenAPI Sync Check (pull_request) Successful in 34s
ci-pangolin / Flutter — analyze + test (pull_request) Successful in 36s
ci-pangolin / Codegen Drift — token 生成物未漂移 (pull_request) Successful in 4s
ci-pangolin / DS-flow — 原型/跨端同源/代码色单源闸 (pull_request) Successful in 5s
ci-pangolin / Go — integration (mysql/redis testcontainers) (pull_request) Failing after 4m42s
ci-pangolin / Golden — 视觉回归 (全量:components/auth/desktop/tablet) (pull_request) Failing after 21s
ci-pangolin / E2E Smoke — L4 进程级端到端 (pull_request) Failing after 10m19s
ci-pangolin / Go — build + test (pull_request) Failing after 10m26s

- orders 详情 created 态:继续支付(主)+ 取消订单(ghost)——orders.html/ui-desktop 原型
  pending 态早已登记双按钮,Flutter 侧漏实现(代码落后原型)。取消走远程 cancel,
  失败(如其实已付,pay 409)不报错,统一 invalidate 刷新以最新状态为准。
- 自动连接「正在自动连接到 X」toast 缺省 3s 用户反馈偏长 → 1.5s(与「已复制」1.4s 同量级)。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
wangjia
2026-07-13 11:43:48 +08:00
parent 1c2ec2844d
commit 66422f92ce
3 changed files with 24 additions and 2 deletions
+5 -1
View File
@@ -229,8 +229,12 @@ class _RootFlowState extends ConsumerState<RootFlow> {
logLine('AutoConnect', 'triggering connect → ${node.code}');
ref.read(connectionProvider.notifier).toggle();
// 自动连接 toast:「正在自动连接到 X」(主显示区内居中,见 pangolin_toast)。
// 瞬态信息,1.5s 即可(默认 3s 用户反馈偏长;与「已复制」1.4s 同量级)。
final t = ref.read(appTextProvider);
if (mounted) showPangolinToast(context, t.autoConnectingTo(node.localizedName(t.lang)));
if (mounted) {
showPangolinToast(context, t.autoConnectingTo(node.localizedName(t.lang)),
duration: const Duration(milliseconds: 1500));
}
} else {
logLine('AutoConnect', 'NOT connecting (autoConnect=${settings.autoConnect} phase=$phase)');
}
+17
View File
@@ -275,6 +275,17 @@ class _OrderDetailView extends ConsumerWidget {
}
}
// 「取消订单」(created 单详情)——远程 cancel 后刷新列表/详情;失败(如已支付,
// pay 回 409)不报错,同样走刷新,以最新状态为准(已付单会显示已开通)。
Future<void> _cancelOrder(BuildContext context, WidgetRef ref) async {
try {
await ref.read(paymentApiProvider).cancel(order.orderNo);
} catch (_) {}
if (!context.mounted) return;
ref.invalidate(ordersProvider);
ref.invalidate(orderDetailProvider(order.orderNo));
}
Future<void> _copy(BuildContext context, String text) async {
await Clipboard.setData(ClipboardData(text: text));
if (context.mounted) {
@@ -346,6 +357,12 @@ class _OrderDetailView extends ConsumerWidget {
switch (o.status) {
case 'created':
list.add(PangolinButton(label: t.orderContinuePay, expand: true, onPressed: () => _resumePay(context, ref)));
// 原型 pending 态为双按钮:继续支付(主)+ 取消订单(ghost)——orders.html/ui-desktop 均已登记。
list.add(PangolinButton(
label: t.cancelOrder,
variant: PangolinButtonVariant.ghost,
expand: true,
onPressed: () => _cancelOrder(context, ref)));
// 过期单 pay 会话已失效,点击是重新下单而非续付 → 用「重新购买」避免歧义。
case 'expired':
case 'canceled':
+2 -1
View File
@@ -78,7 +78,8 @@ void main() {
// 点 created 那单(月付)进详情
await tester.tap(find.text(t.proMonthly));
await tester.pumpAndSettle();
// 详情字段行 + created 态动作继续支付
// 详情字段行 + created 态动作:继续支付(主)+ 取消订单(ghost,原型 pending 双按钮)
expect(find.text(t.cancelOrder), findsOneWidget);
expect(find.text(t.orderNoLabel), findsOneWidget);
expect(find.text(t.orderContinuePay), findsWidgets);
});