CollectionDetail.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. <template>
  2. <div class="collection-detail">
  3. <iframe
  4. :src="`https://4dscene.4dage.com/culturalrelics/NSRDYT/Model2.html?m=nsr03&timestamp=${new Date().getTime()}`"
  5. allow="fullscreen"
  6. frameborder="0"
  7. />
  8. <BtnBack
  9. :color="'white'"
  10. />
  11. <div class="text">
  12. <h1
  13. class="title"
  14. :title="detail?.title"
  15. >
  16. {{ detail?.title }}
  17. </h1>
  18. <div
  19. class="age"
  20. :title="detail?.culturalRelicEraName"
  21. >
  22. {{ detail?.culturalRelicEraName }}
  23. </div>
  24. <div
  25. class="size"
  26. :title="detail?.size"
  27. >
  28. {{ detail?.size }}
  29. </div>
  30. <div class="desc">
  31. {{ detail?.texture }}
  32. </div>
  33. </div>
  34. <Transition name="fade-out">
  35. <div
  36. v-show="isShowTip"
  37. class="tip-wrapper"
  38. >
  39. <img
  40. class="tip"
  41. src="@/assets/images/operation-tip.png"
  42. alt=""
  43. draggable="false"
  44. >
  45. </div>
  46. </Transition>
  47. </div>
  48. </template>
  49. <script setup>
  50. import { ref, computed, watch, onMounted, onBeforeUnmount, inject } from "vue"
  51. import { useRoute, useRouter } from "vue-router"
  52. import { useStore } from "vuex"
  53. import { getCulturalRelicsDetailApi } from '@/api'
  54. const route = useRoute()
  55. const router = useRouter()
  56. const store = useStore()
  57. const $env = inject('$env')
  58. const detail = ref(null)
  59. const loading = ref(false)
  60. const isShowTip = computed(() => {
  61. return store.state.needCollectionDetailTip
  62. })
  63. if (store.state.needCollectionDetailTip) {
  64. setTimeout(() => {
  65. store.commit('setNeedCollectionDetailTip', false)
  66. }, 3000)
  67. }
  68. const getDetail = async() => {
  69. try {
  70. loading.value = true
  71. const data = await getCulturalRelicsDetailApi(route.params.id)
  72. detail.value = data
  73. } finally {
  74. loading.value = false
  75. }
  76. }
  77. onMounted(() => {
  78. getDetail()
  79. })
  80. </script>
  81. <style lang="less" scoped>
  82. .collection-detail{
  83. position: absolute;
  84. left: 0;
  85. top: 0;
  86. width: 100%;
  87. height: 100%;
  88. background-color: #7d7d7e;
  89. z-index: 10;
  90. >iframe{
  91. position: absolute;
  92. left: 0;
  93. top: 0;
  94. width: 100%;
  95. height: 100%;
  96. }
  97. >.text{
  98. position: absolute;
  99. top: 111px;
  100. right: calc(170 / 1920 * 100vw);
  101. width: 279px;
  102. >h1.title{
  103. font-family: Source Han Serif CN, Source Han Serif CN;
  104. font-weight: bold;
  105. font-size: 40px;
  106. color: #FFE794;
  107. display: -webkit-box;
  108. -webkit-box-orient: vertical;
  109. -webkit-line-clamp: 3;
  110. overflow: hidden;
  111. }
  112. >.age{
  113. margin-top: 30px;
  114. overflow: hidden;
  115. white-space: pre;
  116. text-overflow: ellipsis;
  117. font-family: Source Han Sans CN, Source Han Sans CN;
  118. font-weight: 400;
  119. font-size: 18px;
  120. color: #FFFFFF;
  121. line-height: 22px;
  122. }
  123. >.size{
  124. margin-top: 5px;
  125. overflow: hidden;
  126. white-space: pre;
  127. text-overflow: ellipsis;
  128. font-family: Source Han Sans CN, Source Han Sans CN;
  129. font-weight: 400;
  130. font-size: 18px;
  131. color: #FFFFFF;
  132. line-height: 22px;
  133. }
  134. >.desc{
  135. margin-top: 33px;
  136. text-indent: 2em;
  137. font-family: Source Han Sans CN, Source Han Sans CN;
  138. font-weight: 400;
  139. font-size: 18px;
  140. color: #FFFFFF;
  141. line-height: 27px;
  142. text-align: justified;
  143. max-height: 450px;
  144. overflow: auto;
  145. padding-right: 0.5em;
  146. }
  147. }
  148. >.tip-wrapper{
  149. position: absolute;
  150. left: 0;
  151. top: 0;
  152. width: 100%;
  153. height: 100%;
  154. background-color: rgba(0, 0, 0, 0.3);
  155. >img.tip{
  156. position: absolute;
  157. left: 50%;
  158. top: 50%;
  159. height: 30%;
  160. transform: translate(-50%, -50%);
  161. }
  162. }
  163. }
  164. </style>