ExhibitionView.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  1. <template>
  2. <div class="exhibition-view">
  3. <div class="wrapper">
  4. <img
  5. class="banner"
  6. src="@/assets/images/about/banner_03.jpg"
  7. alt=""
  8. draggable="false"
  9. >
  10. <div class="tab-bar">
  11. <button
  12. class="tab-item"
  13. :class="{
  14. active: activeTabIdx === 0
  15. }"
  16. @click="activeTabIdx = 0"
  17. >
  18. 全部
  19. </button>
  20. <button
  21. class="tab-item"
  22. :class="{
  23. active: activeTabIdx === 1
  24. }"
  25. @click="activeTabIdx = 1"
  26. >
  27. 基本陈列
  28. </button>
  29. <button
  30. class="tab-item"
  31. :class="{
  32. active: activeTabIdx === 2
  33. }"
  34. @click="activeTabIdx = 2"
  35. >
  36. 专题展览
  37. </button>
  38. <button
  39. class="tab-item"
  40. :class="{
  41. active: activeTabIdx === 3
  42. }"
  43. @click="activeTabIdx = 3"
  44. >
  45. 主题临展
  46. </button>
  47. </div>
  48. <div class="list-wrap">
  49. <ul class="list">
  50. <li
  51. v-for="item in exhibitionList"
  52. :key="item.id"
  53. class="list-item"
  54. @click="onClickSceneItem(item)"
  55. >
  56. <img
  57. class="thumb"
  58. :src="`${$env.BASE_URL}images/${item.id}.jpg`"
  59. alt=""
  60. draggable="false"
  61. >
  62. <div class="bottom-wrap">
  63. <div
  64. v-show="exhibitionTypeList.indexOf(item.type) !== 1"
  65. class="type"
  66. :class="`type-${exhibitionTypeList.indexOf(item.type)}`"
  67. >
  68. {{ item.type }}
  69. </div>
  70. <h3
  71. class="title"
  72. :title="item.name"
  73. >
  74. {{ item.name }}
  75. </h3>
  76. <div
  77. class="address"
  78. :title="item.address"
  79. >
  80. 展览地点:{{ item.address }}
  81. </div>
  82. <div
  83. class="date"
  84. :title="item.date"
  85. >
  86. 展览时间:{{ item.date }}
  87. </div>
  88. </div>
  89. </li>
  90. </ul>
  91. </div>
  92. </div>
  93. <IframeWrap
  94. v-if="showIframe"
  95. class="iframe-wrap"
  96. :url="iframeUrl"
  97. :need-back-btn="true"
  98. @back="showIframe = false"
  99. />
  100. </div>
  101. </template>
  102. <script setup>
  103. import { ref, computed, watch, onMounted, onBeforeUnmount, inject } from "vue"
  104. import { useRoute, useRouter } from "vue-router"
  105. import { useStore } from "vuex"
  106. import IframeWrap from '@/components/IframeWrap.vue'
  107. const route = useRoute()
  108. const router = useRouter()
  109. const store = useStore()
  110. const $env = inject('$env')
  111. const activeTabIdx = ref(0)
  112. const exhibitionTypeList = [
  113. '全部',
  114. '基本陈列',
  115. '专题展览',
  116. '主题临展',
  117. ]
  118. const exhibitionList = computed(() => {
  119. if (activeTabIdx.value === 0) {
  120. return staticConfig.exhibitionList
  121. } else {
  122. return staticConfig.exhibitionList.filter((item) => {
  123. return item.type === exhibitionTypeList[activeTabIdx.value]
  124. })
  125. }
  126. })
  127. const iframeUrl = ref('')
  128. const showIframe = ref(false)
  129. function onClickSceneItem(item) {
  130. iframeUrl.value = item.url
  131. showIframe.value = true
  132. }
  133. </script>
  134. <style lang="less" scoped>
  135. .exhibition-view{
  136. position: absolute;
  137. left: 0;
  138. top: 0;
  139. width: 100%;
  140. height: 100%;
  141. background-color: #fff;
  142. >.wrapper{
  143. position: absolute;
  144. left: 0;
  145. top: 0;
  146. width: 100%;
  147. height: 100%;
  148. overflow: auto;
  149. >.banner{
  150. width: 100%;
  151. }
  152. >.tab-bar{
  153. height: 138px;
  154. display: flex;
  155. justify-content: center;
  156. text-align: center;
  157. gap: calc(184 / 1920 * 100vw);
  158. >.tab-item {
  159. font-family: Source Han Sans CN, Source Han Sans CN;
  160. font-weight: 400;
  161. font-size: 24px;
  162. color: #474747;
  163. }
  164. >.tab-item.active{
  165. font-weight: bold;
  166. }
  167. }
  168. >.list-wrap {
  169. width: 100%;
  170. display: flex;
  171. justify-content: center;
  172. >ul.list{
  173. position: relative;
  174. transform: translateX(calc(35Px / 2));
  175. width: calc(488Px * 3 + 35Px * 3);
  176. padding-bottom: 50Px;
  177. @media (max-width: 1500Px) {
  178. width: calc(488Px * 2 + 35Px * 2);
  179. }
  180. @media (max-width: 1000Px) {
  181. width: calc(488Px * 1 + 35Px * 1);
  182. }
  183. >li.list-item{
  184. position: relative;
  185. flex: 0 0 auto;
  186. width: 488Px;
  187. height: 439Px;
  188. background-color: #fff;
  189. border-radius: 5Px 5Px 5Px 5Px;
  190. overflow: auto;
  191. margin-right: 35Px;
  192. margin-bottom: 32Px;
  193. cursor: pointer;
  194. >img.thumb{
  195. width: 100%;
  196. height: 320Px;
  197. }
  198. >.bottom-wrap{
  199. width: 100%;
  200. padding-left: 29Px;
  201. padding-right: 29Px;
  202. >.type{
  203. position: absolute;
  204. top: 16px;
  205. right: 28px;
  206. width: 116px;
  207. height: 40px;
  208. display: flex;
  209. justify-content: center;
  210. align-items: center;
  211. border-radius: 5px 5px 5px 5px;
  212. font-family: Source Han Sans CN, Source Han Sans CN;
  213. font-weight: 400;
  214. font-size: 18px;
  215. color: #FFFFFF;
  216. &.type-1{
  217. }
  218. &.type-2{
  219. background: rgba(255,231,148,0.5);
  220. border: 1px solid #FFE794;
  221. }
  222. &.type-3{
  223. background: rgba(88,148,152,0.5);
  224. border: 1px solid #589498;
  225. }
  226. }
  227. >h3.title{
  228. margin-top: 16px;
  229. overflow: hidden;
  230. white-space: pre;
  231. text-overflow: ellipsis;
  232. font-family: Source Han Sans CN, Source Han Sans CN;
  233. font-weight: 400;
  234. font-size: 24px;
  235. color: #474747;
  236. }
  237. >.address{
  238. margin-top: 6px;
  239. font-family: Source Han Sans CN, Source Han Sans CN;
  240. font-weight: 400;
  241. font-size: 18px;
  242. color: #474747;
  243. opacity: 0.8;
  244. }
  245. >.date{
  246. margin-top: 6px;
  247. font-family: Source Han Sans CN, Source Han Sans CN;
  248. font-weight: 400;
  249. font-size: 18px;
  250. color: #474747;
  251. opacity: 0.8;
  252. }
  253. }
  254. }
  255. >li.list-item:hover{
  256. box-shadow: 0Px 4Px 29Px 0Px rgba(0,0,0,0.25);
  257. }
  258. }
  259. }
  260. }
  261. .iframe-wrap{
  262. position: absolute;
  263. left: 0;
  264. top: 0;
  265. width: 100%;
  266. height: 100%;
  267. background-color: #fff;
  268. z-index: 10;
  269. >iframe{
  270. position: absolute;
  271. left: 0;
  272. top: 0;
  273. width: 100%;
  274. height: 100%;
  275. }
  276. }
  277. }
  278. </style>