优化了订单展示

This commit is contained in:
yml
2026-04-09 02:03:39 +08:00
parent e4ab1f559e
commit 98cc0c16fc
6 changed files with 321 additions and 29 deletions
@@ -46,6 +46,22 @@ async function loadOrders(page = pagination.value.page) {
}
onMounted(loadOrders)
function resolveBuyerLabel(item: AdminOrderListItem) {
return item.buyerName || item.buyerId || '未识别'
}
function resolveContactLabel(item: AdminOrderListItem) {
return item.receiverContact || '未提供'
}
function resolveShopLabel(item: AdminOrderListItem) {
return item.shopName || item.shopId || '未识别店铺'
}
function resolveItemSummary(item: AdminOrderListItem) {
return item.itemSummary || '未识别商品'
}
</script>
<template>
@@ -80,20 +96,35 @@ onMounted(loadOrders)
<table class="data-table">
<thead>
<tr>
<th>订单</th>
<th>平台</th>
<th>订单信息</th>
<th>平台 / 店铺</th>
<th>商品摘要</th>
<th>订单进度</th>
<th>金额</th>
<th>金额 / 时间</th>
<th>任务进度</th>
<th>创建时间</th>
</tr>
</thead>
<tbody>
<tr v-for="item in items" :key="item.orderId">
<td>
<RouterLink :to="`/admin/orders/${item.orderId}`">{{ item.platformOrderId }}</RouterLink>
<div class="cell-stack">
<RouterLink :to="`/admin/orders/${item.orderId}`" class="primary-link">{{ item.platformOrderId }}</RouterLink>
<span class="cell-main">{{ resolveBuyerLabel(item) }}</span>
<span class="cell-sub">联系方式{{ resolveContactLabel(item) }}</span>
</div>
</td>
<td>
<div class="cell-stack">
<span class="cell-main">{{ item.platform }}</span>
<span class="cell-sub">{{ resolveShopLabel(item) }}</span>
</div>
</td>
<td>
<div class="cell-stack">
<span class="cell-main">{{ resolveItemSummary(item) }}</span>
<span class="cell-sub">{{ item.itemCount }} 合计 {{ item.totalQuantity }} </span>
</div>
</td>
<td>{{ item.platform }}</td>
<td>
<div class="status-stack">
<AdminStatusTag :status="item.payStatus" />
@@ -102,7 +133,13 @@ onMounted(loadOrders)
<AdminStatusTag :status="item.userBindingStatus" />
</div>
</td>
<td>{{ item.totalAmount }} {{ item.currency }}</td>
<td>
<div class="cell-stack">
<span class="cell-main amount-text">{{ item.totalAmount }} {{ item.currency }}</span>
<span class="cell-sub">支付{{ formatAdminDateTime(item.paidAt) }}</span>
<span class="cell-sub">创建{{ formatAdminDateTime(item.createdAt) }}</span>
</div>
</td>
<td>
<div class="progress-stack">
<span
@@ -119,7 +156,6 @@ onMounted(loadOrders)
</span>
</div>
</td>
<td>{{ formatAdminDateTime(item.createdAt) }}</td>
</tr>
</tbody>
</table>
@@ -142,6 +178,26 @@ onMounted(loadOrders)
align-items: center;
}
.cell-stack {
display: grid;
gap: 4px;
}
.primary-link,
.cell-main {
font-weight: 600;
color: #1d3555;
}
.cell-sub {
color: #64748b;
font-size: 13px;
}
.amount-text {
white-space: nowrap;
}
.progress-stack {
display: flex;
flex-wrap: wrap;