Przeglądaj źródła

黑板模式下判断标点是否显示

natasha 2 tygodni temu
rodzic
commit
2b81e4bebd

+ 17 - 0
src/views/book/courseware/preview/components/article/Voicefullscreen.vue

@@ -1348,12 +1348,17 @@ export default {
       this.pauseAudio();
       this.isPlaying = false;
       let item = JSON.parse(JSON.stringify(this.sentList[this.curSentIndex]));
+
       if (item.sentArr) {
         this.item = item.sentArr;
         this.enwords = item.enwords;
       } else {
         this.item = item;
       }
+      this.item.forEach((wItem, wIndex) => {
+        this.mergeWordSymbol(wItem);
+        wItem.isShow = wItem.isShow;
+      });
       this.sentList.forEach((item) => {
         this.isCollArr.push(false);
       });
@@ -1373,6 +1378,18 @@ export default {
       }
       // this.checkCollStatus();
     },
+    // 词和标点合一起
+    mergeWordSymbol(wItem) {
+      if (
+        this.chsFhList.indexOf(wItem.chs) > -1 ||
+        this.NumberList.indexOf(wItem.chs) > -1 ||
+        this.firstFhlist.indexOf(wItem.chs) > -1
+      ) {
+        wItem.isShow = false;
+      } else {
+        wItem.isShow = true;
+      }
+    },
     pauseAudio() {
       let audio = document.getElementsByTagName('audio');
       if (audio && audio.length > 0 && window.location.href.indexOf('GCLS-Learn') === -1 && audio.forEach) {

+ 2 - 2
src/views/book/courseware/preview/components/dialogue_article/Practicechs.vue

@@ -1165,7 +1165,7 @@ export default {
     },
     pauseAudio() {
       let audio = document.getElementsByTagName('audio');
-      if (audio && audio.length > 0 && window.location.href.indexOf('GCLS-Learn') === -1) {
+      if (audio && audio.length > 0 && window.location.href.indexOf('GCLS-Learn') === -1 && audio.forEach) {
         audio.forEach((item) => {
           item.pause();
         });
@@ -1173,7 +1173,7 @@ export default {
     },
     pauseVideo() {
       let video = document.getElementsByTagName('video');
-      if (video && video.length > 0 && window.location.href.indexOf('GCLS-Learn') === -1) {
+      if (video && video.length > 0 && window.location.href.indexOf('GCLS-Learn') === -1 && video.forEach) {
         video.forEach((item) => {
           item.pause();
         });