瀏覽代碼

录音 bug及功能完善

qinpeng 2 年之前
父節點
當前提交
6839b983f0
共有 1 個文件被更改,包括 18 次插入8 次删除
  1. 18 8
      src/components/Adult/preview/Voicefullscreen.vue

+ 18 - 8
src/components/Adult/preview/Voicefullscreen.vue

@@ -585,6 +585,7 @@
             <div
               @mousewheel="LYmousewheelEvent"
               @dblclick="lydblclick"
+              @click="lyClickEvent"
               id="waveform_ly"
               ref="waveform_ly"
               class="elem"
@@ -1411,6 +1412,7 @@ export default {
     },
     // 鼠标滚动放大缩小
     mousewheelEvent(e) {
+      this.playList = ["yp"];
       let that = this;
       var ev = e || window.event;
       var down = true;
@@ -1427,6 +1429,7 @@ export default {
     },
     // 录音鼠标滚动放大缩小
     LYmousewheelEvent(e) {
+      this.playList = ["ly"];
       let that = this;
       var ev = e || window.event;
       var down = true;
@@ -1442,6 +1445,7 @@ export default {
       wavesurfer_ly.zoom(Number(that.lyzoomNumber), this.zoomTime);
     },
     bigClickEvent() {
+      this.playList = ["yp"];
       if (this.regionData) {
         return;
       }
@@ -1456,7 +1460,8 @@ export default {
       let time2 = newarr[1];
       this.ShowcurentTime = time1 + ":" + time2;
     },
-    lyClickEvent(){
+    lyClickEvent() {
+      this.playList = ["ly"];
       if (this.LY_regionData) {
         return;
       }
@@ -1472,20 +1477,23 @@ export default {
       this.ly_ShowcurentTime = time1 + ":" + time2;
     },
     lydblclick() {
+      this.playList = ["ly"];
       let that = this;
       if (that.LY_regionData) {
         that.LY_regionData = null;
         that.ly_ShowcurentTime = "00:00";
-        that.initLYaudioImage(that.speedList[that.speedIndex], false);
+        wavesurfer_ly.clearRegions();
+        // that.initLYaudioImage(that.speedList[that.speedIndex], false);
       }
     },
     Bibdblclick() {
+      this.playList = ["yp"];
       let that = this;
       if (that.regionData) {
         that.regionData = null;
         that.ShowcurentTime = "00:00";
-
-        that.initaudioImage(that.speedList[that.speedIndex], false);
+        that.wavesurfer_big.clearRegions();
+        // that.initaudioImage(that.speedList[that.speedIndex], false);
       }
     },
     // 初始化声波
@@ -1534,7 +1542,7 @@ export default {
                 loop: false,
                 drag: false,
                 resize: false,
-                color: "rgba(0, 180, 0, 0.5)",
+                color: "rgba(255, 255, 255, 0.2)",
               },
             ],
           })
@@ -1598,6 +1606,7 @@ export default {
       that.wavesurfer_big.on("region-updated", function (region) {
         // region.playLoop(); // 循环播放选中区域
         // region.play()
+        that.playList = ["yp"];
         that.regionData = region;
         let strt_time = that.regionData.start.toFixed(2);
         let end_time = that.regionData.end.toFixed(2);
@@ -1625,7 +1634,7 @@ export default {
             newtime2 += item;
           }
         });
-        that.ShowcurentTime = newtime + "-" + newtime2;
+        that.ShowcurentTime = newtime + " - " + newtime2;
       });
       that.wavesurfer_big.on("region-created", () => {
         that.wavesurfer_big.clearRegions();
@@ -1799,7 +1808,7 @@ export default {
                 loop: false,
                 drag: false,
                 resize: false,
-                color: "rgba(0, 180, 0, 0.3)",
+                color: "rgba(255, 255, 255, 0.2)",
               },
             ],
           })
@@ -1911,6 +1920,7 @@ export default {
       wavesurfer_ly.on("region-updated", function (region) {
         // region.playLoop(); // 循环播放选中区域
         // region.play()
+        _this.playList = ["ly"];
         _this.LY_regionData = region;
         let strt_time = _this.LY_regionData.start.toFixed(2);
         let end_time = _this.LY_regionData.end.toFixed(2);
@@ -1938,7 +1948,7 @@ export default {
             newtime2 += item;
           }
         });
-        _this.ly_ShowcurentTime = newtime + "-" + newtime2;
+        _this.ly_ShowcurentTime = newtime + " - " + newtime2;
       });
       wavesurfer_ly.on("region-created", () => {
         wavesurfer_ly.clearRegions();