Quellcode durchsuchen

对话答题-开发中

gcj vor 3 Jahren
Ursprung
Commit
9f3fed0fef

+ 4 - 0
src/components/Adult/preview/ArticleViewChs/Practicechs.vue

@@ -276,6 +276,7 @@
                   :sentPause="sentPause"
                   :isRecord="isRecord"
                   :handleChangeStopAudio="handleChangeStopAudio"
+                  :getPlayStatus="getPlayStatus"
                 />
               </div>
             </div>
@@ -382,6 +383,9 @@ export default {
   },
   //方法集合
   methods: {
+    getPlayStatus(val) {
+      //this.isPlaying = val;
+    },
     //拼音的显示和隐藏
     changePinyin() {
       if (this.config.isHasPY) {

+ 8 - 3
src/components/Adult/preview/DialogueArticleViewChs/AnswerModel.vue

@@ -95,9 +95,11 @@
                               v-model="pItem.answer"
                               class="answer-input"
                             /> -->
-                            <div class="answer-input" contenteditable="true">
-                              {{ pItem.answer }}
-                            </div>
+                            <div
+                              class="answer-input"
+                              contenteditable="true"
+                              v-html="pItem.answer"
+                            ></div>
                           </template>
                           <span
                             v-if="pyPosition == 'bottom'"
@@ -468,6 +470,7 @@ export default {
       let reg = /_{2,}/g;
       let leg = this.curQue.detail.length;
       let curQue = JSON.parse(JSON.stringify(this.curQue));
+      let hengIndex = 0;
       curQue.detail.forEach((dItem, dIndex) => {
         let isRecord = 0;
         let roleDetail = this.getRole(dItem);
@@ -495,6 +498,8 @@ export default {
               };
               if (obj.isHeng) {
                 isRecord = isRecord + 1;
+                hengIndex = hengIndex + 1;
+                obj.hengIndex = hengIndex;
                 obj.answer = "";
               }
               paraArr.push(obj);

+ 19 - 7
src/components/Adult/preview/DialogueArticleViewChs/DialogueAnswerViewChs.vue

@@ -140,6 +140,11 @@ export default {
     return {
       wordShow: true,
       noFont: ["~", "!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "/"],
+      userAnswer: {
+        recordList: [],
+        input: [],
+        judge: [],
+      },
     };
   },
   computed: {},
@@ -152,6 +157,11 @@ export default {
     handleChangeTab() {
       this.wordShow = !this.wordShow;
     },
+    initAnswer() {
+      this.curQue.list.forEach((item, index) => {
+        item.article;
+      });
+    },
   },
   //生命周期 - 创建完成(可以访问当前this实例)
   created() {},
@@ -159,14 +169,16 @@ export default {
   mounted() {
     console.log("对话答题预览");
     console.log(this.curQue);
+
     if (this.curQue) {
-      let BookAnswer = [];
-      this.curQue.list.forEach((item) => {
-        let answer = [];
-        BookAnswer.push(answer);
-      });
-      this.$set(this.curQue, "Bookanswer", BookAnswer);
-      console.log(this.curQue);
+      if (!this.curQue.Bookanswer) {
+        let BookAnswer = [];
+        this.curQue.list.forEach((item) => {
+          let userAnswer = JSON.parse(JSON.stringify(this.userAnswer));
+          BookAnswer.push(userAnswer);
+        });
+        this.$set(this.curQue, "Bookanswer", BookAnswer);
+      }
     }
   },
   beforeCreate() {}, //生命周期 - 创建之前

+ 0 - 4
src/components/Adult/preview/NewWordShow.vue

@@ -153,7 +153,6 @@ export default {
         return;
       }
       this.playStatus = true;
-      console.log(this.$refs.cans);
       let ref = null;
       this.$refs.cans.forEach((item) => {
         if (item.$el.id == `cans${rowIndex}${colIndex}`) {
@@ -211,7 +210,6 @@ export default {
           }
         });
       });
-      console.log(this.curQue.option);
     },
     // 处理数据
     handleAnswerData() {
@@ -235,7 +233,6 @@ export default {
         }
         item.imgarr = arr;
       });
-      console.log(_this.curQue.option);
     },
     changePraShow() {
       this.isPraShow = false;
@@ -299,7 +296,6 @@ export default {
           }
           writeModel[hz][colIndex] = answer;
         }
-        console.log(this.curQue.Bookanswer);
       }
     },
   },

+ 7 - 1
src/components/Adult/preview/components/FreewriteLettle.vue

@@ -231,7 +231,6 @@ export default {
   },
   //生命周期 - 创建完成(可以访问当前this实例)
   created() {
-    console.log(this.currenHzData);
     let _this = this;
     let color = _this.colorsList[_this.colorIndex];
     _this.hanzicolor = color;
@@ -567,6 +566,13 @@ export default {
           &:active {
             background: #a37557;
           }
+          &.disabled {
+            color: #fff;
+            background-color: #c8c9cc;
+            border-color: #c8c9cc;
+            cursor: not-allowed;
+            background-image: none;
+          }
         }
       }
     }