diff --git a/public/themes/dist_static/static/css/solution2.css b/public/themes/dist_static/static/css/solution2.css index ca04dca..ab8e77f 100644 --- a/public/themes/dist_static/static/css/solution2.css +++ b/public/themes/dist_static/static/css/solution2.css @@ -120,7 +120,7 @@ display: flex; align-items: start; justify-content: space-between; - gap: 10.625rem; + gap: 5rem; } .sl2-arch__copy { display: flex; @@ -137,7 +137,7 @@ } .sl2-arch__desc { margin: 0; - color: var(--color-text); + color: var(--color-text-muted); font-family: "MiSans VF", "PingFang SC", sans-serif; font-size: var(--font-20); font-weight: 400; @@ -145,16 +145,17 @@ margin-bottom: 2.5rem; } .sl2-arch__panel { - width: 60rem; + width: 100%; overflow: hidden; border-radius: 1.875rem; background: var(--color-white); - border: 1px solid rgb(223, 224, 226); + /* border: 1px solid rgb(223, 224, 226); */ } .sl2-arch__panel img { display: block; width: 100%; - height: auto; + /* height: auto; */ + object-fit: contain; } .sl2-core { @@ -219,6 +220,14 @@ font-size: var(--font-20); font-weight: 400; line-height: var(--font-28); + + /* 4行 */ + min-height: calc(var(--font-28) * 4); + display: -webkit-box; + -webkit-line-clamp: 4; + -webkit-box-orient: vertical; + overflow: hidden; + text-overflow: ellipsis; } .sl2-core__media { padding: 3rem; diff --git a/public/themes/dist_static/static/js/product.js b/public/themes/dist_static/static/js/product.js index bb083c1..b47e3c6 100644 --- a/public/themes/dist_static/static/js/product.js +++ b/public/themes/dist_static/static/js/product.js @@ -32,10 +32,18 @@ function relatedCarouselInit() { const root = document.querySelector(".p-related"); const el = root?.querySelector(".p-related__swiper"); if (!root || !el || !window.Swiper) return; + const slideCount = el.querySelectorAll(".swiper-wrapper > .swiper-slide").length; + // 一屏展示 4 条,不超过 4 条时隐藏切换按钮 + if (slideCount <= 4) { + root.querySelectorAll(".p-related__header .s-arrows").forEach((node) => { + node.style.display = "none"; + }); + } new window.Swiper(el, { slidesPerView: 1.15, spaceBetween: 16, grabCursor: true, + watchOverflow: true, pagination: { el: root.querySelector(".p-related__pagination"), clickable: true diff --git a/public/themes/website/1/zh/demo/solution2.html b/public/themes/website/1/zh/demo/solution2.html index e18a658..1a02e6f 100755 --- a/public/themes/website/1/zh/demo/solution2.html +++ b/public/themes/website/1/zh/demo/solution2.html @@ -100,7 +100,7 @@ $current_cate_id = $current_cate['id'] ?? 0;
{$sub_cates[2]['description'] ?? ''}
- +