Sfoglia il codice sorgente

总台直播审核

yuhongqi 2 mesi fa
parent
commit
71e45deee7

+ 1 - 2
src/views/live/live/index.vue

@@ -183,7 +183,6 @@
           alt="直播二维码"
           class="qrcode-img"
           @error="handleImgError"
-          @click="handleImgZoom"
         >
       </div>
     </el-dialog>
@@ -320,7 +319,7 @@ import VideoUpload from "@/components/LiveVideoUpload/index.vue";
 
 export default {
   name: "Live",
-  components: { Editor },
+  components: { Editor,VideoUpload },
   data() {
     return {
       baseUrl: process.env.VUE_APP_BASE_API,

+ 8 - 8
src/views/live/liveConfig/goods.vue

@@ -328,14 +328,14 @@ export default {
     }
   },
   created() {
-    if (this.$route.params.liveId) {
-      this.liveId = this.$route.params.liveId;
-    }else {
-      this.liveId = this.$route.query.liveId;
-    }
-    this.goodsParams.liveId = this.liveId
-    this.getLiveGoodsList();
-    this.socket = this.$store.state.liveWs[this.liveId]
+    // if (this.$route.params.liveId) {
+    //   this.liveId = this.$route.params.liveId;
+    // }else {
+    //   this.liveId = this.$route.query.liveId;
+    // }
+    // this.goodsParams.liveId = this.liveId
+    // this.getLiveGoodsList();
+    // this.socket = this.$store.state.liveWs[this.liveId]
   },
   methods: {
     handleSwitchClick(row) {

+ 13 - 4
src/views/live/liveConfig/idCard.vue

@@ -23,11 +23,20 @@ export default {
       liveId: null,
     };
   },
+  watch: {
+    // 监听路由的 query 参数变化
+    '$route.query': {
+      handler(newQuery) {
+        this.liveId = this.$route.params.liveId
+        getLive(this.liveId).then(res => {
+          this.idCardUrl = res.data.idCardUrl;
+        })
+      },
+      // 初始化时立即执行一次
+      immediate: true
+    }
+  },
   created() {
-    this.liveId = this.$route.params.liveId
-    getLive(this.liveId).then(res => {
-      this.idCardUrl = res.data.idCardUrl;
-    })
   },
   methods: {
     submit(){

+ 26 - 22
src/views/live/liveConfig/liveLotteryConf.vue

@@ -235,12 +235,11 @@
 <!--                <el-input v-model="prize.productId" placeholder="请输入商品ID" />-->
                 <el-select
                   v-model="prize.productId"
-                  filterable
+                  :filterable="true"
                   clearable
                   remote
                 reserve-keyword
                 placeholder="请输入关键字搜索"
-                :remote-method="fetchProducts"
                 :loading="loadingProducts"
                 size="small"
                 style="width: 180px"
@@ -468,6 +467,7 @@ export default {
           this.canLiveId = true;
         }
         this.getList();
+        this.getProducts();
       },
       // 初始化时立即执行一次
       immediate: true
@@ -482,19 +482,7 @@ export default {
       this.lotteryStatusOptions = response.data;
     });
 
-    if (this.$route.params.liveId) {
-      this.liveId = this.$route.params.liveId;
-    }else {
-      this.liveId = this.$route.query.liveId;
-    }
-    this.parentLiveId = this.liveId;
-    this.queryParams.liveId = this.parentLiveId;
-    if(this.queryParams.liveId){
-      this.form.liveId = this.parentLiveId;
-      //设置查询条件直播间ID不可修改
-      this.canLiveId = true;
-    }
-    this.getList();
+
   },
   mounted() {
     this.$watch(
@@ -505,14 +493,9 @@ export default {
     );
   },
   methods: {
-    async fetchProducts(query) {
-      if (!query) {
-        this.productOptions = [];
-        return;
-      }
+    getProducts(){
       const queryParam = {
-        liveId : this.liveId,
-        keywords: query
+        liveId : this.liveId
       }
       this.loadingProducts = true;
       try {
@@ -526,6 +509,27 @@ export default {
         this.loadingProducts = false;
       }
     },
+    // async fetchProducts(query) {
+    //   if (!query) {
+    //     this.productOptions = [];
+    //     return;
+    //   }
+    //   const queryParam = {
+    //     liveId : this.liveId,
+    //     keywords: query
+    //   }
+    //   this.loadingProducts = true;
+    //   try {
+    //     listLiveGoods(queryParam).then(response => {
+    //       this.productOptions = response.rows;
+    //     })
+    //   } catch (err) {
+    //     console.error('查询商品失败:', err);
+    //     this.productOptions = [];
+    //   } finally {
+    //     this.loadingProducts = false;
+    //   }
+    // },
     // 获取默认奖品配置
     getDefaultPrize() {
       return {

+ 0 - 13
src/views/live/liveConfig/liveRedConf.vue

@@ -294,19 +294,6 @@ export default {
     this.getDicts("sys_live_red_type").then(response => {
       this.redTypeOptions = response.data;
     });
-    if (this.$route.params.liveId) {
-      this.liveId = this.$route.params.liveId;
-    }else {
-      this.liveId = this.$route.query.liveId;
-    }
-    this.parentLiveId = this.liveId;
-    this.queryParams.liveId = this.parentLiveId;
-    if(this.queryParams.liveId){
-      this.form.liveId = this.parentLiveId;
-      //设置查询条件直播间ID不可修改
-      this.canLiveId = true;
-    }
-    this.getList();
   },
   computed: {
   },

+ 29 - 10
src/views/live/liveConfig/liveReplay.vue

@@ -180,17 +180,36 @@ export default {
 
     };
   },
-  created() {
-    if (this.$route.params.liveId) {
-      this.liveId = this.$route.params.liveId;
-    }else {
-      this.liveId = this.$route.query.liveId;
-    }
-    if(this.liveId == null) {
-      this.$message.error("页面错误,请联系管理员");
-      return;
+  watch: {
+    // 监听路由的 query 参数变化
+    '$route.query': {
+      handler(newQuery) {
+        if (this.$route.params.liveId) {
+          this.liveId = this.$route.params.liveId;
+        }else {
+          this.liveId = this.$route.query.liveId;
+        }
+        if(this.liveId == null) {
+          this.$message.error("页面错误,请联系管理员");
+          return;
+        }
+        this.getLive();
+      },
+      // 初始化时立即执行一次
+      immediate: true
     }
-    this.getLive();
+  },
+  created() {
+    // if (this.$route.params.liveId) {
+    //   this.liveId = this.$route.params.liveId;
+    // }else {
+    //   this.liveId = this.$route.query.liveId;
+    // }
+    // if(this.liveId == null) {
+    //   this.$message.error("页面错误,请联系管理员");
+    //   return;
+    // }
+    // this.getLive();
   },
   methods: {
     getLiveVideo() {

+ 22 - 12
src/views/live/liveConfig/task.vue

@@ -316,19 +316,29 @@ export default {
       socket:null ,
     };
   },
-  created() {
-    if (this.$route.params.liveId) {
-      this.liveId = this.$route.params.liveId;
-    }else {
-      this.liveId = this.$route.query.liveId;
-    }
-    if(this.liveId == null) {
-      this.$message.error("页面错误,请联系管理员");
-      return;
+  watch: {
+    // 监听路由的 query 参数变化
+    '$route.query': {
+      handler(newQuery) {
+        if (this.$route.params.liveId) {
+          this.liveId = this.$route.params.liveId;
+        }else {
+          this.liveId = this.$route.query.liveId;
+        }
+        if(this.liveId == null) {
+          this.$message.error("页面错误,请联系管理员");
+          return;
+        }
+        this.liveAbled = true
+        this.queryParams.liveId = this.liveId;
+        this.getList();
+      },
+      // 初始化时立即执行一次
+      immediate: true
     }
-    this.liveAbled = true
-    this.queryParams.liveId = this.liveId;
-    this.getList();
+  },
+  created() {
+
     this.socket = this.$store.state.liveWs[this.liveId]
   },
   methods: {

+ 25 - 0
src/views/live/liveConsole/index.vue

@@ -76,8 +76,15 @@
             ref="livingPlayer"
             autoplay
             width="100%"
+            @click.prevent
+            @contextmenu.prevent
+            class="custom-video"
             style="display: block; background: #000; height: 45vh;"
           ></video>
+          <!-- 时间显示(可选) -->
+          <div ref="liveElapsedTime" class="time-display">
+            已播放:<span id="liveElapsedTime">00:00:00</span>
+          </div>
         </div>
         <div style="border-radius: 5px; overflow: hidden;" v-else-if="liveType == 2">
           <video
@@ -513,6 +520,22 @@ export default {
         }
       })
     },
+    updateLiveProgress() {
+      const elapsedTimeEl = this.$refs.liveElapsedTime;
+
+      const currentTime = new Date().getTime();
+      const elapsedTime = currentTime - this.startTime; // 总流逝时间(毫秒)
+      console.log(this.startTime)
+
+      if (elapsedTime < 0) {
+        elapsedTimeEl.textContent = '00:00:00';
+        return;
+      }
+
+
+      // 格式化总流逝时间为“时:分:秒”并显示
+      elapsedTimeEl.textContent = this.formatTime(elapsedTime);
+    },
     handleClickOrder(){
       this.$router.push({
         name: 'LiveOrder',
@@ -546,6 +569,8 @@ export default {
               this.$nextTick(() => {
                 this.initPlayer()
               })
+              this.startTime = new Date(res.data.startTime).getTime()
+              this.processInterval = setInterval(this.updateLiveProgress, 1000);
             } else {
               this.liveType = 2
               this.videoUrl = res.data.videoUrl;