ShuanggouPaintingDetail.vue 3.5 KB

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