feat(client/orders): 订单列表/详情显示 expired 过期态
- _statusPill 函数加 'expired' => neutral 灰状态胶囊(复用 canceled 视觉档) - actions() 函数让 expired 单复用 created 分支,显示「继续支付」按钮 - 对接后端 Task 0 返回的 status=='expired' + Task 2 的 t.orderStatusExpired Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -35,12 +35,13 @@ String _methodName(AppText t, String method) => switch (method) {
|
||||
_ => method,
|
||||
};
|
||||
|
||||
/// 订单状态 → (胶囊色, 文案)。created=等待付款 / paid=已开通 / canceled=已取消。
|
||||
/// 订单状态 → (胶囊色, 文案)。created=等待付款 / paid=已开通 / canceled=已取消 / expired=已过期。
|
||||
({PangolinStatus status, String label}) _statusPill(AppText t, String status) =>
|
||||
switch (status) {
|
||||
'created' => (status: PangolinStatus.connecting, label: t.awaitingPayment),
|
||||
'paid' => (status: PangolinStatus.connected, label: t.orderStatusPaid),
|
||||
'canceled' => (status: PangolinStatus.neutral, label: t.orderStatusCanceled),
|
||||
'expired' => (status: PangolinStatus.neutral, label: t.orderStatusExpired),
|
||||
_ => (status: PangolinStatus.neutral, label: status),
|
||||
};
|
||||
|
||||
@@ -327,6 +328,7 @@ class _OrderDetailView extends ConsumerWidget {
|
||||
final list = <Widget>[];
|
||||
switch (o.status) {
|
||||
case 'created':
|
||||
case 'expired':
|
||||
list.add(PangolinButton(label: t.orderContinuePay, expand: true, onPressed: () => _goPurchase(context, ref)));
|
||||
case 'canceled':
|
||||
list.add(PangolinButton(label: t.orderRebuy, expand: true, onPressed: () => _goPurchase(context, ref)));
|
||||
|
||||
Reference in New Issue
Block a user