diff --git a/dist.rar b/dist.rar index 54fa7da..c6759bc 100644 Binary files a/dist.rar and b/dist.rar differ diff --git a/src/App.vue b/src/App.vue index d0d328d..11fd669 100644 --- a/src/App.vue +++ b/src/App.vue @@ -4,6 +4,7 @@ import { nextTick, onMounted, ref } from "vue" import { getQrcode, getList, monitorState, Generate, monitorMusic, getDetails, lyricsGenerateHttp, lyricsMonitorHttp, quitLoginHttp, likeDetailsHttp } from "./utils/api" import { ElMessage } from "element-plus" +import triangleIcon from "@/components/triangle-icon.vue" onMounted(() => { // getLoginQrcode() @@ -22,14 +23,18 @@ const getListData = () => { if (res.code != 200) return const data = res.data || [] - + let isNeedMonitor = false data.forEach(element => { - // console.log("element", element.metadataid) + if (element.status != "complete") { + isNeedMonitor = true + } }) - // console.log(data[0]) + if (isNeedMonitor) { + monitorMusicState() + } - // data[0].audio_url = "./b91dc2e6-120b-4979-9007-347d74a01561.mp3" + // data[0].audio_url = "./21be5d73-221f-4e7b-82f0-26c7c71b797e.mp3" islogin.value = true list.value = data || [] @@ -189,7 +194,7 @@ const handleMusicList = index => { listIndex.value = index // console.log(target.metadataid) - if (target.status !== "complete" && target.metadataid) { + if (target.status !== "complete") { monitorMusicState(target.metadataid || "没有metadataid") } getMusicDetails(target.id) @@ -268,10 +273,12 @@ const getMusicDetails = id => { const audio = ref(null) const isPlaying = ref(false) +let audioSrc = ref("") let previewState = ref(false) const closeInfo = () => { - previewState.value = false + // previewState.value = false + songInfo.value = {} } const playAudio = index => { @@ -280,10 +287,13 @@ const playAudio = index => { } let targetlist = list.value || [] let target = targetlist[index] || {} - audio.value.src = target.audio_url || "" + const url = target.audio_url || "" + if (audioSrc.value != url) { + audio.value.src = url + currentTime.value = 0 + } audio.value.play() listIndex.value = index - currentTime.value = 0 } const togglePlayPause = () => { @@ -296,6 +306,7 @@ const togglePlayPause = () => { const updatePlayStatus = () => { isPlaying.value = !audio.value.paused + audioSrc.value = audio.value.src || "" } const pauseAudio = () => { @@ -310,6 +321,7 @@ const nextAudio = () => { let target = targetlist[index] audio.value.src = target.audio_url audio.value.play() + listIndex.value = index } @@ -352,6 +364,7 @@ const seekAudio = value => { } const formatTime = time => { + if (isNaN(time)) return "0:00" if (time == Infinity) { return "-- : --" } @@ -490,6 +503,9 @@ const handlelike = index => {
+ + + @@ -536,7 +552,7 @@ const handlelike = index => {
- + @@ -619,7 +635,7 @@ const handlelike = index => { - +
@@ -633,13 +649,13 @@ const handlelike = index => {
- +
创作
-
+
@@ -661,14 +677,14 @@ const handlelike = index => { \ No newline at end of file