优化后台订单列表展示并支持商品标题与SKU规格
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { ArrowLeftOutlined } from '@ant-design/icons'
|
||||
import { Alert, Button, Card, Descriptions, Skeleton, Space, Table, Typography } from 'antd'
|
||||
import { Alert, Button, Card, Descriptions, Skeleton, Space, Table, Tag, Typography } from 'antd'
|
||||
import type { TableColumnsType } from 'antd'
|
||||
import { useQuery } from '@tanstack/react-query'
|
||||
import { useNavigate, useParams } from 'react-router'
|
||||
@@ -115,7 +115,16 @@ export default function AdminOrderDetailPage() {
|
||||
<Descriptions.Item label="更新时间">
|
||||
{formatAdminDateTime(detail.order.updatedAt)}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="商品摘要">{detail.order.itemSummary || '-'}</Descriptions.Item>
|
||||
<Descriptions.Item label="商品摘要">
|
||||
<div className="cell-stack" style={{ gap: 4 }}>
|
||||
<span>{detail.order.itemTitle || detail.order.itemSummary || '-'}</span>
|
||||
{detail.order.skuNick ? (
|
||||
<Tag color="blue" style={{ margin: 0, width: 'fit-content' }}>
|
||||
{detail.order.skuNick}
|
||||
</Tag>
|
||||
) : null}
|
||||
</div>
|
||||
</Descriptions.Item>
|
||||
</Descriptions>
|
||||
</Card>
|
||||
|
||||
@@ -126,8 +135,26 @@ export default function AdminOrderDetailPage() {
|
||||
dataSource={detail.items}
|
||||
scroll={{ x: 760 }}
|
||||
columns={[
|
||||
{ title: '商品', dataIndex: 'itemTitle', minWidth: 240 },
|
||||
{ title: 'SKU', dataIndex: 'skuCode', minWidth: 180 },
|
||||
{
|
||||
title: '商品',
|
||||
dataIndex: 'itemTitle',
|
||||
minWidth: 240,
|
||||
render: (value) => <strong>{value || '-'}</strong>,
|
||||
},
|
||||
{
|
||||
title: 'SKU / 规格',
|
||||
minWidth: 180,
|
||||
render: (_, item) => (
|
||||
<div className="cell-stack" style={{ gap: 4 }}>
|
||||
{item.skuNick ? (
|
||||
<Tag color="blue" style={{ margin: 0, width: 'fit-content' }}>
|
||||
{item.skuNick}
|
||||
</Tag>
|
||||
) : null}
|
||||
<span className="muted">{item.skuCode || item.skuName || '-'}</span>
|
||||
</div>
|
||||
),
|
||||
},
|
||||
{ title: '数量', dataIndex: 'quantity', width: 90 },
|
||||
{ title: '履约模式', dataIndex: 'deliveryMode', minWidth: 140 },
|
||||
]}
|
||||
|
||||
Reference in New Issue
Block a user