ShuanggouPaintingDetail.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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. :size="getPaintingSize(item['尺寸'])"
  29. >
  30. {{ item }}
  31. </PaintingDetail>
  32. </SwiperSlide>
  33. </Swiper>
  34. <OperationTip
  35. class="operation-tip"
  36. direction="h"
  37. :is-show="isShowOperationTip"
  38. />
  39. <BtnBack
  40. class="btn-back"
  41. @click="router.go(-1)"
  42. />
  43. </div>
  44. </template>
  45. <script setup>
  46. import { ref, computed, watch, onMounted, inject } from "vue"
  47. import { useRoute, useRouter } from "vue-router"
  48. import { useStore } from "vuex"
  49. import PaintingDetail from '@/views/PaintingDetail.vue'
  50. import useSizeAdapt from "@/useFunctions/useSizeAdapt"
  51. const getPaintingSize = utils.getPaintingSize
  52. const route = useRoute()
  53. const router = useRouter()
  54. const store = useStore()
  55. const $env = inject('$env')
  56. const {
  57. windowSizeInCssForRef,
  58. windowSizeWhenDesignForRef,
  59. } = useSizeAdapt()
  60. const paintingList = configExcel['画作']
  61. const showPaintingList = computed(() => {
  62. return paintingList.filter(item => item['标题'] === '竹禽图卷' || item['标题'] === '桃竹双凫图')
  63. })
  64. /**
  65. * swiper
  66. */
  67. let swiper = null
  68. const onSwiper = (swiperP) => {
  69. swiper = swiperP
  70. }
  71. const onSlideChange = (e) => {
  72. if (isShowOperationTip.value && e.activeIndex !== Number(route.query.idx)) {
  73. isShowOperationTip.value = false
  74. }
  75. }
  76. const isShowOperationTip = ref(true)
  77. </script>
  78. <style lang="less" scoped>
  79. .painting-detail-list{
  80. position: absolute;
  81. left: 0;
  82. top: 0;
  83. width: 100%;
  84. height: 100%;
  85. >.bg-left{
  86. background: linear-gradient(90deg, #7b916b 0%, #94a586 100%);
  87. position: absolute;
  88. left: 0;
  89. top: 0;
  90. height: 100%;
  91. width: calc(57 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  92. background: -1;
  93. }
  94. >.painting-list{
  95. position: absolute;
  96. left: 0;
  97. top: 0;
  98. width: 100%;
  99. height: 100%;
  100. // backdrop-filter: blur(calc(20 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef')));
  101. // background: linear-gradient(rgba(123,145,107,0.62) 0%, rgba(0,0,0,0.3) 100%);
  102. background-image:url(@/assets/images/shuanggou-detail.jpg);
  103. background-size: 100% 100%;
  104. .swiper-slide{
  105. >.painting-item{
  106. position: relative !important;
  107. }
  108. }
  109. }
  110. >.operation-tip{
  111. position: absolute;
  112. right: calc(20 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  113. bottom: calc(20 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  114. transform: translateX(-50%);
  115. z-index: 10;
  116. }
  117. >.btn-back{
  118. z-index: 10;
  119. }
  120. }
  121. </style>