From 0b737708e696c45720499759b5c31aced87fdbb6 Mon Sep 17 00:00:00 2001
From: zhangzengfei <zhangzengfei@iotlink.com>
Date: 星期三, 07 七月 2021 14:10:03 +0800
Subject: [PATCH] merge master

---
 src/pages/shuohuangMonitorAnalyze/components/eventVideos.vue |   31 +++++++++++++++++--------------
 1 files changed, 17 insertions(+), 14 deletions(-)

diff --git a/src/pages/shuohuangMonitorAnalyze/components/eventVideos.vue b/src/pages/shuohuangMonitorAnalyze/components/eventVideos.vue
index cd08380..472c8c2 100644
--- a/src/pages/shuohuangMonitorAnalyze/components/eventVideos.vue
+++ b/src/pages/shuohuangMonitorAnalyze/components/eventVideos.vue
@@ -1,7 +1,7 @@
 <template>
   <div class="event-video-content">
     <div class="video-player">
-      <video :src="curVideo.ClipPath" controls></video>
+      <video :src="videoUrl" controls autoplay></video>
     </div>
     <div class="more-videos">
       <div class="top">
@@ -20,7 +20,7 @@
           :key="item.ID"
           @click="checkVideo(item)"
         >
-          <img :src="item.Cover" alt />
+          <img :src="`/httpImage/` + item.Cover" alt />
           <div class="time">{{item.EventTime}}</div>
         </div>
       </div>
@@ -29,6 +29,8 @@
 </template>
 
 <script>
+import { getVideoUrl } from "@/api/shuohuang"
+
 export default {
   props: {
     eventVideoArr: {
@@ -36,19 +38,14 @@
       default: () => { return [] }
     }
   },
-  data () {
+  data() {
     return {
       curVideo: {},
+      videoUrl: ""
     }
   },
-  watch: {
-    eventVideoArr (n, o) {
-      if (n.length) {
-        this.curVideo = n[0]
-      }
-    }
-  },
-  mounted () {
+
+  mounted() {
     //this.eventVideoArr.length && (this.curVideo = this.eventVideoArr[0]);
     //this.curVideo = this.eventVideoArr[0];
     this.$nextTick(() => {
@@ -56,8 +53,13 @@
     })
   },
   methods: {
-    checkVideo (data) {
-      this.curVideo = data;
+    checkVideo(item) {
+      this.curVideo = item;
+      getVideoUrl({ id: item.ID }).then(rsp => {
+        if (rsp && rsp.success) {
+          this.videoUrl = "/httpImage/" + rsp.data.videoUrl;
+        }
+      })
     }
   }
 }
@@ -73,7 +75,7 @@
       margin: 20px auto;
       width: 576px;
       height: 324px;
-      background: aquamarine;
+      background: #000;
     }
   }
   .more-videos {
@@ -107,6 +109,7 @@
         padding: 10px;
         border: 1px solid #eee;
         border-radius: 3px;
+        cursor: pointer;
         &.act {
           border-color: #0096fa;
         }

--
Gitblit v1.8.0