From 0dd41bd8cee430d3a948b89c664cb511c400993c Mon Sep 17 00:00:00 2001 From: inleft <inleft@qq.com> Date: Fri, 12 Aug 2022 19:11:46 +0800 Subject: [PATCH] 新增链接添加按钮,优化Dplayer播放 --- src/components/mini/box16-videoDetail.vue | 26 +++++++++++++++++++------- 1 files changed, 19 insertions(+), 7 deletions(-) diff --git a/src/components/mini/box16-videoDetail.vue b/src/components/mini/box16-videoDetail.vue index 8874d56..7071b88 100644 --- a/src/components/mini/box16-videoDetail.vue +++ b/src/components/mini/box16-videoDetail.vue @@ -3,7 +3,7 @@ <div class="boxMain"> <videoPlayBox ref="videoPlayBox"></videoPlayBox> </div> - <div style="padding: 20px 20px 5px;" class="myShadow"> + <div style="padding: 20px 20px 5px;margin-bottom: 20px;" class="myShadow"> <pre>{{introduce}}</pre> </div> <div class="articleComment"> @@ -57,17 +57,25 @@ videoData: { img: "http://t.inleft.com/share/media_photo/idea_beijing.jpg", url: "", - type: "normal" + type: "normal", + title: "", + id: "" } } }, methods: { showVideo(item) { + //防止重复加载 this.lastArticleId = this.articleId; this.articleId = item.id - this.isAllowedComment = item.isAllowedComment - this.introduce = item.introduce - this.loadData() + + if (this.articleId == this.lastArticleId) { + return + } + + this.isAllowedComment = item.isAllowedComment; + this.introduce = item.introduce; + this.loadData(); }, loadData() { @@ -81,7 +89,7 @@ id: this.articleId, authWord: this.secret == "" ? null : md5(this.secret) }).then((res) => { - this.myLock = true; + this.myLock = !this.myLock; if (res.code != 200) { @@ -104,6 +112,10 @@ this.isAllowedComment = res.data.isAllowedComment; this.videoData.url = res.data.articleFileURL; this.videoData.img = res.data.coverFileURL; + this.videoData.title = res.data.title; + this.videoData.id = res.data.id; + + if (res.data.articleFileURL != null && res.data.articleFileURL != "" && res.data.articleFileURL.endsWith("m3u8")) { @@ -112,7 +124,7 @@ this.videoData.type = "normal"; } - this.myLock = false; + this.myLock = !this.myLock; if (this.lastArticleId != this.articleId) { _this.$refs.videoPlayBox.changePlay(this.videoData) } -- Gitblit v1.9.1