修复歌单无法翻页Bug
parent
d4750f4c6e
commit
9564097f46
|
@ -67,7 +67,6 @@ const actions = {
|
||||||
let source = rootState.setting.songList.source
|
let source = rootState.setting.songList.source
|
||||||
let key = `${source}${id}${page}`
|
let key = `${source}${id}${page}`
|
||||||
if (state.listDetail.list.length && state.listDetail.key == key) return true
|
if (state.listDetail.list.length && state.listDetail.key == key) return true
|
||||||
commit('clearListDetail')
|
|
||||||
return music[source].songList.getListDetail(id, page).then(result => commit('setListDetail', { result, key, page }))
|
return music[source].songList.getListDetail(id, page).then(result => commit('setListDetail', { result, key, page }))
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -98,6 +97,7 @@ const mutations = {
|
||||||
state.selectListInfo = info
|
state.selectListInfo = info
|
||||||
},
|
},
|
||||||
clearListDetail(state) {
|
clearListDetail(state) {
|
||||||
|
console.log('object')
|
||||||
state.listDetail.list = []
|
state.listDetail.list = []
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -86,7 +86,6 @@ export default {
|
||||||
} else {
|
} else {
|
||||||
id = null
|
id = null
|
||||||
}
|
}
|
||||||
console.log(id, type)
|
|
||||||
this._requestObj_list = httpFatch(this.getListUrl({ sortId, id, type, page }))
|
this._requestObj_list = httpFatch(this.getListUrl({ sortId, id, type, page }))
|
||||||
return this._requestObj_list.promise.then(({ body }) => {
|
return this._requestObj_list.promise.then(({ body }) => {
|
||||||
if (!id || type == '10000') {
|
if (!id || type == '10000') {
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
p(:title="item.desc") {{item.desc}}
|
p(:title="item.desc") {{item.desc}}
|
||||||
li(:class="$style.item" style="cursor: default;" v-if="listData.list && listData.list.length && listData.list.length % 3 == 2")
|
li(:class="$style.item" style="cursor: default;" v-if="listData.list && listData.list.length && listData.list.length % 3 == 2")
|
||||||
div(:class="$style.pagination")
|
div(:class="$style.pagination")
|
||||||
material-pagination(:count="listData.total" :limit="listData.limit" :page="listData.page" @btn-click="handleTogglePage")
|
material-pagination(:count="listData.total" :limit="listData.limit" :page="listData.page" @btn-click="handleToggleListPage")
|
||||||
material-download-modal(:show="isShowDownload" :musicInfo="musicInfo" @select="handleAddDownload" @close="isShowDownload = false")
|
material-download-modal(:show="isShowDownload" :musicInfo="musicInfo" @select="handleAddDownload" @close="isShowDownload = false")
|
||||||
material-download-multiple-modal(:show="isShowDownloadMultiple" :list="selectdData" @select="handleAddDownloadMultiple" @close="isShowDownloadMultiple = false")
|
material-download-multiple-modal(:show="isShowDownloadMultiple" :list="selectdData" @select="handleAddDownloadMultiple" @close="isShowDownloadMultiple = false")
|
||||||
</template>
|
</template>
|
||||||
|
@ -118,7 +118,7 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
...mapMutations(['setSongList']),
|
...mapMutations(['setSongList']),
|
||||||
...mapActions('songList', ['getTags', 'getList', 'getListDetail']),
|
...mapActions('songList', ['getTags', 'getList', 'getListDetail']),
|
||||||
...mapMutations('songList', ['setVisibleListDetail', 'setSelectListInfo']),
|
...mapMutations('songList', ['setVisibleListDetail', 'setSelectListInfo', 'clearListDetail']),
|
||||||
...mapActions('download', ['createDownload', 'createDownloadMultiple']),
|
...mapActions('download', ['createDownload', 'createDownloadMultiple']),
|
||||||
...mapMutations('list', ['defaultListAdd', 'defaultListAddMultiple']),
|
...mapMutations('list', ['defaultListAdd', 'defaultListAddMultiple']),
|
||||||
...mapMutations('player', ['setList']),
|
...mapMutations('player', ['setList']),
|
||||||
|
@ -170,13 +170,20 @@ export default {
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleTogglePage(page) {
|
handleToggleListPage(page) {
|
||||||
this.getList(page).then(() => {
|
this.getList(page).then(() => {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
scrollTo(this.$refs.dom_scrollContent, 0)
|
scrollTo(this.$refs.dom_scrollContent, 0)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
handleToggleListDetailPage(page) {
|
||||||
|
this.getListDetail({ id: this.selectListInfo.id, page }).then(() => {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
scrollTo(this.$refs.dom_scrollContent, 0)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
handleAddDownload(type) {
|
handleAddDownload(type) {
|
||||||
this.createDownload({ musicInfo: this.musicInfo, type })
|
this.createDownload({ musicInfo: this.musicInfo, type })
|
||||||
this.isShowDownload = false
|
this.isShowDownload = false
|
||||||
|
@ -194,7 +201,10 @@ export default {
|
||||||
handleItemClick(index) {
|
handleItemClick(index) {
|
||||||
this.setSelectListInfo(this.listData.list[index])
|
this.setSelectListInfo(this.listData.list[index])
|
||||||
this.setVisibleListDetail(true)
|
this.setVisibleListDetail(true)
|
||||||
this.getListDetail({ id: this.selectListInfo.id, page: 1 })
|
this.clearListDetail()
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.getListDetail({ id: this.selectListInfo.id, page: 1 })
|
||||||
|
})
|
||||||
},
|
},
|
||||||
handleFlowBtnClick(action) {
|
handleFlowBtnClick(action) {
|
||||||
switch (action) {
|
switch (action) {
|
||||||
|
@ -215,7 +225,7 @@ export default {
|
||||||
case 'listBtnClick':
|
case 'listBtnClick':
|
||||||
return this.handleListBtnClick(data)
|
return this.handleListBtnClick(data)
|
||||||
case 'togglePage':
|
case 'togglePage':
|
||||||
return this.handleTogglePage(data)
|
return this.handleToggleListDetailPage(data)
|
||||||
case 'flowBtnClick':
|
case 'flowBtnClick':
|
||||||
return this.handleFlowBtnClick(data)
|
return this.handleFlowBtnClick(data)
|
||||||
case 'testPlay':
|
case 'testPlay':
|
||||||
|
|
Loading…
Reference in New Issue