diff --git a/src/renderer/store/modules/player.js b/src/renderer/store/modules/player.js index 9ecd6291..a6e42dca 100644 --- a/src/renderer/store/modules/player.js +++ b/src/renderer/store/modules/player.js @@ -415,7 +415,7 @@ const mutations = { }, setTempPlayList(state, list) { addTempPlayList(list) - if (!playMusicInfo.musicInfo) this.commit('player/playNext') + if (!playMusicInfo.musicInfo) this.dispatch('player/playNext') }, removeTempPlayList(state, index) { removeTempPlayList(index) diff --git a/src/renderer/store/modules/songList.js b/src/renderer/store/modules/songList.js index 40fa7033..1618de75 100644 --- a/src/renderer/store/modules/songList.js +++ b/src/renderer/store/modules/songList.js @@ -81,8 +81,7 @@ const actions = { commit('clearList') return music[source].songList.getList(sortId, tabId, page).then(result => commit('setList', { result, key, page })) }, - getListDetail({ state, rootState, commit }, { id, page }) { - let source = rootState.setting.songList.source + getListDetail({ state, commit }, { id, source, page }) { let key = `sdetail__${source}__${id}__${page}` if (state.listDetail.list.length && state.listDetail.key == key) return Promise.resolve() commit('clearListDetail') diff --git a/src/renderer/views/songList/SongList.vue b/src/renderer/views/songList/SongList.vue index 65f52e8f..2cfea448 100644 --- a/src/renderer/views/songList/SongList.vue +++ b/src/renderer/views/songList/SongList.vue @@ -209,7 +209,7 @@ export default { }) }, handleToggleListDetailPage(page) { - this.handleGetListDetail(this.selectListInfo.id, page).then(() => { + this.handleGetListDetail(this.selectListInfo.id, this.selectListInfo.source, page).then(() => { this.$nextTick(() => { this.$refs.songList.scrollToTop() }) @@ -220,7 +220,7 @@ export default { this.setSelectListInfo(this.listData.list[index]) this.setVisibleListDetail(true) this.$nextTick(() => { - this.handleGetListDetail(this.selectListInfo.id, 1) + this.handleGetListDetail(this.selectListInfo.id, this.source, 1) }) }, // handleFlowBtnClick(action) { @@ -246,17 +246,18 @@ export default { handleImportSongListEvent({ action }) { switch (action) { case 'submit': - this.handleGetSongListDetail() + this.handleGetSongListDetail(this.importSongListText, this.source) break // case 'blur': // break } }, - handleGetSongListDetail() { - if (!this.importSongListText.length) return + handleGetSongListDetail(id, source) { + if (!id.length) return + console.log(id, source) this.setSelectListInfo({ play_count: null, - id: this.importSongListText, + id, author: '', name: '', img: null, @@ -264,15 +265,15 @@ export default { source: this.source, }) this.setVisibleListDetail(true) - this.handleGetListDetail(this.importSongListText, 1) + this.handleGetListDetail(id, source, 1) }, setTagListWidth() { this.isInitedTagListWidth = true this.listWidth = this.$refs.tagList.$el.clientWidth + this.$refs.tab.$el.clientWidth + 2 }, - handleGetListDetail(id, page) { + handleGetListDetail(id, source, page) { this.isGetDetailFailed = false - return this.getListDetail({ id, page }).catch(err => { + return this.getListDetail({ id, source, page }).catch(err => { this.isGetDetailFailed = true return Promise.reject(err) })