This commit is contained in:
@@ -568,135 +568,142 @@
|
||||
},
|
||||
{ passive: false }
|
||||
); // passive: false 必须,否则 preventDefault 无效
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
// 初始化所有视频容器
|
||||
function initVideoContainers() {
|
||||
const productRights = document.querySelectorAll('.product-right');
|
||||
// 初始化所有视频容器
|
||||
function initVideoContainers() {
|
||||
const productRights = document.querySelectorAll('.product-right');
|
||||
// 支持的视频格式
|
||||
const supportedVideoFormats = ['.mp4', '.webm', '.ogg', '.mov', '.avi', '.mkv', '.flv', '.wmv'];
|
||||
productRights.forEach((container, index) => {
|
||||
const video = container.querySelector('.right-video');
|
||||
const btn = container.querySelector('.video-play-btn');
|
||||
const img = container.querySelector('.right-img');
|
||||
if (!video || !btn || !img) return;
|
||||
const videoSrc = video.src.trim()
|
||||
console.log(videoSrc,'=videoSrc=')
|
||||
// 修复:正确检测有效视频地址
|
||||
// 排除空字符串、null、undefined
|
||||
const hasValidVideo = !!videoSrc && videoSrc.trim() !== '' && videoSrc !== 'undefined' && videoSrc !== 'null';
|
||||
|
||||
productRights.forEach((container, index) => {
|
||||
const video = container.querySelector('.right-video');
|
||||
const btn = container.querySelector('.video-play-btn');
|
||||
const img = container.querySelector('.right-img');
|
||||
if (!video || !btn || !img) return;
|
||||
const videoSrc = video.src.trim()
|
||||
// 修复:正确检测有效视频地址
|
||||
// 排除空字符串、null、undefined
|
||||
const hasValidVideo = !!videoSrc && videoSrc.trim() !== '' && videoSrc !== 'undefined' && videoSrc !== 'null';
|
||||
// 验证视频格式是否有效
|
||||
const isValidFormat = supportedVideoFormats.some(format =>
|
||||
videoSrc.toLowerCase().endsWith(format) ||
|
||||
(videoSrc.includes('?') && videoSrc.toLowerCase().split('?')[0].endsWith(format))
|
||||
);
|
||||
|
||||
// 初始化状态:无视频则保持图片显示,永不切换
|
||||
if (!hasValidVideo) {
|
||||
img.style.display = 'block';
|
||||
video.style.display = 'none';
|
||||
btn.style.display = 'none';
|
||||
// 绑定空方法,防止调用报错
|
||||
video.switchMedia = function() {};
|
||||
console.log(`容器${index}:无有效视频(src="${videoSrc}"),保持图片显示`);
|
||||
return;
|
||||
}
|
||||
// 初始化状态:无视频或格式无效则保持图片显示,永不切换
|
||||
if (!hasValidVideo || !isValidFormat) {
|
||||
img.style.display = 'block';
|
||||
video.style.display = 'none';
|
||||
btn.style.display = 'none';
|
||||
// 绑定空方法,防止调用报错
|
||||
video.switchMedia = function() {};
|
||||
console.log(`容器${index}:无有效视频(src="${videoSrc}"),保持图片显示`);
|
||||
return;
|
||||
}
|
||||
|
||||
// 有有效视频的情况
|
||||
console.log(`容器${index}:有有效视频(src="${videoSrc}"),初始化播放逻辑`);
|
||||
// 有有效视频的情况
|
||||
console.log(`容器${index}:有有效视频(src="${videoSrc}"),初始化播放逻辑`);
|
||||
|
||||
// 初始状态
|
||||
video.style.display = 'none';
|
||||
video.pause();
|
||||
img.style.display = 'block';
|
||||
btn.style.display = 'none';
|
||||
btn.style.opacity = '0';
|
||||
|
||||
// 同步状态函数
|
||||
function syncMediaState() {
|
||||
if (img.style.display === 'block') {
|
||||
btn.style.display = 'none';
|
||||
btn.style.opacity = '0';
|
||||
} else {
|
||||
btn.style.display = 'block';
|
||||
btn.style.opacity = '1';
|
||||
btn.classList.toggle('paused', !video.paused && !video.ended);
|
||||
}
|
||||
}
|
||||
|
||||
// 按钮点击事件
|
||||
btn.addEventListener('click', () => {
|
||||
if (video.paused) {
|
||||
video.play().catch(() => syncMediaState());
|
||||
} else {
|
||||
video.pause();
|
||||
}
|
||||
syncMediaState();
|
||||
});
|
||||
|
||||
// 视频事件监听
|
||||
['play', 'pause', 'ended', 'playing', 'waiting'].forEach(event => {
|
||||
video.addEventListener(event, syncMediaState);
|
||||
});
|
||||
|
||||
// 滚动切换函数
|
||||
video.switchMedia = function(showVideo) {
|
||||
// 只处理有有效视频的情况
|
||||
if (showVideo) {
|
||||
img.style.display = 'none';
|
||||
video.style.display = 'block';
|
||||
video.play().catch(() => {
|
||||
console.log(`容器${index}:自动播放失败,需要用户交互`);
|
||||
syncMediaState();
|
||||
});
|
||||
} else {
|
||||
// 初始状态
|
||||
video.style.display = 'none';
|
||||
video.pause();
|
||||
img.style.display = 'block';
|
||||
video.style.display = 'none';
|
||||
}
|
||||
syncMediaState();
|
||||
};
|
||||
btn.style.display = 'none';
|
||||
btn.style.opacity = '0';
|
||||
|
||||
// 初始同步
|
||||
syncMediaState();
|
||||
});
|
||||
}
|
||||
// 同步状态函数
|
||||
function syncMediaState() {
|
||||
if (img.style.display === 'block') {
|
||||
btn.style.display = 'none';
|
||||
btn.style.opacity = '0';
|
||||
} else {
|
||||
btn.style.display = 'block';
|
||||
btn.style.opacity = '1';
|
||||
btn.classList.toggle('paused', !video.paused && !video.ended);
|
||||
}
|
||||
}
|
||||
|
||||
// 滚动监听 - 优化版
|
||||
function setupScrollWatcher() {
|
||||
let ticking = false;
|
||||
// 按钮点击事件
|
||||
btn.addEventListener('click', () => {
|
||||
if (video.paused) {
|
||||
video.play().catch(() => syncMediaState());
|
||||
} else {
|
||||
video.pause();
|
||||
}
|
||||
syncMediaState();
|
||||
});
|
||||
|
||||
function updateVideoVisibility() {
|
||||
const productRights = document.querySelectorAll('.product-right');
|
||||
// 视频事件监听
|
||||
['play', 'pause', 'ended', 'playing', 'waiting'].forEach(event => {
|
||||
video.addEventListener(event, syncMediaState);
|
||||
});
|
||||
|
||||
productRights.forEach(container => {
|
||||
const video = container.querySelector('.right-video');
|
||||
if (!video || !video.switchMedia) return;
|
||||
// 滚动切换函数
|
||||
video.switchMedia = function(showVideo) {
|
||||
// 只处理有有效视频的情况
|
||||
if (showVideo) {
|
||||
img.style.display = 'none';
|
||||
video.style.display = 'block';
|
||||
video.play().catch(() => {
|
||||
console.log(`容器${index}:自动播放失败,需要用户交互`);
|
||||
syncMediaState();
|
||||
});
|
||||
} else {
|
||||
video.pause();
|
||||
img.style.display = 'block';
|
||||
video.style.display = 'none';
|
||||
}
|
||||
syncMediaState();
|
||||
};
|
||||
|
||||
// 检查是否在视口中
|
||||
const rect = container.getBoundingClientRect();
|
||||
const viewHeight = window.innerHeight || document.documentElement.clientHeight;
|
||||
const isInView = rect.top < viewHeight * 0.7 && rect.bottom > viewHeight * 0.3;
|
||||
|
||||
// 只对有有效视频的元素调用switchMedia
|
||||
video.switchMedia(isInView);
|
||||
});
|
||||
|
||||
ticking = false;
|
||||
}
|
||||
|
||||
// 使用requestAnimationFrame优化性能
|
||||
window.addEventListener('scroll', () => {
|
||||
if (!ticking) {
|
||||
requestAnimationFrame(updateVideoVisibility);
|
||||
ticking = true;
|
||||
// 初始同步
|
||||
syncMediaState();
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 初始化
|
||||
initVideoContainers();
|
||||
setupScrollWatcher();
|
||||
// 滚动监听 - 优化版
|
||||
function setupScrollWatcher() {
|
||||
let ticking = false;
|
||||
|
||||
// 初始检查一次
|
||||
setTimeout(() => {
|
||||
const event = new Event('scroll');
|
||||
window.dispatchEvent(event);
|
||||
}, 300);
|
||||
});
|
||||
function updateVideoVisibility() {
|
||||
const productRights = document.querySelectorAll('.product-right');
|
||||
|
||||
productRights.forEach(container => {
|
||||
const video = container.querySelector('.right-video');
|
||||
if (!video || !video.switchMedia) return;
|
||||
|
||||
// 检查是否在视口中
|
||||
const rect = container.getBoundingClientRect();
|
||||
const viewHeight = window.innerHeight || document.documentElement.clientHeight;
|
||||
const isInView = rect.top < viewHeight * 0.7 && rect.bottom > viewHeight * 0.3;
|
||||
|
||||
// 只对有有效视频的元素调用switchMedia
|
||||
video.switchMedia(isInView);
|
||||
});
|
||||
|
||||
ticking = false;
|
||||
}
|
||||
|
||||
// 使用requestAnimationFrame优化性能
|
||||
window.addEventListener('scroll', () => {
|
||||
if (!ticking) {
|
||||
requestAnimationFrame(updateVideoVisibility);
|
||||
ticking = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 初始化
|
||||
initVideoContainers();
|
||||
setupScrollWatcher();
|
||||
|
||||
// 初始检查一次
|
||||
setTimeout(() => {
|
||||
const event = new Event('scroll');
|
||||
window.dispatchEvent(event);
|
||||
}, 300);
|
||||
});
|
||||
|
||||
window.onload = function () {
|
||||
if (typeof Swiper === 'undefined') {
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
{block name="main"}
|
||||
<a class="header" href="/">
|
||||
<div class="header-img">
|
||||
<img src="__IMAGES__/logo.png" alt="">
|
||||
<!-- <img src="__IMAGES__/logo.png" alt=""> -->
|
||||
</div>
|
||||
</a>
|
||||
<!-- 轮播核心容器 -->
|
||||
@@ -224,6 +224,7 @@
|
||||
</video>
|
||||
</div>
|
||||
{/notempty}
|
||||
|
||||
</div>
|
||||
{assign name="dc_second_section" value=":array_splice($data.desktop_charger, 0, 2)" /}
|
||||
{notempty name="dc_second_section"}
|
||||
@@ -337,7 +338,7 @@
|
||||
{/neq}
|
||||
{/volist}
|
||||
{notempty name="ct_more_section"}
|
||||
<a href="{$ct_more_section.link}" class="more">
|
||||
<a href="{$ct_more_section.link}" class="more" style="padding: clamp(1.5rem, 3vw, 3rem) 0">
|
||||
<div class="more-img">
|
||||
查看更多
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,320 @@
|
||||
/* iPad横屏特殊适配(可选) */
|
||||
@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
|
||||
.advantage-card-wrap {
|
||||
aspect-ratio: 1 / 1.6; /* 横屏时调整卡片比例 */
|
||||
}
|
||||
/* 核心模块:固定90%宽度(PC端),优化移动端边距 */
|
||||
.advantage-section {
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
padding: 4rem 0 3rem 0;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
height: auto !important;
|
||||
min-height: auto !important;
|
||||
}
|
||||
|
||||
/* 标题容器:恢复原有居中样式 */
|
||||
.advantage-section__title {
|
||||
font-size: clamp(1.5rem, 3vw, 2rem);
|
||||
font-weight: 700;
|
||||
text-align: center;
|
||||
color: #333;
|
||||
line-height: 1.2;
|
||||
margin-bottom: clamp(1.5rem, 2vw, 2.5rem);
|
||||
}
|
||||
|
||||
/* 列表容器:强制设置高度相关属性,确保内容正常显示 */
|
||||
.advantage-section__list {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: flex-start;
|
||||
gap: clamp(0.1rem, 0.3vw, 0.8rem);
|
||||
width: 100% !important;
|
||||
flex-wrap: nowrap;
|
||||
overflow: visible !important; /* 改为visible确保内容显示 */
|
||||
padding: 0 !important;
|
||||
/* 强制设置高度相关属性 */
|
||||
height: auto !important;
|
||||
min-height: 1px !important; /* 确保容器至少有高度 */
|
||||
position: relative !important; /* 建立BFC */
|
||||
}
|
||||
|
||||
/* 卡片包裹容器:确保为块级元素并继承高度 */
|
||||
.advantage-card-wrap {
|
||||
display: block !important;
|
||||
width: 100% !important;
|
||||
height: auto !important;
|
||||
min-height: 1px !important;
|
||||
}
|
||||
|
||||
/* 卡片核心:高度自适应内容 */
|
||||
.advantage-card {
|
||||
flex: 0 0 calc((100% - 4 * clamp(0.1rem, 0.3vw, 0.8rem)) / 5);
|
||||
min-width: calc((100% - 4 * clamp(0.1rem, 0.3vw, 0.8rem)) / 5);
|
||||
max-width: calc((100% - 4 * clamp(0.1rem, 0.3vw, 0.8rem)) / 5);
|
||||
border-radius: 0.5rem;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.1);
|
||||
transition: transform 0.3s ease;
|
||||
cursor: pointer;
|
||||
background: #fff;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
height: auto !important; /* 高度自适应内容 */
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
/* 图片容器:设置为1:1比例 */
|
||||
.advantage-card__img {
|
||||
width: 100%;
|
||||
aspect-ratio: 1 / 1; /* 1:1图片比例 */
|
||||
object-fit: cover;
|
||||
background-color: #f9f9f9;
|
||||
display: block;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
/* 文字区域:flex垂直分布,确保标题和描述都垂直居中 */
|
||||
.advantage-card__content {
|
||||
width: 100%;
|
||||
padding: clamp(0.3rem, 0.4vw, 0.75rem);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex-grow: 1;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
/* 标题容器:水平居中+内部两端对齐,同时垂直居中 */
|
||||
.advantage-card__heading-wrap {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: clamp(0.3rem, 0.5vw, 0.5rem);
|
||||
width: 80%;
|
||||
}
|
||||
|
||||
/* 卡片标题:居左显示 */
|
||||
.advantage-card__heading {
|
||||
font-size: clamp(0.85rem, 1.5vw, 1.4rem);
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
line-height: 1.3;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
/* 卡片标题右侧箭头:自适应大小,与标题协调 */
|
||||
.card-arrow {
|
||||
color: #409eff;
|
||||
transition: transform 0.3s ease;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
/* 箭头大小根据标题字体大小自适应 */
|
||||
width: clamp(1rem, 1.8vw, 1.5rem);
|
||||
height: clamp(1rem, 1.8vw, 1.5rem);
|
||||
font-size: clamp(0.7rem, 1.2vw, 1.1rem);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
/* 卡片hover时箭头动画 */
|
||||
.advantage-card:hover .card-arrow {
|
||||
transform: translateX(3px);
|
||||
}
|
||||
|
||||
/* 描述文字:水平+垂直居中,与标题容器对齐 */
|
||||
.advantage-card__description {
|
||||
font-size: clamp(0.6rem, 0.9vw, 0.9rem);
|
||||
color: #78787a;
|
||||
line-height: 1.2;
|
||||
white-space: normal;
|
||||
overflow: hidden;
|
||||
width: 80%;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
|
||||
}
|
||||
|
||||
/* 卡片hover效果 */
|
||||
.advantage-card:hover {
|
||||
transform: scale(1.03);
|
||||
}
|
||||
|
||||
/* 箭头容器:自适应尺寸 */
|
||||
.arrow {
|
||||
position: relative;
|
||||
/* 箭头尺寸跟随card-arrow自适应 */
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
/* 箭头线条基础样式:自适应粗细 */
|
||||
.arrow::before,
|
||||
.arrow::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
background-color: #fff;
|
||||
border-radius: clamp(0.05rem, 0.1vw, 0.1rem);
|
||||
/* 线条粗细自适应 */
|
||||
height: clamp(0.08rem, 0.15vw, 0.12rem);
|
||||
}
|
||||
|
||||
/* 右箭头:自适应长度 */
|
||||
.arrow-right::before {
|
||||
width: clamp(0.3rem, 0.7vw, 0.55rem);
|
||||
top: 50%;
|
||||
left: 0;
|
||||
transform: translateY(-50%) rotate(45deg);
|
||||
transform-origin: right center;
|
||||
}
|
||||
|
||||
.arrow-right::after {
|
||||
width: clamp(0.3rem, 0.7vw, 0.55rem);
|
||||
top: 50%;
|
||||
left: 0;
|
||||
transform: translateY(-50%) rotate(-45deg);
|
||||
transform-origin: right center;
|
||||
}
|
||||
|
||||
/* 左箭头:自适应长度 */
|
||||
.arrow-left::before {
|
||||
width: clamp(0.3rem, 0.7vw, 0.55rem);
|
||||
top: 50%;
|
||||
right: 0;
|
||||
transform: translateY(-50%) rotate(-45deg);
|
||||
transform-origin: left center;
|
||||
}
|
||||
|
||||
.arrow-left::after {
|
||||
width: clamp(0.3rem, 0.7vw, 0.55rem);
|
||||
top: 50%;
|
||||
right: 0;
|
||||
transform: translateY(-50%) rotate(45deg);
|
||||
transform-origin: left center;
|
||||
}
|
||||
|
||||
/* iPad Pro适配:和移动端一样一行展示2个,最后一个隐藏,字体放大 */
|
||||
@media (max-width: 1024px) and (min-width: 768px) {
|
||||
.advantage-section__list {
|
||||
display: block !important;
|
||||
width: 100% !important;
|
||||
height: auto !important;
|
||||
overflow: hidden !important;
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
.advantage-card-wrap {
|
||||
width: calc(50% - 7.5px) !important;
|
||||
float: left !important;
|
||||
margin: 0 0 15px 0 !important;
|
||||
height: auto !important;
|
||||
}
|
||||
|
||||
.advantage-card-wrap:nth-child(odd) {
|
||||
margin-right: 15px !important;
|
||||
}
|
||||
|
||||
.advantage-card {
|
||||
width: 100% !important;
|
||||
min-width: 100% !important;
|
||||
max-width: 100% !important;
|
||||
flex: none !important;
|
||||
height: auto !important;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
/* 只显示前4个卡片,最后一个隐藏 */
|
||||
.advantage-card-wrap:nth-child(n+5) {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.advantage-card__content {
|
||||
width: 100%;
|
||||
flex-grow: 1;
|
||||
padding: clamp(1rem, 3vw, 1.5rem) 0;
|
||||
}
|
||||
|
||||
.advantage-card__img {
|
||||
aspect-ratio: 1 / 1;
|
||||
max-height: 330px;
|
||||
}
|
||||
|
||||
/* 平板端字体放大 */
|
||||
.advantage-card__heading {
|
||||
font-size: clamp(1.1rem, 2vw, 1.6rem);
|
||||
}
|
||||
|
||||
.advantage-card__description {
|
||||
font-size: clamp(0.85rem, 1.3vw, 1.1rem);
|
||||
|
||||
}
|
||||
|
||||
.card-arrow {
|
||||
width: clamp(1.2rem, 2vw, 1.7rem);
|
||||
height: clamp(1.2rem, 2vw, 1.7rem);
|
||||
font-size: clamp(0.9rem, 1.5vw, 1.3rem);
|
||||
}
|
||||
}
|
||||
|
||||
/* 移动端布局调整:彻底修复高度为0问题 */
|
||||
@media (max-width: 767px) {
|
||||
/* 使用block布局+浮动确保高度正常 */
|
||||
.advantage-section__list {
|
||||
display: block !important;
|
||||
width: 100% !important;
|
||||
height: auto !important;
|
||||
overflow: hidden !important;
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
/* 卡片包裹容器:使用浮动实现一行2个 */
|
||||
.advantage-card-wrap {
|
||||
width: calc(50% - 7.5px) !important;
|
||||
float: left !important;
|
||||
margin: 0 0 15px 0 !important;
|
||||
height: auto !important;
|
||||
}
|
||||
|
||||
/* 偶数个卡片添加右边距 */
|
||||
.advantage-card-wrap:nth-child(odd) {
|
||||
margin-right: 15px !important;
|
||||
}
|
||||
|
||||
/* 卡片尺寸调整 */
|
||||
.advantage-card {
|
||||
width: 100% !important;
|
||||
min-width: 100% !important;
|
||||
max-width: 100% !important;
|
||||
flex: none !important;
|
||||
height: auto !important;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
/* 只显示前4个卡片 */
|
||||
.advantage-card-wrap:nth-child(n+5) {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.advantage-card__img {
|
||||
aspect-ratio: 1 / 1;
|
||||
}
|
||||
|
||||
.advantage-card__content {
|
||||
flex-grow: 1;
|
||||
padding: clamp(1rem, 3vw, 1.5rem) 0; /* 平板端底部内边距稍大 */
|
||||
}
|
||||
}
|
||||
|
||||
/* 超小屏进一步优化 */
|
||||
@media (max-width: 374px) {
|
||||
.advantage-card-wrap {
|
||||
width: calc(50% - 5px) !important;
|
||||
}
|
||||
|
||||
.advantage-card-wrap:nth-child(odd) {
|
||||
margin-right: 10px !important;
|
||||
}
|
||||
}
|
||||
@@ -32,6 +32,7 @@ html {
|
||||
}
|
||||
body {
|
||||
background: rgb(242, 243, 245);
|
||||
/* margin:0 !important; */
|
||||
}
|
||||
a {
|
||||
text-decoration: none;
|
||||
@@ -56,8 +57,8 @@ a {
|
||||
}
|
||||
|
||||
.line {
|
||||
width: 100%;
|
||||
height: clamp(2.5rem, 5vw, 15rem);
|
||||
width: 100%;
|
||||
height: clamp(1.5rem, 3vw, 3rem);
|
||||
}
|
||||
.header {
|
||||
width: 100%;
|
||||
|
||||
@@ -9,19 +9,16 @@
|
||||
display: none;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
z-index: 99999;
|
||||
z-index: 9999;
|
||||
overflow: hidden; /* 阻止蒙版自身滚动 */
|
||||
touch-action: none; /* 禁止触摸行为 */
|
||||
pointer-events: auto; /* 确保蒙版能接收事件 */
|
||||
backdrop-filter: blur(8px); /* 模糊半径,可调整(4px-15px为宜) */
|
||||
-webkit-backdrop-filter: blur(8px); /* 兼容Safari */
|
||||
}
|
||||
|
||||
/* 蒙版内容容器 - 新增触摸事件传递控制 */
|
||||
.mask-content {
|
||||
width: 80%;
|
||||
height: 100% !important;
|
||||
padding: 3% 5%;
|
||||
height: 100%;
|
||||
background: rgb(242, 243, 245);
|
||||
border-radius: 12px;
|
||||
overflow: hidden; /* 内容容器不滚动 */
|
||||
@@ -34,7 +31,7 @@
|
||||
}
|
||||
|
||||
/* 滚动内容容器 - 保持不变 */
|
||||
.mask-e-scroll-content {
|
||||
.mask-scroll-content {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
padding: 20px;
|
||||
@@ -69,7 +66,7 @@
|
||||
background-color: rgba(0, 0, 0, 0.3);
|
||||
border-radius: 50%;
|
||||
color: #fff;
|
||||
font-size: 30px;
|
||||
font-size: 20px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
@@ -1,266 +1,184 @@
|
||||
/* 核心模块:固定90%宽度(PC端),优化移动端边距 */
|
||||
.advantage-section {
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
padding: 2rem 0;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
.product-box {
|
||||
background: #fff;
|
||||
padding: clamp(1.5rem, 3vw, 3rem) 0;
|
||||
/* 产品块之间留间距 */
|
||||
}
|
||||
|
||||
/* 标题容器:恢复原有居中样式 */
|
||||
.advantage-section__title {
|
||||
font-size: clamp(1.5rem, 3vw, 2rem);
|
||||
font-weight: 700;
|
||||
text-align: center;
|
||||
color: #333;
|
||||
line-height: 1.2;
|
||||
margin-bottom: clamp(1.5rem, 2vw, 2.5rem);
|
||||
.product-title {
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
padding-bottom: clamp(1.5rem, 3vw, 3rem);
|
||||
}
|
||||
|
||||
/* 列表容器:优化gap,确保移动端5列不溢出 */
|
||||
.advantage-section__list {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: flex-start;
|
||||
gap: clamp(0.1rem, 0.3vw, 0.8rem);
|
||||
width: 100%;
|
||||
flex-wrap: nowrap;
|
||||
overflow: hidden;
|
||||
padding: 0 0.1rem;
|
||||
.product-title-h2 {
|
||||
font-size: clamp(1.5rem, 3vw, 2.25rem);
|
||||
/* padding-top: clamp(1.5rem, 3vw, 3rem); */
|
||||
}
|
||||
|
||||
/* 新增:卡片外层容器(专门控制圆角,避免缩放时丢失) */
|
||||
.advantage-card-wrap {
|
||||
flex: 0 0 calc((100% - 4 * clamp(0.1rem, 0.3vw, 0.8rem)) / 5);
|
||||
min-width: calc((100% - 4 * clamp(0.1rem, 0.3vw, 0.8rem)) / 5);
|
||||
max-width: calc((100% - 4 * clamp(0.1rem, 0.3vw, 0.8rem)) / 5);
|
||||
border-radius: 0.5rem; /* 外层容器承担圆角 */
|
||||
overflow: hidden; /* 裁剪内部缩放的卡片 */
|
||||
box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.1); /* 阴影移到外层,避免缩放时阴影变形 */
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
aspect-ratio: 1 / 1.7;
|
||||
.product-title-p {
|
||||
font-size: clamp(0.875rem, 1.5vw, 1.125rem);
|
||||
color: #646464;
|
||||
margin-top: clamp(0.5rem, 1vw, 0.75rem);
|
||||
}
|
||||
|
||||
/* 卡片核心:优化宽高比和尺寸计算 */
|
||||
.advantage-card {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
cursor: pointer;
|
||||
background: #fff;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
/* 关键修复:添加will-change优化渲染,移除原圆角和阴影(移到外层) */
|
||||
will-change: transform; /* 告知浏览器准备变换,避免圆角渲染异常 */
|
||||
transition: transform 0.3s ease;
|
||||
/* 容器布局:两个产品通用 */
|
||||
.product-container {
|
||||
display: flex;
|
||||
gap: clamp(0.4rem, 1vw, 0.71rem);
|
||||
margin: 0 auto;
|
||||
width: 90%;
|
||||
align-items: flex-start;
|
||||
}
|
||||
|
||||
.advantage-card__img {
|
||||
width: 100%;
|
||||
height: 72%;
|
||||
/* PC端图片占比提升至72%,文字区域压缩 */
|
||||
object-fit: cover;
|
||||
background-color: #f9f9f9;
|
||||
display: block;
|
||||
/* 左侧容器:两个产品通用 */
|
||||
.product-left {
|
||||
flex: 1.8;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* 文字区域:flex垂直分布,确保标题和描述都垂直居中 */
|
||||
.advantage-card__content {
|
||||
width: 100%;
|
||||
height: 28%;
|
||||
/* PC端文字区域占比降至28% */
|
||||
padding: clamp(0.3rem, 0.4vw, 0.75rem);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
/* 整体垂直居中 */
|
||||
align-items: center;
|
||||
/* 子元素水平居中(关键) */
|
||||
/* text-align: center; */
|
||||
flex-shrink: 0;
|
||||
gap: 4px;
|
||||
/* 标题和描述之间的垂直间距,避免贴边 */
|
||||
.product-img {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
border-radius: 10px;
|
||||
display: block;
|
||||
/* 取消图片底部空隙 */
|
||||
}
|
||||
|
||||
/* 标题容器:水平居中+内部两端对齐,同时垂直居中 */
|
||||
.advantage-card__heading-wrap {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
/* 内部标题和箭头垂直对齐 */
|
||||
justify-content: space-between;
|
||||
/* 文字左、箭头右 */
|
||||
gap: 8px;
|
||||
width: 80%;
|
||||
/* 限制宽度,体现居中效果 */
|
||||
/* 移除底部margin,通过父容器gap控制间距 */
|
||||
/* 悬浮图公共样式:两个产品尺寸完全一致(100%宽度) */
|
||||
.product-img-hover {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
|
||||
/* 两个产品悬浮图宽度相同 */
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
/* 卡片标题:居左显示 */
|
||||
.advantage-card__heading {
|
||||
font-size: clamp(0.85rem, 1.5vw, 1.4rem);
|
||||
/* 比原尺寸放大,PC端更醒目,移动端自适应 */
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
line-height: 1.3;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
.product-img-hover img {
|
||||
width: 100%;
|
||||
max-width: 300px;
|
||||
/* 图片尺寸100%,无区别 */
|
||||
height: auto;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
/* 卡片标题右侧箭头:居右显示 */
|
||||
.card-arrow {
|
||||
color: #409eff;
|
||||
font-size: clamp(0.7rem, 1vw, 1rem);
|
||||
/* 箭头尺寸跟随标题放大,避免不协调 */
|
||||
transition: transform 0.3s ease;
|
||||
display: inline-block;
|
||||
width: 16px;
|
||||
/* 箭头宽度同步增加 */
|
||||
text-align: center;
|
||||
/* 第一个产品:悬浮图居中上移(仅定位差异) */
|
||||
.product-img-1 {
|
||||
top: -10%;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
|
||||
/* 卡片hover时箭头动画 */
|
||||
.advantage-card:hover .card-arrow {
|
||||
transform: translateX(3px);
|
||||
/* 第二个产品:悬浮图上右超出(仅定位差异) */
|
||||
.product-img-2 {
|
||||
top: -10%;
|
||||
/* 上超出 */
|
||||
transform: none;
|
||||
width: 108%;
|
||||
/* 取消居中 */
|
||||
}
|
||||
|
||||
/* 描述文字:水平+垂直居中,与标题容器对齐(仅添加最小高度修复对齐问题) */
|
||||
.advantage-card__description {
|
||||
font-size: clamp(0.6rem, 0.9vw, 0.9rem);
|
||||
/* PC端描述文字略放大 */
|
||||
color: #666;
|
||||
line-height: 1.2;
|
||||
/* PC端行高略紧凑 */
|
||||
white-space: normal;
|
||||
overflow: hidden;
|
||||
width: 80%;
|
||||
/* 与标题容器宽度一致 */
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
/* 最多2行,避免高度溢出 */
|
||||
-webkit-box-orient: vertical;
|
||||
/* 核心修复:固定最小高度=2行文字高度,确保1行时也占满空间 */
|
||||
min-height: calc(clamp(0.6rem, 0.9vw, 0.9rem) * 2 * 1.4);
|
||||
/* 确保文字垂直居中 */
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: left;
|
||||
/* 右侧容器:两个产品通用 */
|
||||
.product-right {
|
||||
flex: 3.2;
|
||||
position: relative;
|
||||
border-radius: 10px;
|
||||
overflow: hidden;
|
||||
width: 100%;
|
||||
background-color: #f5f5f5;
|
||||
align-self: stretch;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
/* 卡片hover效果(仅保留缩放,阴影移到外层) */
|
||||
.advantage-card:hover {
|
||||
transform: scale(1.03);
|
||||
z-index: 10;
|
||||
.right-content {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
transition: opacity 0.3s ease;
|
||||
}
|
||||
|
||||
/* 外层容器hover时增强阴影(更自然的浮起效果) */
|
||||
.advantage-card-wrap:hover {
|
||||
box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.15);
|
||||
.right-video {
|
||||
display: none;
|
||||
}
|
||||
.video-play-btn {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
background: none;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
opacity: 0;
|
||||
transition: opacity 0.3s ease;
|
||||
z-index: 2;
|
||||
display: none; /* 默认隐藏 */
|
||||
}
|
||||
|
||||
/* 平板+移动端适配 - 核心修改:一行2个,显示2行,隐藏第5个 */
|
||||
@media (max-width: 1024px) { /* 平板断点调整为1024px */
|
||||
.advantage-card:active {
|
||||
transform: scale(1.01);
|
||||
}
|
||||
|
||||
.advantage-section {
|
||||
width: 95%;
|
||||
/* 平板/移动端扩大容器宽度 */
|
||||
}
|
||||
|
||||
.advantage-section__list {
|
||||
gap: 0.5rem; /* 优化间距,更美观 */
|
||||
flex-wrap: wrap; /* 允许换行 */
|
||||
overflow: visible; /* 取消溢出隐藏,显示多行 */
|
||||
justify-content: space-between; /* 两端对齐,确保2个卡片均匀分布 */
|
||||
}
|
||||
|
||||
/* 平板/移动端卡片宽度:一行2个 */
|
||||
.advantage-card-wrap {
|
||||
flex: 0 0 calc(50% - 0.25rem); /* 50%宽度减去一半间距,避免溢出 */
|
||||
min-width: calc(50% - 0.25rem);
|
||||
max-width: calc(50% - 0.25rem);
|
||||
aspect-ratio: 1 / 1.8;
|
||||
margin-bottom: 0.5rem; /* 行与行之间的间距 */
|
||||
}
|
||||
|
||||
/* 隐藏第5个卡片 */
|
||||
.advantage-card-wrap:nth-child(5) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.advantage-card__img {
|
||||
height: 62%;
|
||||
/* 平板/移动端图片占比调整 */
|
||||
}
|
||||
|
||||
.advantage-card__content {
|
||||
height: 38%;
|
||||
/* 平板/移动端文字区域占比调整 */
|
||||
padding: 0.2rem 0.15rem;
|
||||
gap: 6px;
|
||||
/* 间距优化 */
|
||||
}
|
||||
|
||||
/* 平板/移动端标题容器宽度放宽 */
|
||||
.advantage-card__heading-wrap {
|
||||
width: 90%;
|
||||
}
|
||||
|
||||
.advantage-card__description {
|
||||
line-height: 1.2;
|
||||
width: 90%;
|
||||
-webkit-line-clamp: 2;
|
||||
/* 同步添加最小高度 */
|
||||
min-height: calc(clamp(0.5rem, 0.8vw, 0.8rem) * 2 * 1.5);
|
||||
}
|
||||
|
||||
/* 平板/移动端箭头和文字尺寸调整 */
|
||||
.card-arrow {
|
||||
font-size: clamp(0.45rem, 0.7vw, 0.8rem);
|
||||
width: 10px;
|
||||
}
|
||||
|
||||
.advantage-card__heading {
|
||||
/* font-size: clamp(1rem, 1vw, 32rem); */
|
||||
font-size: 50px;
|
||||
}
|
||||
|
||||
.advantage-card__description {
|
||||
font-size: 22px;
|
||||
}
|
||||
/* 播放图标默认显示,暂停图标默认隐藏 */
|
||||
.play-icon {
|
||||
display: inline-block;
|
||||
}
|
||||
.pause-icon {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* 移动端适配(小屏手机) */
|
||||
@media (max-width: 767px) {
|
||||
.advantage-section {
|
||||
width: 95%;
|
||||
}
|
||||
|
||||
.advantage-card__heading {
|
||||
font-size: clamp(0.55rem, 1vw, 0.95rem);
|
||||
}
|
||||
/* .paused类时切换图标 */
|
||||
.video-play-btn.paused .play-icon {
|
||||
display: none;
|
||||
}
|
||||
.video-play-btn.paused .pause-icon {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
/* 超小屏适配 */
|
||||
@media (max-width: 374px) {
|
||||
.advantage-section {
|
||||
width: 98%;
|
||||
}
|
||||
|
||||
.advantage-card__heading {
|
||||
font-size: clamp(0.55rem, 0.9vw, 0.9rem);
|
||||
}
|
||||
|
||||
.advantage-card__heading-wrap {
|
||||
width: 95%;
|
||||
gap: 5px;
|
||||
}
|
||||
|
||||
.advantage-card__description {
|
||||
width: 95%;
|
||||
/* 超小屏保持最小高度 */
|
||||
min-height: calc(clamp(0.5rem, 0.8vw, 0.8rem) * 2 * 1.5);
|
||||
}
|
||||
/* 视频显示时按钮可见 */
|
||||
.right-video[playing] ~ .video-play-btn,
|
||||
.product-right:hover .video-play-btn {
|
||||
opacity: 1;
|
||||
display: block;
|
||||
}
|
||||
/* PC端适配:仅微调定位参数,尺寸不变 */
|
||||
@media (min-width: 1024px) {
|
||||
.product-container {
|
||||
width: 90%;
|
||||
}
|
||||
|
||||
.product-left {
|
||||
flex: 2;
|
||||
}
|
||||
|
||||
.product-right {
|
||||
flex: 5;
|
||||
}
|
||||
|
||||
/* 宽度保持一致,仅调定位偏移 */
|
||||
.product-img-1 {
|
||||
top: -11%;
|
||||
}
|
||||
|
||||
.product-img-2 {
|
||||
top: -12%;
|
||||
}
|
||||
}
|
||||
|
||||
/* 超小屏适配:尺寸不变,微调定位 */
|
||||
@media (max-width: 375px) {
|
||||
.product-left {
|
||||
flex: 1.5;
|
||||
}
|
||||
|
||||
.product-right {
|
||||
flex: 3.5;
|
||||
}
|
||||
|
||||
/* 宽度仍保持一致 */
|
||||
.product-img-1 {
|
||||
top: -6%;
|
||||
}
|
||||
|
||||
.product-img-2 {
|
||||
top: -8%;
|
||||
}
|
||||
}
|
||||
@@ -9,76 +9,76 @@
|
||||
width: 100%;
|
||||
margin: 0 auto;
|
||||
display: flex;
|
||||
flex-wrap: wrap; /* 修改为可换行 */
|
||||
overflow: visible; /* 改为可见,显示所有内容 */
|
||||
gap: clamp(0.6rem, 1vw, 0.8rem);
|
||||
padding: 0;
|
||||
flex-wrap: nowrap;
|
||||
overflow: visible !important; /* 改为visible,显示所有内容 */
|
||||
padding: 0 clamp(0.2rem, 0.6vw, 0.3rem);
|
||||
height: auto !important; /* 高度自适应内容 */
|
||||
}
|
||||
|
||||
/* 新增:外层容器(承载圆角、阴影、尺寸,避免缩放时圆角丢失) */
|
||||
/* 卡片包裹容器:确保不独占一行 */
|
||||
.product-card-wrap {
|
||||
width: calc(25% - (clamp(0.6rem, 1vw, 0.8rem) * 3 / 4));
|
||||
flex: none;
|
||||
border-radius: clamp(0.375rem, 1vw, 0.5rem);
|
||||
overflow: hidden;
|
||||
box-shadow: 0 clamp(0.1rem, 0.2vw, 0.125rem) clamp(0.3rem, 0.8vw, 0.5rem) rgba(0, 0, 0, 0.05);
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
margin-bottom: clamp(1rem, 2vw, 1.5rem); /* 添加底部间距 */
|
||||
display: contents; /* 让包裹容器不影响布局 */
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* ######################################################################### */
|
||||
/* 移动端样式(单独配置,max-width: 1023px)- 后续修改仅改这里 */
|
||||
/* 移动端+平板样式(max-width: 1023px)- 后续修改仅改这里 */
|
||||
/* ######################################################################### */
|
||||
@media (max-width: 1023px) {
|
||||
/* 卡片容器:移动端特有 */
|
||||
/* 卡片容器:移动端+平板特有 - 改为wrap换行,一行2个,高度自适应 */
|
||||
.product-card-container {
|
||||
align-items: stretch;
|
||||
justify-content: flex-start; /* 左对齐 */
|
||||
align-items: flex-start; /* 改为flex-start,避免拉伸 */
|
||||
flex-wrap: wrap !important; /* 强制开启换行 */
|
||||
justify-content: flex-start !important; /* 左对齐 */
|
||||
gap: clamp(0.5rem, 1vw, 1rem) !important; /* 设置间距 */
|
||||
padding: 0 clamp(0.2rem, 0.6vw, 0.3rem) clamp(1rem, 2vw, 1.5rem) !important;
|
||||
height: auto !important; /* 高度自适应内容 */
|
||||
}
|
||||
|
||||
/* 外层容器移动端适配:一行2个 */
|
||||
.product-card-wrap {
|
||||
width: calc(50% - (clamp(0.6rem, 1vw, 0.8rem) * 1 / 2));
|
||||
aspect-ratio: 3 / 4.2;
|
||||
}
|
||||
/* 卡片包裹容器:移动端+平板适配 */
|
||||
.product-card-wrap {
|
||||
display: block !important;
|
||||
width: calc(50% - clamp(0.25rem, 0.5vw, 0.5rem)) !important;
|
||||
margin: 0 !important;
|
||||
padding: 0 !important;
|
||||
height: auto !important; /* 高度自适应 */
|
||||
}
|
||||
|
||||
/* 卡片核心:移动端调整 */
|
||||
/* 卡片核心:移动端+平板改为一行2个,高度自适应内容 */
|
||||
.product-card {
|
||||
background: rgb(242, 243, 245);
|
||||
border-radius: clamp(0.375rem, 1vw, 0.5rem);
|
||||
cursor: pointer;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
width: 100% !important; /* 卡片宽度100%,由包裹容器控制 */
|
||||
flex: none;
|
||||
margin: 0;
|
||||
box-shadow: 0 clamp(0.1rem, 0.2vw, 0.125rem)
|
||||
clamp(0.3rem, 0.8vw, 0.5rem) rgba(0, 0, 0, 0.05);
|
||||
margin: 0 !important; /* 移除margin,用gap控制间距 */
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
will-change: transform;
|
||||
height: auto !important; /* 高度自适应内容 */
|
||||
}
|
||||
|
||||
/* 卡片hover效果 */
|
||||
/* 卡片hover效果:移动端+平板特有 */
|
||||
.product-card:hover {
|
||||
transform: scale(clamp(1.01, 1.02, 1.03));
|
||||
transition: transform 0.3s ease;
|
||||
}
|
||||
|
||||
.product-card-wrap:hover {
|
||||
box-shadow: 0 clamp(0.2rem, 0.4vw, 0.25rem) clamp(0.5rem, 1vw, 0.8rem) rgba(0, 0, 0, 0.08);
|
||||
}
|
||||
|
||||
/* 图片容器 */
|
||||
/* 图片容器:移动端+平板固定占比 */
|
||||
.product-card-img {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
flex: 0 0 72%;
|
||||
flex: 0 0 auto; /* 改为auto,高度自适应 */
|
||||
aspect-ratio: 3 / 2.8; /* 保持图片比例 */
|
||||
margin-bottom: clamp(0.4rem, 0.6vw, 0.5rem);
|
||||
overflow: hidden;
|
||||
border-radius: clamp(0.2rem, 0.4vw, 0.25rem);
|
||||
}
|
||||
|
||||
/* 产品图片 */
|
||||
/* 产品图片:移动端+平板特有 */
|
||||
.product-card img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
@@ -86,66 +86,85 @@
|
||||
object-position: center;
|
||||
}
|
||||
|
||||
/* 文字容器 */
|
||||
/* 文字容器:移动端+平板高度自适应 */
|
||||
.product-card-text {
|
||||
/* flex: 0 0 20%; */
|
||||
/* display: flex;
|
||||
flex: 1 1 auto; /* 改为flex:1,高度自适应内容 */
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center; */
|
||||
justify-content: center;
|
||||
padding-left: clamp(0.8rem, 2vw, 1.5rem);
|
||||
padding-right: clamp(0.8rem, 2vw, 1.5rem);
|
||||
height: auto !important; /* 高度自适应 */
|
||||
}
|
||||
|
||||
/* 标题样式 */
|
||||
/* 标题样式:移动端+平板特有,高度自适应 */
|
||||
.product-card-title {
|
||||
font-size:clamp(0.8rem, 1.3vw, 1.9rem);
|
||||
font-size: clamp(0.8rem, 1.3vw, 1.2rem);
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
/* height: 35%; */
|
||||
/* line-height: 1.2; */
|
||||
height: auto !important; /* 移除固定高度 */
|
||||
margin-bottom: clamp(0.2rem, 0.4vw, 0.3rem); /* 添加间距 */
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
/* 描述样式 */
|
||||
/* 描述样式:移动端+平板高度自适应 */
|
||||
.product-card-desc {
|
||||
font-size: clamp(0.8rem, 1.3vw, 1.5rem);
|
||||
font-size: clamp(0.7rem, 1.1vw, 0.9rem);
|
||||
color: #656565;
|
||||
word-break: break-word;
|
||||
/* height: 65%; */
|
||||
height: auto !important; /* 移除固定高度 */
|
||||
overflow: hidden;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
padding-top:clamp(0.4rem, 3vw, 0.6rem);
|
||||
-webkit-box-orient: vertical;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
/* 链接图标容器 */
|
||||
/* 链接图标容器:移动端+平板高度自适应,添加较小的底部内边距 */
|
||||
.product-card-link {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex: 1;
|
||||
flex: 0 0 auto; /* 改为auto,高度自适应 */
|
||||
padding: clamp(0.5rem, 1vw, 0.8rem); /* 减小上下内边距 */
|
||||
padding-bottom: clamp(1rem, 3vw, 1.5rem); /* 更小的底部内边距(约12px) */
|
||||
padding-left: clamp(0.8rem, 2vw, 1.5rem);
|
||||
height: auto !important; /* 高度自适应 */
|
||||
}
|
||||
|
||||
/* 链接图标 */
|
||||
/* 链接图标:移动端+平板特有 */
|
||||
.product-card-link img {
|
||||
width: clamp(2.5rem, 5vw, 4.5rem);
|
||||
height: auto;
|
||||
object-fit: contain;
|
||||
}
|
||||
|
||||
/* 移动端768px以上补充样式 */
|
||||
/* 平板端(768px-1023px)补充样式 */
|
||||
@media (min-width: 768px) and (max-width: 1023px) {
|
||||
.product-card-img {
|
||||
flex: 0 0 72%;
|
||||
aspect-ratio: 3 / 2.8; /* 保持图片比例 */
|
||||
}
|
||||
|
||||
.product-card-link img {
|
||||
width: clamp(5rem, 4vw, 6rem);
|
||||
}
|
||||
|
||||
/* 平板端字体稍大 */
|
||||
.product-card-title {
|
||||
font-size: clamp(1rem, 1.5vw, 1.4rem);
|
||||
}
|
||||
|
||||
.product-card-desc {
|
||||
font-size: clamp(0.85rem, 1.2vw, 1rem);
|
||||
}
|
||||
|
||||
/* 平板端底部内边距稍大但仍较小 */
|
||||
.product-card-link {
|
||||
padding-bottom: clamp(1rem, 3vw, 1.5rem);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -153,59 +172,52 @@
|
||||
/* PC端样式(单独配置,min-width: 1024px)- 后续修改仅改这里 */
|
||||
/* ######################################################################### */
|
||||
@media (min-width: 1024px) {
|
||||
/* 卡片容器:PC端特有 */
|
||||
/* 卡片容器:PC端特有,高度自适应内容 */
|
||||
.product-card-container {
|
||||
align-items: stretch;
|
||||
height: clamp(30vw, 35vw, 480px);
|
||||
gap: clamp(0.6rem, 1vw, 0.8rem);
|
||||
padding: 0;
|
||||
flex-wrap: nowrap; /* PC端保持不换行 */
|
||||
overflow: hidden; /* PC端隐藏溢出 */
|
||||
align-items: flex-start; /* 改为flex-start,避免拉伸 */
|
||||
height: auto !important; /* 高度自适应内容 */
|
||||
}
|
||||
|
||||
/* 外层容器PC端适配 */
|
||||
.product-card-wrap {
|
||||
width: calc(25% - (clamp(0.6rem, 1vw, 0.8rem) * 3 / 4));
|
||||
height: 100%;
|
||||
margin-bottom: 0; /* PC端移除底部间距 */
|
||||
}
|
||||
/* 卡片包裹容器:PC端适配 */
|
||||
.product-card-wrap {
|
||||
display: contents;
|
||||
}
|
||||
|
||||
/* 卡片核心 */
|
||||
/* 卡片核心:PC端高度自适应内容 */
|
||||
.product-card {
|
||||
background: rgb(242, 243, 245);
|
||||
border-radius: clamp(0.375rem, 1vw, 0.5rem);
|
||||
cursor: pointer;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
width: calc(25% - clamp(0.3rem, 0.5vw, 0.36rem));
|
||||
flex: none;
|
||||
margin: 0;
|
||||
box-shadow: 0 clamp(0.1rem, 0.2vw, 0.125rem)
|
||||
clamp(0.3rem, 0.8vw, 0.5rem) rgba(0, 0, 0, 0.05);
|
||||
margin: 0 clamp(0.16rem, 0.24vw, 0.2rem);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
will-change: transform;
|
||||
height: auto !important; /* 高度自适应内容 */
|
||||
}
|
||||
|
||||
/* 卡片hover效果 */
|
||||
/* 卡片hover效果:PC端特有 */
|
||||
.product-card:hover {
|
||||
transform: scale(clamp(1.01, 1.02, 1.03));
|
||||
transition: transform 0.3s ease;
|
||||
}
|
||||
|
||||
.product-card-wrap:hover {
|
||||
box-shadow: 0 clamp(0.2rem, 0.4vw, 0.25rem) clamp(0.5rem, 1vw, 0.8rem) rgba(0, 0, 0, 0.08);
|
||||
}
|
||||
|
||||
/* 图片容器 */
|
||||
/* 图片容器:PC端高度自适应 */
|
||||
.product-card-img {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
flex: 0 0 72%;
|
||||
flex: 0 0 auto; /* 改为auto,高度自适应 */
|
||||
aspect-ratio: 3 / 2.8; /* 保持图片比例 */
|
||||
margin-bottom: clamp(0.4rem, 0.6vw, 0.5rem);
|
||||
overflow: hidden;
|
||||
border-radius: clamp(0.2rem, 0.4vw, 0.25rem);
|
||||
}
|
||||
|
||||
/* 产品图片 */
|
||||
/* 产品图片:PC端特有 */
|
||||
.product-card img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
@@ -213,17 +225,18 @@
|
||||
object-position: center;
|
||||
}
|
||||
|
||||
/* 文字容器 */
|
||||
/* 文字容器:PC端高度自适应 */
|
||||
.product-card-text {
|
||||
flex: 0 0 15%;
|
||||
display: flex;
|
||||
flex: 1 1 auto; /* 改为flex:1,高度自适应内容 */
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
padding-left: clamp(0.8rem, 2vw, 1.5rem);
|
||||
padding-right: clamp(0.8rem, 2vw, 1.5rem);
|
||||
display: flex; /* 确保flex布局 */
|
||||
height: auto !important; /* 高度自适应 */
|
||||
}
|
||||
|
||||
/* 标题样式 */
|
||||
/* 标题样式:PC端特有,高度自适应 */
|
||||
.product-card-title {
|
||||
font-size: clamp(0.8rem, 1.3vw, 1.2rem);
|
||||
font-weight: 600;
|
||||
@@ -231,16 +244,19 @@
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
height: auto !important; /* 高度自适应 */
|
||||
margin-bottom: clamp(0.2rem, 0.4vw, 0.3rem); /* 添加间距 */
|
||||
line-height: 1.2;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
/* 描述样式 */
|
||||
/* 描述样式:PC端高度自适应 */
|
||||
.product-card-desc {
|
||||
font-size: clamp(0.7rem, 1.1vw, 0.9rem);
|
||||
color: #656565;
|
||||
word-break: break-word;
|
||||
height: auto !important; /* 高度自适应 */
|
||||
overflow: hidden;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
@@ -248,16 +264,18 @@
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
/* 链接图标容器 */
|
||||
/* 链接图标容器:PC端高度自适应,添加较小的底部内边距 */
|
||||
.product-card-link {
|
||||
width: 100%;
|
||||
flex: 0 0 12%;
|
||||
padding-left: clamp(0.8rem, 2vw, 1.5rem);
|
||||
display: flex;
|
||||
display: flex; /* 确保flex布局 */
|
||||
align-items: center;
|
||||
flex: 0 0 auto; /* 改为auto,高度自适应 */
|
||||
padding-left: clamp(0.8rem, 2vw, 1.5rem);
|
||||
padding-bottom: clamp(1rem, 3vw, 1.5rem) ; /* 更小的底部内边距 */
|
||||
height: auto !important; /* 高度自适应 */
|
||||
}
|
||||
|
||||
/* 链接图标 */
|
||||
/* 链接图标:PC端特有 */
|
||||
.product-card-link img {
|
||||
width: clamp(2.5rem, 5vw, 4.5rem);
|
||||
height: auto;
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -25,9 +25,10 @@
|
||||
/* 列表容器:优化gap,确保移动端5列不溢出 */
|
||||
.advantage-section__list {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
justify-content: space-between;
|
||||
align-items: flex-start;
|
||||
gap: clamp(0.1rem, 0.3vw, 0.8rem);
|
||||
/* gap: clamp(0.1rem, 0.3vw, 0.8rem); */
|
||||
|
||||
width: 100%;
|
||||
flex-wrap: nowrap;
|
||||
overflow: hidden;
|
||||
@@ -152,7 +153,7 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: left;
|
||||
margin-top:clamp(10px, 0.9vw, 30px)
|
||||
margin-top:clamp(9px, 0.5vw, 18px)
|
||||
}
|
||||
|
||||
/* 卡片hover效果(仅保留缩放,阴影移到外层) */
|
||||
|
||||
@@ -43,9 +43,11 @@ a {
|
||||
margin: 0 auto;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
padding: 40px 0;
|
||||
max-width: 1690px;
|
||||
/* padding: 40px 0; */
|
||||
/* padding-top: clamp(1.5rem, 3vw, 3rem); */
|
||||
}
|
||||
|
||||
.more-img {
|
||||
background: #000;
|
||||
color: #fff;
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
/* 字体大小:小屏最小30px,大屏最大50px,中间按视口宽度自适应 */
|
||||
font-size: clamp(30px, 4vw, 50px);
|
||||
/* 顶部内边距:小屏最小80px,大屏最大160px,自适应缩放 */
|
||||
padding-top: clamp(80px, 10vw, 160px);
|
||||
padding-top: clamp(60px, 10vw, 110px);
|
||||
/* 底部内边距:小屏最小15px,大屏最大30px,自适应缩放 */
|
||||
padding-bottom: clamp(15px, 2vw, 30px);
|
||||
/* 可选:限制最大宽度并居中,优化大屏显示 */
|
||||
@@ -45,6 +45,8 @@
|
||||
flex: 1.8;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
max-width: 526px;
|
||||
max-height: 680px;
|
||||
}
|
||||
|
||||
.product-img {
|
||||
@@ -52,6 +54,8 @@
|
||||
height: auto;
|
||||
border-radius: 10px;
|
||||
display: block;
|
||||
max-width: 526px;
|
||||
max-height: 680px;
|
||||
/* 取消图片底部空隙 */
|
||||
}
|
||||
|
||||
@@ -105,12 +109,14 @@
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: contain;
|
||||
object-position: center; /* 内容居中显示(默认值) */
|
||||
/* object-position: center; 内容居中显示(默认值) */
|
||||
transition: opacity 0.3s ease;
|
||||
}
|
||||
|
||||
.right-video {
|
||||
display: none;
|
||||
width: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
/* PC端适配:仅微调定位参数,尺寸不变 */
|
||||
@@ -122,10 +128,14 @@
|
||||
|
||||
.product-left {
|
||||
flex: 2;
|
||||
max-width: 526px;
|
||||
max-height: 680px;
|
||||
}
|
||||
|
||||
.product-right {
|
||||
flex: 5;
|
||||
max-width: 1150px;
|
||||
max-height: 680px;
|
||||
}
|
||||
|
||||
/* 宽度保持一致,仅调定位偏移 */
|
||||
|
||||
@@ -16,6 +16,9 @@
|
||||
min-width: 180px;
|
||||
max-width: 836px;
|
||||
max-height:530px;
|
||||
padding: 10px 0;
|
||||
padding-left: clamp(30px, 3vw, 100px); ;
|
||||
|
||||
/* 保证图片显示 */
|
||||
/* max-width: calc(50% - 10px); */
|
||||
/* 适配gap */
|
||||
@@ -93,7 +96,10 @@
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
min-width: 70px; */
|
||||
flex:1;
|
||||
width: 100%;
|
||||
/* flex:1; */
|
||||
/* width:510px ;
|
||||
height: 510px; */
|
||||
max-width: 510px;
|
||||
max-height:510px ;
|
||||
/* 强制保留图片区域,避免被挤压 */
|
||||
@@ -101,11 +107,11 @@
|
||||
|
||||
.product-card-img2 img {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
object-fit: contain
|
||||
/* object-fit: contain;
|
||||
|
||||
/* object-fit: contain */
|
||||
object-fit: contain;
|
||||
max-width: 510px;
|
||||
max-width: 510px; */
|
||||
max-height: 510px;
|
||||
/* 保持图片比例完整,不拉伸 */
|
||||
}
|
||||
|
||||
@@ -118,8 +124,8 @@
|
||||
}
|
||||
|
||||
.product-card-link2 img {
|
||||
width: clamp(2.5rem, 5vw, 4.5rem);
|
||||
height: auto;
|
||||
max-width: 111px;
|
||||
max-height: 19px;
|
||||
object-fit: contain;
|
||||
/* 清除居中margin */
|
||||
}
|
||||
|
||||
@@ -3,9 +3,11 @@
|
||||
width: 90%;
|
||||
/* margin: clamp(1rem, 2vw, 1.5rem) auto 0; */
|
||||
margin:0 auto;
|
||||
padding-top: 40px;
|
||||
margin-top: 40px;
|
||||
max-width: 1690px;
|
||||
padding-bottom:45px;
|
||||
margin-bottom:45px;
|
||||
max-height: 560px;
|
||||
|
||||
}
|
||||
|
||||
.product-card-container {
|
||||
@@ -18,6 +20,7 @@
|
||||
/* gap: clamp(0.6rem, 1vw, 0.8rem); */
|
||||
padding: 0; /* 保持无内边距,避免间距叠加 */
|
||||
max-width: 1690px;
|
||||
max-height: 560px;
|
||||
}
|
||||
|
||||
/* 新增:外层容器(承载圆角、阴影、尺寸,避免缩放时圆角丢失) */
|
||||
@@ -234,6 +237,7 @@
|
||||
display: flex; /* 补充display: flex,原代码遗漏 */
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
|
||||
padding-left: clamp(1.5rem, 2vw, 3rem);
|
||||
}
|
||||
|
||||
@@ -248,6 +252,7 @@
|
||||
line-height: 1.2;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
/* margin-top */
|
||||
}
|
||||
|
||||
/* 描述样式:PC端固定2行高度 clamp(0.7rem, 1.1vw, 0.9rem);*/
|
||||
@@ -269,6 +274,8 @@
|
||||
padding-left: clamp(1.5rem, 2vw, 3rem);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
/* max-width: 111px;
|
||||
max-height:19px ; */
|
||||
/* 1rem=16px,3.125rem=50px */
|
||||
/* padding-top: clamp(1rem, 2vw, 3.125rem);
|
||||
padding-bottom: clamp(1rem, 5vw, 3.125rem); */
|
||||
@@ -276,8 +283,9 @@
|
||||
|
||||
/* 链接图标:PC端特有 */
|
||||
.product-card-link img {
|
||||
width: clamp(2.5rem, 5vw, 4.5rem);
|
||||
height: auto;
|
||||
/* width: clamp(2.5rem, 5vw, 4.5rem); */
|
||||
max-width: 111px;
|
||||
max-height: 19px;
|
||||
object-fit: contain;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user