inleft
2022-08-12 e4f0862bd8af0ac1c7aab59904b69dd071526aff
src/components/mini/box16-videoDetail.vue
@@ -1,12 +1,12 @@
<template>
   <div>
      <div class="boxMain">
         <videoPlayBox ref="videoPlayBox"></videoPlayBox>
      <div class="boxMain ">
         <videoPlayBox ref="videoPlayBox" @swichPlay="swichPlay"></videoPlayBox>
      </div>
      <div style="padding: 20px 20px 5px;" class="myShadow">
      <div style="padding: 20px 20px 5px;margin-bottom: 20px;" class="myShadow fadeInLeft">
         <pre>{{introduce}}</pre>
      </div>
      <div class="articleComment">
      <div class="articleComment fadeInRight">
         <comment ref="myComment" :articleId="articleId" :isAllowedComment="isAllowedComment" :foldReply="true" />
      </div>
   </div>
@@ -57,19 +57,36 @@
            videoData: {
               img: "http://t.inleft.com/share/media_photo/idea_beijing.jpg",
               url: "",
               type: "normal"
               type: "normal",
               title: "",
               introduce: "",
               id: ""
            }
         }
      },
      methods: {
         swichPlay(videoData) {
            this.introduce = videoData.introduce;
            this.$refs.myComment.updateCommentList(videoData.id);
         },
         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() {
            if (this.$refs.videoPlayBox.isPlaying) {
               this.$message.info("上个视频正在播放中")
            }
            if (this.myLock) {
               this.$message.info("正在努力加载中..", 3)
@@ -81,7 +98,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 +121,11 @@
               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.introduce = res.data.introduce;
               this.videoData.id = res.data.id;
               if (res.data.articleFileURL != null &&
                  res.data.articleFileURL != "" &&
                  res.data.articleFileURL.endsWith("m3u8")) {
@@ -112,9 +134,10 @@
                  this.videoData.type = "normal";
               }
               this.myLock = false;
               this.myLock = !this.myLock;
               if (this.lastArticleId != this.articleId) {
                  _this.$refs.videoPlayBox.changePlay(this.videoData)
                  let tempParam = JSON.parse(JSON.stringify(this.videoData))
                  _this.$refs.videoPlayBox.startPlay(tempParam)
               }
            })
@@ -133,6 +156,7 @@
   }
   .boxMain {
      user-select: none;
      display: flex;
      justify-content: center;
      padding: 5px 20px;