feat: 产品详情页竖屏适配

This commit is contained in:
2025-11-01 16:26:16 +08:00
parent fc164beaf3
commit 52048fc2a6
2 changed files with 33 additions and 2 deletions

View File

@ -42,4 +42,11 @@
color: var(--el-text-color-primary); color: var(--el-text-color-primary);
margin: 0; margin: 0;
} }
@media (max-width: 768px) {
.product-tabs ::v-deep(.el-tabs__nav) {
float: none;
min-width: 100%;
}
}
</style> </style>

View File

@ -10,7 +10,7 @@
<el-carousel <el-carousel
v-else v-else
class="product-carousel" class="product-carousel"
height="500px" height="auto"
:autoplay="false" :autoplay="false"
:loop="false" :loop="false"
arrow="always" arrow="always"
@ -18,8 +18,9 @@
<el-carousel-item <el-carousel-item
v-for="(item, index) in product.images || []" v-for="(item, index) in product.images || []"
:key="index" :key="index"
class="product-carousel-item"
> >
<div class="product-carousel-item"> <div>
<el-image <el-image
:src="getImageUrl(item.image || '')" :src="getImageUrl(item.image || '')"
:alt="product.name" :alt="product.name"
@ -59,6 +60,10 @@
gap: 3rem; gap: 3rem;
} }
.product-carousel-item {
height: 500px;
}
.product-image .el-image { .product-image .el-image {
position: relative; position: relative;
width: 100%; width: 100%;
@ -99,4 +104,23 @@
line-height: 1.6; line-height: 1.6;
margin-bottom: 2rem; margin-bottom: 2rem;
} }
@media (max-width: 768px) {
.product-header {
grid-template-columns: 1fr;
}
.product-carousel-item {
height: 300px;
}
.product-image .el-image {
height: 300px;
}
.product-info h1 {
font-size: 1.5rem;
margin-top: 0;
}
}
</style> </style>