natasha 3 years ago
parent
commit
bcc91e147a
1 changed files with 12 additions and 3 deletions
  1. 12 3
      src/components/Adult/preview/TextInputRecord.vue

+ 12 - 3
src/components/Adult/preview/TextInputRecord.vue

@@ -4,6 +4,10 @@
     <h2 v-if="curQue.title">{{curQue.title}}</h2>
     <ul>
       <li v-for="(items, indexs) in curQue.option" :key="indexs">
+          <Audio
+                :mp3="items.mp3_list.length > 0 ? items.mp3_list[0].url : ''"
+                class="audio-play"
+            />
           <b v-if="items.number">{{ items.number }}.</b>
           <span class="item-con">{{items.con}}</span>
           <input
@@ -22,8 +26,9 @@
 
 <script>
 import Soundrecord from "../preview/Soundrecord.vue"; // 录音模板
+import Audio from "../preview/components/AudioRed.vue"; // 音频播放
 export default {
-  components: {Soundrecord},
+  components: {Soundrecord,Audio},
   props: ["curQue"],
   data() {
     return {
@@ -39,13 +44,13 @@ export default {
         },
         // 处理数据
         handleData(){
-            if(!this.curQue.Bookanswer){
+            // if(!this.curQue.Bookanswer){
                 let curCorrect = [];
                 this.curQue.option.forEach(item => {
                     curCorrect.push('')
                 });
                 this.$set(this.curQue, "Bookanswer", curCorrect);
-            }
+            // }
         },
         handleWav(data) {
         
@@ -94,6 +99,10 @@ export default {
             align-items: center;
             padding: 8px 8px 8px 12px;
             margin-bottom: 8px;
+            .audio-play{
+                width: 24px;
+                margin-right: 4px;
+            }
             >b{
                width: 24px;
                line-height: 24px;