diff --git a/resources/beike/shop/default/css/page-product.scss b/resources/beike/shop/default/css/page-product.scss index 5d6874cc..a8f661d8 100644 --- a/resources/beike/shop/default/css/page-product.scss +++ b/resources/beike/shop/default/css/page-product.scss @@ -16,7 +16,7 @@ body.page-product { } .product-image { - .swiper { + #swiper { height: 250px; @media (min-width: 480px) { height: 400px; @@ -39,6 +39,14 @@ body.page-product { } } + #swiper-2 { + .swiper-pagination { + --swiper-theme-color: #ff6600;/* 设置Swiper风格 */ + --swiper-navigation-color: #ff6600;/* 单独设置按钮颜色 */ + --swiper-navigation-size: 30px;/* 设置按钮大小 */ + } + } + .left { margin-right: 1rem; diff --git a/themes/default/product.blade.php b/themes/default/product.blade.php index e106ce57..ed6c60cd 100644 --- a/themes/default/product.blade.php +++ b/themes/default/product.blade.php @@ -17,26 +17,35 @@
- -
-
-
-
- - - + @if(!is_mobile()) +
+
+
+
+ + + +
+
+
+
+
-
-
-
-
-
- -
- -
+
+ +
+ @else +
+
+
+ +
+
+
+
+ @endif
@@ -256,13 +265,12 @@ } }); - $(document).on("mouseover", ".product-image .swiper .swiper-slide a", function() { + $(document).on("mouseover", ".product-image #swiper .swiper-slide a", function() { $(this).parent().addClass('active').siblings().removeClass('active'); $('#zoom').trigger('zoom.destroy'); $('#zoom img').attr('src', $(this).attr('data-image')); $('#zoom').zoom({url: $(this).attr('data-zoom-image')}); }); - var swiper = new Swiper("#swiper", { direction: "vertical", slidesPerView: 1, @@ -294,6 +302,16 @@ observeParents: true }); + var swiper2 = new Swiper("#swiper-2", { + slidesPerView: 1, + pagination: { + el: ".swiper-pagination", + clickable: true, + }, + observer: true, + observeParents: true + }); + $(document).ready(function () { $('#zoom').trigger('zoom.destroy'); $('#zoom').zoom({url: $('#swiper a').attr('data-zoom-image')});