inleft
2024-01-10 7319260f31c9a593418ff17b1ca42e0822c3c4eb
commit | author | age
146176 1 <template>
I 2     <div class="myModal">
6461f5 3         <a-modal v-drag-modal v-model="visible" title="视频盒子" :width="myWidth" :footer="null" :mask="false"
I 4             :maskClosable="true" :bodyStyle="{'overflow':'overlay','height': '700px'}" :afterClose="afterClose">
1cf6d9 5             <videoDetail ref="videoDetail" :showFade="showFade"></videoDetail>
146176 6         </a-modal>
I 7     </div>
1cf6d9 8
146176 9 </template>
I 10
11 <script>
859ec7 12     import videoDetail from "../mini/box16-videoDetail.vue"
I 13
146176 14     export default {
105729 15         components: {
859ec7 16             videoDetail,
1cf6d9 17         },
I 18         mounted() {
19             this.juseWidth(document.body.clientWidth)
20             window.onresize = () => {
21                 return (() => {
22                     this.juseWidth(document.body.clientWidth)
23                 })();
24             };
859ec7 25         },
I 26         watch: {
27             // '$route'(to, from) {
28             //     if ("mdDetail" === to.name) {
29             //         this.articleId = this.$route.query.id;
30             //         this.articleFileType = this.$route.query.articleFileType;
31             //     }
32             // },
33             articleId: function(newValue, oldValue) {
34                 if (newValue == undefined || newValue == null || newValue == "") {
35                     this.showMsg = true;
36                     this.errorMsg = "日志id参数缺失";
37                 } else {
38                     this.$nextTick(function() {
39                         this.$refs.myComment.updateCommentList(this.articleId);
40                     })
41                 }
42             },
105729 43         },
146176 44         data() {
I 45             return {
46                 visible: false,
859ec7 47                 articleId: "",
1cf6d9 48                 myWidth: 410,
I 49                 showFade: true,
146176 50             }
I 51         },
52         methods: {
1cf6d9 53             juseWidth(screenWidth) {
I 54                 this.showFade = true;
55                 if (screenWidth > 1000) {
56                     this.myWidth = 1000
57                 } else if (screenWidth > 767) {
58                     this.myWidth = 600
59                 } else {
60                     this.myWidth = 410
61                     this.showFade = false;
62                 }
63             },
105729 64             showModal(param) {
a3ab3a 65                 if (this.$route.path == "/videoDetail") {
I 66                     this.$message.info("已经在播放页面啦..")
67                     return
68                 }
146176 69                 this.visible = true;
859ec7 70                 this.$nextTick(function() {
I 71                     this.$refs.videoDetail.showVideo(param)
72                 })
146176 73             },
I 74             handleCancel(e) {
75                 this.visible = false;
76             },
0dd41b 77             afterClose() {
8ec9c5 78                 //关闭视频播放
I 79                 this.$refs.videoDetail.$refs.videoPlayBox.pauseMyVideo()
6461f5 80
0dd41b 81                 this.$emit("closeMyVideo")
I 82             }
146176 83         },
I 84     }
85 </script>
6461f5 86 <style lang="less">
I 87     
146176 88 </style>