123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287 |
- <template>
- <div class="exhibition-view">
- <div class="wrapper">
- <img
- class="banner"
- src="@/assets/images/about/banner_03.jpg"
- alt=""
- draggable="false"
- >
- <div class="tab-bar">
- <button
- class="tab-item"
- :class="{
- active: activeTabIdx === 0
- }"
- @click="activeTabIdx = 0"
- >
- 全部
- </button>
- <button
- class="tab-item"
- :class="{
- active: activeTabIdx === 1
- }"
- @click="activeTabIdx = 1"
- >
- 基本陈列
- </button>
- <button
- class="tab-item"
- :class="{
- active: activeTabIdx === 2
- }"
- @click="activeTabIdx = 2"
- >
- 专题展览
- </button>
- <button
- class="tab-item"
- :class="{
- active: activeTabIdx === 3
- }"
- @click="activeTabIdx = 3"
- >
- 主题临展
- </button>
- </div>
- <div class="list-wrap">
- <ul class="list">
- <li
- v-for="item in exhibitionList"
- :key="item.id"
- class="list-item"
- @click="onClickSceneItem(item)"
- >
- <img
- class="thumb"
- :src="`${$env.BASE_URL}images/${item.id}.jpg`"
- alt=""
- draggable="false"
- >
- <div class="bottom-wrap">
- <div
- v-show="exhibitionTypeList.indexOf(item.type) !== 1"
- class="type"
- :class="`type-${exhibitionTypeList.indexOf(item.type)}`"
- >
- {{ item.type }}
- </div>
- <h3
- class="title"
- :title="item.name"
- >
- {{ item.name }}
- </h3>
- <div
- class="address"
- :title="item.address"
- >
- 展览地点:{{ item.address }}
- </div>
- <div
- class="date"
- :title="item.date"
- >
- 展览时间:{{ item.date }}
- </div>
- </div>
- </li>
- </ul>
- </div>
- </div>
- <IframeWrap
- v-if="showIframe"
- class="iframe-wrap"
- :url="iframeUrl"
- :need-back-btn="true"
- @back="showIframe = false"
- />
- </div>
- </template>
- <script setup>
- import { ref, computed, watch, onMounted, onBeforeUnmount, inject } from "vue"
- import { useRoute, useRouter } from "vue-router"
- import { useStore } from "vuex"
- import IframeWrap from '@/components/IframeWrap.vue'
- const route = useRoute()
- const router = useRouter()
- const store = useStore()
- const $env = inject('$env')
- const activeTabIdx = ref(0)
- const exhibitionTypeList = [
- '全部',
- '基本陈列',
- '专题展览',
- '主题临展',
- ]
- const exhibitionList = computed(() => {
- if (activeTabIdx.value === 0) {
- return staticConfig.exhibitionList
- } else {
- return staticConfig.exhibitionList.filter((item) => {
- return item.type === exhibitionTypeList[activeTabIdx.value]
- })
- }
- })
- const iframeUrl = ref('')
- const showIframe = ref(false)
- function onClickSceneItem(item) {
- iframeUrl.value = item.url
- showIframe.value = true
- }
- </script>
- <style lang="less" scoped>
- .exhibition-view{
- position: absolute;
- left: 0;
- top: 0;
- width: 100%;
- height: 100%;
- background-color: #fff;
- >.wrapper{
- position: absolute;
- left: 0;
- top: 0;
- width: 100%;
- height: 100%;
- overflow: auto;
- >.banner{
- width: 100%;
- }
- >.tab-bar{
- height: 138px;
- display: flex;
- justify-content: center;
- text-align: center;
- gap: calc(184 / 1920 * 100vw);
- >.tab-item {
- font-family: Source Han Sans CN, Source Han Sans CN;
- font-weight: 400;
- font-size: 24px;
- color: #474747;
- }
- >.tab-item.active{
- font-weight: bold;
- }
- }
- >.list-wrap {
- width: 100%;
- display: flex;
- justify-content: center;
- >ul.list{
- position: relative;
- transform: translateX(calc(35Px / 2));
- width: calc(488Px * 3 + 35Px * 3);
- padding-bottom: 50Px;
- @media (max-width: 1500Px) {
- width: calc(488Px * 2 + 35Px * 2);
- }
- @media (max-width: 1000Px) {
- width: calc(488Px * 1 + 35Px * 1);
- }
- >li.list-item{
- position: relative;
- flex: 0 0 auto;
- width: 488Px;
- height: 439Px;
- background-color: #fff;
- border-radius: 5Px 5Px 5Px 5Px;
- overflow: auto;
- margin-right: 35Px;
- margin-bottom: 32Px;
- cursor: pointer;
- >img.thumb{
- width: 100%;
- height: 320Px;
- }
- >.bottom-wrap{
- width: 100%;
- padding-left: 29Px;
- padding-right: 29Px;
- >.type{
- position: absolute;
- top: 16px;
- right: 28px;
- width: 116px;
- height: 40px;
- display: flex;
- justify-content: center;
- align-items: center;
- border-radius: 5px 5px 5px 5px;
- font-family: Source Han Sans CN, Source Han Sans CN;
- font-weight: 400;
- font-size: 18px;
- color: #FFFFFF;
- &.type-1{
- }
- &.type-2{
- background: rgba(255,231,148,0.5);
- border: 1px solid #FFE794;
- }
- &.type-3{
- background: rgba(88,148,152,0.5);
- border: 1px solid #589498;
- }
- }
- >h3.title{
- margin-top: 16px;
- overflow: hidden;
- white-space: pre;
- text-overflow: ellipsis;
- font-family: Source Han Sans CN, Source Han Sans CN;
- font-weight: 400;
- font-size: 24px;
- color: #474747;
- }
- >.address{
- margin-top: 6px;
- font-family: Source Han Sans CN, Source Han Sans CN;
- font-weight: 400;
- font-size: 18px;
- color: #474747;
- opacity: 0.8;
- }
- >.date{
- margin-top: 6px;
- font-family: Source Han Sans CN, Source Han Sans CN;
- font-weight: 400;
- font-size: 18px;
- color: #474747;
- opacity: 0.8;
- }
- }
- }
- >li.list-item:hover{
- box-shadow: 0Px 4Px 29Px 0Px rgba(0,0,0,0.25);
- }
- }
- }
- }
- .iframe-wrap{
- position: absolute;
- left: 0;
- top: 0;
- width: 100%;
- height: 100%;
- background-color: #fff;
- z-index: 10;
- >iframe{
- position: absolute;
- left: 0;
- top: 0;
- width: 100%;
- height: 100%;
- }
- }
- }
- </style>
|