feat: C端支持溯源节点视频播放,后台节点支持上传视频
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -70,7 +70,17 @@
|
||||
<div class="tl-meta muted">{{ [fmtDate(n.occurredAt), n.location].filter(Boolean).join(' · ') }}</div>
|
||||
<div v-if="n.description" class="tl-desc">{{ n.description }}</div>
|
||||
<div v-if="n.media?.length" class="tl-media">
|
||||
<img v-for="(m, j) in n.media" :key="j" :src="m.url" @click="openLightbox(m.url)" />
|
||||
<template v-for="(m, j) in n.media" :key="j">
|
||||
<video
|
||||
v-if="isVideo(m)"
|
||||
:src="m.url"
|
||||
class="tl-video"
|
||||
controls
|
||||
playsinline
|
||||
preload="metadata"
|
||||
/>
|
||||
<img v-else :src="m.url" @click="openLightbox(m.url)" />
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -160,6 +170,9 @@ function ellipsis(s?: string) {
|
||||
if (!s) return '-';
|
||||
return s.length > 16 ? `${s.slice(0, 8)}…${s.slice(-6)}` : s;
|
||||
}
|
||||
function isVideo(m: { type?: string; url?: string }) {
|
||||
return m.type === 'video' || /\.(mp4|webm|mov|m4v)$/i.test(m.url || '');
|
||||
}
|
||||
function openLightbox(url: string) {
|
||||
lightbox.value = url;
|
||||
}
|
||||
@@ -405,6 +418,12 @@ watch(
|
||||
object-fit: cover;
|
||||
border-radius: 8px;
|
||||
}
|
||||
.tl-video {
|
||||
width: 100%;
|
||||
max-height: 220px;
|
||||
border-radius: 8px;
|
||||
background: #000;
|
||||
}
|
||||
.cert-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
|
||||
Reference in New Issue
Block a user