From 6677114c4660bd2fdaed5f261f513dfbc3ee8ad1 Mon Sep 17 00:00:00 2001 From: tikkhun Date: Wed, 7 Jan 2026 15:22:48 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E8=AE=A2=E5=8D=95=E9=A1=B5=E9=9D=A2):=20?= =?UTF-8?q?=E5=A2=9E=E5=BC=BA=E8=AE=A2=E5=8D=95=E5=88=97=E8=A1=A8=E5=B1=95?= =?UTF-8?q?=E7=A4=BA=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增订单号、财务状态、支付时间等字段展示 - 调整现有字段顺序和显示名称 - 优化物流信息显示逻辑 - 修改订单统计查询接口为专用计数接口 --- src/pages/Site/Shop/Duplicate/index.tsx | 0 src/pages/Site/Shop/Orders/index.tsx | 117 ++++++++++++++++++------ 2 files changed, 90 insertions(+), 27 deletions(-) create mode 100644 src/pages/Site/Shop/Duplicate/index.tsx diff --git a/src/pages/Site/Shop/Duplicate/index.tsx b/src/pages/Site/Shop/Duplicate/index.tsx new file mode 100644 index 0000000..e69de29 diff --git a/src/pages/Site/Shop/Orders/index.tsx b/src/pages/Site/Shop/Orders/index.tsx index dcb8d26..9c224b0 100644 --- a/src/pages/Site/Shop/Orders/index.tsx +++ b/src/pages/Site/Shop/Orders/index.tsx @@ -64,21 +64,19 @@ const OrdersPage: React.FC = () => { const columns: ProColumns[] = [ { - title: '订单号', + title: '订单ID', dataIndex: 'id', }, + { + title:'订单号', + dataIndex: 'number', + }, { title: '状态', dataIndex: 'status', valueType: 'select', valueEnum: ORDER_STATUS_ENUM, }, - { - title: '订单日期', - dataIndex: 'date_created', - hideInSearch: true, - valueType: 'dateTime', - }, { title: '金额', dataIndex: 'total', @@ -89,6 +87,38 @@ const OrdersPage: React.FC = () => { dataIndex: 'currency', hideInSearch: true, }, + { + title: '财务状态', + dataIndex: 'financial_status', + }, + { + title: '支付方式', + dataIndex: 'payment_method', + }, + { + title: '支付时间', + dataIndex: 'date_paid', + hideInSearch: true, + valueType: 'dateTime', + }, + { + title: '创建时间', + dataIndex: 'date_created', + hideInSearch: true, + valueType: 'dateTime', + }, + { + title: '更新时间', + dataIndex: 'date_modified', + hideInSearch: true, + valueType: 'dateTime', + }, + + { + title: '客户ID', + dataIndex: 'customer_id', + hideInSearch: true, + }, { title: '客户邮箱', dataIndex: 'email', @@ -96,6 +126,29 @@ const OrdersPage: React.FC = () => { { title: '客户姓名', dataIndex: 'customer_name', + }, + { + title: '客户IP', + dataIndex: 'customer_ip_address', + }, + { + title: '联系电话', + render: (_, record) => record.shipping?.phone || record.billing?.phone, + }, + { + title: '设备类型', + dataIndex: 'device_type', + hideInSearch: true, + }, + { + title: '来源类型', + dataIndex: 'source_type', + hideInSearch: true, + }, + { + title: 'UTM来源', + dataIndex: 'utm_source', + hideInSearch: true, }, { title: '商品', @@ -121,14 +174,6 @@ const OrdersPage: React.FC = () => { return '-'; }, }, - { - title: '支付方式', - dataIndex: 'payment_method', - }, - { - title: '联系电话', - render: (_, record) => record.shipping?.phone || record.billing?.phone, - }, { title: '账单地址', dataIndex: 'billing_full_address', @@ -144,24 +189,46 @@ const OrdersPage: React.FC = () => { width: 200, ellipsis: true, copyable: true, + }, + { + title: '发货状态', + dataIndex: 'fulfillment_status', + // hideInSearch: true, + // render: (_, record) => { + // const fulfillmentStatus = record.fulfillment_status; + // const fulfillmentStatusMap: Record = { + // '0': '未发货', + // '1': '部分发货', + // '2': '已发货', + // '3': '已取消', + // '4': '确认发货', + // }; + // if (fulfillmentStatus === undefined || fulfillmentStatus === null) { + // return '-'; + // } + // return ( + // fulfillmentStatusMap[String(fulfillmentStatus)] || + // String(fulfillmentStatus) + // ); + // }, }, { title: '物流', - dataIndex: 'tracking', + dataIndex: 'fulfillments', hideInSearch: true, render: (_, record) => { // 检查是否有物流信息 if ( - !record.tracking || - !Array.isArray(record.tracking) || - record.tracking.length === 0 + !record.fulfillments || + !Array.isArray(record.fulfillments) || + record.fulfillments.length === 0 ) { return '-'; } // 遍历物流信息数组, 显示每个物流的提供商和单号 return (
- {record.tracking.map((item: any, index: number) => ( + {record.fulfillments.map((item: any, index: number) => (
{ page: current, per_page: pageSize, where, - ...(orderObj ? { order: orderObj } : {}), + ...(orderObj ? { orderBy: orderObj } : {}), }, }); @@ -474,12 +541,8 @@ const OrdersPage: React.FC = () => { return { status: key, count: 0 }; } try { - const res = await request(`/site-api/${siteId}/orders`, { - params: { - page: 1, - per_page: 1, - where: { ...baseWhere, status: rawStatus }, - }, + const res = await request(`/site-api/${siteId}/orders/count`, { + params: { ...baseWhere, status: rawStatus }, }); const totalCount = Number(res?.data?.total || 0); return { status: key, count: totalCount };