Commit ae9e4f73 by haojie

没有音色的问题

parent d9eb9ee6
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { show_message } from '@/utils/tool';
import { ref, onBeforeMount, onBeforeUnmount, computed, watch } from 'vue'; import { ref, onBeforeMount, onBeforeUnmount, computed, watch } from 'vue';
const props = withDefaults( const props = withDefaults(
defineProps<{ defineProps<{
...@@ -167,7 +168,10 @@ const UpdateAudio = async () => { ...@@ -167,7 +168,10 @@ const UpdateAudio = async () => {
const onStartPlay = async () => { const onStartPlay = async () => {
// 音频播放完后,重新播放 // 音频播放完后,重新播放
// if (playProgress.value === 100) audioRef.value.currentTime = 0; // if (playProgress.value === 100) audioRef.value.currentTime = 0;
if (!props.url) {
show_message('没有音频');
return;
}
await audioRef.value.play(); await audioRef.value.play();
// //
emit('startPlay', props.id); emit('startPlay', props.id);
......
...@@ -77,11 +77,12 @@ export const getTonesList = async (mustSuccess: boolean = true) => { ...@@ -77,11 +77,12 @@ export const getTonesList = async (mustSuccess: boolean = true) => {
item.img = item.icon; item.img = item.icon;
item.c_name = item.name; item.c_name = item.name;
item.c_categorie = item.extend?.voice; item.c_categorie = item.extend?.voice;
item.audio_url = item.audio_url ? item.audio_url : '';
}); });
obj.tones = res.data.filter((item: any) => item.type == typeTones); obj.tones = res.data.filter((item: any) => item.type == typeTones);
obj.soundColor = res.data.filter((item: any) => { obj.soundColor = res.data.filter((item: any) => {
if (item.type == typeSoundColor) { if (item.type == typeSoundColor) {
if (item.status != LIVE_AUDIT_STATUS.LIVE_AUDIT_STATUS_FINISH && mustSuccess) { if ((!item.status || item.audit_status != LIVE_AUDIT_STATUS.LIVE_AUDIT_STATUS_FINISH) && mustSuccess) {
return; return;
} }
return item; return item;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment