You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

118 lines
3.4 KiB

2 years ago
  1. <template>
  2. <div :class="
  3. $vuetify.breakpoint.mdAndUp
  4. ? 'my-ad-banner mt-15 mb-15'
  5. : $vuetify.breakpoint.smOnly
  6. ? 'mt-10'
  7. : 'mt-7'
  8. ">
  9. <div class="computer hidden-sm-and-down">
  10. <v-container class="main-container py-0">
  11. <v-carousel v-model="carousel" hide-delimiters height="180" class="exhibition-swiper">
  12. <v-carousel-item v-for="p in Math.ceil(parseFloat(item.length / 3))" :key="p">
  13. <v-row>
  14. <v-col cols="4" v-for="i in p < Math.ceil(parseFloat(item.length / 3)) ||
  15. item.length % 3 == 0
  16. ? 3
  17. : item.length % 3" :key="i">
  18. <!--a :href="item[i - 1 + (p - 1) * 3].url"
  19. >
  20. </a-->
  21. <lazyImg :src="item[i - 1 + (p - 1) * 3].image" :customClass="'rounded-lg mx-auto'"></lazyImg>
  22. <!-- <v-img
  23. max-width="360"
  24. max-height="180"
  25. :src="item[i - 1 + (p - 1) * 3].image"
  26. class="rounded-lg mx-auto"
  27. ></v-img> -->
  28. </v-col>
  29. </v-row>
  30. </v-carousel-item>
  31. </v-carousel>
  32. </v-container>
  33. </div>
  34. <div class="tablet d-none d-sm-flex d-md-none">
  35. <v-container class="main-container py-0 pe-0">
  36. <v-sheet max-width="3000">
  37. <v-slide-group v-model="slide" center-active class="ps-2">
  38. <v-slide-item v-for="(ad, index) in item" :key="index">
  39. <v-card class="mx-4 rounded-xl" height="150" width="300">
  40. <v-img width="300" height="150" :src="ad.image" class="rounded-xl"></v-img>
  41. </v-card>
  42. </v-slide-item>
  43. </v-slide-group>
  44. </v-sheet>
  45. </v-container>
  46. </div>
  47. <!-- <div class="tablet d-none d-sm-flex d-md-none">
  48. <v-sheet max-width="3000">
  49. <v-slide-group mobile-break-point="820" class="pa-4 ms-6" center-active >
  50. <v-slide-item v-for="(ad, index) in item" :key="index">
  51. <div>
  52. <v-img
  53. max-width="300"
  54. contain
  55. :src="ad.image"
  56. class="rounded-lg me-7"
  57. ></v-img>
  58. </div>
  59. </v-slide-item>
  60. </v-slide-group>
  61. </v-sheet>
  62. </div> -->
  63. <div class="phone hidden-sm-and-up">
  64. <v-container class="main-container pa-0">
  65. <v-sheet max-width="3000">
  66. <v-slide-group v-model="slide" center-active class="ps-2">
  67. <v-slide-item v-for="(ad, index) in item" :key="index">
  68. <v-card class="mx-5 rounded-xl" height="120" width="240">
  69. <v-img width="240" height="120" :src="ad.image" class="rounded-xl"></v-img>
  70. </v-card>
  71. </v-slide-item>
  72. </v-slide-group>
  73. </v-sheet>
  74. </v-container>
  75. </div>
  76. </div>
  77. </template>
  78. <script>
  79. import lazyImg from "@/components/img/img.vue";
  80. export default {
  81. props: {
  82. item: {
  83. type: Array,
  84. },
  85. },
  86. components: {
  87. lazyImg,
  88. },
  89. data() {
  90. return {
  91. carousel: 0,
  92. carouselPagesNum: 2,
  93. slide: null,
  94. };
  95. },
  96. created() {},
  97. };
  98. </script>
  99. <style lang="scss" scoped>
  100. :deep() {
  101. .exhibition-swiper {
  102. padding: 0 53px;
  103. .v-window__prev {
  104. left: auto;
  105. right: 100%;
  106. }
  107. .v-window__next {
  108. right: auto;
  109. left: 100%;
  110. }
  111. }
  112. }
  113. </style>