代码结构调整
parent
5422cc4024
commit
366f248b75
|
@ -5,7 +5,7 @@
|
|||
<layout-toolbar id="toolbar" />
|
||||
<div class="middle">
|
||||
<layout-view id="view" />
|
||||
<PlayListWindow v-if="isShowPlaylist" id="playlist" @close="closePlaylist" />
|
||||
<layout-play-list-window v-if="isShowPlaylist" id="playlist" @close="closePlaylist" />
|
||||
</div>
|
||||
<layout-play-bar id="player" />
|
||||
</div>
|
||||
|
@ -22,7 +22,6 @@
|
|||
<script setup>
|
||||
import { onMounted } from '@common/utils/vueTools'
|
||||
import useApp from '@renderer/core/useApp'
|
||||
import PlayListWindow from '@renderer/components/common/PlayListWindow.vue'
|
||||
import { isShowPlaylist } from '@renderer/store/player/state'
|
||||
import { setShowPlaylist } from '@renderer/store/player/action'
|
||||
|
||||
|
|
|
@ -16,7 +16,16 @@
|
|||
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
|
||||
import {
|
||||
statusText,
|
||||
musicInfo,
|
||||
isShowPlayerDetail,
|
||||
isPlay,
|
||||
playInfo,
|
||||
playMusicInfo,
|
||||
} from '@renderer/store/player/state'
|
||||
import { isPlay, playedList, playInfo, playMusicInfo, tempPlayList, musicInfo as _musicInfo } from '@renderer/store/player/state'
|
||||
import { togglePlay, playNext, playPrev } from '@renderer/core/player'
|
||||
const emit = defineEmits(['close'])
|
||||
|
||||
const songs = ref([
|
||||
|
@ -25,6 +34,32 @@ const songs = ref([
|
|||
{ title: '告白气球', artist: '周杰伦', album: '周杰伦的床边故事' },
|
||||
{ title: '平凡之路', artist: '朴树', album: '平凡之路' },
|
||||
])
|
||||
if (tempPlayList.length) { // 如果稍后播放列表存在歌曲则直接播放改列表的歌曲
|
||||
for (let music of tempPlayList) {
|
||||
songs.value.push(
|
||||
{ title: music.musicInfo.name, artist: music.musicInfo.singer, album: music.musicInfo.meta.albumName }
|
||||
)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
if (playMusicInfo.musicInfo == null) {
|
||||
handleToggleStop()
|
||||
console.log('musicInfo empty')
|
||||
return
|
||||
}
|
||||
|
||||
// console.log(playInfo.playerListId)
|
||||
const currentListId = playInfo.playerListId
|
||||
if (!currentListId) {
|
||||
handleToggleStop()
|
||||
console.log('currentListId empty')
|
||||
return
|
||||
}
|
||||
const currentList = getList(currentListId)
|
||||
songs.value.push(
|
||||
{ title: musicInfo.name, artist: musicInfo.singer, album: musicInfo.album }
|
||||
)
|
||||
|
||||
const emitClose = () => {
|
||||
emit('close')
|
Loading…
Reference in New Issue