浏览代码

修改对话文章注释问题

gcj 2 年之前
父节点
当前提交
676e110b60

+ 103 - 30
src/components/Adult/preview/DialogueArticleViewChs/NormalModelChs.vue

@@ -1,11 +1,12 @@
 <!--  -->
 <template>
   <div class="NNPE-ArticleView" v-if="curQue">
-    <div class="aduioLine-box aduioLine-practice-npc" v-if="
-            curQue.mp3_list &&
-            curQue.mp3_list.length > 0 &&
-            curQue.mp3_list[0].id
-          ">
+    <div
+      class="aduioLine-box aduioLine-practice-npc"
+      v-if="
+        curQue.mp3_list && curQue.mp3_list.length > 0 && curQue.mp3_list[0].id
+      "
+    >
       <div class="aduioLine-content">
         <template
           v-if="
@@ -116,13 +117,19 @@
                         v-if="
                           item.wordsList[pIndex + 1] &&
                           item.wordsList[pIndex + 1].chs &&
-                          chsFhList.indexOf(item.wordsList[pIndex + 1].chs) > -1 || item.wordsList[pIndex + 1] &&
-                          item.wordsList[pIndex + 1].chs &&item.wordsList[pIndex + 1].chs== '#'
+                          (chsFhList.indexOf(item.wordsList[pIndex + 1].chs) >
+                            -1 ||
+                            NumberList.indexOf(item.wordsList[pIndex + 1].chs) >
+                              -1)
                         "
                       >
                         <span class="NNPE-words-box">
                           <span
-                            v-if="curQue.pyPosition == 'top' && config.isShowPY && item.dhaspinyin"
+                            v-if="
+                              curQue.pyPosition == 'top' &&
+                              config.isShowPY &&
+                              item.dhaspinyin
+                            "
                             class="NNPE-pinyin"
                             :class="[
                               pItem.className ? pItem.className : '',
@@ -145,13 +152,19 @@
                                     ? 'wordActive'
                                     : '',
                                 ]"
-                                >{{ NumberList.indexOf(pItem.pinyin)==-1 ? pItem.chs[wIndex] : '' }}</span
+                                >{{
+                                  NumberList.indexOf(pItem.pinyin) == -1
+                                    ? pItem.chs[wIndex]
+                                    : ""
+                                }}</span
                               >
                             </template>
                           </span>
                           <span
                             v-if="
-                              curQue.pyPosition == 'bottom' && config.isShowPY && item.dhaspinyin
+                              curQue.pyPosition == 'bottom' &&
+                              config.isShowPY &&
+                              item.dhaspinyin
                             "
                             class="NNPE-pinyin"
                             :class="[
@@ -164,7 +177,11 @@
                         </span>
                         <span class="NNPE-words-box">
                           <span
-                            v-if="curQue.pyPosition == 'top' && config.isShowPY && item.dhaspinyin"
+                            v-if="
+                              curQue.pyPosition == 'top' &&
+                              config.isShowPY &&
+                              item.dhaspinyin
+                            "
                             class="NNPE-pinyin"
                             :class="[
                               noFont.indexOf(
@@ -173,7 +190,12 @@
                                 ? 'noFont'
                                 : '',
                             ]"
-                            @click.stop="viewNotes($event, item.wordsList[pIndex + 1].pinyin)"
+                            @click.stop="
+                              viewNotes(
+                                $event,
+                                item.wordsList[pIndex + 1].pinyin
+                              )
+                            "
                             style="text-align: left"
                             >{{ item.wordsList[pIndex + 1].pinyin }}</span
                           >
@@ -191,11 +213,19 @@
                                 ? 'wordActive'
                                 : '',
                             ]"
-                            >{{ NumberList.indexOf(item.wordsList[pIndex + 1].pinyin)==-1 ? item.wordsList[pIndex + 1].chs : '' }}</span
+                            >{{
+                              NumberList.indexOf(
+                                item.wordsList[pIndex + 1].pinyin
+                              ) == -1
+                                ? item.wordsList[pIndex + 1].chs
+                                : ""
+                            }}</span
                           >
                           <span
                             v-if="
-                              curQue.pyPosition == 'bottom' && config.isShowPY && item.dhaspinyin
+                              curQue.pyPosition == 'bottom' &&
+                              config.isShowPY &&
+                              item.dhaspinyin
                             "
                             class="NNPE-pinyin"
                             :class="[
@@ -205,7 +235,12 @@
                                 ? 'noFont'
                                 : '',
                             ]"
-                            @click.stop="viewNotes($event, item.wordsList[pIndex + 1].pinyin)"
+                            @click.stop="
+                              viewNotes(
+                                $event,
+                                item.wordsList[pIndex + 1].pinyin
+                              )
+                            "
                             style="text-align: left"
                             >{{ item.wordsList[pIndex + 1].pinyin }}</span
                           >
@@ -215,12 +250,14 @@
                           v-if="
                             item.wordsList[pIndex + 2] &&
                             item.wordsList[pIndex + 2].chs &&
-                            chsFhList.indexOf(item.wordsList[pIndex + 2].chs) >
-                              -1
+                            (chsFhList.indexOf(item.wordsList[pIndex + 2].chs) >
+                              -1 ||
+                              NumberList.indexOf(
+                                item.wordsList[pIndex + 2].chs
+                              ) > -1)
                           "
                         >
                           <span
-                            v-if="curQue.pyPosition == 'top' && config.isShowPY && item.dhaspinyin"
                             :class="[
                               'NNPE-pinyin',
                               noFont.indexOf(
@@ -229,7 +266,12 @@
                                 ? 'noFont'
                                 : '',
                             ]"
-                            @click.stop="viewNotes($event, item.wordsList[pIndex + 2].pinyin)"
+                            @click.stop="
+                              viewNotes(
+                                $event,
+                                item.wordsList[pIndex + 2].pinyin
+                              )
+                            "
                             style="text-align: left"
                             >{{ item.wordsList[pIndex + 2].pinyin }}</span
                           >
@@ -246,11 +288,22 @@
                                 ? 'wordActive'
                                 : '',
                             ]"
-                            >{{ NumberList.indexOf(item.wordsList[pIndex + 2].pinyin)==-1 ? item.wordsList[pIndex + 2].chs : '' }}</span
+                            @click.stop="
+                              viewNotes($event, item.wordsList[pIndex + 2].chs)
+                            "
+                            >{{
+                              NumberList.indexOf(
+                                item.wordsList[pIndex + 2].pinyin
+                              ) == -1
+                                ? item.wordsList[pIndex + 2].chs
+                                : ""
+                            }}</span
                           >
                           <span
                             v-if="
-                              curQue.pyPosition == 'bottom' && config.isShowPY && item.dhaspinyin
+                              curQue.pyPosition == 'bottom' &&
+                              config.isShowPY &&
+                              item.dhaspinyin
                             "
                             :class="[
                               'NNPE-pinyin',
@@ -260,7 +313,12 @@
                                 ? 'noFont'
                                 : '',
                             ]"
-                            @click.stop="viewNotes($event, item.wordsList[pIndex + 2].pinyin)"
+                            @click.stop="
+                              viewNotes(
+                                $event,
+                                item.wordsList[pIndex + 2].pinyin
+                              )
+                            "
                             style="text-align: left"
                             >{{ item.wordsList[pIndex + 2].pinyin }}</span
                           >
@@ -268,7 +326,11 @@
                       </template>
                       <template v-else>
                         <span
-                          v-if="curQue.pyPosition == 'top' && config.isShowPY && item.dhaspinyin"
+                          v-if="
+                            curQue.pyPosition == 'top' &&
+                            config.isShowPY &&
+                            item.dhaspinyin
+                          "
                           class="NNPE-pinyin"
                           :class="[
                             pItem.chs != '“' && pItem.padding ? 'padding' : '',
@@ -299,13 +361,19 @@
                                   ? 'wordActive'
                                   : '',
                               ]"
-                              >{{ NumberList.indexOf(pItem.pinyin)==-1 ? pItem.chs[wIndex] : '' }}</span
+                              >{{
+                                NumberList.indexOf(pItem.pinyin) == -1
+                                  ? pItem.chs[wIndex]
+                                  : ""
+                              }}</span
                             >
                           </template>
                         </span>
                         <span
                           v-if="
-                            curQue.pyPosition == 'bottom' && config.isShowPY && item.dhaspinyin
+                            curQue.pyPosition == 'bottom' &&
+                            config.isShowPY &&
+                            item.dhaspinyin
                           "
                           class="NNPE-pinyin"
                           :class="[
@@ -429,7 +497,7 @@ export default {
     return {
       resArr: [],
       curTime: 0, //单位s
-      chsFhList: [",", "。", "”", ":", "》", "《", "?", "!", ";"],
+      chsFhList: [",", "。", "”", ":", "》", "《", "?", "!", ";", "#"],
       enFhList: [",", ".", ";", "?", "!", ":", ">", "<"],
       NumberList: [
         "①",
@@ -534,7 +602,7 @@ export default {
       let asIndex = 0;
       let dhaspinyin = false; // 每段是否有拼音
       curQue.detail.forEach((dItem, dIndex) => {
-        dhaspinyin = false
+        dhaspinyin = false;
         let roleDetail = this.getRole(dItem);
         let remarkDetail = dItem.remark;
         if (remarkDetail && (remarkDetail.chs || remarkDetail.en)) {
@@ -565,6 +633,7 @@ export default {
               padding: true, //wItem.padding,
               className: wItem.className,
               isShow: wItem.isShow,
+              isNumShow: wItem.isNumShow,
               isNewWord: this.newWords.indexOf(wItem.chs) > -1 ? true : false,
               startIndex: startIndex,
               endIndex: endIndex,
@@ -582,7 +651,7 @@ export default {
             if (wIndex == sItem.length - 1) {
               asIndex++;
             }
-            if(wItem.pinyin) dhaspinyin=true
+            if (wItem.pinyin) dhaspinyin = true;
           });
         });
 
@@ -604,11 +673,12 @@ export default {
           timeList: timeList,
           roleDetail: roleDetail,
           remarkDetail: remarkDetail,
-          dhaspinyin:dhaspinyin
+          dhaspinyin: dhaspinyin,
         };
         resArr.push(paraObj);
       });
       this.resArr = resArr;
+      console.log(this.resArr);
 
       // 循环文章图片
       if (curQue.img_list) {
@@ -629,7 +699,10 @@ export default {
     },
     //词和标点合一起
     mergeWordSymbol(wItem) {
-      if (this.chsFhList.indexOf(wItem.chs) > -1||this.NumberList.indexOf(wItem.pinyin)>-1) {
+      if (
+        this.chsFhList.indexOf(wItem.chs) > -1 ||
+        this.NumberList.indexOf(wItem.chs) > -1
+      ) {
         wItem.isShow = false;
       } else {
         wItem.isShow = true;

+ 104 - 30
src/components/Adult/preview/DialogueArticleViewChs/PhraseModelChs.vue

@@ -1,11 +1,12 @@
 <!--  -->
 <template>
   <div class="NNPE-ArticleView" v-if="curQue">
-    <div class="aduioLine-box aduioLine-practice-npc" v-if="
-            curQue.mp3_list &&
-            curQue.mp3_list.length > 0 &&
-            curQue.mp3_list[0].id
-          ">
+    <div
+      class="aduioLine-box aduioLine-practice-npc"
+      v-if="
+        curQue.mp3_list && curQue.mp3_list.length > 0 && curQue.mp3_list[0].id
+      "
+    >
       <div class="aduioLine-content">
         <template
           v-if="
@@ -92,13 +93,19 @@
                         v-if="
                           item.wordsList[pIndex + 1] &&
                           item.wordsList[pIndex + 1].chs &&
-                          chsFhList.indexOf(item.wordsList[pIndex + 1].chs) > -1|| item.wordsList[pIndex + 1] &&
-                          item.wordsList[pIndex + 1].chs &&item.wordsList[pIndex + 1].chs== '#'
+                          (chsFhList.indexOf(item.wordsList[pIndex + 1].chs) >
+                            -1 ||
+                            NumberList.indexOf(item.wordsList[pIndex + 1].chs) >
+                              -1)
                         "
                       >
                         <span class="NNPE-words-box">
                           <span
-                            v-if="curQue.pyPosition == 'top' && config.isShowPY && item.dhaspinyin"
+                            v-if="
+                              curQue.pyPosition == 'top' &&
+                              config.isShowPY &&
+                              item.dhaspinyin
+                            "
                             class="NNPE-pinyin"
                             :class="[
                               pItem.className ? pItem.className : '',
@@ -114,11 +121,17 @@
                                 ? 'newActive'
                                 : '',
                             ]"
-                            >{{ NumberList.indexOf(pItem.pinyin)==-1 ? pItem.chs : '' }}</span
+                            >{{
+                              NumberList.indexOf(pItem.pinyin) == -1
+                                ? pItem.chs
+                                : ""
+                            }}</span
                           >
                           <span
                             v-if="
-                              curQue.pyPosition == 'bottom' && config.isShowPY && item.dhaspinyin
+                              curQue.pyPosition == 'bottom' &&
+                              config.isShowPY &&
+                              item.dhaspinyin
                             "
                             class="NNPE-pinyin"
                             :class="[
@@ -131,7 +144,11 @@
                         </span>
                         <span class="NNPE-words-box">
                           <span
-                            v-if="curQue.pyPosition == 'top' && config.isShowPY && item.dhaspinyin"
+                            v-if="
+                              curQue.pyPosition == 'top' &&
+                              config.isShowPY &&
+                              item.dhaspinyin
+                            "
                             class="NNPE-pinyin"
                             style="text-align: left"
                             :class="[
@@ -141,15 +158,26 @@
                                 ? 'noFont'
                                 : '',
                             ]"
-                            @click.stop="viewNotes($event, item.wordsList[pIndex + 1].pinyin)"
+                            @click.stop="
+                              viewNotes(
+                                $event,
+                                item.wordsList[pIndex + 1].pinyin
+                              )
+                            "
                             >{{ item.wordsList[pIndex + 1].pinyin }}</span
                           >
                           <span class="NNPE-chs" style="text-align: left">{{
-                            NumberList.indexOf(item.wordsList[pIndex + 1].pinyin)==-1 ? item.wordsList[pIndex + 1].chs : ''
+                            NumberList.indexOf(
+                              item.wordsList[pIndex + 1].pinyin
+                            ) == -1
+                              ? item.wordsList[pIndex + 1].chs
+                              : ""
                           }}</span>
                           <span
                             v-if="
-                              curQue.pyPosition == 'bottom' && config.isShowPY && item.dhaspinyin
+                              curQue.pyPosition == 'bottom' &&
+                              config.isShowPY &&
+                              item.dhaspinyin
                             "
                             class="NNPE-pinyin"
                             :class="[
@@ -159,7 +187,12 @@
                                 ? 'noFont'
                                 : '',
                             ]"
-                            @click.stop="viewNotes($event, item.wordsList[pIndex + 1].pinyin)"
+                            @click.stop="
+                              viewNotes(
+                                $event,
+                                item.wordsList[pIndex + 1].pinyin
+                              )
+                            "
                             style="text-align: left"
                             >{{ item.wordsList[pIndex + 1].pinyin }}</span
                           >
@@ -169,12 +202,19 @@
                           v-if="
                             item.wordsList[pIndex + 2] &&
                             item.wordsList[pIndex + 2].chs &&
-                            chsFhList.indexOf(item.wordsList[pIndex + 2].chs) >
-                              -1
+                            (chsFhList.indexOf(item.wordsList[pIndex + 2].chs) >
+                              -1 ||
+                              NumberList.indexOf(
+                                item.wordsList[pIndex + 2].chs
+                              ) > -1)
                           "
                         >
                           <span
-                            v-if="curQue.pyPosition == 'top' && config.isShowPY && item.dhaspinyin"
+                            v-if="
+                              curQue.pyPosition == 'top' &&
+                              config.isShowPY &&
+                              item.dhaspinyin
+                            "
                             :class="[
                               'NNPE-pinyin',
                               noFont.indexOf(
@@ -183,7 +223,12 @@
                                 ? 'noFont'
                                 : '',
                             ]"
-                            @click.stop="viewNotes($event, item.wordsList[pIndex + 2].pinyin)"
+                            @click.stop="
+                              viewNotes(
+                                $event,
+                                item.wordsList[pIndex + 2].pinyin
+                              )
+                            "
                             style="text-align: left"
                             >{{ item.wordsList[pIndex + 2].pinyin }}</span
                           >
@@ -200,11 +245,22 @@
                                 ? 'wordActive'
                                 : '',
                             ]"
-                            >{{ NumberList.indexOf(item.wordsList[pIndex + 2].pinyin)==-1 ? item.wordsList[pIndex + 2].chs : '' }}</span
+                            @click.stop="
+                              viewNotes($event, item.wordsList[pIndex + 2].chs)
+                            "
+                            >{{
+                              NumberList.indexOf(
+                                item.wordsList[pIndex + 2].pinyin
+                              ) == -1
+                                ? item.wordsList[pIndex + 2].chs
+                                : ""
+                            }}</span
                           >
                           <span
                             v-if="
-                              curQue.pyPosition == 'bottom' && config.isShowPY && item.dhaspinyin
+                              curQue.pyPosition == 'bottom' &&
+                              config.isShowPY &&
+                              item.dhaspinyin
                             "
                             :class="[
                               'NNPE-pinyin',
@@ -214,7 +270,12 @@
                                 ? 'noFont'
                                 : '',
                             ]"
-                            @click.stop="viewNotes($event, item.wordsList[pIndex + 2].pinyin)"
+                            @click.stop="
+                              viewNotes(
+                                $event,
+                                item.wordsList[pIndex + 2].pinyin
+                              )
+                            "
                             style="text-align: left"
                             >{{ item.wordsList[pIndex + 2].pinyin }}</span
                           >
@@ -222,7 +283,11 @@
                       </template>
                       <template v-else>
                         <span
-                          v-if="curQue.pyPosition == 'top' && config.isShowPY && item.dhaspinyin"
+                          v-if="
+                            curQue.pyPosition == 'top' &&
+                            config.isShowPY &&
+                            item.dhaspinyin
+                          "
                           class="NNPE-pinyin"
                           :class="[
                             pItem.chs != '“' && pItem.padding ? 'padding' : '',
@@ -241,11 +306,17 @@
                               : '',
                             pItem.chs != '“' && pItem.padding ? 'padding' : '',
                           ]"
-                          >{{ NumberList.indexOf(pItem.pinyin)==-1 ? pItem.chs : '' }}</span
+                          >{{
+                            NumberList.indexOf(pItem.pinyin) == -1
+                              ? pItem.chs
+                              : ""
+                          }}</span
                         >
                         <span
                           v-if="
-                            curQue.pyPosition == 'bottom' && config.isShowPY && item.dhaspinyin
+                            curQue.pyPosition == 'bottom' &&
+                            config.isShowPY &&
+                            item.dhaspinyin
                           "
                           class="NNPE-pinyin"
                           :class="[
@@ -376,7 +447,7 @@ export default {
     return {
       resArr: [],
       curTime: 0, //单位s
-      chsFhList: [",", "。", "”", ":", "》", "《", "?", "!", ";"],
+      chsFhList: [",", "。", "”", ":", "》", "《", "?", "!", ";", "#"],
       enFhList: [",", ".", ";", "?", "!", ":", ">", "<"],
       NumberList: [
         "①",
@@ -503,7 +574,7 @@ export default {
       let curQue = JSON.parse(JSON.stringify(this.curQue));
       let dhaspinyin = false; // 每段是否有拼音
       curQue.detail.forEach((dItem, dIndex) => {
-        dhaspinyin = false
+        dhaspinyin = false;
         let roleDetail = this.getRole(dItem);
         let remarkDetail = dItem.remark;
         if (remarkDetail && (remarkDetail.chs || remarkDetail.en)) {
@@ -526,7 +597,7 @@ export default {
               isNewWord: this.newWords.indexOf(wItem.chs) > -1 ? true : false,
             };
             paraArr.push(obj);
-            if(wItem.pinyin) dhaspinyin=true
+            if (wItem.pinyin) dhaspinyin = true;
           });
         });
         let enwords =
@@ -538,7 +609,7 @@ export default {
           enwords: enwords,
           roleDetail: roleDetail,
           remarkDetail: remarkDetail,
-          dhaspinyin:dhaspinyin
+          dhaspinyin: dhaspinyin,
         };
         resArr.push(paraObj);
       });
@@ -553,7 +624,10 @@ export default {
     },
     //词和标点合一起
     mergeWordSymbol(wItem) {
-      if (this.chsFhList.indexOf(wItem.chs) > -1||this.NumberList.indexOf(wItem.pinyin)>-1) {
+      if (
+        this.chsFhList.indexOf(wItem.chs) > -1 ||
+        this.NumberList.indexOf(wItem.chs) > -1
+      ) {
         wItem.isShow = false;
       } else {
         wItem.isShow = true;