diff --git a/src/app/(main)/comparison-records/page.tsx b/src/app/(main)/comparison-records/page.tsx index 04fb24e..113b9ac 100644 --- a/src/app/(main)/comparison-records/page.tsx +++ b/src/app/(main)/comparison-records/page.tsx @@ -8,11 +8,12 @@ import { } from 'antd'; import type { ColumnsType } from 'antd/es/table'; import { api, errMsg } from '@/lib/api'; -import { formatUtcTime, yuan } from '@/lib/format'; +import { formatWallTime, yuan } from '@/lib/format'; import { usePagedList } from '@/lib/usePagedList'; import type { ComparisonRecordDetail, ComparisonRecordListItem } from '@/lib/types'; -const STATUS_COLOR: Record = { success: 'green', failed: 'red' }; +const STATUS_COLOR: Record = { success: 'green', failed: 'red', cancelled: 'default' }; +const STATUS_LABEL: Record = { success: '成功', failed: '失败', cancelled: '已终止' }; // 「卡在哪一步」: platform_results[*].status 翻成人话(找店/加菜/起送/读价) const STUCK_LABEL: Record = { @@ -97,7 +98,7 @@ export default function ComparisonRecordsPage() { ), }, - { title: '状态', dataIndex: 'status', width: 72, render: (s: string) => {s} }, + { title: '状态', dataIndex: 'status', width: 72, render: (s: string) => {STATUS_LABEL[s] || s} }, { title: '源平台', dataIndex: 'source_platform_name', width: 90, render: (v) => v || '-' }, { title: '店/商品', dataIndex: 'store_name', width: 150, ellipsis: true, render: (v) => v || '-' }, { title: '最优', dataIndex: 'best_platform_name', width: 80, render: (v) => v || '-' }, @@ -126,7 +127,7 @@ export default function ComparisonRecordsPage() { ellipsis: true, render: (_, r) => [r.device_model, r.rom_name].filter(Boolean).join(' / ') || '-', }, - { title: '时间', dataIndex: 'created_at', width: 150, render: (v: string) => formatUtcTime(v) }, + { title: '时间', dataIndex: 'created_at', width: 150, render: (v: string) => formatWallTime(v) }, { title: '操作', key: 'op', @@ -163,7 +164,11 @@ export default function ComparisonRecordsPage() { onChange={setStatus} allowClear style={{ width: 110 }} - options={[{ value: 'success', label: 'success' }, { value: 'failed', label: 'failed' }]} + options={[ + { value: 'success', label: '成功' }, + { value: 'failed', label: '失败' }, + { value: 'cancelled', label: '已终止' }, + ]} /> @@ -194,7 +199,7 @@ export default function ComparisonRecordsPage() { {detail.phone || `#${detail.user_id}`}{detail.nickname ? `(${detail.nickname})` : ''} - {detail.status} + {STATUS_LABEL[detail.status] || detail.status} {detail.business_type} {fmtMs(detail.total_ms)} {detail.step_count ?? '-'} @@ -212,6 +217,11 @@ export default function ComparisonRecordsPage() { {detail.longitude != null ? `${detail.longitude}, ${detail.latitude}` : '-'} + + {detail.best_deeplink + ? {detail.best_deeplink} + : '-'} + @@ -221,9 +231,30 @@ export default function ComparisonRecordsPage() { {detail.android_version || '-'}(SDK {detail.android_sdk ?? '-'}) {detail.app_version || '-'}({detail.app_version_code ?? '-'}) {detail.source_app_version || '-'} + {detail.device_id || '-'} + {((detail.items?.length ?? 0) > 0 || (detail.skipped_dish_names?.length ?? 0) > 0) && ( + + {(detail.items?.length ?? 0) > 0 ? ( +
    + {detail.items.map((it, i) => ( +
  • + {it.name}{it.qty != null ? ` ×${it.qty}` : ''} + {it.specs?.length ? ({it.specs.join('/')}) : null} +
  • + ))} +
+ ) : 无商品明细} + {(detail.skipped_dish_names?.length ?? 0) > 0 && ( +
+ 跳过{detail.skipped_dish_count != null ? ` ${detail.skipped_dish_count} ` : ''}个:{detail.skipped_dish_names.join('、')} +
+ )} +
+ )} + {platformResults.length > 0 && ( )} - {detail.comparison_results.length > 0 && ( + {(detail.comparison_results?.length ?? 0) > 0 && (