update domain

This commit is contained in:
2023-10-22 12:55:58 +08:00
parent 0b971bf4d4
commit 9301dcc0aa
3 changed files with 9 additions and 3 deletions

View File

@@ -231,6 +231,7 @@ function createColumns(): DataTableColumns<SongsInfo> {
type: 'primary',
size: 'small',
circle: true,
loading: isLrcLoading.value == data.key,
onClick: () => OnPlayMusic(data),
},
{
@@ -306,7 +307,9 @@ function OnPlayMusic(song: SongsInfo) {
}
}
}
const isLrcLoading = ref('')
async function GetLyric(song: SongsInfo) {
isLrcLoading.value = song.key
QueryGetAPI<{ lyric: string; tlyric: string }>(SONG_API_URL + 'get-netease-lyric', { id: song.id })
.then((data) => {
console.log(mergeLyrics(data.data.lyric, data.data.tlyric))
@@ -329,6 +332,9 @@ async function GetLyric(song: SongsInfo) {
lrc: '',
}
})
.finally(() => {
isLrcLoading.value = ''
})
}
function mergeLyrics(originalLyrics: string, translatedLyrics: string): string {
const originalLines = originalLyrics.split('\n')
@@ -494,7 +500,7 @@ onMounted(() => {
<NDivider style="margin: 5px 0 5px 0"> {{ songsComputed.length }} </NDivider>
<Transition>
<div v-if="aplayerMusic" class="song-list">
<APlayer :music="aplayerMusic" autoplay :showLrc="aplayerMusic.lrc != null && aplayerMusic.lrc.length > 0"/>
<APlayer :music="aplayerMusic" autoplay :showLrc="aplayerMusic.lrc != null && aplayerMusic.lrc.length > 0" />
<NDivider style="margin: 15px 0 15px 0" />
</div>
</Transition>