From 8f545c22e66f7359b3f7eab1c4ef5adb6fbbbfe9 Mon Sep 17 00:00:00 2001 From: Tomas <tomasysh@gmail.com> Date: 星期一, 31 七月 2023 16:03:25 +0800 Subject: [PATCH] Update: 依據網址參數顯示更新廣告影片 --- PAMapp/pages/index.vue | 32 ++++++++++++++++++++++++-------- 1 files changed, 24 insertions(+), 8 deletions(-) diff --git a/PAMapp/pages/index.vue b/PAMapp/pages/index.vue index d2dc803..9adeb1c 100644 --- a/PAMapp/pages/index.vue +++ b/PAMapp/pages/index.vue @@ -147,10 +147,11 @@ v-if="isShowFilmPlayer" style="position: fixed; bottom: 30px; right: 30px; z-index: 9999; display: flex; justify-content: flex-end;" > - <iframe width=��780�� - height=��440�� - allowfullscreen - src="https://www.youtube.com/embed/655JnwbuRGA?autoplay=1&mute=1" + <iframe + width=��780�� + height=��440�� + allowfullscreen + :src="filmVideoSrc" ></iframe> <div class="close-btn" @click="closeVideo()">X</div> </div> @@ -159,7 +160,7 @@ </template> <script lang="ts"> -import {Action, Component, Mutation, namespace, State, Vue, Watch} from 'nuxt-property-decorator'; +import {Action, Component, Getter, Mutation, namespace, State, Vue, Watch} from 'nuxt-property-decorator'; import appointmentService from '~/shared/services/appointment.service'; import utilService, {AccessFroms} from '~/shared/services/utils.service'; @@ -276,7 +277,22 @@ appointments : [] }; - isShowFilmPlayer = true; + isCloseVideo = false; + + @Getter + fromAccess!: AccessFroms; + + get filmVideoSrc() { + if (!this.fromAccess) return ''; + return this.fromAccess === AccessFroms.FILM_1 + ? 'https://www.youtube.com/embed/zVBLW9hWD0g?autoplay=1&mute=1' + : 'https://www.youtube.com/embed/655JnwbuRGA?autoplay=1&mute=1'; + } + + + get isShowFilmPlayer() { + return !!this.fromAccess && !this.isCloseVideo; + } ////////////////////////////////////////////////////////////////////// @@ -438,8 +454,8 @@ this.storageClearNotContactAppointmentIdFromMsg(); } - closeVideo() { - this.isShowFilmPlayer = false; + closeVideo(): void { + this.isCloseVideo = true; } /////////////////////////////////////////////////////////////////////////////// -- Gitblit v1.8.0