fix: When there is only a voice file in the answer, an error is reported when reading it aloud.
--bug=1051784 --user=刘瑞斌 【应用编排】回答中只有语音文件的时候,朗读报错 https://www.tapd.cn/57709429/s/1649307
This commit is contained in:
parent
05d06fae11
commit
e9eb7a847e
@ -79,7 +79,7 @@
|
|||||||
<audio ref="audioPlayer" v-for="item in audioList" :key="item" controls hidden="hidden"></audio>
|
<audio ref="audioPlayer" v-for="item in audioList" :key="item" controls hidden="hidden"></audio>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { onMounted, ref } from 'vue'
|
import { nextTick, onMounted, ref } from 'vue'
|
||||||
import { useRoute } from 'vue-router'
|
import { useRoute } from 'vue-router'
|
||||||
import { copyClick } from '@/utils/clipboard'
|
import { copyClick } from '@/utils/clipboard'
|
||||||
import applicationApi from '@/api/application'
|
import applicationApi from '@/api/application'
|
||||||
@ -173,8 +173,11 @@ const playAnswerText = (text: string) => {
|
|||||||
// console.log(text)
|
// console.log(text)
|
||||||
audioPlayerStatus.value = true
|
audioPlayerStatus.value = true
|
||||||
// 分割成多份
|
// 分割成多份
|
||||||
audioList.value = text.split(/(<audio[^>]*><\/audio>)/)
|
audioList.value = text.split(/(<audio[^>]*><\/audio>)/).filter((item) => item.trim().length > 0)
|
||||||
|
nextTick(()=>{
|
||||||
|
// console.log(audioList.value, audioPlayer.value)
|
||||||
playAnswerTextPart()
|
playAnswerTextPart()
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const playAnswerTextPart = () => {
|
const playAnswerTextPart = () => {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user