Przeglądaj źródła

生词模板每行添加录音

natasha 1 rok temu
rodzic
commit
7bc7b2229a

BIN
src/assets/NPC/detail-icon.png


+ 1 - 1
src/components/Adult/Preview.vue

@@ -1142,7 +1142,7 @@ export default {
                     this.previewGroupId.indexOf(item.group_id[0]) > -1)||
                     !this.previewType
                 ) {
-                    if(itemss.type!='article_nnpe'&&itemss.type!='dialogue_article_chs'&&itemss.type!='notes_chs'&&itemss.type!='NewWord_chs'&&itemss.type!='voice_matrix'&&itemss.type!='upload_control_chs'&&itemss.type!='upload_control_preview_chs'&&itemss.type!='record_control_mini'&&itemss.type!='record_control_normal'&&itemss.type!='record_control_pro'&&itemss.type!='record_control_promax'&&itemss.type!='text_problem_chs'&&itemss.type!='newWord_preview_chs'&&itemss.type!='CourseStart_chs'&&itemss.type!='tinydemo_chs'&&itemss.type!='video_chs'&&itemss.type!='play_record_chs'&&itemss.type!='upload_pdf_chs'&&itemss.type!='options_list_chs'&&itemss.type!='sentence_listen_read_chs'&&itemss.type!='imgage_image'){
+                    if(itemss.type!='article_nnpe'&&itemss.type!='dialogue_article_chs'&&itemss.type!='notes_chs'&&itemss.type!='voice_matrix'&&itemss.type!='upload_control_chs'&&itemss.type!='upload_control_preview_chs'&&itemss.type!='record_control_mini'&&itemss.type!='record_control_normal'&&itemss.type!='record_control_pro'&&itemss.type!='record_control_promax'&&itemss.type!='text_problem_chs'&&itemss.type!='newWord_preview_chs'&&itemss.type!='CourseStart_chs'&&itemss.type!='tinydemo_chs'&&itemss.type!='video_chs'&&itemss.type!='play_record_chs'&&itemss.type!='upload_pdf_chs'&&itemss.type!='options_list_chs'&&itemss.type!='sentence_listen_read_chs'&&itemss.type!='imgage_image'){
                         item.showSubmit = true
                     }
                 } 

+ 16 - 5
src/components/Adult/preview/Soundrecord.vue

@@ -141,6 +141,8 @@ export default {
     "answerRecordList",
     "TaskModel",
     "sentIndex",
+    "modelType",
+    "tmsIndex"
   ],
   data() {
     return {
@@ -276,11 +278,20 @@ export default {
             _this.recordList[_this.selectIndex].fileSize = fileSize;
             _this.wavblob = _this.recordList[_this.selectIndex].wavData;
             _this.$emit("getWavblob", _this.wavblob);
-            _this.$emit(
-              "handleWav",
-              JSON.parse(JSON.stringify(_this.recordList)),
-              _this.tmIndex
-            );
+            if(_this.modelType&&_this.modelType==='NewWord_chs'){
+                _this.$emit(
+                    "handleWav",
+                    JSON.parse(JSON.stringify(_this.recordList)),
+                    _this.tmIndex,
+                    _this.tmsIndex
+                );
+            }else{
+                _this.$emit(
+                    "handleWav",
+                    JSON.parse(JSON.stringify(_this.recordList)),
+                    _this.tmIndex
+                );
+            }
             if (this.recordList[this.selectIndex].selectData) {
               this.$emit(
                 "getSelectData",

+ 38 - 2
src/components/Adult/preview/WordPhrase.vue

@@ -204,6 +204,23 @@
                   v-html="sItem.def_str"
                 ></span>
               </template>
+              <span v-if="curQue.type == 'NewWord_chs'">
+                <Soundrecord
+                    :tmIndex="index"
+                    :tmsIndex="sIndex"
+                    :TaskModel="TaskModel"
+                    @handleWav="handleWav"
+                    :modelType="curQue.type"
+                    :answerRecordList="
+                        judgeAnswer != 'standardAnswer'
+                        ? curQue.Bookanswer[index][sIndex].recordList
+                        : []
+                    "
+                    type="mini"
+                    class="luyin-box-wordphrase"
+                    :style="{ marginLeft: '8px' }"
+                />
+              </span>
               <span v-if="curQue.isInfor">
                 <img
                   src="../../../assets/NPC/detail-icon.png"
@@ -237,13 +254,15 @@
 //例如:import 《组件名称》from ‘《组件路径》';
 import WordPhraseDetail from "./components/WordPhraseDetail.vue";
 import AudioLine from "../preview/AudioLine.vue";
+import Soundrecord from "../preview/Soundrecord.vue"; // 录音模板
 export default {
   //import引入的组件需要注入到对象中才能使用
   components: {
     WordPhraseDetail,
     AudioLine,
+    Soundrecord
   },
-  props: ["curQue", "themeColor", "currentTreeID", "indexs", "indexss","indexStr"],
+  props: ["curQue", "themeColor", "currentTreeID", "indexs", "indexss","indexStr", "TaskModel", "judgeAnswer"],
   data() {
     //这里存放数据
     return {
@@ -437,8 +456,10 @@ export default {
         let optionRes = [];
         let mp3List = [];
         let itemNumber = 0;
+        let Bookanswer = []
         this.curQue.option.forEach((item, index) => {
           optionRes = optionRes.concat(item);
+          Bookanswer.push([])
           item.forEach((sItem, sIndex) => {
             sItem.mIndex = sIndex;
             sItem.sIndex = resIndex;
@@ -455,10 +476,16 @@ export default {
               sItem.ed = _this.curQue.wordTime[itemNumber].ed;
             }
             itemNumber++;
+            Bookanswer[index].push({
+                recordList: []
+            })
           });
         });
         this.optionRes = JSON.parse(JSON.stringify(optionRes));
         this.mp3List = mp3List;
+        if (!this.curQue.Bookanswer) {
+            this.$set(this.curQue, "Bookanswer", Bookanswer);
+        }
       }
     },
     handleChangeTab() {
@@ -481,6 +508,11 @@ export default {
     emptyEd() {
       this.ed = null;
     },
+    handleWav(list, tmIndex, tmsIndex) {
+      tmIndex = tmIndex ? tmIndex : 0;
+      tmsIndex = tmsIndex ? tmsIndex : 0
+      this.$set(this.curQue.Bookanswer[tmIndex][tmsIndex], "recordList", list);
+    },
   },
   //生命周期 - 创建完成(可以访问当前this实例)
   created() {
@@ -690,10 +722,11 @@ export default {
     border-radius: 0 0 8px 8px;
   }
   .detail-icon {
-    width: 56px;
+    width: 24px;
     height: 24px;
     display: block;
     cursor: pointer;
+    opacity: 0.5;
   }
   .play-btn {
     margin-top: 4px;
@@ -748,6 +781,9 @@ export default {
     transform: rotateZ(0deg);
   }
 }
+.luyin-box-wordphrase{
+    height: 24px;
+}
 </style>
 <style lang="scss">
 .NPC-zhedie {