12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- <template>
- <transition appear name="custom-classes-transition" leave-active-class="animated fadeOut faster">
- <div class="open-video">
- <video x5-playsinline="true" playsinline="true" webkit-playsinline="true" ref="openvideo$" preload autoplay :src="videourl"></video>
- <div @click.stop="emit('close')" class="jump">跳過</div>
- </div>
- </transition>
- </template>
- <script setup>
- import { ref, watch, defineEmits, computed, onMounted,nextTick, defineProps } from 'vue'
- import * as apis from "@/apis/index.js";
- const openvideo$ = ref(null);
- const videourl = ref(null);
- const emit = defineEmits(["close"]);
- onMounted(()=>{
- nextTick(async ()=>{
- let res = await apis.get_video()
- videourl.value = res.data.videoUrl
- openvideo$.value.addEventListener('ended',()=>{
- emit('close')
- })
-
- document.addEventListener("WeixinJSBridgeReady",()=> {
- openvideo$.value.play();
- }, false);
- })
- })
- </script>
- <style lang="scss" scoped>
- .open-video{
- position: fixed;
- width: 100%;
- height: 100%;
- top: 0;
- left: 0;
- right: 0;
- bottom: 0;
- display: table;
- table-layout: fixed;
- background: rgba(255, 255, 255, 1);
- >video{
- width: 100%;
- height: 100%;
- display: table-cell;
- text-align: center;
- vertical-align: middle;
- }
- .jump{
- position: absolute;
- right: 15px;
- top: 20px;
- width: 56px;
- height: 28px;
- background: rgba(0, 0, 0, 0.5);
- border-radius: 16px;
- text-align: center;
- line-height: 28px;
- z-index: 999;
- }
- }
- </style>
|