swiperXcShop.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329
  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. text-align: center;
  117. }
  118. .shop_li_img_1_price {
  119. text-align: center;
  120. height: 21px;
  121. line-height: 21px;
  122. color: #A01C0E;
  123. font-size: 18px;
  124. width: 140px;
  125. margin: 0px auto 0px;
  126. font-weight: bold;
  127. }
  128. .shop_li_img_1_hot::after {
  129. content: '';
  130. display: block;
  131. position: absolute;
  132. width: 35px;
  133. height: 25px;
  134. left: 10px;
  135. top: 0px;
  136. z-index: 11;
  137. background: url(../../public/img/11.png) no-repeat left 0px;
  138. background-size: 100% 100%;
  139. }
  140. .shop_li_img_1:hover .shop_li_img_1_dot2 {
  141. color: #A01C0E;
  142. }
  143. .roll_num_box {
  144. position: absolute;
  145. z-index: 2;
  146. left: 60px;
  147. bottom: 0px;
  148. height: 60px;
  149. line-height: 60px;
  150. color: #fff;
  151. font-size: 16px;
  152. .roll_num_box_new {
  153. font-size: 20px;
  154. }
  155. }
  156. .dot1 {
  157. display: block;
  158. word-break: keep-all;
  159. white-space: nowrap;
  160. overflow: hidden;
  161. text-overflow: ellipsis;
  162. }
  163. .swiper {
  164. width: 100%;
  165. height: 405px;
  166. position: relative;
  167. img {
  168. width: 100%;
  169. height: 405px;
  170. }
  171. .swiper_dot1 {
  172. display: block;
  173. width: 100%;
  174. line-height: 60px;
  175. height: 60px;
  176. color: red;
  177. font-size: 18px;
  178. text-indent: 20px;
  179. position: absolute;
  180. bottom: 0;
  181. left: 0;
  182. z-index: 10;
  183. box-sizing: border-box;
  184. padding: 0 144px;
  185. background: linear-gradient(0deg, rgba(0, 0, 0, 0.5) 33%, rgba(0, 0, 0, 0) 100%);
  186. }
  187. }
  188. .swiper {
  189. height: 300px;
  190. }
  191. .el-carousel {
  192. /deep/.el-carousel__indicators--outside {
  193. margin-top: -35px;
  194. }
  195. /deep/.el-carousel__arrow--right {
  196. width: 35px;
  197. height: 57px;
  198. color: #fff;
  199. background: rgba(0, 0, 0, 0);
  200. position: absolute;
  201. right: 9;
  202. border: none;
  203. border-radius: 0;
  204. top: 100%;
  205. margin-top: -28px;
  206. }
  207. /deep/ .el-carousel__indicators {
  208. // 指示器
  209. left: unset;
  210. transform: unset;
  211. right: 10px;
  212. bottom: 11px;
  213. }
  214. /deep/ .el-carousel__button {
  215. // 指示器按钮
  216. width: 10px;
  217. height: 10px;
  218. border: none;
  219. border-radius: 5px;
  220. background: #EDCEA2;
  221. opacity: .5;
  222. }
  223. /deep/ .is-active .el-carousel__button {
  224. // 指示器激活按钮
  225. background: #EDCEA2;
  226. opacity: 1;
  227. }
  228. /deep/ .el-carousel__container {
  229. height: 100%;
  230. }
  231. }
  232. .custom-indicator button {
  233. background-color: #fff;
  234. opacity: 1;
  235. width: 8px;
  236. height: 8px;
  237. }
  238. .custom-indicator button.is-active {
  239. background-color: #DD7D18;
  240. width: 58px;
  241. opacity: 1;
  242. }
  243. </style>
  244. <style lang="less" scoped>
  245. @media screen and (min-width:801px){/*pc*/
  246. .pc_none{display:none;}
  247. }
  248. @media screen and (max-width:800px){/*ipad_phone*/
  249. .shop_li_img_1{width:23%;margin:1vw 1%;overflow:hidden;}
  250. .shop_li_img_1:nth-of-type(n+5){display:none;}
  251. .shop_li_img_1_img{height:22vw!important;}
  252. .shop_li_img_1_dot2{width:100%;font-size:2vw;line-height:4vw;height:8vw!important;margin:1vw auto;}
  253. .shop_li_img_1_price{width:100%;font-size:4vw;height:6vw;line-height:6vw;}
  254. .swiper{height:auto;height:47vw!important;}
  255. /deep/.el-carousel .el-carousel__button{width:4vw;height:4vw;border-radius:50%;margin:0px 2vw;}
  256. .el-carousel--horizontal, .el-carousel--vertical{
  257. height:100%;
  258. }
  259. /deep/.el-carousel .el-carousel__container{
  260. height:100%!important;
  261. }
  262. /deep/.el-carousel .el-carousel__indicators--outside{
  263. margin-top: -9vw;
  264. }
  265. .phone_none{display:none;}
  266. }
  267. </style>