@@ -64,7 +64,7 @@ div(:class="$style.player")
6464 //- transition(enter-active-class="animated lightSpeedIn"
6565 transition( enter-active-class ="animated lightSpeedIn"
6666 leave-active-class ="animated slideOutDown" )
67- core-player-detail( v-show ="isShowPlayerDetail" : visible .sync = "isShowPlayerDetail" : musicInfo= "currentMusicInfo"
67+ core-player-detail( v-if ="isShowPlayerDetail" : visible .sync = "isShowPlayerDetail" : musicInfo= "currentMusicInfo"
6868 :lyric ="lyric" : list= "list" : listId= "listId"
6969 :playInfo ="{ nowPlayTimeStr, maxPlayTimeStr, progress, nowPlayTime, status }"
7070 :isPlay ="isPlay" @action ="handlePlayDetailAction"
@@ -505,8 +505,6 @@ export default {
505505 this .musicInfo .album = targetSong .albumName
506506 audio .src = filePath
507507 // console.log(filePath)
508- this .setImg (targetSong)
509- this .setLrc (targetSong)
510508 } else {
511509 // if (!this.assertApiSupport(targetSong.source)) return this.playNext()
512510 this .currentMusicInfo = targetSong
@@ -515,9 +513,9 @@ export default {
515513 this .musicInfo .name = targetSong .name
516514 this .musicInfo .album = targetSong .albumName
517515 this .setUrl (targetSong)
518- this .setImg (targetSong)
519- this .setLrc (targetSong)
520516 }
517+ this .setImg (targetSong)
518+ this .setLrc (targetSong)
521519 this .handleUpdateWinLyricInfo (' music_info' , {
522520 songmid: this .musicInfo .songmid ,
523521 singer: this .musicInfo .singer ,
@@ -595,11 +593,25 @@ export default {
595593 window .getComputedStyle (this .$refs .dom_progress , null ).width ,
596594 )
597595 },
598- togglePlay () {
596+ async togglePlay () {
599597 if (! audio .src ) {
600598 if (this .restorePlayTime != null ) {
601- // if (!this.assertApiSupport(this.targetSong.source)) return this.playNext()
602- this .setUrl (this .targetSong )
599+ if (this .listId == ' download' ) {
600+ const filePath = path .join (this .setting .download .savePath , this .targetSong .fileName )
601+ // console.log(filePath)
602+ if (! await checkPath (filePath) || ! this .targetSong .isComplate || / \. ape$ / .test (filePath)) {
603+ if (this .list .length == 1 ) {
604+ this .handleRemoveMusic ()
605+ } else {
606+ this .playNext ()
607+ }
608+ return
609+ }
610+ audio .src = filePath
611+ } else {
612+ // if (!this.assertApiSupport(this.targetSong.source)) return this.playNext()
613+ this .setUrl (this .targetSong )
614+ }
603615 }
604616 return
605617 }
@@ -919,8 +931,18 @@ export default {
919931 if (! this .musicInfo .songmid ) return
920932 this .isShowAddMusicTo = true
921933 },
922- handleRestorePlay (restorePlayInfo ) {
923- let musicInfo = this .list [restorePlayInfo .index ]
934+ async handleRestorePlay (restorePlayInfo ) {
935+ let musicInfo
936+
937+ if (this .listId == ' download' ) {
938+ this .currentMusicInfo = musicInfo = window .downloadListFullMap .get (this .list [restorePlayInfo .index ].key ).musicInfo
939+ // console.log(filePath)
940+ } else {
941+ // if (!this.assertApiSupport(targetSong.source)) return this.playNext()
942+ musicInfo = this .list [restorePlayInfo .index ]
943+ this .currentMusicInfo = musicInfo
944+ }
945+
924946 this .musicInfo .songmid = musicInfo .songmid
925947 this .musicInfo .singer = musicInfo .singer
926948 this .musicInfo .name = musicInfo .name
0 commit comments