This commit is contained in:
2025-11-28 14:18:19 +08:00
parent c8d5661856
commit ca3c00f396
13 changed files with 753 additions and 471 deletions

View File

@@ -568,135 +568,142 @@
}, },
{ passive: false } { passive: false }
); // passive: false 必须,否则 preventDefault 无效 ); // passive: false 必须,否则 preventDefault 无效
document.addEventListener('DOMContentLoaded', () => { document.addEventListener('DOMContentLoaded', () => {
// 初始化所有视频容器 // 初始化所有视频容器
function initVideoContainers() { function initVideoContainers() {
const productRights = document.querySelectorAll('.product-right'); const productRights = document.querySelectorAll('.product-right');
// 支持的视频格式
productRights.forEach((container, index) => { const supportedVideoFormats = ['.mp4', '.webm', '.ogg', '.mov', '.avi', '.mkv', '.flv', '.wmv'];
const video = container.querySelector('.right-video'); productRights.forEach((container, index) => {
const btn = container.querySelector('.video-play-btn'); const video = container.querySelector('.right-video');
const img = container.querySelector('.right-img'); const btn = container.querySelector('.video-play-btn');
if (!video || !btn || !img) return; const img = container.querySelector('.right-img');
const videoSrc = video.src.trim() if (!video || !btn || !img) return;
// 修复:正确检测有效视频地址 const videoSrc = video.src.trim()
// 排除空字符串、null、undefined console.log(videoSrc,'=videoSrc=')
const hasValidVideo = !!videoSrc && videoSrc.trim() !== '' && videoSrc !== 'undefined' && videoSrc !== 'null'; // 修复:正确检测有效视频地址
// 排除空字符串、null、undefined
const hasValidVideo = !!videoSrc && videoSrc.trim() !== '' && videoSrc !== 'undefined' && videoSrc !== 'null';
// 初始化状态:无视频则保持图片显示,永不切换 // 验证视频格式是否有效
if (!hasValidVideo) { const isValidFormat = supportedVideoFormats.some(format =>
img.style.display = 'block'; videoSrc.toLowerCase().endsWith(format) ||
video.style.display = 'none'; (videoSrc.includes('?') && videoSrc.toLowerCase().split('?')[0].endsWith(format))
btn.style.display = 'none'; );
// 绑定空方法,防止调用报错
video.switchMedia = function() {};
console.log(`容器${index}:无有效视频(src="${videoSrc}"),保持图片显示`);
return;
}
// 有有效视频的情况 // 初始化状态:无视频或格式无效则保持图片显示,永不切换
console.log(`容器${index}:有有效视频(src="${videoSrc}"),初始化播放逻辑`); if (!hasValidVideo || !isValidFormat) {
img.style.display = 'block';
// 初始状态 video.style.display = 'none';
video.style.display = 'none'; btn.style.display = 'none';
video.pause(); // 绑定空方法,防止调用报错
img.style.display = 'block'; video.switchMedia = function() {};
btn.style.display = 'none'; console.log(`容器${index}:无有效视频(src="${videoSrc}"),保持图片显示`);
btn.style.opacity = '0'; return;
}
// 同步状态函数 // 有有效视频的情况
function syncMediaState() { console.log(`容器${index}:有有效视频(src="${videoSrc}"),初始化播放逻辑`);
if (img.style.display === 'block') {
btn.style.display = 'none'; // 初始状态
btn.style.opacity = '0'; video.style.display = 'none';
} 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.pause(); video.pause();
img.style.display = 'block'; img.style.display = 'block';
video.style.display = 'none'; btn.style.display = 'none';
} btn.style.opacity = '0';
syncMediaState();
};
// 初始同步 // 同步状态函数
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() { btn.addEventListener('click', () => {
let ticking = false; if (video.paused) {
video.play().catch(() => syncMediaState());
function updateVideoVisibility() { } else {
const productRights = document.querySelectorAll('.product-right'); video.pause();
}
productRights.forEach(container => { syncMediaState();
const video = container.querySelector('.right-video'); });
if (!video || !video.switchMedia) return;
// 检查是否在视口中 // 视频事件监听
const rect = container.getBoundingClientRect(); ['play', 'pause', 'ended', 'playing', 'waiting'].forEach(event => {
const viewHeight = window.innerHeight || document.documentElement.clientHeight; video.addEventListener(event, syncMediaState);
const isInView = rect.top < viewHeight * 0.7 && rect.bottom > viewHeight * 0.3; });
// 只对有有效视频的元素调用switchMedia // 滚动切换函数
video.switchMedia(isInView); video.switchMedia = function(showVideo) {
}); // 只处理有有效视频的情况
if (showVideo) {
ticking = false; img.style.display = 'none';
} video.style.display = 'block';
video.play().catch(() => {
// 使用requestAnimationFrame优化性能 console.log(`容器${index}:自动播放失败,需要用户交互`);
window.addEventListener('scroll', () => { syncMediaState();
if (!ticking) { });
requestAnimationFrame(updateVideoVisibility); } else {
ticking = true; video.pause();
img.style.display = 'block';
video.style.display = 'none';
}
syncMediaState();
};
// 初始同步
syncMediaState();
});
} }
});
}
// 初始化 // 滚动监听 - 优化版
initVideoContainers(); function setupScrollWatcher() {
setupScrollWatcher(); let ticking = false;
// 初始检查一次 function updateVideoVisibility() {
setTimeout(() => { const productRights = document.querySelectorAll('.product-right');
const event = new Event('scroll');
window.dispatchEvent(event); productRights.forEach(container => {
}, 300); 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 () { window.onload = function () {
if (typeof Swiper === 'undefined') { if (typeof Swiper === 'undefined') {

View File

@@ -16,7 +16,7 @@
{block name="main"} {block name="main"}
<a class="header" href="/"> <a class="header" href="/">
<div class="header-img"> <div class="header-img">
<img src="__IMAGES__/logo.png" alt=""> <!-- <img src="__IMAGES__/logo.png" alt=""> -->
</div> </div>
</a> </a>
<!-- 轮播核心容器 --> <!-- 轮播核心容器 -->
@@ -224,6 +224,7 @@
</video> </video>
</div> </div>
{/notempty} {/notempty}
</div> </div>
{assign name="dc_second_section" value=":array_splice($data.desktop_charger, 0, 2)" /} {assign name="dc_second_section" value=":array_splice($data.desktop_charger, 0, 2)" /}
{notempty name="dc_second_section"} {notempty name="dc_second_section"}
@@ -337,7 +338,7 @@
{/neq} {/neq}
{/volist} {/volist}
{notempty name="ct_more_section"} {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 class="more-img">
查看更多 查看更多
</div> </div>

View File

@@ -1,6 +1,320 @@
/* iPad横屏特殊适配可选 */ /* 核心模块固定90%宽度PC端优化移动端边距 */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) { .advantage-section {
.advantage-card-wrap { width: 90%;
aspect-ratio: 1 / 1.6; /* 横屏时调整卡片比例 */ 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;
}
} }

View File

@@ -32,6 +32,7 @@ html {
} }
body { body {
background: rgb(242, 243, 245); background: rgb(242, 243, 245);
/* margin:0 !important; */
} }
a { a {
text-decoration: none; text-decoration: none;
@@ -56,8 +57,8 @@ a {
} }
.line { .line {
width: 100%; width: 100%;
height: clamp(2.5rem, 5vw, 15rem); height: clamp(1.5rem, 3vw, 3rem);
} }
.header { .header {
width: 100%; width: 100%;

View File

@@ -9,19 +9,16 @@
display: none; display: none;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
z-index: 99999; z-index: 9999;
overflow: hidden; /* 阻止蒙版自身滚动 */ overflow: hidden; /* 阻止蒙版自身滚动 */
touch-action: none; /* 禁止触摸行为 */ touch-action: none; /* 禁止触摸行为 */
pointer-events: auto; /* 确保蒙版能接收事件 */ pointer-events: auto; /* 确保蒙版能接收事件 */
backdrop-filter: blur(8px); /* 模糊半径可调整4px-15px为宜 */
-webkit-backdrop-filter: blur(8px); /* 兼容Safari */
} }
/* 蒙版内容容器 - 新增触摸事件传递控制 */ /* 蒙版内容容器 - 新增触摸事件传递控制 */
.mask-content { .mask-content {
width: 80%; width: 80%;
height: 100% !important; height: 100%;
padding: 3% 5%;
background: rgb(242, 243, 245); background: rgb(242, 243, 245);
border-radius: 12px; border-radius: 12px;
overflow: hidden; /* 内容容器不滚动 */ overflow: hidden; /* 内容容器不滚动 */
@@ -34,7 +31,7 @@
} }
/* 滚动内容容器 - 保持不变 */ /* 滚动内容容器 - 保持不变 */
.mask-e-scroll-content { .mask-scroll-content {
flex: 1; flex: 1;
overflow-y: auto; overflow-y: auto;
padding: 20px; padding: 20px;
@@ -69,7 +66,7 @@
background-color: rgba(0, 0, 0, 0.3); background-color: rgba(0, 0, 0, 0.3);
border-radius: 50%; border-radius: 50%;
color: #fff; color: #fff;
font-size: 30px; font-size: 20px;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;

View File

@@ -1,266 +1,184 @@
/* 核心模块固定90%宽度PC端优化移动端边距 */ .product-box {
.advantage-section { background: #fff;
width: 90%; padding: clamp(1.5rem, 3vw, 3rem) 0;
margin: 0 auto; /* 产品块之间留间距 */
padding: 2rem 0;
position: relative;
z-index: 1;
} }
/* 标题容器:恢复原有居中样式 */ .product-title {
.advantage-section__title { width: 90%;
font-size: clamp(1.5rem, 3vw, 2rem); margin: 0 auto;
font-weight: 700; padding-bottom: clamp(1.5rem, 3vw, 3rem);
text-align: center;
color: #333;
line-height: 1.2;
margin-bottom: clamp(1.5rem, 2vw, 2.5rem);
} }
/* 列表容器优化gap确保移动端5列不溢出 */ .product-title-h2 {
.advantage-section__list { font-size: clamp(1.5rem, 3vw, 2.25rem);
display: flex; /* padding-top: clamp(1.5rem, 3vw, 3rem); */
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-p {
.advantage-card-wrap { font-size: clamp(0.875rem, 1.5vw, 1.125rem);
flex: 0 0 calc((100% - 4 * clamp(0.1rem, 0.3vw, 0.8rem)) / 5); color: #646464;
min-width: calc((100% - 4 * clamp(0.1rem, 0.3vw, 0.8rem)) / 5); margin-top: clamp(0.5rem, 1vw, 0.75rem);
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;
} }
/* 卡片核心:优化宽高比和尺寸计算 */ /* 容器布局:两个产品通用 */
.advantage-card { .product-container {
width: 100%; display: flex;
height: 100%; gap: clamp(0.4rem, 1vw, 0.71rem);
cursor: pointer; margin: 0 auto;
background: #fff; width: 90%;
position: relative; align-items: flex-start;
z-index: 1;
/* 关键修复添加will-change优化渲染移除原圆角和阴影移到外层 */
will-change: transform; /* 告知浏览器准备变换,避免圆角渲染异常 */
transition: transform 0.3s ease;
} }
.advantage-card__img { /* 左侧容器:两个产品通用 */
width: 100%; .product-left {
height: 72%; flex: 1.8;
/* PC端图片占比提升至72%,文字区域压缩 */ position: relative;
object-fit: cover; width: 100%;
background-color: #f9f9f9;
display: block;
} }
/* 文字区域flex垂直分布确保标题和描述都垂直居中 */ .product-img {
.advantage-card__content { width: 100%;
width: 100%; height: auto;
height: 28%; border-radius: 10px;
/* PC端文字区域占比降至28% */ display: block;
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;
/* 标题和描述之间的垂直间距,避免贴边 */
} }
/* 标题容器:水平居中+内部两端对齐,同时垂直居中 */ /* 悬浮图公共样式两个产品尺寸完全一致100%宽度) */
.advantage-card__heading-wrap { .product-img-hover {
display: flex; position: absolute;
align-items: center; width: 100%;
/* 内部标题和箭头垂直对齐 */
justify-content: space-between; /* 两个产品悬浮图宽度相同 */
/* 文字左、箭头右 */ z-index: 1;
gap: 8px;
width: 80%;
/* 限制宽度,体现居中效果 */
/* 移除底部margin通过父容器gap控制间距 */
} }
/* 卡片标题:居左显示 */ .product-img-hover img {
.advantage-card__heading { width: 100%;
font-size: clamp(0.85rem, 1.5vw, 1.4rem); max-width: 300px;
/* 比原尺寸放大PC端更醒目移动端自适应 */ /* 图片尺寸100%,无区别 */
font-weight: 600; height: auto;
color: #333; border-radius: 10px;
line-height: 1.3;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
} }
/* 卡片标题右侧箭头:居右显示 */ /* 第一个产品:悬浮图居中上移(仅定位差异) */
.card-arrow { .product-img-1 {
color: #409eff; top: -10%;
font-size: clamp(0.7rem, 1vw, 1rem); left: 50%;
/* 箭头尺寸跟随标题放大,避免不协调 */ transform: translateX(-50%);
transition: transform 0.3s ease;
display: inline-block;
width: 16px;
/* 箭头宽度同步增加 */
text-align: center;
} }
/* 卡片hover时箭头动画 */ /* 第二个产品:悬浮图上右超出(仅定位差异) */
.advantage-card:hover .card-arrow { .product-img-2 {
transform: translateX(3px); top: -10%;
/* 上超出 */
transform: none;
width: 108%;
/* 取消居中 */
} }
/* 描述文字:水平+垂直居中,与标题容器对齐(仅添加最小高度修复对齐问题) */ /* 右侧容器:两个产品通用 */
.advantage-card__description { .product-right {
font-size: clamp(0.6rem, 0.9vw, 0.9rem); flex: 3.2;
/* PC端描述文字略放大 */ position: relative;
color: #666; border-radius: 10px;
line-height: 1.2; overflow: hidden;
/* PC端行高略紧凑 */ width: 100%;
white-space: normal; background-color: #f5f5f5;
overflow: hidden; align-self: stretch;
width: 80%; position: relative;
/* 与标题容器宽度一致 */
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;
} }
/* 卡片hover效果仅保留缩放阴影移到外层 */ .right-content {
.advantage-card:hover { position: absolute;
transform: scale(1.03); top: 0;
z-index: 10; left: 0;
width: 100%;
height: 100%;
object-fit: cover;
transition: opacity 0.3s ease;
} }
/* 外层容器hover时增强阴影更自然的浮起效果 */ .right-video {
.advantage-card-wrap:hover { display: none;
box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.15); }
.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 */ .play-icon {
.advantage-card:active { display: inline-block;
transform: scale(1.01); }
} .pause-icon {
display: none;
.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;
}
} }
/* 移动端适配(小屏手机) */ /* .paused类时切换图标 */
@media (max-width: 767px) { .video-play-btn.paused .play-icon {
.advantage-section { display: none;
width: 95%; }
} .video-play-btn.paused .pause-icon {
display: inline-block;
.advantage-card__heading {
font-size: clamp(0.55rem, 1vw, 0.95rem);
}
} }
/* 超小屏适配 */ /* 视频显示时按钮可见 */
@media (max-width: 374px) { .right-video[playing] ~ .video-play-btn,
.advantage-section { .product-right:hover .video-play-btn {
width: 98%; opacity: 1;
} display: block;
}
/* PC端适配仅微调定位参数尺寸不变 */
@media (min-width: 1024px) {
.product-container {
width: 90%;
}
.advantage-card__heading { .product-left {
font-size: clamp(0.55rem, 0.9vw, 0.9rem); flex: 2;
} }
.advantage-card__heading-wrap { .product-right {
width: 95%; flex: 5;
gap: 5px; }
}
.advantage-card__description { /* 宽度保持一致,仅调定位偏移 */
width: 95%; .product-img-1 {
/* 超小屏保持最小高度 */ top: -11%;
min-height: calc(clamp(0.5rem, 0.8vw, 0.8rem) * 2 * 1.5); }
}
} .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%;
}
}

View File

@@ -9,76 +9,76 @@
width: 100%; width: 100%;
margin: 0 auto; margin: 0 auto;
display: flex; display: flex;
flex-wrap: wrap; /* 修改为可换行 */ flex-wrap: nowrap;
overflow: visible; /* 改为可见,显示所有内容 */ overflow: visible !important; /* 改为visible,显示所有内容 */
gap: clamp(0.6rem, 1vw, 0.8rem); padding: 0 clamp(0.2rem, 0.6vw, 0.3rem);
padding: 0; height: auto !important; /* 高度自适应内容 */
} }
/* 新增:外层容器(承载圆角、阴影、尺寸,避免缩放时圆角丢失) */ /* 卡片包裹容器:确保不独占一行 */
.product-card-wrap { .product-card-wrap {
width: calc(25% - (clamp(0.6rem, 1vw, 0.8rem) * 3 / 4)); display: contents; /* 让包裹容器不影响布局 */
flex: none; width: 100%;
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); /* 添加底部间距 */
} }
/* ######################################################################### */ /* ######################################################################### */
/* 移动端样式(单独配置,max-width: 1023px- 后续修改仅改这里 */ /* 移动端+平板样式max-width: 1023px- 后续修改仅改这里 */
/* ######################################################################### */ /* ######################################################################### */
@media (max-width: 1023px) { @media (max-width: 1023px) {
/* 卡片容器:移动端特有 */ /* 卡片容器:移动端+平板特有 - 改为wrap换行一行2个高度自适应 */
.product-card-container { .product-card-container {
align-items: stretch; align-items: flex-start; /* 改为flex-start避免拉伸 */
justify-content: 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 { .product-card-wrap {
width: calc(50% - (clamp(0.6rem, 1vw, 0.8rem) * 1 / 2)); display: block !important;
aspect-ratio: 3 / 4.2; width: calc(50% - clamp(0.25rem, 0.5vw, 0.5rem)) !important;
} margin: 0 !important;
padding: 0 !important;
height: auto !important; /* 高度自适应 */
}
/* 卡片核心:移动端调整 */ /* 卡片核心:移动端+平板改为一行2个高度自适应内容 */
.product-card { .product-card {
background: rgb(242, 243, 245); background: rgb(242, 243, 245);
border-radius: clamp(0.375rem, 1vw, 0.5rem);
cursor: pointer; cursor: pointer;
width: 100%; width: 100% !important; /* 卡片宽度100%,由包裹容器控制 */
height: 100%;
flex: none; 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; display: flex;
flex-direction: column; flex-direction: column;
will-change: transform; height: auto !important; /* 高度自适应内容 */
} }
/* 卡片hover效果 */ /* 卡片hover效果:移动端+平板特有 */
.product-card:hover { .product-card:hover {
transform: scale(clamp(1.01, 1.02, 1.03)); transform: scale(clamp(1.01, 1.02, 1.03));
transition: transform 0.3s ease; 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 { .product-card-img {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
width: 100%; 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); margin-bottom: clamp(0.4rem, 0.6vw, 0.5rem);
overflow: hidden; overflow: hidden;
border-radius: clamp(0.2rem, 0.4vw, 0.25rem); border-radius: clamp(0.2rem, 0.4vw, 0.25rem);
} }
/* 产品图片 */ /* 产品图片:移动端+平板特有 */
.product-card img { .product-card img {
width: 100%; width: 100%;
height: 100%; height: 100%;
@@ -86,66 +86,85 @@
object-position: center; object-position: center;
} }
/* 文字容器 */ /* 文字容器:移动端+平板高度自适应 */
.product-card-text { .product-card-text {
/* flex: 0 0 20%; */ flex: 1 1 auto; /* 改为flex:1高度自适应内容 */
/* display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: center; */ justify-content: center;
padding-left: clamp(0.8rem, 2vw, 1.5rem); padding-left: clamp(0.8rem, 2vw, 1.5rem);
padding-right: clamp(0.8rem, 2vw, 1.5rem); padding-right: clamp(0.8rem, 2vw, 1.5rem);
height: auto !important; /* 高度自适应 */
} }
/* 标题样式 */ /* 标题样式:移动端+平板特有,高度自适应 */
.product-card-title { .product-card-title {
font-size:clamp(0.8rem, 1.3vw, 1.9rem); font-size: clamp(0.8rem, 1.3vw, 1.2rem);
font-weight: 600; font-weight: 600;
color: #333; color: #333;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
/* height: 35%; */ height: auto !important; /* 移除固定高度 */
/* line-height: 1.2; */ margin-bottom: clamp(0.2rem, 0.4vw, 0.3rem); /* 添加间距 */
line-height: 1.2;
} }
/* 描述样式 */ /* 描述样式:移动端+平板高度自适应 */
.product-card-desc { .product-card-desc {
font-size: clamp(0.8rem, 1.3vw, 1.5rem); font-size: clamp(0.7rem, 1.1vw, 0.9rem);
color: #656565; color: #656565;
word-break: break-word; word-break: break-word;
/* height: 65%; */ height: auto !important; /* 移除固定高度 */
overflow: hidden; overflow: hidden;
display: -webkit-box; display: -webkit-box;
-webkit-line-clamp: 2; -webkit-line-clamp: 2;
padding-top:clamp(0.4rem, 3vw, 0.6rem);
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
line-height: 1.4;
} }
/* 链接图标容器 */ /* 链接图标容器:移动端+平板高度自适应,添加较小的底部内边距 */
.product-card-link { .product-card-link {
width: 100%; width: 100%;
display: flex; display: flex;
align-items: center; 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); padding-left: clamp(0.8rem, 2vw, 1.5rem);
height: auto !important; /* 高度自适应 */
} }
/* 链接图标 */ /* 链接图标:移动端+平板特有 */
.product-card-link img { .product-card-link img {
width: clamp(2.5rem, 5vw, 4.5rem); width: clamp(2.5rem, 5vw, 4.5rem);
height: auto; height: auto;
object-fit: contain; object-fit: contain;
} }
/* 移动端768px以上补充样式 */ /* 平板端(768px-1023px补充样式 */
@media (min-width: 768px) and (max-width: 1023px) { @media (min-width: 768px) and (max-width: 1023px) {
.product-card-img { .product-card-img {
flex: 0 0 72%; aspect-ratio: 3 / 2.8; /* 保持图片比例 */
} }
.product-card-link img { .product-card-link img {
width: clamp(5rem, 4vw, 6rem); 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- 后续修改仅改这里 */ /* PC端样式单独配置min-width: 1024px- 后续修改仅改这里 */
/* ######################################################################### */ /* ######################################################################### */
@media (min-width: 1024px) { @media (min-width: 1024px) {
/* 卡片容器PC端特有 */ /* 卡片容器PC端特有,高度自适应内容 */
.product-card-container { .product-card-container {
align-items: stretch; align-items: flex-start; /* 改为flex-start避免拉伸 */
height: clamp(30vw, 35vw, 480px); height: auto !important; /* 高度自适应内容 */
gap: clamp(0.6rem, 1vw, 0.8rem);
padding: 0;
flex-wrap: nowrap; /* PC端保持不换行 */
overflow: hidden; /* PC端隐藏溢出 */
} }
/* 外层容器PC端适配 */ /* 卡片包裹容器PC端适配 */
.product-card-wrap { .product-card-wrap {
width: calc(25% - (clamp(0.6rem, 1vw, 0.8rem) * 3 / 4)); display: contents;
height: 100%; }
margin-bottom: 0; /* PC端移除底部间距 */
}
/* 卡片核心 */ /* 卡片核心PC端高度自适应内容 */
.product-card { .product-card {
background: rgb(242, 243, 245); background: rgb(242, 243, 245);
border-radius: clamp(0.375rem, 1vw, 0.5rem);
cursor: pointer; cursor: pointer;
width: 100%; width: calc(25% - clamp(0.3rem, 0.5vw, 0.36rem));
height: 100%;
flex: none; 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; display: flex;
flex-direction: column; flex-direction: column;
will-change: transform; height: auto !important; /* 高度自适应内容 */
} }
/* 卡片hover效果 */ /* 卡片hover效果PC端特有 */
.product-card:hover { .product-card:hover {
transform: scale(clamp(1.01, 1.02, 1.03)); transform: scale(clamp(1.01, 1.02, 1.03));
transition: transform 0.3s ease; transition: transform 0.3s ease;
} }
.product-card-wrap:hover { /* 图片容器PC端高度自适应 */
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 { .product-card-img {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
width: 100%; 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); margin-bottom: clamp(0.4rem, 0.6vw, 0.5rem);
overflow: hidden; overflow: hidden;
border-radius: clamp(0.2rem, 0.4vw, 0.25rem); border-radius: clamp(0.2rem, 0.4vw, 0.25rem);
} }
/* 产品图片 */ /* 产品图片PC端特有 */
.product-card img { .product-card img {
width: 100%; width: 100%;
height: 100%; height: 100%;
@@ -213,17 +225,18 @@
object-position: center; object-position: center;
} }
/* 文字容器 */ /* 文字容器PC端高度自适应 */
.product-card-text { .product-card-text {
flex: 0 0 15%; flex: 1 1 auto; /* 改为flex:1高度自适应内容 */
display: flex;
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
padding-left: clamp(0.8rem, 2vw, 1.5rem); padding-left: clamp(0.8rem, 2vw, 1.5rem);
padding-right: clamp(0.8rem, 2vw, 1.5rem); padding-right: clamp(0.8rem, 2vw, 1.5rem);
display: flex; /* 确保flex布局 */
height: auto !important; /* 高度自适应 */
} }
/* 标题样式 */ /* 标题样式PC端特有高度自适应 */
.product-card-title { .product-card-title {
font-size: clamp(0.8rem, 1.3vw, 1.2rem); font-size: clamp(0.8rem, 1.3vw, 1.2rem);
font-weight: 600; font-weight: 600;
@@ -231,16 +244,19 @@
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
height: auto !important; /* 高度自适应 */
margin-bottom: clamp(0.2rem, 0.4vw, 0.3rem); /* 添加间距 */
line-height: 1.2; line-height: 1.2;
display: flex; display: flex;
align-items: center; align-items: center;
} }
/* 描述样式 */ /* 描述样式PC端高度自适应 */
.product-card-desc { .product-card-desc {
font-size: clamp(0.7rem, 1.1vw, 0.9rem); font-size: clamp(0.7rem, 1.1vw, 0.9rem);
color: #656565; color: #656565;
word-break: break-word; word-break: break-word;
height: auto !important; /* 高度自适应 */
overflow: hidden; overflow: hidden;
display: -webkit-box; display: -webkit-box;
-webkit-line-clamp: 2; -webkit-line-clamp: 2;
@@ -248,16 +264,18 @@
line-height: 1.4; line-height: 1.4;
} }
/* 链接图标容器 */ /* 链接图标容器PC端高度自适应添加较小的底部内边距 */
.product-card-link { .product-card-link {
width: 100%; width: 100%;
flex: 0 0 12%; display: flex; /* 确保flex布局 */
padding-left: clamp(0.8rem, 2vw, 1.5rem);
display: flex;
align-items: center; 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 { .product-card-link img {
width: clamp(2.5rem, 5vw, 4.5rem); width: clamp(2.5rem, 5vw, 4.5rem);
height: auto; height: auto;

View File

@@ -19,7 +19,6 @@
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
} }

View File

@@ -25,9 +25,10 @@
/* 列表容器优化gap确保移动端5列不溢出 */ /* 列表容器优化gap确保移动端5列不溢出 */
.advantage-section__list { .advantage-section__list {
display: flex; display: flex;
justify-content: center; justify-content: space-between;
align-items: flex-start; align-items: flex-start;
gap: clamp(0.1rem, 0.3vw, 0.8rem); /* gap: clamp(0.1rem, 0.3vw, 0.8rem); */
width: 100%; width: 100%;
flex-wrap: nowrap; flex-wrap: nowrap;
overflow: hidden; overflow: hidden;
@@ -152,7 +153,7 @@
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: left; justify-content: left;
margin-top:clamp(10px, 0.9vw, 30px) margin-top:clamp(9px, 0.5vw, 18px)
} }
/* 卡片hover效果仅保留缩放阴影移到外层 */ /* 卡片hover效果仅保留缩放阴影移到外层 */

View File

@@ -43,9 +43,11 @@ a {
margin: 0 auto; margin: 0 auto;
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
padding: 40px 0; max-width: 1690px;
/* padding: 40px 0; */
/* padding-top: clamp(1.5rem, 3vw, 3rem); */ /* padding-top: clamp(1.5rem, 3vw, 3rem); */
} }
.more-img { .more-img {
background: #000; background: #000;
color: #fff; color: #fff;

View File

@@ -15,7 +15,7 @@
/* 字体大小小屏最小30px大屏最大50px中间按视口宽度自适应 */ /* 字体大小小屏最小30px大屏最大50px中间按视口宽度自适应 */
font-size: clamp(30px, 4vw, 50px); font-size: clamp(30px, 4vw, 50px);
/* 顶部内边距小屏最小80px大屏最大160px自适应缩放 */ /* 顶部内边距小屏最小80px大屏最大160px自适应缩放 */
padding-top: clamp(80px, 10vw, 160px); padding-top: clamp(60px, 10vw, 110px);
/* 底部内边距小屏最小15px大屏最大30px自适应缩放 */ /* 底部内边距小屏最小15px大屏最大30px自适应缩放 */
padding-bottom: clamp(15px, 2vw, 30px); padding-bottom: clamp(15px, 2vw, 30px);
/* 可选:限制最大宽度并居中,优化大屏显示 */ /* 可选:限制最大宽度并居中,优化大屏显示 */
@@ -45,6 +45,8 @@
flex: 1.8; flex: 1.8;
position: relative; position: relative;
width: 100%; width: 100%;
max-width: 526px;
max-height: 680px;
} }
.product-img { .product-img {
@@ -52,6 +54,8 @@
height: auto; height: auto;
border-radius: 10px; border-radius: 10px;
display: block; display: block;
max-width: 526px;
max-height: 680px;
/* 取消图片底部空隙 */ /* 取消图片底部空隙 */
} }
@@ -105,12 +109,14 @@
width: 100%; width: 100%;
height: 100%; height: 100%;
object-fit: contain; object-fit: contain;
object-position: center; /* 内容居中显示(默认值) */ /* object-position: center; 内容居中显示(默认值) */
transition: opacity 0.3s ease; transition: opacity 0.3s ease;
} }
.right-video { .right-video {
display: none; display: none;
width: 100%;
object-fit: cover;
} }
/* PC端适配仅微调定位参数尺寸不变 */ /* PC端适配仅微调定位参数尺寸不变 */
@@ -122,10 +128,14 @@
.product-left { .product-left {
flex: 2; flex: 2;
max-width: 526px;
max-height: 680px;
} }
.product-right { .product-right {
flex: 5; flex: 5;
max-width: 1150px;
max-height: 680px;
} }
/* 宽度保持一致,仅调定位偏移 */ /* 宽度保持一致,仅调定位偏移 */

View File

@@ -16,6 +16,9 @@
min-width: 180px; min-width: 180px;
max-width: 836px; max-width: 836px;
max-height:530px; max-height:530px;
padding: 10px 0;
padding-left: clamp(30px, 3vw, 100px); ;
/* 保证图片显示 */ /* 保证图片显示 */
/* max-width: calc(50% - 10px); */ /* max-width: calc(50% - 10px); */
/* 适配gap */ /* 适配gap */
@@ -93,7 +96,10 @@
justify-content: center; justify-content: center;
align-items: center; align-items: center;
min-width: 70px; */ min-width: 70px; */
flex:1; width: 100%;
/* flex:1; */
/* width:510px ;
height: 510px; */
max-width: 510px; max-width: 510px;
max-height:510px ; max-height:510px ;
/* 强制保留图片区域,避免被挤压 */ /* 强制保留图片区域,避免被挤压 */
@@ -101,11 +107,11 @@
.product-card-img2 img { .product-card-img2 img {
width: 100%; width: 100%;
height: auto;
object-fit: contain /* object-fit: contain */
/* object-fit: contain; object-fit: contain;
max-width: 510px; max-width: 510px;
max-width: 510px; */ max-height: 510px;
/* 保持图片比例完整,不拉伸 */ /* 保持图片比例完整,不拉伸 */
} }
@@ -118,8 +124,8 @@
} }
.product-card-link2 img { .product-card-link2 img {
width: clamp(2.5rem, 5vw, 4.5rem); max-width: 111px;
height: auto; max-height: 19px;
object-fit: contain; object-fit: contain;
/* 清除居中margin */ /* 清除居中margin */
} }

View File

@@ -3,9 +3,11 @@
width: 90%; width: 90%;
/* margin: clamp(1rem, 2vw, 1.5rem) auto 0; */ /* margin: clamp(1rem, 2vw, 1.5rem) auto 0; */
margin:0 auto; margin:0 auto;
padding-top: 40px; margin-top: 40px;
max-width: 1690px; max-width: 1690px;
padding-bottom:45px; margin-bottom:45px;
max-height: 560px;
} }
.product-card-container { .product-card-container {
@@ -18,6 +20,7 @@
/* gap: clamp(0.6rem, 1vw, 0.8rem); */ /* gap: clamp(0.6rem, 1vw, 0.8rem); */
padding: 0; /* 保持无内边距,避免间距叠加 */ padding: 0; /* 保持无内边距,避免间距叠加 */
max-width: 1690px; max-width: 1690px;
max-height: 560px;
} }
/* 新增:外层容器(承载圆角、阴影、尺寸,避免缩放时圆角丢失) */ /* 新增:外层容器(承载圆角、阴影、尺寸,避免缩放时圆角丢失) */
@@ -234,6 +237,7 @@
display: flex; /* 补充display: flex原代码遗漏 */ display: flex; /* 补充display: flex原代码遗漏 */
flex-direction: column; flex-direction: column;
justify-content: center; justify-content: center;
padding-left: clamp(1.5rem, 2vw, 3rem); padding-left: clamp(1.5rem, 2vw, 3rem);
} }
@@ -248,6 +252,7 @@
line-height: 1.2; line-height: 1.2;
display: flex; display: flex;
align-items: center; align-items: center;
/* margin-top */
} }
/* 描述样式PC端固定2行高度 clamp(0.7rem, 1.1vw, 0.9rem);*/ /* 描述样式PC端固定2行高度 clamp(0.7rem, 1.1vw, 0.9rem);*/
@@ -269,6 +274,8 @@
padding-left: clamp(1.5rem, 2vw, 3rem); padding-left: clamp(1.5rem, 2vw, 3rem);
display: flex; display: flex;
align-items: center; align-items: center;
/* max-width: 111px;
max-height:19px ; */
/* 1rem=16px3.125rem=50px */ /* 1rem=16px3.125rem=50px */
/* padding-top: clamp(1rem, 2vw, 3.125rem); /* padding-top: clamp(1rem, 2vw, 3.125rem);
padding-bottom: clamp(1rem, 5vw, 3.125rem); */ padding-bottom: clamp(1rem, 5vw, 3.125rem); */
@@ -276,8 +283,9 @@
/* 链接图标PC端特有 */ /* 链接图标PC端特有 */
.product-card-link img { .product-card-link img {
width: clamp(2.5rem, 5vw, 4.5rem); /* width: clamp(2.5rem, 5vw, 4.5rem); */
height: auto; max-width: 111px;
max-height: 19px;
object-fit: contain; object-fit: contain;
} }
} }