ShuanggouPaintingDetail.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. <template>
  2. <div class="painting-detail-list">
  3. <!-- <div class="bg-left" /> -->
  4. <img
  5. v-show="route.query.m == 1"
  6. class="bg-img"
  7. src="@/assets/images/img_shese.jpg"
  8. alt=""
  9. >
  10. <img
  11. v-show="!route.query.m || route.query.m == 0 "
  12. class="bg-img"
  13. src="@/assets/images/img_shuanggou.jpg"
  14. alt=""
  15. >
  16. <Swiper
  17. class="painting-list"
  18. :initial-slide="Number(route.query.idx)"
  19. :slides-per-view="1"
  20. @swiper="onSwiper"
  21. @slideChange="onSlideChange"
  22. >
  23. <SwiperSlide
  24. v-for="item in showPaintingList"
  25. :key="item['标题']"
  26. class="swiper-slider"
  27. >
  28. <PaintingDetail
  29. class="painting-item"
  30. :thumb="`${$env.BASE_URL}configMultiMedia/paintings-small/${item['标题']}.jpg`"
  31. :title="item['标题(展示)']"
  32. :author="item['作者']"
  33. :age="item['朝代']"
  34. :subtitle="item['装裱\/材质\/笔类型']"
  35. :location="item['馆藏']"
  36. :painting-desc="item['简介']"
  37. :author-desc="item['作者简介']"
  38. :big-painting="`${$env.BASE_URL}configMultiMedia/paintings/${item['标题']}.jpg`"
  39. :can-close="false"
  40. :direction="item['方向']"
  41. :size="getPaintingSize(item['尺寸'])"
  42. >
  43. {{ item }}
  44. </PaintingDetail>
  45. </SwiperSlide>
  46. </Swiper>
  47. <OperationTip
  48. class="operation-tip"
  49. direction="h"
  50. :is-show="isShowOperationTip"
  51. />
  52. <BtnBack
  53. class="btn-back"
  54. @click="router.replace({name:'ShuanggouDetail'})"
  55. />
  56. </div>
  57. </template>
  58. <script setup>
  59. import { ref, computed, watch, onMounted, inject } from "vue"
  60. import { useRoute, useRouter } from "vue-router"
  61. import { useStore } from "vuex"
  62. import PaintingDetail from '@/views/PaintingDetail.vue'
  63. import useSizeAdapt from "@/useFunctions/useSizeAdapt"
  64. const getPaintingSize = utils.getPaintingSize
  65. const route = useRoute()
  66. const router = useRouter()
  67. const store = useStore()
  68. const $env = inject('$env')
  69. const {
  70. windowSizeInCssForRef,
  71. windowSizeWhenDesignForRef,
  72. } = useSizeAdapt()
  73. const paintingList = configExcel['画作']
  74. const showPaintingList = computed(() => {
  75. return paintingList.filter(item => item['标题'] === '竹禽图卷' || item['标题'] === '桃竹双凫图')
  76. })
  77. /**
  78. * swiper
  79. */
  80. let swiper = null
  81. const onSwiper = (swiperP) => {
  82. swiper = swiperP
  83. }
  84. const onSlideChange = (e) => {
  85. if (isShowOperationTip.value && e.activeIndex !== Number(route.query.idx)) {
  86. isShowOperationTip.value = false
  87. }
  88. }
  89. const isShowOperationTip = ref(true)
  90. </script>
  91. <style lang="less" scoped>
  92. .painting-detail-list{
  93. position: absolute;
  94. left: 0;
  95. top: 0;
  96. width: 100%;
  97. height: 100%;
  98. >.bg-img{
  99. width: 100%;
  100. height: 100%;
  101. object-fit: cover;
  102. }
  103. >.bg-left{
  104. background: linear-gradient(90deg, #7b916b 0%, #94a586 100%);
  105. position: absolute;
  106. left: 0;
  107. top: 0;
  108. height: 100%;
  109. width: calc(57 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  110. background: -1;
  111. }
  112. >.painting-list{
  113. position: absolute;
  114. left: 0;
  115. top: 0;
  116. width: 100%;
  117. height: 100%;
  118. // backdrop-filter: blur(calc(20 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef')));
  119. // background: linear-gradient(rgba(123,145,107,0.62) 0%, rgba(0,0,0,0.3) 100%);
  120. // background-image:url(@/assets/images/shuanggou-detail.jpg);
  121. // background-size: 100% 100%;
  122. .swiper-slide{
  123. >.painting-item{
  124. position: relative !important;
  125. }
  126. }
  127. }
  128. >.operation-tip{
  129. position: absolute;
  130. right: calc(20 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  131. bottom: calc(20 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  132. transform: translateX(-50%);
  133. z-index: 10;
  134. }
  135. >.btn-back{
  136. z-index: 10;
  137. }
  138. }
  139. </style>