From 539b20ab881abe8b9059d2fc7ab83722f28ee2aa Mon Sep 17 00:00:00 2001 From: Tomas <tomasysh@gmail.com> Date: 星期三, 02 八月 2023 14:18:34 +0800 Subject: [PATCH] Fixed: <iframe> 安全性規範,使用 sandbox --- PAMapp/pages/index.vue | 39 ++++++++++++++++++++++++++++----------- 1 files changed, 28 insertions(+), 11 deletions(-) diff --git a/PAMapp/pages/index.vue b/PAMapp/pages/index.vue index f4a172a..5520015 100644 --- a/PAMapp/pages/index.vue +++ b/PAMapp/pages/index.vue @@ -59,7 +59,7 @@ <p>�批嚗{gender}}</p> <p>撟湧翩嚗{appointmentDetail.age | toAgeLabel }}</p> <p>�璆哨�{appointmentDetail.job}}</p> - <p>隢株岷�撘�{appointmentDetail.consultantMode }}</p> + <p>隢株岷�撘�{appointmentDetail.consultationMethod | toConsultationMethod }}</p> <p>��瘙�{ appointmentDetail.requirement ? appointmentDetail.requirement.split(',').join('��') : '--'}}</p> <p v-for="(item, index) in hopeContactTime" @@ -142,15 +142,17 @@ </div> </div> </PopUpFrame> - + <div class="video-container" 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 + sandbox="allow-scripts allow-same-origin" + :src="filmVideoSrc" ></iframe> <div class="close-btn" @click="closeVideo()">X</div> </div> @@ -159,7 +161,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'; @@ -258,7 +260,7 @@ phone : '', requirement : '', satisfactionScore : 0, - consultantMode : '' + consultationMethod : '' }; agentInfo: Consultant = { @@ -276,7 +278,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&loop=1&playlist=zVBLW9hWD0g' + : 'https://www.youtube.com/embed/655JnwbuRGA?autoplay=1&mute=1&loop=1&playlist=655JnwbuRGA'; + } + + + get isShowFilmPlayer() { + return !!this.fromAccess && !this.isCloseVideo; + } ////////////////////////////////////////////////////////////////////// @@ -438,8 +455,8 @@ this.storageClearNotContactAppointmentIdFromMsg(); } - closeVideo() { - this.isShowFilmPlayer = false; + closeVideo(): void { + this.isCloseVideo = true; } /////////////////////////////////////////////////////////////////////////////// -- Gitblit v1.8.0