Bläddra i källkod

连线添加音频功能

lvmax 3 månader sedan
förälder
incheckning
5e3d7a3da4
1 ändrade filer med 3 tillägg och 4 borttagningar
  1. 3 4
      src/views/buss/exam/question/QuestionFormPage.vue

+ 3 - 4
src/views/buss/exam/question/QuestionFormPage.vue

@@ -585,10 +585,9 @@ function addConnectionRow(value) {
 </div>`
           } else if (file.type === 'audio/mpeg') {
             option.innerHTML += `<div id="option${index + "-" + (option.children.length + 1)}" style="width: 90px;height: 90px;overflow: hidden;background-color: #0a9fe5;margin: auto;margin-bottom: 10px">
-
-<audio id="myAudio" style="width: 290px;height:50px;position: relative;left: -120px" src="${url}"  controls="false"></audio>
-        <button onclick="document.getElementById('myAudio').play();">开始</button>
-        <button onclick="document.getElementById('myAudio').pause();">暂停</button>
+<audio id="option${index + "-" + (option.children.length + 1)+'1'}" style="width: 320px;height:50px;position: relative;left: -130px" src="${url}"  controls="false"></audio>
+        <button onclick="document.getElementById('option${index + "-" + (option.children.length + 1)+'1'}').play();">开始</button>
+        <button onclick="document.getElementById('option${index + "-" + (option.children.length + 1)+'1'}').pause();">暂停</button>
 </div>`
           }