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 };