贯通商品编号全流程

This commit is contained in:
yml
2026-06-08 20:00:07 +08:00
parent 38d7469965
commit 494b2c068a
22 changed files with 322 additions and 107 deletions
@@ -12,6 +12,7 @@ import {
} from '@/features/orders/api/orders'
import { useSessionStore } from '@/stores/session'
import { formatDateMinute } from '@/utils/time'
import { formatListingNo } from '@/utils/listingDisplay'
const router = useRouter()
const route = useRoute()
@@ -139,6 +140,19 @@ function ownerActualIncome(order: Order) {
const value = order.checkout?.owner_income_amount
return typeof value === 'number' ? value : null
}
function formatListingCode(order: Order) {
return formatListingNo(order.listing_no, order.listing_id)
}
async function copyListingCode(order: Order) {
try {
await navigator.clipboard.writeText(formatListingCode(order))
showToast({ message: '商品编号已复制', icon: 'passed' })
} catch {
showToast({ message: '复制失败', icon: 'cross' })
}
}
</script>
<template>
@@ -197,6 +211,9 @@ function ownerActualIncome(order: Order) {
<!-- 卡片体关键信息 -->
<div class="card-body">
<button class="listing-code-chip" type="button" @click.stop="copyListingCode(order)">
商品编号 {{ formatListingCode(order) }}
</button>
<h3 class="order-title">{{ order.title }}</h3>
<div class="tag-row">
<span class="info-tag">{{ order.server_region }}</span>
@@ -370,6 +387,17 @@ function ownerActualIncome(order: Order) {
line-height: 1;
}
.listing-code-chip {
margin-bottom: 8px;
padding: 4px 9px;
border: 1px solid #dbeafe;
border-radius: 999px;
background: #eff6ff;
color: #2563eb;
font-size: 12px;
font-weight: 800;
}
/* 状态徽章颜色 - 现代轻量化配色 */
.badge-pending_payment {
color: #ff6a00;