feat: 新增客户端作品展示模块
This commit is contained in:
@@ -11,7 +11,8 @@
|
||||
"queriedAt": "This query: {t}"
|
||||
},
|
||||
"section": {
|
||||
"basic": "Basic Info",
|
||||
"basic": "Product Introduction",
|
||||
"showcase": "Artwork Showcase",
|
||||
"timeline": "Provenance Timeline",
|
||||
"cert": "Copyright Certificates",
|
||||
"chain": "Digital Identity & Blockchain"
|
||||
|
||||
@@ -11,7 +11,8 @@
|
||||
"queriedAt": "本次查询:{t}"
|
||||
},
|
||||
"section": {
|
||||
"basic": "基础信息",
|
||||
"basic": "产品介绍",
|
||||
"showcase": "作品展示",
|
||||
"timeline": "溯源时间轴",
|
||||
"cert": "版权证书",
|
||||
"chain": "数字身份与区块链存证"
|
||||
|
||||
+150
-57
@@ -178,15 +178,21 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 基础信息 -->
|
||||
<section class="card">
|
||||
<!-- 产品介绍 -->
|
||||
<section class="card product-intro-card">
|
||||
<h2 class="section-title">{{ t('section.basic') }}</h2>
|
||||
<h1 class="art-title">{{ data.artwork.title }}</h1>
|
||||
<div class="fields">
|
||||
<div v-if="data.artwork.artist" class="field">
|
||||
<span class="field-label">{{ t('artist') }}</span>
|
||||
<span class="field-value">{{ data.artwork.artist }}</span>
|
||||
</div>
|
||||
<div v-for="(f, i) in data.artwork.fields" :key="i" class="field">
|
||||
<div
|
||||
v-for="(f, i) in data.artwork.fields"
|
||||
:key="i"
|
||||
class="field"
|
||||
:class="{ 'field-media': f.type === 'IMAGE' && f.value }"
|
||||
>
|
||||
<span class="field-label">{{ f.label }}</span>
|
||||
<span class="field-value">
|
||||
<img
|
||||
@@ -205,47 +211,23 @@
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- 溯源时间轴 -->
|
||||
<section v-if="timelineItems.length" class="card">
|
||||
<h2 class="section-title">{{ t('section.timeline') }}</h2>
|
||||
<div class="timeline">
|
||||
<div v-for="(n, i) in timelineItems" :key="n.system || `${n.nodeType || 'node'}-${i}`" class="tl-item">
|
||||
<div class="tl-dot" />
|
||||
<div class="tl-body">
|
||||
<div class="tl-title">{{ nodeTitle(n) }}</div>
|
||||
<div class="tl-meta muted">{{ [nodeOccurredAt(n), n.location].filter(Boolean).join(' · ') }}</div>
|
||||
<div v-if="nodeDesc(n)" class="tl-desc">{{ nodeDesc(n) }}</div>
|
||||
<div v-if="n.system === 'OUTBOUND_RECORD' && outboundRemark" class="tl-remark">
|
||||
<span class="muted">{{ t('timeline.remark') }}</span>
|
||||
{{ outboundRemark }}
|
||||
</div>
|
||||
<template v-if="n.media?.length">
|
||||
<button class="tl-toggle" @click="toggleNode(i)">
|
||||
<span class="tl-toggle-ico" :class="{ open: expanded.has(i) }">▸</span>
|
||||
{{ expanded.has(i) ? t('timeline.collapse') : t('timeline.expandMedia', { n: nodeMediaCount(n) }) }}
|
||||
</button>
|
||||
<div v-if="expanded.has(i)" class="tl-media">
|
||||
<div v-for="(m, j) in n.media" :key="j" class="tl-media-item" @click="openViewer(n.media, j)">
|
||||
<div class="tl-media-thumb">
|
||||
<video v-if="isVideo(m)" :src="mediaUrl(m)" muted playsinline preload="metadata" />
|
||||
<img v-else :src="mediaUrl(m)" :alt="m.name || nodeTitle(n)" loading="lazy" />
|
||||
<div v-if="isVideo(m)" class="tl-play">▶</div>
|
||||
</div>
|
||||
<div v-if="m.name" class="tl-cap text-ellipsis">{{ m.name }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<button
|
||||
v-if="n.system === 'OUTBOUND_RECORD' && expanded.has(i) && canLoadMoreOutboundImages"
|
||||
type="button"
|
||||
class="tl-load-more"
|
||||
:disabled="outboundImagesLoading"
|
||||
@click="loadMoreOutboundImages"
|
||||
>
|
||||
{{ outboundImagesLoading ? t('timeline.loadingMedia') : t('timeline.loadMoreMedia') }}
|
||||
</button>
|
||||
</template>
|
||||
<!-- 作品展示 -->
|
||||
<section v-if="showcaseImages.length" class="card showcase-card">
|
||||
<h2 class="section-title">{{ t('section.showcase') }}</h2>
|
||||
<div class="showcase-list">
|
||||
<article v-for="(item, index) in showcaseImages" :key="item.url || index" class="showcase-item">
|
||||
<div v-if="item.name || item.description" class="showcase-copy">
|
||||
<h3 v-if="item.name" class="showcase-title">{{ item.name }}</h3>
|
||||
<p v-if="item.description" class="showcase-description">{{ item.description }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<img
|
||||
:src="mediaUrl(item)"
|
||||
:alt="item.name || t('section.showcase')"
|
||||
class="showcase-image"
|
||||
loading="lazy"
|
||||
@click="openViewer(showcaseImages, index)"
|
||||
/>
|
||||
</article>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@@ -300,6 +282,50 @@
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- 溯源时间轴 -->
|
||||
<section v-if="timelineItems.length" class="card">
|
||||
<h2 class="section-title">{{ t('section.timeline') }}</h2>
|
||||
<div class="timeline">
|
||||
<div v-for="(n, i) in timelineItems" :key="n.system || `${n.nodeType || 'node'}-${i}`" class="tl-item">
|
||||
<div class="tl-dot" />
|
||||
<div class="tl-body">
|
||||
<div class="tl-title">{{ nodeTitle(n) }}</div>
|
||||
<div class="tl-meta muted">{{ [nodeOccurredAt(n), n.location].filter(Boolean).join(' · ') }}</div>
|
||||
<div v-if="nodeDesc(n)" class="tl-desc">{{ nodeDesc(n) }}</div>
|
||||
<div v-if="n.system === 'OUTBOUND_RECORD' && outboundRemark" class="tl-remark">
|
||||
<span class="muted">{{ t('timeline.remark') }}</span>
|
||||
{{ outboundRemark }}
|
||||
</div>
|
||||
<template v-if="n.media?.length">
|
||||
<button class="tl-toggle" @click="toggleNode(i)">
|
||||
<span class="tl-toggle-ico" :class="{ open: expanded.has(i) }">▸</span>
|
||||
{{ expanded.has(i) ? t('timeline.collapse') : t('timeline.expandMedia', { n: nodeMediaCount(n) }) }}
|
||||
</button>
|
||||
<div v-if="expanded.has(i)" class="tl-media">
|
||||
<div v-for="(m, j) in n.media" :key="j" class="tl-media-item" @click="openViewer(n.media, j)">
|
||||
<div class="tl-media-thumb">
|
||||
<video v-if="isVideo(m)" :src="mediaUrl(m)" muted playsinline preload="metadata" />
|
||||
<img v-else :src="mediaUrl(m)" :alt="m.name || nodeTitle(n)" loading="lazy" />
|
||||
<div v-if="isVideo(m)" class="tl-play">▶</div>
|
||||
</div>
|
||||
<div v-if="m.name" class="tl-cap text-ellipsis">{{ m.name }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<button
|
||||
v-if="n.system === 'OUTBOUND_RECORD' && expanded.has(i) && canLoadMoreOutboundImages"
|
||||
type="button"
|
||||
class="tl-load-more"
|
||||
:disabled="outboundImagesLoading"
|
||||
@click="loadMoreOutboundImages"
|
||||
>
|
||||
{{ outboundImagesLoading ? t('timeline.loadingMedia') : t('timeline.loadMoreMedia') }}
|
||||
</button>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- 数字身份与区块链存证 -->
|
||||
<section class="card">
|
||||
<h2 class="section-title">{{ t('section.chain') }}</h2>
|
||||
@@ -421,16 +447,20 @@ const appIconUrl = ref(resolveAppIcon());
|
||||
const filingInfo = ref('');
|
||||
const toast = ref('');
|
||||
const browserTitle = computed(() => {
|
||||
const archiveNo = data.value?.status === 'OK' ? data.value?.artwork?.archiveNo : '';
|
||||
return archiveNo || appName.value || t('app.name');
|
||||
const artworkTitle = data.value?.status === 'OK' ? data.value?.artwork?.title : '';
|
||||
return artworkTitle || appName.value || t('app.name');
|
||||
});
|
||||
const topbarTitle = computed(() => {
|
||||
const archiveNo = data.value?.status === 'OK' ? data.value?.artwork?.archiveNo : '';
|
||||
return archiveNo || appName.value || t('app.name');
|
||||
const artworkTitle = data.value?.status === 'OK' ? data.value?.artwork?.title : '';
|
||||
return artworkTitle || appName.value || t('app.name');
|
||||
});
|
||||
const antiModalOpen = ref(false);
|
||||
const certIndex = ref(0);
|
||||
const currentCert = computed(() => data.value?.certificates?.[certIndex.value] || null);
|
||||
const showcaseImages = computed<any[]>(() => {
|
||||
const items = data.value?.artwork?.showcaseImages;
|
||||
return Array.isArray(items) ? items.filter((item: any) => item?.url || item?.key) : [];
|
||||
});
|
||||
|
||||
type ProofStatus = 'PENDING' | 'SUBMITTING' | 'CONFIRMING' | 'ONCHAIN' | 'FAILED' | 'UNKNOWN';
|
||||
|
||||
@@ -1296,7 +1326,11 @@ watch(
|
||||
}
|
||||
.art-title {
|
||||
font-size: 20px;
|
||||
margin: 0 0 4px;
|
||||
margin: 0 0 14px;
|
||||
line-height: 1.35;
|
||||
}
|
||||
.product-intro-card .section-title {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
.fields {
|
||||
display: flex;
|
||||
@@ -1326,12 +1360,27 @@ watch(
|
||||
word-break: break-word;
|
||||
}
|
||||
.field-img {
|
||||
width: 96px;
|
||||
height: 96px;
|
||||
object-fit: cover;
|
||||
width: 100%;
|
||||
height: auto;
|
||||
object-fit: contain;
|
||||
border-radius: 8px;
|
||||
cursor: pointer;
|
||||
background: var(--trace-thumb-bg);
|
||||
display: block;
|
||||
}
|
||||
.field.field-media {
|
||||
display: block;
|
||||
padding: 8px 0 12px;
|
||||
}
|
||||
.field-media .field-label {
|
||||
display: block;
|
||||
margin-bottom: 9px;
|
||||
color: var(--text);
|
||||
font-weight: 600;
|
||||
white-space: normal;
|
||||
}
|
||||
.field-media .field-value {
|
||||
display: block;
|
||||
}
|
||||
.field-link {
|
||||
color: var(--brand-2);
|
||||
@@ -1344,6 +1393,47 @@ watch(
|
||||
font-size: 13px;
|
||||
}
|
||||
}
|
||||
.showcase-card {
|
||||
padding: 16px 0 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
.showcase-card > .section-title {
|
||||
margin: 0 16px 14px;
|
||||
}
|
||||
.showcase-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.showcase-item {
|
||||
margin: 0;
|
||||
}
|
||||
.showcase-item + .showcase-item {
|
||||
padding-top: 20px;
|
||||
border-top: 1px solid var(--trace-divider);
|
||||
}
|
||||
.showcase-copy {
|
||||
padding: 0 16px 12px;
|
||||
}
|
||||
.showcase-title {
|
||||
margin: 0;
|
||||
font-size: 16px;
|
||||
line-height: 1.45;
|
||||
color: var(--text);
|
||||
}
|
||||
.showcase-description {
|
||||
margin: 6px 0 0;
|
||||
color: var(--muted);
|
||||
font-size: 13px;
|
||||
line-height: 1.7;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
.showcase-image {
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: auto;
|
||||
background: var(--soft-bg);
|
||||
cursor: zoom-in;
|
||||
}
|
||||
.timeline {
|
||||
position: relative;
|
||||
}
|
||||
@@ -1474,20 +1564,22 @@ watch(
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-height: 238px;
|
||||
min-height: 190px;
|
||||
padding: 0 38px;
|
||||
}
|
||||
.cert {
|
||||
width: min(100%, 300px);
|
||||
width: min(100%, 440px);
|
||||
text-align: center;
|
||||
}
|
||||
.cert img {
|
||||
width: 100%;
|
||||
height: 170px;
|
||||
object-fit: cover;
|
||||
height: auto;
|
||||
max-height: 420px;
|
||||
object-fit: contain;
|
||||
border-radius: 10px;
|
||||
background: var(--soft-bg);
|
||||
cursor: zoom-in;
|
||||
display: block;
|
||||
}
|
||||
.cert-placeholder {
|
||||
height: 170px;
|
||||
@@ -1511,7 +1603,7 @@ watch(
|
||||
.cert-name {
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
max-width: 190px;
|
||||
max-width: 280px;
|
||||
}
|
||||
.cert-type {
|
||||
font-size: 11px;
|
||||
@@ -1526,7 +1618,8 @@ watch(
|
||||
}
|
||||
.cert-nav {
|
||||
position: absolute;
|
||||
top: 82px;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
width: 32px;
|
||||
height: 44px;
|
||||
border: 1px solid var(--border);
|
||||
|
||||
Reference in New Issue
Block a user