feat: 修改图片详情页
- 为图片详情页添加图片轮播功能
This commit is contained in:
@ -15,7 +15,15 @@
|
|||||||
<!-- 产品详情内容 -->
|
<!-- 产品详情内容 -->
|
||||||
<div class="production-header">
|
<div class="production-header">
|
||||||
<div class="production-image">
|
<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>
|
||||||
<div class="production-info">
|
<div class="production-info">
|
||||||
<h1>{{ production.title }}</h1>
|
<h1>{{ production.title }}</h1>
|
||||||
@ -150,6 +158,15 @@ useHead({
|
|||||||
border-radius: 8px;
|
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 {
|
.production-info h1 {
|
||||||
margin-top: 2rem;
|
margin-top: 2rem;
|
||||||
margin-bottom: 1rem;
|
margin-bottom: 1rem;
|
||||||
|
|||||||
Reference in New Issue
Block a user