feat(trade): WeChat confirm-receive component + admin status log columns

Open weappOrderConfirm in mini-user so users confirm in-app instead of
service notice; verify via get_order before completing. Show operator/remark
on admin order status timeline.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-29 16:48:44 +08:00
parent 05dffbfa15
commit 1a0afb6d39
14 changed files with 505 additions and 32 deletions
+11
View File
@@ -19,6 +19,17 @@ export const ORDER_STATUS_LABELS: Record<string, string> = {
REFUNDED: '已退款',
};
/** 订单状态流转操作人(common_event.param3 */
export const ORDER_STATUS_OPERATOR_LABELS: Record<string, string> = {
USER: '用户',
USER_ON_SITE: '用户·现场取货',
USER_WECHAT_CONFIRM: '用户·微信确认收货',
WECHAT_TRADE_MANAGE: '微信结算同步',
MOCK: 'Mock',
MOCK_PAY: 'Mock 支付',
SYSTEM: '系统',
};
/** 订单状态 Tag 颜色(Ant Design preset */
export const ORDER_STATUS_COLORS: Record<string, string> = {
PENDING_PAY: 'red',
+39 -5
View File
@@ -24,6 +24,7 @@ import {
DELIVERY_PROVIDER_LABELS,
ORDER_STATUS_COLORS,
ORDER_STATUS_LABELS,
ORDER_STATUS_OPERATOR_LABELS,
fmtTime,
} from '../lib/constants';
import { FULFILLMENT_HOLD_REASON_LABELS } from '@dukang/shared-types';
@@ -102,7 +103,13 @@ type OrderDetail = AdminOrderRow & {
listUnitPrice?: number;
items?: AdminOrderItem[];
payment?: Record<string, unknown> | null;
statusLogs?: Array<{ fromStatus: string | null; toStatus: string; createdAt: string }>;
statusLogs?: Array<{
fromStatus: string | null;
toStatus: string;
operator?: string | null;
remark?: string | null;
createdAt: string;
}>;
benefitCoupons?: Array<Record<string, unknown>>;
redeemSummary?: OrderRedeemSummary | null;
redeemRecords?: OrderRedeemRecord[];
@@ -765,13 +772,40 @@ export default function OrdersPage() {
<Typography.Title level={5} style={{ marginTop: 16 }}></Typography.Title>
<Table
size="small"
rowKey="createdAt"
rowKey={(_, i) => String(i)}
pagination={false}
dataSource={detail.statusLogs}
columns={[
{ title: '从', dataIndex: 'fromStatus', render: (v) => v || '—' },
{ title: '', dataIndex: 'toStatus', render: (v) => ORDER_STATUS_LABELS[v] || v },
{ title: '时间', dataIndex: 'createdAt', render: (v) => new Date(v).toLocaleString('zh-CN') },
{
title: '',
dataIndex: 'fromStatus',
width: 100,
render: (v) => (v ? ORDER_STATUS_LABELS[v] || v : '—'),
},
{
title: '到',
dataIndex: 'toStatus',
width: 100,
render: (v) => ORDER_STATUS_LABELS[v] || v,
},
{
title: '操作人',
dataIndex: 'operator',
width: 120,
render: (v) => ORDER_STATUS_OPERATOR_LABELS[v] || v || '—',
},
{
title: '备注',
dataIndex: 'remark',
ellipsis: true,
render: (v) => v || '—',
},
{
title: '时间',
dataIndex: 'createdAt',
width: 170,
render: (v) => new Date(v).toLocaleString('zh-CN'),
},
]}
/>
</>