123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189 |
- <script setup lang='ts'>
- import { ExhibitionApi } from '@/api/api/exhibition';
- import { showToast } from 'vant';
- const route = useRoute()
- export type ExhibitionDetailType = {
- createTime: string,
- creatorId: number,
- creatorName: string,
- dateEnd: string,
- dateStart: string,
- description: string,
- id: number,
- link: string,
- location: string,
- name: string,
- publishDate: string,
- rtf: string,
- thumb:
- string,
- type: string,
- updateTime: string,
- videos: any[]
- }
- const exhibitionDetail = ref({} as ExhibitionDetailType)
- const isShowScene = ref(false)
- const getDetailById = async () => {
- const res: any = await ExhibitionApi.getDetailById(Number(route.params.id))
- if (res.code == 0) {
- exhibitionDetail.value = res.data.entity
- exhibitionDetail.value.videos = res.data.file.filter((item: any) => {
- return item.type == 'video'
- })
- } else {
- showToast(res.msg)
- }
- }
- onBeforeMount(() => {
- getDetailById()
- })
- </script>
- <template>
- <div class='detail-box'>
- <img class="thumb-box" :src="exhibitionDetail.thumb" alt="">
- <div class="content-box">
- <div class="name-box">{{ exhibitionDetail.name }}</div>
- <div class="time-box">
- <div class="location-box"> {{ exhibitionDetail.location }}</div>
- <div>{{ exhibitionDetail.dateStart }} - {{ exhibitionDetail.dateEnd }}</div>
- </div>
- <div class="rtf-box" v-html="exhibitionDetail.rtf"></div>
- <video :src="item" v-for="(item, index) in exhibitionDetail.videos" :key="index" controls></video>
- </div>
- <div class="online-box" @click="() => { isShowScene = true }">体验线上展厅</div>
- <div v-if="isShowScene" class="iframe-box">
- <img src="@/assets/images/sceneBack.png" @click="isShowScene = false" alt="">
- <iframe :src="exhibitionDetail.link" frameborder="0"></iframe>
- </div>
- </div>
- </template>
- <style lang='less' scoped>
- .detail-box {
- width: 100%;
- height: 100vh;
- max-width: 500px;
- position: relative;
- overflow: auto;
- .thumb-box {
- width: 100%;
- margin-bottom: 10px;
- height: 30vh;
- }
- .content-box {
- width: 100%;
- padding: 0 10px;
- box-sizing: border-box;
- height: calc(70vh + 25px);
- overflow: auto;
- border-radius: 20px 20px 0 0;
- margin-top: -40px;
- position: relative;
- z-index: 2;
- background: #F7F3E8;
- padding: 25px 20px;
- box-sizing: border-box;
- .name-box {
- width: 100%;
- font-size: 1.2em;
- font-weight: bold;
- color: #333333;
- font-family: 'SourceHanSansCN-Medium';
- line-height: 1.5em;
- margin-bottom: 10px;
- }
- .time-box {
- width: 100%;
- display: flex;
- justify-content: space-between;
- color: #9D4F0B;
- margin: 10px auto;
- font-size: 0.8em;
- align-items: center;
- .location-box {
- max-width: 50vw;
- }
- }
- .rtf-box {
- color: #88866F;
- }
- }
- video {
- width: 100%;
- margin-top: 10px;
- }
- .online-box {
- width: 80%;
- max-width: 400px;
- height: 60px;
- border-radius: 50px;
- background: url(@/assets/images/onlineBg.png);
- background-size: 100% 100%;
- color: #F1E9D4;
- position: fixed;
- left: 50%;
- transform: translateX(-50%);
- bottom: 3vh;
- display: flex;
- justify-content: center;
- align-items: center;
- letter-spacing: 2px;
- font-weight: bold;
- z-index: 2;
- }
- .back-icon {
- width: 40px;
- position: fixed;
- right: 10px;
- bottom: 10vh;
- }
- .iframe-box {
- width: 100%;
- height: 100%;
- position: absolute;
- top: 0;
- left: 0;
- z-index: 10;
- iframe {
- width: 100%;
- height: 100%;
- position: absolute;
- top: 0;
- left: 0;
- }
- img {
- width: 30px;
- height: 30px;
- position: absolute;
- top: 3%;
- left: 3%;
- z-index: 11;
- }
- }
- }
- </style>
|