diff --git a/assets/css/index.css b/assets/css/index.css index 8e20fe3..537226b 100755 --- a/assets/css/index.css +++ b/assets/css/index.css @@ -74,7 +74,7 @@ padding: 0px 1px; } .as-nav-slider { - margin: 24px 50px 0px !important; + margin: -108px 50px 0px !important; } .vehica-car-card__info .cus-btn{ height: 30px; @@ -121,7 +121,7 @@ height: 240px; } .as-nav-slider { - margin: 24px 10px 0px !important; + margin: -50px 10px 0px !important; } .tag{ margin-left: 10px !important; diff --git a/assets/css/newcar.css b/assets/css/newcar.css index 6f85769..821840e 100755 --- a/assets/css/newcar.css +++ b/assets/css/newcar.css @@ -271,50 +271,35 @@ -/* 底部 */ +/* 底部 */ +@media (max-width: 820px) { + .footer-why { + display: none; + } +} .footer-why { - background: #ecf3f9; - color: #2d74ba; + background: #2d74ba; + color: #fff; font-weight: 700; - height: 10rem; + height: 7rem; } .footer-why ul { padding: 0px 10px; - height: 10rem; + height: 7rem; align-items: center; display: flex; } .footer-why li { - height: 10rem; + height: 7rem; align-items: center; display: flex; gap: 1rem; } -/* footer-why .xz-main { - height: 12.6rem; -} -.footer-why ul { - height: 100%; - justify-content: space-between -} -.xz-main { - margin: 0 auto; - width: clamp(1200px,calc(760px + 34.375vw),1440px); -} -.footer-why li,.footer-why ul { - align-items: center; - display: flex -} */ .footer-why li { font-weight: 700; /* gap: 1rem */ } -/* -.footer-why i { - font-size: 3rem; - font-weight: 400 -} */ @@ -634,9 +619,9 @@ border-radius: 4px; font-size: 12px; margin: 0px; - } - .brand-item{ - width: 116px; + } + .brand-item{ + width: 116px; } } @@ -758,10 +743,6 @@ .slick-initialized .slick-slide { text-align: center; } -.colorsib img{ - width:30%; -} - .brand { position: relative; } @@ -793,3 +774,42 @@ .brand-toggle .fa { margin-left: 5px; } +.colorsib { + padding: 0px 20px; +} +.color-slide-item p{ + text-align: center; +} + +.color-slider-arrows { + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; + pointer-events: none; /* 让箭头以外区域可点 */ +} +.color-slider-arrows .arrow-btn { + position: absolute; + top: 50%; + transform: translateY(-50%); + z-index: 2; + width: 30px; + height: 30px; + background: rgba(255, 255, 255, 0.8); + border: 1px solid #ddd; + border-radius: 50%; + display: flex; + align-items: center; + justify-content: center; + pointer-events: auto; /* 让按钮可点 */ +} +.color-slider-arrows .arrow-btn svg { + width: 10px; +} +.color-slider-arrows .btn-prev { + left: -16px; +} +.color-slider-arrows .btn-next { + right: -16px; +} diff --git a/assets/js/newcar-details.js b/assets/js/newcar-details.js index 1563f71..148897f 100755 --- a/assets/js/newcar-details.js +++ b/assets/js/newcar-details.js @@ -39,6 +39,13 @@ $(function() { }, ], }); + + // $(".color-slider").slick({ + // slidesToShow: 3, + // slidesToScroll: 1, + // dots: false, + // arrows: false, + // }); } // 生成HTML function generateslide(product) { @@ -62,6 +69,19 @@ $(function() { `; } + + function generateColorSlide(color) { + if (!color.skuAttributes) { + return ''; + } + return ` +
+ `; + } + // 渲染轮播图 function renderbanner(lbdata) { const rentalslider = document.getElementById('rental-slider'); @@ -74,6 +94,15 @@ $(function() { ).join(''); initSlick() } + + function renderColorSlider(colors) { + if (!colors || colors.length === 0) { + return; + } + const colorSlider = document.querySelector('.color-slider'); + colorSlider.innerHTML = colors.map(color => generateColorSlide(color)).join(''); + } + // Introduction function Introductionhtml(data){ $(".nav-menu").append( @@ -213,6 +242,10 @@ $(function() { $(".views").html(carinfo.views) $("#brands").html(''+carinfo.brand_name+'') renderbanner(carinfo.album) + // if (carinfo.sku) { + // renderColorSlider(carinfo.sku); + // } + // initSlick(); Introductionhtml(carinfo.content) Highlightedhtml(carinfo.trait) diff --git a/assets/media/icons/meony.png b/assets/media/icons/meony.png index 29f92d9..a02cbf8 100755 Binary files a/assets/media/icons/meony.png and b/assets/media/icons/meony.png differ diff --git a/assets/media/icons/proect.png b/assets/media/icons/proect.png index 891dd69..25085b1 100755 Binary files a/assets/media/icons/proect.png and b/assets/media/icons/proect.png differ diff --git a/assets/media/icons/xing.png b/assets/media/icons/xing.png index a6c75e6..3413a7d 100755 Binary files a/assets/media/icons/xing.png and b/assets/media/icons/xing.png differ diff --git a/assets/media/icons/zan.png b/assets/media/icons/zan.png index c599173..c103b18 100755 Binary files a/assets/media/icons/zan.png and b/assets/media/icons/zan.png differ diff --git a/assets/media/icons/zhuans.png b/assets/media/icons/zhuans.png index cb205f4..15db624 100755 Binary files a/assets/media/icons/zhuans.png and b/assets/media/icons/zhuans.png differ diff --git a/newcar-details.html b/newcar-details.html index 619a0d1..e360396 100755 --- a/newcar-details.html +++ b/newcar-details.html @@ -252,7 +252,23 @@ - + +