Browse Source

通话时间修改

zhangjie 4 years ago
parent
commit
85b8f76137

+ 1 - 2
src/features/invigilation/RealtimeMonitoring/WarningDetail.vue

@@ -620,10 +620,9 @@ export default {
       });
       });
       this.client.on("stream-subscribed", (event) => {
       this.client.on("stream-subscribed", (event) => {
         const remoteStream = event.stream;
         const remoteStream = event.stream;
-
         this.isWaiting = false;
         this.isWaiting = false;
         this.$nextTick(() => {
         this.$nextTick(() => {
-          this.$refs.SecondTimer.start();
+          if (!this.$refs.SecondTimer.recoding) this.$refs.SecondTimer.start();
           remoteStream.play("communication-host", { objectFit: "contain" });
           remoteStream.play("communication-host", { objectFit: "contain" });
         });
         });
       });
       });

+ 3 - 0
src/features/invigilation/common/SecondTimer.vue

@@ -12,10 +12,12 @@ export default {
       duration: "00:00:00",
       duration: "00:00:00",
       recordSecondCount: 0,
       recordSecondCount: 0,
       setT: null,
       setT: null,
+      recoding: false,
     };
     };
   },
   },
   methods: {
   methods: {
     start() {
     start() {
+      this.recoding = true;
       this.setT = setInterval(() => {
       this.setT = setInterval(() => {
         this.recordSecondCount++;
         this.recordSecondCount++;
         this.duration = this.timeToText(this.recordSecondCount);
         this.duration = this.timeToText(this.recordSecondCount);
@@ -27,6 +29,7 @@ export default {
       this.recordSecondCount = 0;
       this.recordSecondCount = 0;
     },
     },
     pause() {
     pause() {
+      this.recoding = false;
       clearInterval(this.setT);
       clearInterval(this.setT);
       this.$emit("on-duration", this.recordSecondCount, this.duration);
       this.$emit("on-duration", this.recordSecondCount, this.duration);
     },
     },