feat: 完成 PRD 差距与修复,新增审核流与日志清理功能,支持出库信息与动态字段,优化 C 端用户体验

This commit is contained in:
Nixevol
2026-06-29 23:41:39 +08:00
parent d18b7c592d
commit 2fba42c9fd
39 changed files with 1247 additions and 185 deletions
+99 -19
View File
@@ -33,6 +33,8 @@
· {{ t('anti.firstActivatedAt', { t: fmt(data.antiCounterfeit.firstActivatedAt) }) }}
</span>
</div>
<div v-if="data.queriedAt" class="anti-meta">{{ t('anti.queriedAt', { t: fmt(data.queriedAt) }) }}</div>
<div v-if="data.code" class="anti-code">{{ t('anti.code') }}:<span class="mono">{{ data.code }}</span></div>
</div>
</div>
@@ -69,7 +71,19 @@
<div class="fields">
<div v-for="(f, i) in data.artwork.fields" :key="i" class="field">
<span class="field-label">{{ f.label }}</span>
<span class="field-value">{{ f.value }}</span>
<span class="field-value">
<img
v-if="f.type === 'IMAGE' && f.value"
:src="f.value"
class="field-img"
loading="lazy"
@click="openViewer([{ url: f.value, type: 'image', name: f.label }], 0)"
/>
<a v-else-if="(f.type === 'LINK' || f.type === 'FILE') && safeUrl(f.value)" :href="safeUrl(f.value)" target="_blank" rel="noopener" class="field-link">
{{ f.type === 'FILE' ? t('field.viewFile') : f.value }}
</a>
<template v-else>{{ f.value }}</template>
</span>
</div>
</div>
</section>
@@ -108,33 +122,52 @@
<div class="cert-grid">
<div v-for="(c, i) in data.certificates" :key="i" class="cert">
<img v-if="c.url" :src="c.url" loading="lazy" @click="openViewer([{ url: c.url, name: c.name, type: 'image' }], 0)" />
<div class="cert-name text-ellipsis">{{ c.name }}</div>
<div class="cert-head">
<span class="cert-name text-ellipsis">{{ c.name }}</span>
<span v-if="c.type" class="cert-type">{{ t(`cert.type.${c.type}`) }}</span>
</div>
<div v-if="c.issuer" class="muted cert-issuer text-ellipsis">{{ c.issuer }}</div>
<div v-if="c.issuedAt" class="muted cert-issuer">{{ fmtDate(c.issuedAt) }}</div>
</div>
</div>
</section>
<!-- 区块链存证 -->
<section v-if="data.blockchain" class="card">
<!-- 数字身份与区块链存证 -->
<section class="card">
<h2 class="section-title">{{ t('section.chain') }}</h2>
<div class="chain-row">
<span class="chain-k">{{ t('chain.hash') }}</span>
<span class="chain-v mono">{{ ellipsis(data.blockchain.txHash) }}</span>
<button class="copy" @click="copy(data.blockchain.txHash)">{{ t('chain.copy') }}</button>
<span class="chain-k">{{ t('chain.code') }}</span>
<span class="chain-v mono">{{ data.code || '-' }}</span>
</div>
<div class="chain-row">
<span class="chain-k">{{ t('chain.blockHeight') }}</span>
<span class="chain-v">{{ data.blockchain.blockHeight }}</span>
</div>
<div class="chain-row">
<span class="chain-k">{{ t('chain.onchainAt') }}</span>
<span class="chain-v">{{ fmt(data.blockchain.onchainAt) }}</span>
</div>
<a v-if="data.blockchain.explorerUrl" class="chain-link" :href="data.blockchain.explorerUrl" target="_blank">
{{ t('chain.explorer') }} →
</a>
<template v-if="data.blockchain">
<div class="chain-row">
<span class="chain-k">{{ t('chain.hash') }}</span>
<span class="chain-v mono">{{ ellipsis(data.blockchain.txHash) }}</span>
<button class="copy" @click="copy(data.blockchain.txHash)">{{ t('chain.copy') }}</button>
</div>
<div v-if="data.blockchain.dataHash" class="chain-row">
<span class="chain-k">{{ t('chain.dataHash') }}</span>
<span class="chain-v mono">{{ ellipsis(data.blockchain.dataHash) }}</span>
<button class="copy" @click="copy(data.blockchain.dataHash)">{{ t('chain.copy') }}</button>
</div>
<div class="chain-row">
<span class="chain-k">{{ t('chain.blockHeight') }}</span>
<span class="chain-v">{{ data.blockchain.blockHeight ?? '-' }}</span>
</div>
<div class="chain-row">
<span class="chain-k">{{ t('chain.onchainAt') }}</span>
<span class="chain-v">{{ fmt(data.blockchain.onchainAt) }}</span>
</div>
<a v-if="data.blockchain.explorerUrl" class="chain-link" :href="data.blockchain.explorerUrl" target="_blank">
{{ t('chain.explorer') }} →
</a>
</template>
<div v-else class="chain-empty muted">{{ t('chain.notOnchain') }}</div>
</section>
<!-- 隐私说明 -->
<p class="privacy muted">{{ t('privacy.note') }}</p>
<footer class="footer muted">{{ appName }}</footer>
</template>
@@ -190,6 +223,11 @@ function ellipsis(s?: string) {
function isVideo(m: { type?: string; url?: string }) {
return m.type === 'video' || /\.(mp4|webm|mov|m4v|ogg)$/i.test(m.url || '');
}
// 仅允许 http(s) 或站内相对路径作为外链,过滤 javascript:/data: 等危险协议
function safeUrl(v?: string): string {
if (!v) return '';
return /^(https?:\/\/|\/)/i.test(v) ? v : '';
}
function openViewer(items: any[], index: number) {
viewerItems.value = items || [];
viewerStart.value = index;
@@ -340,6 +378,12 @@ watch(
font-size: 12px;
opacity: 0.85;
}
.anti-code {
font-size: 12px;
opacity: 0.85;
margin-top: 2px;
word-break: break-all;
}
.carousel {
display: flex;
gap: 8px;
@@ -403,6 +447,18 @@ watch(
flex: 1;
color: var(--text);
}
.field-img {
width: 96px;
height: 96px;
object-fit: cover;
border-radius: 8px;
cursor: pointer;
background: #e7ecf3;
}
.field-link {
color: var(--brand-2);
word-break: break-all;
}
.timeline {
position: relative;
}
@@ -472,10 +528,24 @@ watch(
border-radius: 10px;
background: #e7ecf3;
}
.cert-head {
display: flex;
align-items: center;
gap: 6px;
margin-top: 6px;
}
.cert-name {
font-size: 13px;
font-weight: 600;
margin-top: 6px;
flex: 1;
}
.cert-type {
font-size: 11px;
color: var(--brand-2);
background: rgba(19, 138, 114, 0.12);
border-radius: 4px;
padding: 1px 6px;
flex-shrink: 0;
}
.cert-issuer {
font-size: 12px;
@@ -515,6 +585,16 @@ watch(
font-size: 14px;
text-decoration: none;
}
.chain-empty {
font-size: 13px;
padding: 8px 0;
}
.privacy {
font-size: 12px;
line-height: 1.6;
padding: 0 16px;
margin: 16px 0 0;
}
.footer {
text-align: center;
font-size: 12px;