ソースを参照

例句只取简体

natasha 9 ヶ月 前
コミット
e39271f874

+ 8 - 1
src/components/Adult/preview/DialogueArticleViewChs/PhraseModelChs.vue

@@ -939,7 +939,14 @@ export default {
           let item = pItem[j];
           if (item.new_word.trim() == val.trim()) {
             let wordlist = val.split("");
-            this.word = { list: wordlist, detail: item, top: top, left: left };
+            this.word = JSON.parse(
+              JSON.stringify({
+                list: wordlist,
+                detail: item,
+                top: top,
+                left: left
+              })
+            );
             break;
           }
         }

+ 7 - 7
src/components/Adult/preview/components/WordPhraseDetail.vue

@@ -580,7 +580,7 @@ export default {
       // 获取本课的 本教材的 本套的 的例句
       getContent(Mname, {
         courseware_id: this.currentTreeID, // 课件id
-        word: this.data.new_word, //生词
+        word: this.data.new_word_str, //生词
         search_scope: 0, //检索范围0 本课件  1本教材 2本套
         is_contain_word_variants: false,
         is_filter_repetitive_sentence: "true",
@@ -1015,12 +1015,12 @@ export default {
   //生命周期 - 创建完成(可以访问当前this实例)
   created() {
     // 去掉生词里的标点
-    let new_word_str = "";
-    for (let i = 0; i < this.data.new_word.length; i++) {
-      if (/[\u4E00-\u9FA5\uF900-\uFA2D]/.test(this.data.new_word[i])) {
-        new_word_str += this.data.new_word[i];
-      }
-    }
+    let new_word_str = this.data.new_word.replace(/\(.*?\)/g, "");
+    // for (let i = 0; i < this.data.new_word.length; i++) {
+    //   if (/[\u4E00-\u9FA5\uF900-\uFA2D]/.test(this.data.new_word[i])) {
+    //     new_word_str += JSON.parse(JSON.stringify(this.data.new_word[i]));
+    //   }
+    // }
     this.data.new_word_str = new_word_str;
   },
   //生命周期 - 挂载完成(可以访问DOM元素)

+ 8 - 6
src/components/Adult/preview/components/Wordcard.vue

@@ -463,12 +463,14 @@ export default {
   },
   //生命周期 - 创建完成(可以访问当前this实例)
   created() {
-    let new_word_str = "";
-    for (let i = 0; i < this.word.detail.new_word.length; i++) {
-      if (/[\u4E00-\u9FA5\uF900-\uFA2D]/.test(this.word.detail.new_word[i])) {
-        new_word_str += this.word.detail.new_word[i];
-      }
-    }
+    let new_word_str = this.word.detail.new_word.replace(/\(.*?\)/g, "");
+    // for (let i = 0; i < this.word.detail.new_word.length; i++) {
+    //   if (/[\u4E00-\u9FA5\uF900-\uFA2D]/.test(this.word.detail.new_word[i])) {
+    //     new_word_str += JSON.parse(
+    //       JSON.stringify(this.word.detail.new_word[i])
+    //     );
+    //   }
+    // }
     this.word.detail.new_word = new_word_str;
   },
   //生命周期 - 挂载完成(可以访问DOM元素)