hjyd
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.

127 lines
3.0 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <div class="trumbs_container">
  3. <swiper
  4. :slidesPerView="7"
  5. :freeMode="true"
  6. :modules="modules"
  7. :autoHeight="true"
  8. @swiper="onSwiper"
  9. @slideChange="onSlideChange"
  10. class="trumbs_swiper"
  11. >
  12. <swiper-slide
  13. v-for="item in props.isCase
  14. ? case_detail_img_data[industry_id]
  15. : hard_img_data[hardware_id]"
  16. :key="item.id"
  17. style="background: none"
  18. >
  19. <div class="img_card">
  20. <img :src="item.picUrl" class="img" alt="" />
  21. <div class="dialog_text">
  22. <div class="btn" @click="viewDetail(item.id)">查看详情</div>
  23. </div>
  24. </div>
  25. </swiper-slide>
  26. </swiper>
  27. </div>
  28. </template>
  29. <script setup>
  30. import { ref } from 'vue'
  31. // Import Swiper Vue.js components
  32. import { Swiper, SwiperSlide } from 'swiper/vue'
  33. import { case_detail_img_data } from '@/mock/case'
  34. import { case_detail_img_data as hard_img_data } from '@/mock/hardware'
  35. import { useDetailStore } from '@/store'
  36. import { storeToRefs } from 'pinia'
  37. // Import Swiper styles
  38. import 'swiper/css'
  39. import 'swiper/css/free-mode'
  40. // import required modules
  41. import { FreeMode } from 'swiper'
  42. const detailStore = useDetailStore()
  43. const { industry_id, hardware_id } = storeToRefs(detailStore)
  44. const myEmit = defineEmits(['onMySonFunc'])
  45. const props = defineProps({
  46. isCase: Boolean,
  47. })
  48. const modules = ref([FreeMode])
  49. const viewDetail = index => {
  50. if (props.isCase) {
  51. myEmit('onMySonFunc')
  52. detailStore.updateExampleId(index)
  53. } else {
  54. detailStore.updateHardwareExampleId(index)
  55. }
  56. const intIndex = parseInt(index)
  57. if (intIndex > 4) {
  58. sw.value.slideTo(intIndex - 4, 500, false)
  59. } else {
  60. sw.value.slideTo(intIndex - 2, 500, false)
  61. }
  62. }
  63. const sw = ref(null)
  64. const onSwiper = swiper => {
  65. sw.value = swiper
  66. }
  67. </script>
  68. <style lang="scss" scoped>
  69. .swiper {
  70. width: 1594px !important;
  71. }
  72. .trumbs_container {
  73. width: 100%;
  74. height: 108px;
  75. .img_card {
  76. min-width: 194px;
  77. width: 194px;
  78. height: 108px;
  79. position: relative;
  80. .img {
  81. width: 194px;
  82. }
  83. .dialog_text {
  84. display: flex;
  85. position: absolute;
  86. top: 0;
  87. left: 0;
  88. right: 0;
  89. bottom: 0;
  90. opacity: 0;
  91. align-items: center;
  92. justify-content: center;
  93. transition-property: all;
  94. transition-duration: 0.7s;
  95. animation-fill-mode: forwards;
  96. .btn {
  97. font-size: 18px;
  98. font-family: 'SourceHanSans';
  99. font-weight: 400;
  100. color: #ffffff;
  101. padding: 6px 14px;
  102. border: 1px solid #ffffff;
  103. border-radius: 2px;
  104. cursor: pointer;
  105. transition-property: all;
  106. transition-duration: 0.7s;
  107. animation-fill-mode: forwards;
  108. }
  109. .btn:hover {
  110. background: #283fe7 !important;
  111. border: 1px solid #283fe7 !important;
  112. opacity: 1;
  113. transform: scale(1.1);
  114. }
  115. }
  116. }
  117. .dialog_text:hover {
  118. background: rgba(53, 83, 227, 0.63);
  119. opacity: 1;
  120. }
  121. }
  122. </style>