Ver código fonte

对话课文细节

natasha 3 meses atrás
pai
commit
3b51a7a2eb

+ 0 - 1
src/views/book/courseware/create/components/question/dialogue_article/Article.vue

@@ -723,7 +723,6 @@ export default {
           });
         }
       });
-      console.log(node_list);
 
       this.data.mind_map.node_list = node_list;
     },

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

@@ -863,42 +863,42 @@ export default {
     // 添加收藏
     addColl() {
       let Bookdetail = sessionStorage.getItem('Bookdetail');
-      if (Bookdetail) {
-        Bookdetail = JSON.parse(Bookdetail);
-
-        let MethodName = 'order-collection_manager-AddMyCollection';
-        let text = '';
-        this.item.forEach((item) => {
-          if (item.chs != '#') {
-            text += item.chs;
-          }
-        });
-        let sentence_json = {
-          item: JSON.stringify(this.item),
-          bg: this.bg,
-          ed: this.ed,
-          mp3: this.mp3,
-          pyPosition: this.curQue.property.pinyin_position,
-        };
-        let data = {
-          goods_id: this.currentTreeID,
-          goods_type: 502,
-          goods_name: Bookdetail.name,
-          goods_person_name_desc: Bookdetail.author ? Bookdetail.author : '',
-          goods_picture_id: Bookdetail.picture_id ? Bookdetail.picture_id : '',
-          goods_price: Bookdetail.price,
-          sentence: {
-            sentence_text: text,
-            sentence_json: JSON.stringify(sentence_json),
-          },
-        };
-        LearnWebSI(MethodName, data).then((res) => {
-          this.$set(this.isCollArr, this.curSentIndex, true);
-          this.$message.success('收藏成功!');
-        });
-      } else {
-        this.$message.warning('权限不足!');
-      }
+      // if (Bookdetail) {
+      Bookdetail = JSON.parse(Bookdetail);
+
+      let MethodName = 'order-collection_manager-AddMyCollection';
+      let text = '';
+      this.item.forEach((item) => {
+        if (item.chs != '#') {
+          text += item.chs;
+        }
+      });
+      let sentence_json = {
+        item: JSON.stringify(this.item),
+        bg: this.bg,
+        ed: this.ed,
+        mp3: this.mp3,
+        pyPosition: this.curQue.property.pinyin_position,
+      };
+      let data = {
+        goods_id: this.currentTreeID,
+        goods_type: 502,
+        goods_name: Bookdetail.name,
+        goods_person_name_desc: Bookdetail.author ? Bookdetail.author : '',
+        goods_picture_id: Bookdetail.picture_id ? Bookdetail.picture_id : '',
+        goods_price: Bookdetail.price,
+        sentence: {
+          sentence_text: text,
+          sentence_json: JSON.stringify(sentence_json),
+        },
+      };
+      LearnWebSI(MethodName, data).then((res) => {
+        this.$set(this.isCollArr, this.curSentIndex, true);
+        this.$message.success('收藏成功!');
+      });
+      // } else {
+      //   this.$message.warning('权限不足!');
+      // }
     },
     // 取消收藏
     cancleColl() {
@@ -1144,14 +1144,14 @@ export default {
         _this.pauseAudio();
         _this.isNewWordPlay = false;
         let new_word = item.words ? item.words : item.chs;
-        _this.NNPENewWordList.forEach((items) => {
-          items.forEach((itemn) => {
-            if (itemn.new_word === new_word) {
-              _this.wordbg = itemn.bg;
-              _this.worded = itemn.ed;
-              _this.wordPlayMp3 = itemn.newWordMp3;
-            }
-          });
+        _this.NNPENewWordList.forEach((itemn) => {
+          // items.forEach((itemn) => {
+          if (itemn.new_word === new_word) {
+            _this.wordbg = itemn.bg;
+            _this.worded = itemn.ed;
+            _this.wordPlayMp3 = itemn.newWordMp3;
+          }
+          // });
         });
         setTimeout(() => {
           _this.isNewWordPlay = true;
@@ -1183,14 +1183,14 @@ export default {
       _this.clientY = e.clientY;
       let new_word = item.words ? item.words : item.chs;
       _this.wordPlayMp3 = '';
-      _this.NNPENewWordList.forEach((items) => {
-        items.forEach((itemn) => {
-          if (itemn.new_word === new_word) {
-            _this.wordbgs = itemn.bg;
-            _this.wordeds = itemn.ed;
-            _this.wordPlayMp3 = itemn.newWordMp3;
-          }
-        });
+      _this.NNPENewWordList.forEach((itemn) => {
+        // items.forEach((itemn) => {
+        if (itemn.new_word === new_word) {
+          _this.wordbgs = itemn.bg;
+          _this.wordeds = itemn.ed;
+          _this.wordPlayMp3 = itemn.newWordMp3;
+        }
+        // });
       });
       let left = e.clientX;
       let width = 0;
@@ -1246,10 +1246,10 @@ export default {
     },
     handleNewword() {
       let NewWordList = [];
-      this.NNPENewWordList.forEach((item) => {
-        item.forEach((wItem) => {
-          NewWordList.push(wItem.new_word);
-        });
+      this.NNPENewWordList.forEach((wItem) => {
+        // item.forEach((wItem) => {
+        NewWordList.push(wItem.new_word);
+        // });
       });
       this.newWordList = JSON.parse(JSON.stringify(NewWordList));
     },

+ 29 - 29
src/views/book/courseware/preview/components/article/components/Practice.vue

@@ -272,27 +272,27 @@ export default {
     },
     addColl() {
       let Bookdetail = sessionStorage.getItem('Bookdetail');
-      if (Bookdetail) {
-        Bookdetail = JSON.parse(Bookdetail);
-        let MethodName = 'order-collection_manager-AddMyCollection';
-        let data = {
-          goods_id: this.currentTreeID,
-          goods_type: 501,
-          goods_name: Bookdetail.name,
-          goods_person_name_desc: Bookdetail.author ? Bookdetail.author : '',
-          goods_picture_id: Bookdetail.picture_id ? Bookdetail.picture_id : '',
-          goods_price: Bookdetail.price,
-          new_word: {
-            new_word: this.cur.stem[0].con,
-          },
-        };
-        LearnWebSI(MethodName, data).then((res) => {
-          this.collFlag = true;
-          this.$message.success('收藏成功!');
-        });
-      } else {
-        this.$message.warning('权限不足!');
-      }
+      // if (Bookdetail) {
+      Bookdetail = JSON.parse(Bookdetail);
+      let MethodName = 'order-collection_manager-AddMyCollection';
+      let data = {
+        goods_id: this.currentTreeID,
+        goods_type: 501,
+        goods_name: Bookdetail.name,
+        goods_person_name_desc: Bookdetail.author ? Bookdetail.author : '',
+        goods_picture_id: Bookdetail.picture_id ? Bookdetail.picture_id : '',
+        goods_price: Bookdetail.price,
+        new_word: {
+          new_word: this.cur.stem[0].con,
+        },
+      };
+      LearnWebSI(MethodName, data).then((res) => {
+        this.collFlag = true;
+        this.$message.success('收藏成功!');
+      });
+      // } else {
+      //   this.$message.warning('权限不足!');
+      // }
     },
     // 取消收藏
     cancleColl() {
@@ -361,10 +361,10 @@ export default {
       if (_this.TaskModel == 'ANSWER') {
         _this.$refs.freewrite[_this.isShow].getStuImgList(_this.isShow);
       } else if (_this.navIndex == 1) {
-          setTimeout(() => {
-            _this.$refs.freewrite[_this.isShow].getImgList(_this.isShow);
-          }, 100);
-        }
+        setTimeout(() => {
+          _this.$refs.freewrite[_this.isShow].getImgList(_this.isShow);
+        }, 100);
+      }
     },
     handleClick2(index) {
       let _this = this;
@@ -372,10 +372,10 @@ export default {
       if (_this.TaskModel == 'ANSWER') {
         _this.$refs.freewrite[_this.isShow].getStuImgList(_this.isShow);
       } else if (_this.navIndex == 1) {
-          setTimeout(() => {
-            _this.$refs.freewrite[_this.isShow].getImgList(_this.isShow);
-          }, 100);
-        }
+        setTimeout(() => {
+          _this.$refs.freewrite[_this.isShow].getImgList(_this.isShow);
+        }, 100);
+      }
     },
     saveWriteAnswer(data) {
       let answer = JSON.parse(JSON.stringify(data));

+ 21 - 21
src/views/book/courseware/preview/components/article/components/Wordcard.vue

@@ -271,27 +271,27 @@ export default {
     },
     addColl() {
       let Bookdetail = sessionStorage.getItem('Bookdetail');
-      if (Bookdetail) {
-        Bookdetail = JSON.parse(Bookdetail);
-        let MethodName = 'order-collection_manager-AddMyCollection';
-        let data = {
-          goods_id: this.currentTreeID,
-          goods_type: 501,
-          goods_name: Bookdetail.name,
-          goods_person_name_desc: Bookdetail.author ? Bookdetail.author : '',
-          goods_picture_id: Bookdetail.picture_id ? Bookdetail.picture_id : '',
-          goods_price: Bookdetail.price,
-          new_word: {
-            new_word: this.word.detail.new_word,
-          },
-        };
-        LearnWebSI(MethodName, data).then((res) => {
-          this.collFlag = true;
-          this.$message.success('收藏成功!');
-        });
-      } else {
-        this.$message.warning('权限不足!');
-      }
+      // if (Bookdetail) {
+      Bookdetail = JSON.parse(Bookdetail);
+      let MethodName = 'order-collection_manager-AddMyCollection';
+      let data = {
+        goods_id: this.currentTreeID,
+        goods_type: 501,
+        goods_name: Bookdetail.name,
+        goods_person_name_desc: Bookdetail.author ? Bookdetail.author : '',
+        goods_picture_id: Bookdetail.picture_id ? Bookdetail.picture_id : '',
+        goods_price: Bookdetail.price,
+        new_word: {
+          new_word: this.word.detail.new_word,
+        },
+      };
+      LearnWebSI(MethodName, data).then((res) => {
+        this.collFlag = true;
+        this.$message.success('收藏成功!');
+      });
+      // } else {
+      //   this.$message.warning('权限不足!');
+      // }
     },
     // 取消收藏
     cancleColl() {

+ 8 - 8
src/views/book/courseware/preview/components/article/index.vue

@@ -538,14 +538,14 @@ export default {
     },
     handleNewword() {
       let NewWordList = [];
-      this.NNPENewWordList.forEach((item) => {
-        item.forEach((wItem) => {
-          if (wItem.new_word) {
-            NewWordList.push(wItem.new_word);
-          } else if (wItem.detail && wItem.detail.sentence) {
-            NewWordList.push(wItem.detail.sentence);
-          }
-        });
+      this.NNPENewWordList.forEach((wItem) => {
+        // item.forEach((wItem) => {
+        if (wItem.new_word) {
+          NewWordList.push(wItem.new_word);
+        } else if (wItem.detail && wItem.detail.sentence) {
+          NewWordList.push(wItem.detail.sentence);
+        }
+        // });
       });
       this.newWordList = JSON.parse(JSON.stringify(NewWordList));
     },

+ 8 - 9
src/views/book/courseware/preview/components/dialogue_article/NormalModelChs.vue

@@ -102,7 +102,7 @@
                       >
                         <span class="NNPE-words-box">
                           <span
-                            v-if="curQue.pyPosition == 'top' && config.isShowPY && item.dhaspinyin"
+                            v-if="curQue.property.pinyin_position == 'top' && config.isShowPY && item.dhaspinyin"
                             class="NNPE-pinyin"
                             :class="[
                               pItem.className ? pItem.className : '',
@@ -152,7 +152,7 @@
                             </template>
                           </span>
                           <span
-                            v-if="curQue.pyPosition == 'bottom' && config.isShowPY && item.dhaspinyin"
+                            v-if="curQue.property.pinyin_position == 'bottom' && config.isShowPY && item.dhaspinyin"
                             class="NNPE-pinyin"
                             :class="[
                               pItem.className ? pItem.className : '',
@@ -172,7 +172,7 @@
                         </span>
                         <span class="NNPE-words-box">
                           <span
-                            v-if="curQue.pyPosition == 'top' && config.isShowPY && item.dhaspinyin"
+                            v-if="curQue.property.pinyin_position == 'top' && config.isShowPY && item.dhaspinyin"
                             class="NNPE-pinyin"
                             :class="[noFont.indexOf(item.wordsList[pIndex + 1].pinyin) > -1 ? 'noFont' : '']"
                             @click.stop="
@@ -221,7 +221,7 @@
                             }}</span
                           >
                           <span
-                            v-if="curQue.pyPosition == 'bottom' && config.isShowPY && item.dhaspinyin"
+                            v-if="curQue.property.pinyin_position == 'bottom' && config.isShowPY && item.dhaspinyin"
                             class="NNPE-pinyin"
                             :class="[noFont.indexOf(item.wordsList[pIndex + 1].pinyin) > -1 ? 'noFont' : '']"
                             @click.stop="
@@ -247,7 +247,7 @@
                           "
                         >
                           <span
-                            v-if="curQue.pyPosition == 'top' && config.isShowPY && item.dhaspinyin"
+                            v-if="curQue.property.pinyin_position == 'top' && config.isShowPY && item.dhaspinyin"
                             :class="[
                               'NNPE-pinyin',
                               noFont.indexOf(item.wordsList[pIndex + 2].pinyin) > -1 ? 'noFont' : '',
@@ -297,7 +297,7 @@
                             }}</span
                           >
                           <span
-                            v-if="curQue.pyPosition == 'bottom' && config.isShowPY && item.dhaspinyin"
+                            v-if="curQue.property.pinyin_position == 'bottom' && config.isShowPY && item.dhaspinyin"
                             :class="[
                               'NNPE-pinyin',
                               noFont.indexOf(item.wordsList[pIndex + 2].pinyin) > -1 ? 'noFont' : '',
@@ -318,7 +318,7 @@
                       </template>
                       <template v-else>
                         <span
-                          v-if="curQue.pyPosition == 'top' && config.isShowPY && item.dhaspinyin"
+                          v-if="curQue.property.pinyin_position == 'top' && config.isShowPY && item.dhaspinyin"
                           class="NNPE-pinyin"
                           :class="[
                             pItem.chs != '“' && pItem.padding ? 'padding' : '',
@@ -374,7 +374,7 @@
                           </template>
                         </span>
                         <span
-                          v-if="curQue.pyPosition == 'bottom' && config.isShowPY && item.dhaspinyin"
+                          v-if="curQue.property.pinyin_position == 'bottom' && config.isShowPY && item.dhaspinyin"
                           class="NNPE-pinyin"
                           :class="[
                             pItem.chs != '“' && pItem.padding ? 'padding' : '',
@@ -675,7 +675,6 @@ export default {
         resArr.push(paraObj);
       });
       this.resArr = resArr;
-      console.log(resArr);
 
       // 循环文章图片
       if (curQue.img_list) {

+ 43 - 42
src/views/book/courseware/preview/components/dialogue_article/PhraseModelChs.vue

@@ -80,7 +80,7 @@
                       >
                         <span class="NNPE-words-box">
                           <span
-                            v-if="curQue.pyPosition == 'top' && config.isShowPY && item.dhaspinyin"
+                            v-if="curQue.property.pinyin_position == 'top' && config.isShowPY && item.dhaspinyin"
                             class="NNPE-pinyin"
                             :class="[
                               pItem.className ? pItem.className : '',
@@ -104,7 +104,7 @@
                             >{{ NumberList.indexOf(pItem.pinyin) == -1 ? pItem.chs : '' }}</span
                           >
                           <span
-                            v-if="curQue.pyPosition == 'bottom' && config.isShowPY && item.dhaspinyin"
+                            v-if="curQue.property.pinyin_position == 'bottom' && config.isShowPY && item.dhaspinyin"
                             class="NNPE-pinyin"
                             :class="[
                               pItem.className ? pItem.className : '',
@@ -116,7 +116,7 @@
                         </span>
                         <span class="NNPE-words-box">
                           <span
-                            v-if="curQue.pyPosition == 'top' && config.isShowPY && item.dhaspinyin"
+                            v-if="curQue.property.pinyin_position == 'top' && config.isShowPY && item.dhaspinyin"
                             class="NNPE-pinyin"
                             style="text-align: left"
                             :class="[noFont.indexOf(item.wordsList[pIndex + 1].pinyin) > -1 ? 'noFont' : '']"
@@ -146,7 +146,7 @@
                             }}</span
                           >
                           <span
-                            v-if="curQue.pyPosition == 'bottom' && config.isShowPY && item.dhaspinyin"
+                            v-if="curQue.property.pinyin_position == 'bottom' && config.isShowPY && item.dhaspinyin"
                             class="NNPE-pinyin"
                             :class="[noFont.indexOf(item.wordsList[pIndex + 1].pinyin) > -1 ? 'noFont' : '']"
                             @click.stop="viewNotes($event, item.wordsList[pIndex + 1].pinyin)"
@@ -164,7 +164,7 @@
                           "
                         >
                           <span
-                            v-if="curQue.pyPosition == 'top' && config.isShowPY && item.dhaspinyin"
+                            v-if="curQue.property.pinyin_position == 'top' && config.isShowPY && item.dhaspinyin"
                             :class="[
                               'NNPE-pinyin',
                               noFont.indexOf(item.wordsList[pIndex + 2].pinyin) > -1 ? 'noFont' : '',
@@ -205,7 +205,7 @@
                             }}</span
                           >
                           <span
-                            v-if="curQue.pyPosition == 'bottom' && config.isShowPY && item.dhaspinyin"
+                            v-if="curQue.property.pinyin_position == 'bottom' && config.isShowPY && item.dhaspinyin"
                             :class="[
                               'NNPE-pinyin',
                               noFont.indexOf(item.wordsList[pIndex + 2].pinyin) > -1 ? 'noFont' : '',
@@ -218,7 +218,7 @@
                       </template>
                       <template v-else>
                         <span
-                          v-if="curQue.pyPosition == 'top' && config.isShowPY && item.dhaspinyin"
+                          v-if="curQue.property.pinyin_position == 'top' && config.isShowPY && item.dhaspinyin"
                           class="NNPE-pinyin"
                           :class="[
                             pItem.chs != '“' && pItem.padding ? 'padding' : '',
@@ -245,7 +245,7 @@
                           >{{ NumberList.indexOf(pItem.pinyin) == -1 ? pItem.chs : '' }}</span
                         >
                         <span
-                          v-if="curQue.pyPosition == 'bottom' && config.isShowPY && item.dhaspinyin"
+                          v-if="curQue.property.pinyin_position == 'bottom' && config.isShowPY && item.dhaspinyin"
                           class="NNPE-pinyin"
                           :class="[
                             pItem.chs != '“' && pItem.padding ? 'padding' : '',
@@ -300,7 +300,7 @@
     </template>
     <template v-if="isShow">
       <div
-        ref="wordcard"
+        ref="dialogueWordcard"
         class="NNPE-wordDetail"
         :style="{
           marginLeft:
@@ -328,7 +328,7 @@
     </template>
     <template v-if="isNoteShow">
       <div
-        ref="notecard"
+        ref="dialogueNotecard"
         class="NNPE-wordDetail NNPE-noteDetail"
         :style="{
           marginLeft: windowWidth > 642 ? '-321px' : '0px',
@@ -450,7 +450,8 @@ export default {
         let _this = this;
         if (val) {
           setTimeout(() => {
-            _this.cardHeight = _this.$refs.wordcard.offsetHeight;
+            console.log(_this.$refs.dialogueWordcard);
+            _this.cardHeight = _this.$refs.dialogueWordcard.offsetHeight;
             if (_this.screenHeight - _this.clientY > _this.cardHeight) {
               _this.top = _this.clientY + 20;
             } else {
@@ -477,7 +478,7 @@ export default {
         let _this = this;
         if (val) {
           setTimeout(() => {
-            _this.cardHeight = _this.$refs.notecard.offsetHeight;
+            _this.cardHeight = _this.$refs.dialogueNotecard.offsetHeight;
             if (_this.screenHeight - _this.clientY > _this.cardHeight) {
               _this.top = _this.clientY + 20;
             } else {
@@ -678,14 +679,14 @@ export default {
 
     handleNewword() {
       let NewWordList = [];
-      this.NNPENewWordList.forEach((item) => {
-        item.forEach((wItem) => {
-          if (wItem.new_word) {
-            NewWordList.push(wItem.new_word);
-          } else if (wItem.detail && wItem.detail.sentence) {
-            NewWordList.push(wItem.detail.sentence);
-          }
-        });
+      this.NNPENewWordList.forEach((wItem) => {
+        // item.forEach((wItem) => {
+        if (wItem.new_word) {
+          NewWordList.push(wItem.new_word);
+        } else if (wItem.detail && wItem.detail.sentence) {
+          NewWordList.push(wItem.detail.sentence);
+        }
+        // });
       });
       this.newWordList = JSON.parse(JSON.stringify(NewWordList));
     },
@@ -749,21 +750,21 @@ export default {
       this.word = null;
       for (let i = 0; i < this.NNPENewWordList.length; i++) {
         let pItem = this.NNPENewWordList[i];
-        for (let j = 0; j < pItem.length; j++) {
-          let item = pItem[j];
-          if (item.new_word.trim() == val.trim()) {
-            let wordlist = val.split('');
-            this.word = JSON.parse(
-              JSON.stringify({
-                list: wordlist,
-                detail: item,
-                top: top,
-                left: left,
-              }),
-            );
-            break;
-          }
+        // for (let j = 0; j < pItem.length; j++) {
+        let item = pItem;
+        if (item.new_word.trim() == val.trim()) {
+          let wordlist = val.split('');
+          this.word = JSON.parse(
+            JSON.stringify({
+              list: wordlist,
+              detail: item,
+              top: top,
+              left: left,
+            }),
+          );
+          break;
         }
+        // }
       }
       this.oldHz = val;
     },
@@ -772,14 +773,14 @@ export default {
       _this.clickType = 'note';
       let noteIndex = '';
       _this.wordPlayMp3 = '';
-      _this.NNPENewWordList.forEach((items) => {
-        items.forEach((itemn) => {
-          if (itemn.new_word === noteNum) {
-            _this.wordbgs = itemn.bg;
-            _this.wordeds = itemn.ed;
-            _this.wordPlayMp3 = itemn.newWordMp3;
-          }
-        });
+      _this.NNPENewWordList.forEach((itemn) => {
+        // items.forEach((itemn) => {
+        if (itemn.new_word === noteNum) {
+          _this.wordbgs = itemn.bg;
+          _this.wordeds = itemn.ed;
+          _this.wordPlayMp3 = itemn.newWordMp3;
+        }
+        // });
       });
       if (_this.NumberList.indexOf(noteNum) > -1) {
         for (let i = 0; i < _this.NumberList.length; i++) {

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

@@ -135,7 +135,7 @@
                           "
                         >
                           <span class="NNPE-words-box">
-                            <template v-if="curQue.pyPosition == 'top'">
+                            <template v-if="curQue.property.pinyin_position == 'top'">
                               <span
                                 v-if="config.isShowPY && item.dhaspinyin"
                                 class="NNPE-pinyin"
@@ -179,7 +179,7 @@
                                 >
                               </template>
                             </span>
-                            <template v-if="curQue.pyPosition == 'bottom'">
+                            <template v-if="curQue.property.pinyin_position == 'bottom'">
                               <span
                                 v-if="config.isShowPY && item.dhaspinyin"
                                 class="NNPE-pinyin"
@@ -193,7 +193,7 @@
                             </template>
                           </span>
                           <span class="NNPE-words-box">
-                            <template v-if="curQue.pyPosition == 'top'">
+                            <template v-if="curQue.property.pinyin_position == 'top'">
                               <span
                                 v-if="config.isShowPY && item.dhaspinyin"
                                 :class="[
@@ -231,7 +231,7 @@
                                 }}</span
                               >
                             </span>
-                            <template v-if="curQue.pyPosition == 'bottom'">
+                            <template v-if="curQue.property.pinyin_position == 'bottom'">
                               <span
                                 v-if="config.isShowPY && item.dhaspinyin"
                                 :class="[
@@ -252,7 +252,7 @@
                               chsFhList.indexOf(item.sentArr[pIndex + 2].chs) > -1
                             "
                           >
-                            <template v-if="curQue.pyPosition == 'top'">
+                            <template v-if="curQue.property.pinyin_position == 'top'">
                               <span
                                 v-if="config.isShowPY && item.dhaspinyin"
                                 :class="[
@@ -290,7 +290,7 @@
                                 }}</span
                               >
                             </span>
-                            <template v-if="curQue.pyPosition == 'bottom'">
+                            <template v-if="curQue.property.pinyin_position == 'bottom'">
                               <span
                                 v-if="config.isShowPY && item.dhaspinyin"
                                 :class="[
@@ -305,7 +305,7 @@
                           </span>
                         </template>
                         <template v-else>
-                          <template v-if="curQue.pyPosition == 'top'">
+                          <template v-if="curQue.property.pinyin_position == 'top'">
                             <template v-if="NumberList.indexOf(pItem.pinyin) < 0">
                               <span
                                 v-if="config.isShowPY && item.dhaspinyin"
@@ -352,7 +352,7 @@
                               >
                             </template>
                           </span>
-                          <template v-if="curQue.pyPosition == 'bottom'">
+                          <template v-if="curQue.property.pinyin_position == 'bottom'">
                             <template v-if="NumberList.indexOf(pItem.pinyin) < 0">
                               <span
                                 v-if="config.isShowPY && item.dhaspinyin"
@@ -890,14 +890,14 @@ export default {
     },
     handleNewword() {
       let NewWordList = [];
-      this.NNPENewWordList.forEach((item) => {
-        item.forEach((wItem) => {
-          if (wItem.new_word) {
-            NewWordList.push(wItem.new_word);
-          } else if (wItem.detail && wItem.detail.sentence) {
-            NewWordList.push(wItem.detail.sentence);
-          }
-        });
+      this.NNPENewWordList.forEach((wItem) => {
+        // item.forEach((wItem) => {
+        if (wItem.new_word) {
+          NewWordList.push(wItem.new_word);
+        } else if (wItem.detail && wItem.detail.sentence) {
+          NewWordList.push(wItem.detail.sentence);
+        }
+        // });
       });
       this.newWordList = JSON.parse(JSON.stringify(NewWordList));
     },
@@ -906,9 +906,6 @@ export default {
   created() {},
   //生命周期 - 挂载完成(可以访问DOM元素)
   mounted() {
-    if (this.NNPENewWordList && this.NNPENewWordList.length > 0) {
-      this.handleNewword();
-    }
     if (this.curQue) {
       this.handleData();
     }

+ 98 - 0
src/views/book/courseware/preview/components/dialogue_article/RemarkChs.vue

@@ -0,0 +1,98 @@
+<!--  -->
+<template>
+  <div
+    class="remarkChs"
+    v-if="remarkDetail && (remarkDetail.chs || remarkDetail.en || (remarkDetail.img_list && remarkDetail.img_list.length>0))"
+    :style="{top:marginTop?marginTop+'px':'0px'}"
+  >
+    <div class="remark-chs" v-if="remarkDetail.chs">{{ remarkDetail.chs }}</div>
+    <div class="remark-en" v-if="remarkDetail.en">{{ remarkDetail.en }}</div>
+    <div v-if="remarkDetail.img_list && remarkDetail.img_list.length>0" class="remark-img">
+        <el-image
+            :style="{width: remarkDetail.widthNumber ? remarkDetail.widthNumber+'px':'', height: remarkDetail.heightNumber ? remarkDetail.heightNumber+'px':''}"
+            :src="remarkDetail.img_list[0].id"
+            fit="contain"
+            :preview-src-list="[remarkDetail.img_list[0].id]"
+        ></el-image>
+    </div>
+  </div>
+</template>
+
+<script>
+export default {
+  name: "RemarkChs",
+  components: {},
+  props: ["remarkDetail","marginTop"],
+  data() {
+    return {};
+  },
+  computed: {},
+  watch: {},
+  //方法集合
+  methods: {},
+  //生命周期 - 创建完成(可以访问当前this实例)
+  created() {},
+  //生命周期 - 挂载完成(可以访问DOM元素)
+  mounted() {},
+  beforeCreate() {}, //生命周期 - 创建之前
+  beforeMount() {}, //生命周期 - 挂载之前
+  beforeUpdate() {}, //生命周期 - 更新之前
+  updated() {}, //生命周期 - 更新之后
+  beforeDestroy() {}, //生命周期 - 销毁之前
+  destroyed() {}, //生命周期 - 销毁完成
+  activated() {} //如果页面有keep-alive缓存功能,这个函数会触发
+};
+</script>
+<style lang="scss" scoped>
+//@import url(); 引入公共css类
+.remarkChs {
+  position: absolute;
+  top: 0;
+  box-sizing: border-box;
+  width: 178px;
+  border-radius: 8px;
+  box-shadow: 0 4px 8px rgba(0, 0, 0, 10%);
+
+  > .remark-chs {
+    box-sizing: border-box;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    width: 100%;
+    min-height: 34px;
+    font-size: 14px;
+    font-weight: normal;
+    line-height: 22px;
+    color: #fff;
+    text-align: center;
+    background: #988ed6;
+    border: 1px solid rgba(0, 0, 0, 10%);
+    border-radius: 8px 8px 0 0;
+  }
+
+  > .remark-en {
+    box-sizing: border-box;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    min-height: 34px;
+    font-size: 14px;
+    line-height: 22px;
+    color: #000;
+    text-align: center;
+    word-break: break-word;
+    border: 1px solid rgba(0, 0, 0, 10%);
+    border-top: 0;
+    border-radius: 0 0 8px 8px;
+  }
+
+  > .remark-img{
+    width: 100%;
+    text-align: center;
+
+    .el-image{
+        max-width: 178px;
+    }
+  }
+}
+</style>

+ 124 - 0
src/views/book/courseware/preview/components/dialogue_article/RoleChs.vue

@@ -0,0 +1,124 @@
+<!--  -->
+<template>
+  <div class="role-rItem" v-if="curRole">
+    <span v-if="curRole.color" class="adult-book-input-roleText" :style="{ background: this.curRole.color }">{{
+      curRole.name
+    }}</span>
+    <img
+      v-else-if="curRole.img_list.length > 0"
+      :src="curRole.img_list[0] && curRole.img_list[0].id"
+      class="adult-book-input-roleImg"
+    />
+    <div
+      class="adult-book-input-roleImg"
+      :class="['adult-book-input-roleImg' + curRole.simpleHead]"
+      v-else-if="curRole.simpleHead !== ''"
+    ></div>
+    <template v-if="type != 1 && curRole.detail.wordsList.length > 0">
+      <span class="pinyin" :style="{ color: wordColor }">{{ curRole.detail.wordsList | handlePinyin }}</span>
+      <span class="chs" :style="{ color: wordColor }">{{ curRole.detail.wordsList | handleChs }}</span>
+    </template>
+  </div>
+</template>
+
+<script>
+export default {
+  components: {},
+  props: ['curRole', 'color', 'type'],
+  filters: {
+    handlePinyin(wordsList) {
+      let str = '';
+      wordsList.forEach((item, index) => {
+        if (index < wordsList.length - 1) {
+          str += item.pinyin + ' ';
+        } else {
+          str += item.pinyin;
+        }
+      });
+      return str;
+    },
+    handleChs(wordsList) {
+      let str = '';
+      wordsList.forEach((item, index) => {
+        if (index < wordsList.length - 1) {
+          str += item.chs + ' ';
+        } else {
+          str += item.chs;
+        }
+      });
+      return str;
+    },
+  },
+  data() {
+    return {};
+  },
+  computed: {
+    wordColor: function () {
+      let color = 'rgba(0,0,0,0.85)';
+      if (this.color) {
+        color = this.color;
+      }
+      return color;
+    },
+  },
+  watch: {},
+  //方法集合
+  methods: {},
+  //生命周期 - 创建完成(可以访问当前this实例)
+  created() {},
+  //生命周期 - 挂载完成(可以访问DOM元素)
+  mounted() {},
+  beforeCreate() {}, //生命周期 - 创建之前
+  beforeMount() {}, //生命周期 - 挂载之前
+  beforeUpdate() {}, //生命周期 - 更新之前
+  updated() {}, //生命周期 - 更新之后
+  beforeDestroy() {}, //生命周期 - 销毁之前
+  destroyed() {}, //生命周期 - 销毁完成
+  activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
+};
+</script>
+<style lang="scss" scoped>
+//@import url(); 引入公共css类
+.role-rItem {
+  display: flex;
+  align-items: center;
+  justify-content: flex-start;
+
+  .adult-book-input {
+    &-roleText {
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      width: 36px;
+      height: 36px;
+      font-size: 12px;
+      line-height: 20px;
+      color: #fff;
+      text-align: center;
+      background: #a7a7a7;
+      border-radius: 100%;
+    }
+
+    &-roleImg {
+      width: 36px;
+      height: 36px;
+    }
+  }
+
+  .pinyin {
+    margin-right: 4px;
+    margin-left: 8px;
+    font-family: 'GB-PINYINOK-B';
+    font-size: 14px;
+    line-height: 22px;
+    color: rgba(0, 0, 0, 85%);
+  }
+
+  .chs {
+    font-family: 'FZJCGFKTK';
+    font-size: 16px;
+    line-height: 24px;
+    color: rgba(0, 0, 0, 85%);
+  }
+}
+</style>

+ 13 - 15
src/views/book/courseware/preview/components/dialogue_article/WordModelChs.vue

@@ -79,7 +79,7 @@
                       >
                         <span class="NNPE-words-box" @click="showWordDetail($event, pItem)">
                           <span
-                            v-if="curQue.pyPosition == 'top' && config.isShowPY && item.dhaspinyin"
+                            v-if="curQue.property.pinyin_position == 'top' && config.isShowPY && item.dhaspinyin"
                             class="NNPE-pinyin"
                             :class="[
                               pItem.className ? pItem.className : '',
@@ -105,7 +105,7 @@
                             >{{ NumberList.indexOf(pItem.pinyin) == -1 ? pItem.chs : '' }}</span
                           >
                           <span
-                            v-if="curQue.pyPosition == 'bottom' && config.isShowPY && item.dhaspinyin"
+                            v-if="curQue.property.pinyin_position == 'bottom' && config.isShowPY && item.dhaspinyin"
                             class="NNPE-pinyin"
                             :class="[
                               pItem.className ? pItem.className : '',
@@ -116,7 +116,7 @@
                         </span>
                         <span class="NNPE-words-box" @click="showWordDetail($event, item.wordsList[pIndex + 1])">
                           <span
-                            v-if="curQue.pyPosition == 'top' && config.isShowPY && item.dhaspinyin"
+                            v-if="curQue.property.pinyin_position == 'top' && config.isShowPY && item.dhaspinyin"
                             class="NNPE-pinyin"
                             :class="[noFont.indexOf(item.wordsList[pIndex + 1].pinyin) > -1 ? 'noFont' : '']"
                             style="text-align: left"
@@ -137,7 +137,7 @@
                             }}</span
                           >
                           <span
-                            v-if="curQue.pyPosition == 'bottom' && config.isShowPY && item.dhaspinyin"
+                            v-if="curQue.property.pinyin_position == 'bottom' && config.isShowPY && item.dhaspinyin"
                             class="NNPE-pinyin"
                             :class="[noFont.indexOf(item.wordsList[pIndex + 1].pinyin) > -1 ? 'noFont' : '']"
                             style="text-align: left"
@@ -154,7 +154,7 @@
                           @click="showWordDetail($event, item.wordsList[pIndex + 2])"
                         >
                           <span
-                            v-if="curQue.pyPosition == 'top' && config.isShowPY && item.dhaspinyin"
+                            v-if="curQue.property.pinyin_position == 'top' && config.isShowPY && item.dhaspinyin"
                             :class="[
                               'NNPE-pinyin',
                               noFont.indexOf(item.wordsList[pIndex + 2].pinyin) > -1 ? 'noFont' : '',
@@ -187,7 +187,7 @@
                             }}</span
                           >
                           <span
-                            v-if="curQue.pyPosition == 'bottom' && config.isShowPY && item.dhaspinyin"
+                            v-if="curQue.property.pinyin_position == 'bottom' && config.isShowPY && item.dhaspinyin"
                             :class="[
                               'NNPE-pinyin',
                               noFont.indexOf(item.wordsList[pIndex + 2].pinyin) > -1 ? 'noFont' : '',
@@ -199,7 +199,7 @@
                       </template>
                       <template v-else>
                         <span
-                          v-if="curQue.pyPosition == 'top' && config.isShowPY && item.dhaspinyin"
+                          v-if="curQue.property.pinyin_position == 'top' && config.isShowPY && item.dhaspinyin"
                           class="NNPE-pinyin"
                           :class="[
                             pItem.chs != '“' && pItem.padding ? 'padding' : '',
@@ -227,7 +227,7 @@
                           >{{ NumberList.indexOf(pItem.pinyin) == -1 ? pItem.chs : '' }}</span
                         >
                         <span
-                          v-if="curQue.pyPosition == 'bottom' && config.isShowPY && item.dhaspinyin"
+                          v-if="curQue.property.pinyin_position == 'bottom' && config.isShowPY && item.dhaspinyin"
                           class="NNPE-pinyin"
                           :class="[
                             pItem.chs != '“' && pItem.padding ? 'padding' : '',
@@ -683,10 +683,10 @@ export default {
     },
     handleNewword() {
       let NewWordList = [];
-      this.NNPENewWordList.forEach((item) => {
-        item.forEach((wItem) => {
-          NewWordList.push(wItem.new_word);
-        });
+      this.NNPENewWordList.forEach((wItem) => {
+        // item.forEach((wItem) => {
+        NewWordList.push(wItem.new_word);
+        // });
       });
       this.newWordList = JSON.parse(JSON.stringify(NewWordList));
     },
@@ -765,9 +765,7 @@ export default {
     if (this.curQue) {
       this.handleData();
     }
-    if (this.NNPENewWordList && this.NNPENewWordList.length > 0) {
-      this.handleNewword();
-    }
+
     window.addEventListener('resize', this.getScreenHeight);
     this.getScreenHeight();
   },

+ 13 - 11
src/views/book/courseware/preview/components/dialogue_article/index.vue

@@ -244,6 +244,9 @@ export default {
         },
         writeModel: {}, //生词/取词模式
         practiceModel: {}, //练习模式
+        wordModel: {
+          recordList: [],
+        },
       },
       tokenData: getToken(),
       mathNum: Math.random().toString(36).substr(2),
@@ -378,7 +381,6 @@ export default {
       }
     },
     handleData() {
-      console.log(this.data);
       let userAnswer = JSON.parse(JSON.stringify(this.userAnswer));
       this.$set(this.data, 'Bookanswer', userAnswer);
       if (this.data.mp3_list && this.data.mp3_list.length > 0) {
@@ -387,8 +389,8 @@ export default {
         });
       }
       this.NNPENewWordList = this.data.new_word_list_other_component_input
-        .concat(this.data.new_word_list.new_word_list)
-        .concat(this.data.other_word_list.new_word_list);
+        ? this.data.new_word_list_other_component_input
+        : [].concat(this.data.new_word_list.new_word_list).concat(this.data.other_word_list.new_word_list);
       this.NNPEAnnotationList = this.data.notes_list.option;
       let resArr = [],
         sentArrTotal = [],
@@ -534,14 +536,14 @@ export default {
     },
     handleNewword() {
       let NewWordList = [];
-      this.NNPENewWordList.forEach((item) => {
-        item.forEach((wItem) => {
-          if (wItem.new_word) {
-            NewWordList.push(wItem.new_word);
-          } else if (wItem.detail && wItem.detail.sentence) {
-            NewWordList.push(wItem.detail.sentence);
-          }
-        });
+      this.NNPENewWordList.forEach((wItem) => {
+        // item.forEach((wItem) => {
+        if (wItem.new_word) {
+          NewWordList.push(wItem.new_word);
+        } else if (wItem.detail && wItem.detail.sentence) {
+          NewWordList.push(wItem.detail.sentence);
+        }
+        // });
       });
       this.newWordList = JSON.parse(JSON.stringify(NewWordList));
     },