index.html 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. {layout name="common/layout" /}
  2. <style>
  3. .swiper-recommend .swiper-slide {
  4. width: 216px;
  5. float: left;
  6. margin-right: 15px;
  7. }
  8. .swiper-recommend .item {
  9. padding: 15px;
  10. background: #fff;
  11. }
  12. .swiper-recommend .item img {
  13. width: 100%;
  14. }
  15. .swiper-recommend .item h4 {
  16. overflow: hidden;
  17. text-overflow: ellipsis;
  18. -webkit-box-orient: vertical;
  19. display: -webkit-box;
  20. -webkit-line-clamp: 2;
  21. }
  22. .index-tab h3 {
  23. font-size: 16px;
  24. margin-bottom: 15px;
  25. }
  26. #index-focus .item {
  27. min-height: 500px;
  28. background-color: rgba(54, 63, 72, 0.34);
  29. background-size: cover;
  30. background-attachment: scroll;
  31. background-position: center;
  32. }
  33. #index-focus .item .carousel-text {
  34. width: 500px;
  35. margin-top: 114px;
  36. }
  37. #index-focus .item .carousel-text h2 {
  38. margin-top: 30px;
  39. margin-bottom: 25px;
  40. font-size: 50px;
  41. line-height: 56px;
  42. font-weight: bold;
  43. color: #fff;
  44. }
  45. #index-focus .item .carousel-text p {
  46. margin-bottom: 30px;
  47. font-size: 18px;
  48. color: #fff;
  49. line-height: 28px;
  50. }
  51. @media (max-width: 767px) {
  52. #index-focus .item .carousel-text {
  53. width: 100%;
  54. }
  55. }
  56. </style>
  57. <link rel="stylesheet" href="__ADDON__/css/animate.css"/>
  58. <div class="swiper-container index-focus">
  59. <!-- S 焦点图 -->
  60. <div id="index-focus" class="carousel slide carousel-focus" data-ride="carousel">
  61. <ol class="carousel-indicators">
  62. {shop:blocklist id="block" name="indexfocus" row="5"}
  63. <li data-target="#index-focus" data-slide-to="{:$i-1}" class="{if $i==1}active{/if}"></li>
  64. {/shop:blocklist}
  65. </ol>
  66. <div class="carousel-inner" role="listbox">
  67. {shop:blocklist id="block" name="indexfocus" row="5"}
  68. <div class="item {if $i==1}active{/if}" style="background-image:linear-gradient(rgba(0, 0, 0, 0.56), rgba(0, 0, 0, 0.63)), url('{$block.image|htmlentities}')">
  69. <a href="{$block.url|htmlentities}">
  70. <div class="container">
  71. <div class="carousel-text pull-right">
  72. {$block.content}
  73. </div>
  74. </div>
  75. </a>
  76. </div>
  77. {/shop:blocklist}
  78. </div>
  79. <a class="left carousel-control" href="#index-focus" role="button" data-slide="prev">
  80. <span class="icon-prev fa fa-chevron-left" aria-hidden="true"></span>
  81. <span class="sr-only">Previous</span>
  82. </a>
  83. <a class="right carousel-control" href="#index-focus" role="button" data-slide="next">
  84. <span class="icon-next fa fa-chevron-right" aria-hidden="true"></span>
  85. <span class="sr-only">Next</span>
  86. </a>
  87. <!-- E 焦点图 -->
  88. </div>
  89. </div>
  90. <div class="container">
  91. <!-- S 热门推荐 -->
  92. <h2 style="color:#444;font-size:16px;">热门推荐</h2>
  93. <div class="swiper-container swiper-recommend" style="margin:20px 0;">
  94. <div class="swiper-wrapper">
  95. {shop:goodslist flag="recommend" id="goods" row="10"}
  96. <div class="swiper-slide">
  97. <div class="item">
  98. <a href="{$goods.url|htmlentities}" target="_blank">
  99. <div class="embed-responsive embed-responsive-square img-zoom">
  100. <img src="{$goods.image|cdnurl|htmlentities}" alt="{$goods.title|htmlentities}">
  101. </div>
  102. </a>
  103. <div class="caption text-left">
  104. <div class="my-1"><a href="{$goods.url|htmlentities}" title="{$goods.title|htmlentities}">{$goods.title|htmlentities}</a></div>
  105. <p class="text-muted text-danger">¥{$goods.price|htmlentities}</p>
  106. </div>
  107. </div>
  108. </div>
  109. {/shop:goodslist}
  110. </div>
  111. <div class="swiper-pagination"></div>
  112. <div class="swiper-button-next"></div>
  113. <div class="swiper-button-prev"></div>
  114. </div>
  115. <!-- E 首页推荐 -->
  116. {shop:catelist flag="index" id="cate"}
  117. <div class="index-tab my-4">
  118. {php}$colorArr = ['4fae9d', '686fb4', '3688d8', '536070', '8782a4','4fae9d', '686fb4', '3688d8', '536070', '8782a4'];{/php}
  119. <h3><a href="{$cate.url|htmlentities}"><span style="color:#{$colorArr[$key]}">{:$key+1}F {$cate.name|htmlentities}</span></a></h3>
  120. <div class="product-list">
  121. <div class="product-grid">
  122. {shop:goodslist category="$cate->id" id="goods" row="8" orderby="weigh"}
  123. <div class="product-item text-center">
  124. <a class="card-item" href="{$goods.url|htmlentities}" target="_blank">
  125. <div class="mb-3">
  126. <div class="embed-responsive embed-responsive-square img-zoom">
  127. <img src="{$goods.image|cdnurl|htmlentities}" class="" alt="{$goods.title|htmlentities}">
  128. </div>
  129. </div>
  130. <div class="item-info text-left">
  131. <div class="item-title">{$goods.title|htmlentities}</div>
  132. <div class="item-detail text-danger">
  133. <span>¥</span>{$goods.price|htmlentities}
  134. </div>
  135. </div>
  136. </a>
  137. </div>
  138. {/shop:goodslist}
  139. </div>
  140. <div class="clearfix"></div>
  141. </div>
  142. </div>
  143. {/shop:catelist}
  144. </div>
  145. <script data-render="script">
  146. var mySwiper = new Swiper('.swiper-container', {
  147. pagination: {
  148. el: '.swiper-pagination',
  149. },
  150. navigation: {
  151. nextEl: '.swiper-button-next',
  152. prevEl: '.swiper-button-prev',
  153. },
  154. slidesPerView: 5,
  155. paginationClickable: true,
  156. spaceBetween: 15,
  157. breakpoints: {
  158. 1200: {
  159. slidesPerView: 4,
  160. spaceBetween: 40
  161. },
  162. 970: {
  163. slidesPerView: 3,
  164. spaceBetween: 50
  165. },
  166. 640: {
  167. slidesPerView: 2,
  168. spaceBetween: 20
  169. },
  170. 320: {
  171. slidesPerView: 1,
  172. spaceBetween: 10
  173. }
  174. }
  175. });
  176. </script>