From d7c5701cc0321f5c36b75a2e36bcc5c7fb34ed56 Mon Sep 17 00:00:00 2001 From: yml2213 Date: Mon, 22 Jun 2026 19:05:41 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=91=98=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E8=AF=A6=E6=83=85=E4=BC=98=E5=8C=96,?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=AF=94=E4=BE=8B=E5=92=8C=E9=A2=9D=E5=A4=96?= =?UTF-8?q?=E7=89=A9=E5=93=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/views/AdminOrderDetailView.vue | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) 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;