123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141 |
- <!-- -->
- <template>
- <div class="Video">
- <div class="videoBox" :class="{ none: show }">
- <video
- id="VideoDom"
- src="../../assets/media/bacVideo.mp4"
- muted
- autoplay
- ></video>
- <div class="skip" :class="{ active: skip }" @click="show = true">
- 跳过
- </div>
- </div>
- <div class="bacImg">
- <div class="btnn" @click="toSwkk"> 进入展馆</div>
- </div>
- </div>
- </template>
- <script>
- export default {
- name: "Video",
- components: {},
- data() {
- //这里存放数据
- return {
- skip: false,
- show: false,
- };
- },
- //监听属性 类似于data概念
- computed: {},
- //监控data中的数据变化
- watch: {},
- //方法集合
- methods: {
- toSwkk(){
- window.location.replace('/Swkk')
- }
- },
- //生命周期 - 创建完成(可以访问当前this实例)
- created() {},
- //生命周期 - 挂载完成(可以访问DOM元素)
- mounted() {
- setTimeout(() => {
- this.skip = true;
- }, 3000);
- let dom = document.querySelector("#VideoDom");
- dom.addEventListener("ended", () => {
- this.show = true;
- });
- },
- beforeCreate() {}, //生命周期 - 创建之前
- beforeMount() {}, //生命周期 - 挂载之前
- beforeUpdate() {}, //生命周期 - 更新之前
- updated() {}, //生命周期 - 更新之后
- beforeDestroy() {}, //生命周期 - 销毁之前
- destroyed() {}, //生命周期 - 销毁完成
- activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
- };
- </script>
- <style lang='less' scoped>
- .Video {
- width: 100%;
- height: 100%;
- overflow: hidden;
- position: absolute;
- top: 0;
- left: 0;
- .videoBox {
- background-color: #fff;
- transition: opacity 0.5s;
- position: absolute;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- z-index: 30;
- }
- video {
- position: absolute;
- top: 50%;
- transform: translateY(-50%);
- width: 100%;
- }
- .skip {
- opacity: 0;
- pointer-events: none;
- transition: opacity 0.3s;
- cursor: pointer;
- background-image: url("../../assets/img/skip.png");
- background-size: 100% 100%;
- position: absolute;
- bottom: 50px;
- right: 50px;
- width: 60px;
- height: 60px;
- line-height: 60px;
- text-align: center;
- font-size: 16px;
- color: #a50f0f;
- }
- .active {
- opacity: 1;
- pointer-events: auto;
- }
- }
- .bacImg {
- transition: opacity 0.5s;
- position: absolute;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
- z-index: 29;
- background-image: url("../../assets/img/HomeBac.jpg");
- background-size: 100% 100%;
- .btnn {
- cursor: pointer;
- position: absolute;
- bottom: 70px;
- left: 50%;
- transform: translateX(-50%);
- width: 302px;
- height: 140px;
- line-height: 190px;
- font-weight: 700;
- text-align: center;
- font-size: 24px;
- color: #930909;
- background-image: url("../../assets/img/HomeBtnn.png");
- background-size: 100% 100%;
- }
- }
- .none {
- opacity: 0;
- pointer-events: none;
- }
- </style>
|