feat: 增加产品展示功能 #7

Manually merged
remilia merged 2 commits from dev into master 2025-09-12 11:13:56 +08:00
2 changed files with 21 additions and 4 deletions
Showing only changes of commit 8b763699ed - Show all commits

View File

@ -15,7 +15,15 @@
<!-- 产品详情内容 -->
<div class="production-header">
<div class="production-image">
<el-image :src="useStrapiMedia(production?.cover?.url || '')" :alt="production.title" fit="contain" />
<el-image v-if="production.production_images.length <= 1" :src="useStrapiMedia(production?.cover?.url || '')" :alt="production.title" fit="contain" />
<el-carousel v-else class="production-carousel" height="500px" :autoplay="false" :loop="false" arrow="always">
<el-carousel-item v-for="(item, index) in production.production_images || []":key="index">
<div class="production-carousel-item">
<el-image :src="useStrapiMedia(item.url || '')" :alt="item.alternativeText || production.title" fit="contain" lazy />
<p v-if="item.caption" class="production-image-caption">{{ item.caption }}</p>
</div>
</el-carousel-item>
</el-carousel>
</div>
<div class="production-info">
<h1>{{ production.title }}</h1>
@ -150,6 +158,15 @@ useHead({
border-radius: 8px;
}
.production-carousel :deep(.el-carousel__button) {
/* 指示器按钮样式 */
width: 8px;
height: 8px;
border-radius: 50%;
background-color: #475669;
transition: all 0.3s ease;
}
.production-info h1 {
margin-top: 2rem;
margin-bottom: 1rem;