SwiperNfcpgx.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264
  1. <template>
  2. <!-- {{ imgData[0].imgurl }} -->
  3. <!-- {{ imgData[0] }} -->
  4. <div class="swiper " v-if="imgData">
  5. <el-carousel
  6. :interval="3333"
  7. class="roll_in"
  8. indicator-class="custom-indicator"
  9. arrow="always"
  10. @change="change_fun">
  11. <el-carousel-item v-for="(item, index) in imgData" :key="index">
  12. <NuxtLink :href="getLinkPathDetail(item)">
  13. <img :src="item.imgurl" :alt="item.title">
  14. <span class="swiper_dot1 dot1 roll_phone_none">
  15. {{ item.title }}
  16. </span>
  17. <span class="roll_dot2 roll_pc_none">
  18. {{ item.title }}
  19. </span>
  20. </NuxtLink>
  21. </el-carousel-item>
  22. <div class="roll_num_box phone_none">
  23. <span class="roll_num_box_new">{{ roll_num_this + 1 }}</span>
  24. /
  25. {{ roll_num_lang }}
  26. </div>
  27. </el-carousel>
  28. </div>
  29. </template>
  30. <script setup>
  31. import { ElCarousel, ElCarouselItem } from 'element-plus'
  32. //获取焦点图数据 start---------------------------------------->
  33. import { ref } from 'vue'
  34. const roll_num_lang = ref(4);
  35. const roll_num_this = ref(0);
  36. const props = defineProps({
  37. imgData: {
  38. type: Array,
  39. default: []
  40. }
  41. })
  42. const change_fun = (the_1) => {
  43. roll_num_this.value = the_1
  44. }
  45. </script>
  46. <style lang="less" scoped>
  47. .roll_num_box {
  48. position: absolute;
  49. z-index: 2;
  50. left: 60px;
  51. bottom: 0px;
  52. height: 60px;
  53. line-height: 60px;
  54. color: #fff;
  55. font-size: 16px;
  56. .roll_num_box_new {
  57. font-size: 20px;
  58. }
  59. }
  60. .dot1 {
  61. display: block;
  62. word-break: keep-all;
  63. white-space: nowrap;
  64. overflow: hidden;
  65. text-overflow: ellipsis;
  66. }
  67. .swiper {
  68. width: 100%;
  69. height: 405px;
  70. position: relative;
  71. img {
  72. width: 100%;
  73. height: 405px;
  74. }
  75. .swiper_dot1 {
  76. display: block;
  77. width: 100%;
  78. line-height: 60px;
  79. height: 60px;
  80. color: #fff;
  81. font-size: 18px;
  82. text-indent: 20px;
  83. position: absolute;
  84. bottom: 0;
  85. left: 0;
  86. z-index: 10;
  87. box-sizing: border-box;
  88. padding: 0 144px;
  89. background: linear-gradient(0deg, rgba(0, 0, 0, 0.5) 33%, rgba(0, 0, 0, 0) 100%);
  90. }
  91. }
  92. .el-carousel {
  93. /deep/.el-carousel__arrow i {
  94. font-size: 33px !important;
  95. }
  96. .roll_1_box {
  97. position: relative;
  98. }
  99. /deep/.el-carousel__arrow--left {
  100. position: absolute;
  101. width: 35px;
  102. height: 57px;
  103. color: #fff;
  104. background: rgba(0, 0, 0, 0);
  105. left: 9px;
  106. border: none;
  107. border-radius: 0;
  108. top: 100%;
  109. margin-top: -28px;
  110. }
  111. /deep/.el-carousel__arrow--right {
  112. width: 35px;
  113. height: 57px;
  114. color: #fff;
  115. background: rgba(0, 0, 0, 0);
  116. position: absolute;
  117. right: 9;
  118. border: none;
  119. border-radius: 0;
  120. top: 100%;
  121. margin-top: -28px;
  122. }
  123. /deep/ .el-carousel__indicators {
  124. // 指示器
  125. left: unset;
  126. transform: unset;
  127. right: 10px;
  128. bottom: 11px;
  129. }
  130. /deep/ .el-carousel__button {
  131. // 指示器按钮
  132. width: 10px;
  133. height: 10px;
  134. border: none;
  135. border-radius: 5px;
  136. background: #fff;
  137. opacity: 1;
  138. }
  139. /deep/ .is-active .el-carousel__button {
  140. // 指示器激活按钮
  141. background: #255590;
  142. width: 25px;
  143. opacity: 1;
  144. }
  145. /deep/ .el-carousel__container {
  146. height: 100%;
  147. }
  148. }
  149. .custom-indicator button {
  150. background-color: #fff;
  151. opacity: 1;
  152. width: 8px;
  153. height: 8px;
  154. }
  155. .custom-indicator button.is-active {
  156. background-color: #DD7D18;
  157. width: 58px;
  158. opacity: 1;
  159. }
  160. </style>
  161. <style lang="less" scoped>
  162. @media screen and (min-width:801px){/*pc*/
  163. .pc_none{display:none;}
  164. }
  165. @media screen and (max-width:800px){/*ipad_phone*/
  166. .phone_none{display:none;}
  167. }
  168. </style>
  169. <style lang="less" scoped>
  170. @media screen and (min-width:801px){/*pc*/
  171. .roll_in{height:405px;}
  172. .swiper /deep/.el-carousel__indicators{display:none;}
  173. .roll_pc_none{display:none!important;}
  174. .pc_none{display:none;}
  175. }
  176. @media screen and (max-width:800px){/*ipad_phone*/
  177. .swiper{ height:55vw; width:92%;margin:15px auto 0px;}
  178. .roll_in{height:55vw;}
  179. .swiper /deep/ul.el-carousel__indicators{width:100%; right:0px;text-align:center;}
  180. .swiper img{width:100%;height:100%;}
  181. .roll_in{height:55vw;}
  182. .el-carousel /deep/.el-icon svg{width:.4em;display:none;}
  183. .el-carousel /deep/.el-carousel__button{width:10px;height:10px;margin:0px 4px;}
  184. .roll_dot2{
  185. width:100%;line-height:22px; height:54px;font-size:16px;
  186. padding:10px 10px 0;top:0px;
  187. display: inline-block;
  188. box-sizing: border-box;
  189. position: absolute;
  190. left: 0;
  191. font-family: Source Han Sans, Source Han Sans;
  192. font-weight: 800;
  193. color: #FFFFFF;
  194. background: linear-gradient(to bottom, rgba(0, 0, 0, 1), rgba(0, 0, 0, 0));
  195. overflow:hidden;display:-webkit-box!important;-webkit-box-orient:vertical;-webkit-line-clamp:2;
  196. }
  197. /deep/.el-carousel .el-carousel__button{width:10px!important;}
  198. /deep/.el-carousel .el-carousel__indicators{bottom:0px;}
  199. .roll_phone_none{display:none!important;}
  200. .phone_none{display:none;}
  201. }
  202. </style>