diff --git a/frontend/src/features/admin/views/AdminOrderDetailView.vue b/frontend/src/features/admin/views/AdminOrderDetailView.vue index 69538c4..dda126f 100644 --- a/frontend/src/features/admin/views/AdminOrderDetailView.vue +++ b/frontend/src/features/admin/views/AdminOrderDetailView.vue @@ -102,6 +102,25 @@ const paidOrderPayment = computed(() => const currentSnapshot = computed(() => readSnapshot(order.value)) const snapshotHafCoinM = computed(() => getSnapshotHafCoinM(order.value)) const snapshotResources = computed(() => readSnapshotResources(order.value).slice(0, 6)) +const assetSummary = computed(() => { + const snapshot = order.value?.account_snapshot + if (typeof snapshot !== 'object' || snapshot === null) return null + const summary = (snapshot as Record).asset_summary + if (typeof summary !== 'object' || summary === null) return null + return summary as Record +}) +const snapshotRatio = computed(() => { + const breakdown = assetSummary.value?.price_breakdown + if (typeof breakdown !== 'object' || breakdown === null) return null + const row = breakdown as Record + const sellerRatio = Number(row.seller_ratio || 0) + const buyerRatio = Number(row.buyer_ratio || 0) + const publishRatio = Number(assetSummary.value?.publish_ratio || 0) + return { + recycleRatio: sellerRatio > 0 ? sellerRatio : publishRatio > 0 ? publishRatio : 0, + sellRatio: buyerRatio > 0 ? buyerRatio : 0, + } +}) const snapshotSeasonTags = computed(() => { const tags = currentSnapshot.value?.season_tags return Array.isArray(tags) ? tags.map(item => String(item)).filter(Boolean) : [] @@ -371,6 +390,11 @@ function quantity(value: unknown) { }) } +function formatRatioNumber(value: number) { + const rounded = Math.round(value * 100) / 100 + return Number.isInteger(rounded) ? `${rounded}` : rounded.toFixed(2) +} + function paymentPaidAt(record: AdminPayment) { return record.paid_at || record.updated_at || record.created_at } @@ -741,6 +765,16 @@ function paymentPaidAt(record: AdminPayment) {
{{ item.value }}
+
+
+ 回收比例 + 1:{{ formatRatioNumber(snapshotRatio.recycleRatio) }} +
+
+ 售卖比例 + 1:{{ formatRatioNumber(snapshotRatio.sellRatio) }} +
+
{{ tag }} @@ -959,6 +993,34 @@ function paymentPaidAt(record: AdminPayment) { margin-bottom: 14px; } +.ratio-row { + display: flex; + gap: 24px; + margin-bottom: 14px; + padding: 12px 14px; + border: 1px solid #eef2f7; + border-radius: 8px; + background: #fbfcff; +} + +.ratio-item { + display: flex; + flex-direction: column; + gap: 4px; +} + +.ratio-label { + font-size: 12px; + color: #8f9bba; + font-weight: 600; +} + +.ratio-value { + font-size: 20px; + font-weight: 700; + color: #1b2559; +} + .snapshot-tags { justify-content: flex-start; margin-bottom: 14px;