Просмотр исходного кода

黑板模式扩展任意分词都可以查看字词卡片

natasha 1 месяц назад
Родитель
Сommit
9454c06f79

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

@@ -1548,6 +1548,32 @@ export default {
         }
 
         this.left = left - width / 2;
+      } else {
+        if (this.oldHz !== item.chs) {
+          this.isShow = false;
+
+          setTimeout(() => {
+            this.hz = item.words ? item.words : item.chs;
+            this.pinyin = item.pinyin;
+            this.wordIndex = item.wordIndex;
+          }, 50);
+        }
+        this.clientY = e.clientY;
+        let new_word = item.words ? item.words : item.chs;
+        this.wordPlayMp3 = '';
+        this.wordbgs = '';
+        this.wordeds = '';
+        this.wordPlayMp3 = '';
+        let left = e.clientX;
+        let width = 0;
+        if (item.chs.length === 1 || item.chs.length === 2) {
+          width = 304;
+        } else if (item.chs.length === 3 || item.chs.length === 4) {
+          width = 432;
+        } else if (item.chs.length > 3) {
+          width = 560;
+        }
+        this.left = left - width / 2;
       }
     },
     showNoteDetail(e, noteNum) {