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
+20 -3
View File
@@ -7,22 +7,39 @@
"firstDesc": "This is the first query of the code. The artwork is genuine.",
"repeatDesc": "This code has been activated. Please note the query count.",
"queryCount": "Queried {n} times",
"firstActivatedAt": "First activated: {t}"
"firstActivatedAt": "First activated: {t}",
"queriedAt": "This query: {t}",
"code": "Trace Code"
},
"section": {
"basic": "Basic Info",
"timeline": "Provenance Timeline",
"cert": "Certificates",
"chain": "Blockchain Attestation"
"chain": "Digital Identity & Blockchain"
},
"chain": {
"code": "Trace Code",
"hash": "Tx Hash",
"dataHash": "Data Hash",
"blockHeight": "Block Height",
"onchainAt": "On-chain Time",
"explorer": "View Proof",
"copy": "Copy",
"copied": "Copied"
"copied": "Copied",
"notOnchain": "This artwork has not been recorded on-chain yet."
},
"cert": {
"type": {
"PHOTO": "Photo with Author",
"CERT": "Certificate",
"APPRAISAL": "Appraisal"
}
},
"field": {
"viewFile": "View file"
},
"privacy": {
"note": "Privacy: for anti-counterfeit risk control and query statistics, this visit's necessary info (time, IP, region and device) is recorded."
},
"state": {
"loading": "Loading…",
+20 -3
View File
@@ -7,22 +7,39 @@
"firstDesc": "该防伪码为首次查询,本作品为正品。",
"repeatDesc": "该防伪码已激活,请留意查询次数是否异常。",
"queryCount": "累计查询 {n} 次",
"firstActivatedAt": "首次激活:{t}"
"firstActivatedAt": "首次激活:{t}",
"queriedAt": "本次查询:{t}",
"code": "唯一追溯码"
},
"section": {
"basic": "基础信息",
"timeline": "溯源时间轴",
"cert": "认证文件",
"chain": "区块链存证"
"chain": "数字身份与区块链存证"
},
"chain": {
"code": "唯一追溯码",
"hash": "交易哈希",
"dataHash": "数据哈希",
"blockHeight": "区块高度",
"onchainAt": "上链时间",
"explorer": "查看存证",
"copy": "复制",
"copied": "已复制"
"copied": "已复制",
"notOnchain": "该作品暂未上链存证。"
},
"cert": {
"type": {
"PHOTO": "作者合照",
"CERT": "证书",
"APPRAISAL": "鉴定意见"
}
},
"field": {
"viewFile": "查看文件"
},
"privacy": {
"note": "隐私说明:为防伪风控与查询统计,系统会记录本次访问的必要信息(如访问时间、IP、地区与设备信息)。"
},
"state": {
"loading": "正在查询…",
+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;