swiperXcShop.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  1. <template>
  2. <div class="swiper">
  3. <el-carousel :interval="933993" height="300px" indicator-position="outside" @change="change_fun">
  4. <el-carousel-item>
  5. <div
  6. class="shop_li_img_1 clearfix"
  7. :class="per_index == 2 ? 'shop_li_img_1_hot' : ''"
  8. v-for="item in props.data"
  9. >
  10. <nuxtLink
  11. :to="getShopPathDetail1(item)"
  12. class="shop_li_img_1_a"
  13. :title="item.name"
  14. >
  15. <img class="shop_li_img_1_img" :src="item.imgurl" alt="item.name">
  16. <div class="shop_li_img_1_dot2 dot2">
  17. {{ item.name }}
  18. </div>
  19. <div class="shop_li_img_1_price">{{getShopType(item)}}</div>
  20. </nuxtLink>
  21. </div>
  22. </el-carousel-item>
  23. <el-carousel-item>
  24. <div
  25. class="shop_li_img_1 clearfix"
  26. :class="per_index == 2 ? 'shop_li_img_1_hot' : ''"
  27. v-for="item in props.data2"
  28. >
  29. <nuxtLink
  30. :to="getShopPathDetail1(item)"
  31. class="shop_li_img_1_a"
  32. :title="item.name"
  33. >
  34. <img class="shop_li_img_1_img" :src="item.imgurl" alt="item.name">
  35. <div class="shop_li_img_1_dot2 dot2">
  36. {{ item.name }}
  37. </div>
  38. <div class="shop_li_img_1_price">{{getShopType(item)}}</div>
  39. </nuxtLink>
  40. </div>
  41. </el-carousel-item>
  42. <el-carousel-item>
  43. <div
  44. class="shop_li_img_1 clearfix"
  45. :class="per_index == 2 ? 'shop_li_img_1_hot' : ''"
  46. v-for="item in props.data3"
  47. >
  48. <nuxtLink
  49. :to="getShopPathDetail1(item)"
  50. class="shop_li_img_1_a"
  51. :title="item.name"
  52. >
  53. <img class="shop_li_img_1_img" :src="item.imgurl" alt="item.name">
  54. <div class="shop_li_img_1_dot2 dot2">
  55. {{ item.name }}
  56. </div>
  57. <div class="shop_li_img_1_price">{{getShopType(item)}}</div>
  58. </nuxtLink>
  59. </div>
  60. </el-carousel-item>
  61. </el-carousel>
  62. </div>
  63. </template>
  64. <script setup>
  65. //1.页面必备方法 start ---------------------------------------->
  66. import { ElCarousel, ElCarouselItem } from 'element-plus'
  67. import { ref } from 'vue'
  68. const roll_num_lang = ref(3);
  69. const roll_num_this = ref(0);
  70. const change_fun = (the_1) => {
  71. roll_num_this.value = the_1
  72. }
  73. //1.页面必备方法 end ---------------------------------------->
  74. //2.组件数据 start ---------------------------------------->
  75. const props = defineProps({
  76. data: {
  77. type: Array,
  78. default: () => []
  79. },
  80. data2: {
  81. type: Array,
  82. default: () => []
  83. },
  84. data3: {
  85. type: Array,
  86. default: () => []
  87. }
  88. })
  89. //2.组件数据 end ---------------------------------------->
  90. </script>
  91. <style lang="less" scoped>
  92. .dot2 {
  93. overflow: hidden;
  94. display: -webkit-box;
  95. -webkit-box-orient: vertical;
  96. -webkit-line-clamp: 2;
  97. }
  98. .shop_li_img_1 {
  99. float: left;
  100. width: 150px;
  101. position: relative;
  102. margin: 45px 14px 8px;
  103. }
  104. .shop_li_img_1_img {
  105. display: block;
  106. width: 100%;
  107. height: 150px !important;
  108. }
  109. .shop_li_img_1_dot2 {
  110. height: 36px !important;
  111. line-height: 18px;
  112. color: #333;
  113. font-size: 14px;
  114. margin: 7px auto 6px;
  115. width: 140px;
  116. }
  117. .shop_li_img_1_price {
  118. text-align: center;
  119. height: 21px;
  120. line-height: 21px;
  121. color: #A01C0E;
  122. font-size: 18px;
  123. width: 140px;
  124. margin: 0px auto 0px;
  125. font-weight: bold;
  126. }
  127. .shop_li_img_1_hot::after {
  128. content: '';
  129. display: block;
  130. position: absolute;
  131. width: 35px;
  132. height: 25px;
  133. left: 10px;
  134. top: 0px;
  135. z-index: 11;
  136. background: url(../../public/img/11.png) no-repeat left 0px;
  137. background-size: 100% 100%;
  138. }
  139. .shop_li_img_1:hover .shop_li_img_1_dot2 {
  140. color: #A01C0E;
  141. }
  142. .roll_num_box {
  143. position: absolute;
  144. z-index: 2;
  145. left: 60px;
  146. bottom: 0px;
  147. height: 60px;
  148. line-height: 60px;
  149. color: #fff;
  150. font-size: 16px;
  151. .roll_num_box_new {
  152. font-size: 20px;
  153. }
  154. }
  155. .dot1 {
  156. display: block;
  157. word-break: keep-all;
  158. white-space: nowrap;
  159. overflow: hidden;
  160. text-overflow: ellipsis;
  161. }
  162. .swiper {
  163. width: 100%;
  164. height: 405px;
  165. position: relative;
  166. img {
  167. width: 100%;
  168. height: 405px;
  169. }
  170. .swiper_dot1 {
  171. display: block;
  172. width: 100%;
  173. line-height: 60px;
  174. height: 60px;
  175. color: red;
  176. font-size: 18px;
  177. text-indent: 20px;
  178. position: absolute;
  179. bottom: 0;
  180. left: 0;
  181. z-index: 10;
  182. box-sizing: border-box;
  183. padding: 0 144px;
  184. background: linear-gradient(0deg, rgba(0, 0, 0, 0.5) 33%, rgba(0, 0, 0, 0) 100%);
  185. }
  186. }
  187. .swiper {
  188. height: 300px;
  189. }
  190. .el-carousel {
  191. /deep/.el-carousel__indicators--outside {
  192. margin-top: -35px;
  193. }
  194. /deep/.el-carousel__arrow--right {
  195. width: 35px;
  196. height: 57px;
  197. color: #fff;
  198. background: rgba(0, 0, 0, 0);
  199. position: absolute;
  200. right: 9;
  201. border: none;
  202. border-radius: 0;
  203. top: 100%;
  204. margin-top: -28px;
  205. }
  206. /deep/ .el-carousel__indicators {
  207. // 指示器
  208. left: unset;
  209. transform: unset;
  210. right: 10px;
  211. bottom: 11px;
  212. }
  213. /deep/ .el-carousel__button {
  214. // 指示器按钮
  215. width: 10px;
  216. height: 10px;
  217. border: none;
  218. border-radius: 5px;
  219. background: #EDCEA2;
  220. opacity: .5;
  221. }
  222. /deep/ .is-active .el-carousel__button {
  223. // 指示器激活按钮
  224. background: #EDCEA2;
  225. opacity: 1;
  226. }
  227. /deep/ .el-carousel__container {
  228. height: 100%;
  229. }
  230. }
  231. .custom-indicator button {
  232. background-color: #fff;
  233. opacity: 1;
  234. width: 8px;
  235. height: 8px;
  236. }
  237. .custom-indicator button.is-active {
  238. background-color: #DD7D18;
  239. width: 58px;
  240. opacity: 1;
  241. }
  242. </style>