|
|
@@ -4,13 +4,13 @@
|
|
|
<div class="videoPlayBox" v-if="videoId">
|
|
|
<video controls autoplay :src="`/data/${videoId}.mp4`"></video>
|
|
|
<!-- 关闭按钮 -->
|
|
|
- <div class="close" @click="videoId=null"></div>
|
|
|
+ <div class="close" @click="videoId = null"></div>
|
|
|
</div>
|
|
|
<!-- 视频 -->
|
|
|
<div class="videoBox">
|
|
|
- <div class="vidPlay" @click="videoId='1'"></div>
|
|
|
- <video src="/data/1.mp4"></video>
|
|
|
- <!-- <img src="../assets/img/vid1.png" alt="" /> -->
|
|
|
+ <div class="vidPlay" @click="videoId = '1'"></div>
|
|
|
+ <!-- <video src="/data/1.mp4" autoplay loop muted></video> -->
|
|
|
+ <img src="../assets/img/vid1.png" alt="" />
|
|
|
</div>
|
|
|
<div class="shuming">《鸦片成瘾机制》</div>
|
|
|
<div class="sonBj1"></div>
|
|
|
@@ -31,7 +31,7 @@
|
|
|
</div>
|
|
|
<div class="sonBj2"></div>
|
|
|
<div class="videoBox">
|
|
|
- <div class="vidPlay" @click="videoId='2'"></div>
|
|
|
+ <div class="vidPlay" @click="videoId = '2'"></div>
|
|
|
<img src="../assets/img/vid2.png" alt="" />
|
|
|
</div>
|
|
|
<div class="shuming">《鸦片走私贸易》</div>
|
|
|
@@ -45,7 +45,7 @@ export default {
|
|
|
data() {
|
|
|
//这里存放数据
|
|
|
return {
|
|
|
- videoId:null,
|
|
|
+ videoId: null,
|
|
|
data: [
|
|
|
{
|
|
|
id: 9,
|
|
|
@@ -116,7 +116,16 @@ export default {
|
|
|
//监听属性 类似于data概念
|
|
|
computed: {},
|
|
|
//监控data中的数据变化
|
|
|
- watch: {},
|
|
|
+ watch: {
|
|
|
+ videoId(val) {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ // 获取body,防止滚动
|
|
|
+ let body = document.querySelector("body");
|
|
|
+ if (val === null) body.style.overflow = "auto";
|
|
|
+ else body.style.overflow = "hidden";
|
|
|
+ });
|
|
|
+ },
|
|
|
+ },
|
|
|
//方法集合
|
|
|
methods: {
|
|
|
toInfo(id) {
|
|
|
@@ -138,29 +147,30 @@ export default {
|
|
|
</script>
|
|
|
<style lang='less' scoped>
|
|
|
.son3 {
|
|
|
- .videoPlayBox{
|
|
|
+ .videoPlayBox {
|
|
|
position: fixed;
|
|
|
width: 100vw;
|
|
|
height: 100vh;
|
|
|
+ overflow: hidden;
|
|
|
z-index: 999;
|
|
|
top: 0;
|
|
|
left: 0;
|
|
|
- background-color: rgba(0,0,0,.9);
|
|
|
- video{
|
|
|
+ background-color: rgba(0, 0, 0, 0.9);
|
|
|
+ video {
|
|
|
position: absolute;
|
|
|
width: 100%;
|
|
|
max-height: 60vh;
|
|
|
top: 50%;
|
|
|
transform: translateY(-50%);
|
|
|
}
|
|
|
- .close{
|
|
|
+ .close {
|
|
|
position: absolute;
|
|
|
bottom: 20px;
|
|
|
left: 50%;
|
|
|
transform: translateX(-50%);
|
|
|
width: 32px;
|
|
|
height: 32px;
|
|
|
- background: url('../assets/img/close.png');
|
|
|
+ background: url("../assets/img/close.png");
|
|
|
background-size: 100% 100%;
|
|
|
}
|
|
|
}
|
|
|
@@ -169,14 +179,14 @@ export default {
|
|
|
& > img {
|
|
|
width: 100%;
|
|
|
}
|
|
|
- .vidPlay{
|
|
|
+ .vidPlay {
|
|
|
position: absolute;
|
|
|
top: 50%;
|
|
|
left: 50%;
|
|
|
- transform: translate(-50%,-50%);
|
|
|
+ transform: translate(-50%, -50%);
|
|
|
width: 77px;
|
|
|
height: 77px;
|
|
|
- background: url('../assets/img/videoPlay.png');
|
|
|
+ background: url("../assets/img/videoPlay.png");
|
|
|
background-size: 100% 100%;
|
|
|
}
|
|
|
}
|
|
|
@@ -198,7 +208,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
&:nth-of-type(2n + 1) {
|
|
|
- justify-content: end;
|
|
|
+ justify-content: flex-end
|
|
|
}
|
|
|
}
|
|
|
.noPad {
|