重构列表功能,使其支持多列表,新增我喜欢列表
parent
70b718d372
commit
4204b62f8f
|
@ -1,12 +0,0 @@
|
||||||
祝贺祖国成立70周年~!
|
|
||||||
|
|
||||||
#### 新增
|
|
||||||
|
|
||||||
- 新增QQ音乐源歌单
|
|
||||||
|
|
||||||
#### 修复
|
|
||||||
|
|
||||||
- 修正火影皮肤名字
|
|
||||||
- 修复当试听列表为空时,无法切到其他界面的Bug
|
|
||||||
- 修复百度源搜索结果为空时的接口处理Bug
|
|
||||||
- 恢复**酷狗**其他音质播放
|
|
|
@ -49,7 +49,7 @@ export default {
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters(['electronStore', 'setting', 'theme', 'version']),
|
...mapGetters(['electronStore', 'setting', 'theme', 'version']),
|
||||||
...mapGetters('list', ['defaultList']),
|
...mapGetters('list', ['defaultList', 'loveList']),
|
||||||
...mapGetters('download', {
|
...mapGetters('download', {
|
||||||
downloadList: 'list',
|
downloadList: 'list',
|
||||||
downloadStatus: 'downloadStatus',
|
downloadStatus: 'downloadStatus',
|
||||||
|
@ -73,6 +73,13 @@ export default {
|
||||||
},
|
},
|
||||||
deep: true,
|
deep: true,
|
||||||
},
|
},
|
||||||
|
loveList: {
|
||||||
|
handler(n) {
|
||||||
|
// console.log(n)
|
||||||
|
this.electronStore.set('list.loveList', n)
|
||||||
|
},
|
||||||
|
deep: true,
|
||||||
|
},
|
||||||
downloadList: {
|
downloadList: {
|
||||||
handler(n) {
|
handler(n) {
|
||||||
this.electronStore.set('download.list', n)
|
this.electronStore.set('download.list', n)
|
||||||
|
@ -90,7 +97,7 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
...mapActions(['getVersionInfo']),
|
...mapActions(['getVersionInfo']),
|
||||||
...mapMutations(['setNewVersion', 'setVersionModalVisible']),
|
...mapMutations(['setNewVersion', 'setVersionModalVisible']),
|
||||||
...mapMutations('list', ['initDefaultList']),
|
...mapMutations('list', ['initList']),
|
||||||
...mapMutations('download', ['updateDownloadList']),
|
...mapMutations('download', ['updateDownloadList']),
|
||||||
...mapMutations(['setSetting']),
|
...mapMutations(['setSetting']),
|
||||||
init() {
|
init() {
|
||||||
|
@ -156,13 +163,9 @@ export default {
|
||||||
},
|
},
|
||||||
initPlayList() {
|
initPlayList() {
|
||||||
let defaultList = this.electronStore.get('list.defaultList')
|
let defaultList = this.electronStore.get('list.defaultList')
|
||||||
|
let loveList = this.electronStore.get('list.loveList')
|
||||||
// console.log(defaultList)
|
// console.log(defaultList)
|
||||||
if (defaultList) {
|
if (defaultList) this.initList({ defaultList, loveList })
|
||||||
// defaultList.list.forEach(m => {
|
|
||||||
// m.typeUrl = {}
|
|
||||||
// })
|
|
||||||
this.initDefaultList(defaultList)
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
initDownloadList() {
|
initDownloadList() {
|
||||||
let downloadList = this.electronStore.get('download.list')
|
let downloadList = this.electronStore.get('download.list')
|
||||||
|
|
|
@ -16,8 +16,9 @@ div(:class="$style.aside")
|
||||||
dl
|
dl
|
||||||
dt 我的音乐
|
dt 我的音乐
|
||||||
dd
|
dd
|
||||||
router-link(:active-class="$style.active" to="list") {{defaultList.name}}
|
router-link(:active-class="($route.query.id === defaultList.id || $route.query.id == '') ? $style.active : ''" :to="`list?id=${defaultList.id || ''}`") {{defaultList.name}}
|
||||||
router-link(:active-class="$style.active" v-for="item in userList" :to="`list?id=${item._id}`" :key="item._id") {{item.name}}
|
router-link(:active-class="$route.query.id === loveList.id ? $style.active : ''" :to="`list?id=${loveList.id}`") {{loveList.name}}
|
||||||
|
router-link(:active-class="$route.query.id === item.id ? $style.active : ''" v-for="item in userList" :to="`list?id=${item._id}`" :key="item._id") {{item.name}}
|
||||||
dl
|
dl
|
||||||
dt 其他
|
dt 其他
|
||||||
dd
|
dd
|
||||||
|
@ -43,7 +44,7 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters('list', ['defaultList', 'userList']),
|
...mapGetters('list', ['defaultList', 'loveList', 'userList']),
|
||||||
},
|
},
|
||||||
methods: {},
|
methods: {},
|
||||||
}
|
}
|
||||||
|
|
|
@ -210,7 +210,7 @@ export default {
|
||||||
this.audio.currentTime = this.audioErrorTime
|
this.audio.currentTime = this.audioErrorTime
|
||||||
this.audioErrorTime = 0
|
this.audioErrorTime = 0
|
||||||
}
|
}
|
||||||
if (!this.targetSong.interval && this.listId != 'download') this.updateMusicInfo({ index: this.playIndex, data: { interval: formatPlayTime2(this.maxPlayTime) } })
|
if (!this.targetSong.interval && this.listId != 'download') this.updateMusicInfo({ id: 'default', index: this.playIndex, data: { interval: formatPlayTime2(this.maxPlayTime) } })
|
||||||
this.status = '音乐加载中...'
|
this.status = '音乐加载中...'
|
||||||
})
|
})
|
||||||
this.audio.addEventListener('loadstart', () => {
|
this.audio.addEventListener('loadstart', () => {
|
||||||
|
|
|
@ -1,15 +1,22 @@
|
||||||
// state
|
// state
|
||||||
const state = {
|
const state = {
|
||||||
defaultList: {
|
defaultList: {
|
||||||
|
id: 'default',
|
||||||
name: '试听列表',
|
name: '试听列表',
|
||||||
list: [],
|
list: [],
|
||||||
},
|
},
|
||||||
|
loveList: {
|
||||||
|
id: 'love',
|
||||||
|
name: '我喜欢',
|
||||||
|
list: [],
|
||||||
|
},
|
||||||
userList: [],
|
userList: [],
|
||||||
}
|
}
|
||||||
|
|
||||||
// getters
|
// getters
|
||||||
const getters = {
|
const getters = {
|
||||||
defaultList: state => state.defaultList || {},
|
defaultList: state => state.defaultList || {},
|
||||||
|
loveList: state => state.loveList || {},
|
||||||
userList: state => state.userList,
|
userList: state => state.userList,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,39 +25,72 @@ const actions = {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const getList = (state, id) => {
|
||||||
|
let targetList
|
||||||
|
switch (id) {
|
||||||
|
case 'default':
|
||||||
|
targetList = state.defaultList
|
||||||
|
break
|
||||||
|
case 'love':
|
||||||
|
targetList = state.loveList
|
||||||
|
break
|
||||||
|
default:
|
||||||
|
targetList = state.userList.find(l => l.id === id)
|
||||||
|
break
|
||||||
|
}
|
||||||
|
return targetList
|
||||||
|
}
|
||||||
|
|
||||||
// mitations
|
// mitations
|
||||||
const mutations = {
|
const mutations = {
|
||||||
initDefaultList(state, data) {
|
initList(state, { defaultList, loveList }) {
|
||||||
state.defaultList = data
|
if (defaultList !== undefined) state.defaultList = defaultList
|
||||||
|
if (loveList !== undefined) state.loveList = loveList
|
||||||
},
|
},
|
||||||
setDefaultList(state, list) {
|
setList(state, { id, list }) {
|
||||||
state.defaultList.list = list
|
const targetList = getList(state, id)
|
||||||
|
if (!targetList) return
|
||||||
|
targetList.list = list
|
||||||
},
|
},
|
||||||
defaultListAdd(state, musicInfo) {
|
listAdd(state, { id, musicInfo }) {
|
||||||
if (state.defaultList.list.some(s => s.songmid === musicInfo.songmid)) return
|
const targetList = getList(state, id)
|
||||||
state.defaultList.list.push(musicInfo)
|
if (!targetList) return
|
||||||
|
if (targetList.list.some(s => s.songmid === musicInfo.songmid)) return
|
||||||
|
targetList.list.push(musicInfo)
|
||||||
},
|
},
|
||||||
defaultListAddMultiple(state, list) {
|
listAddMultiple(state, { id, list }) {
|
||||||
|
let targetList = getList(state, id)
|
||||||
|
if (!targetList) return
|
||||||
|
targetList = targetList.list
|
||||||
list.forEach(musicInfo => {
|
list.forEach(musicInfo => {
|
||||||
if (state.defaultList.list.some(s => s.songmid === musicInfo.songmid)) return
|
if (targetList.some(s => s.songmid === musicInfo.songmid)) return
|
||||||
state.defaultList.list.push(musicInfo)
|
targetList.push(musicInfo)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
defaultListRemove(state, index) {
|
listRemove(state, { id, index }) {
|
||||||
state.defaultList.list.splice(index, 1)
|
let targetList = getList(state, id)
|
||||||
|
if (!targetList) return
|
||||||
|
targetList.list.splice(index, 1)
|
||||||
},
|
},
|
||||||
updateMusicInfo(state, { index, data }) {
|
listRemoveMultiple(state, { id, list }) {
|
||||||
Object.assign(state.defaultList.list[index], data)
|
let targetList = getList(state, id)
|
||||||
},
|
if (!targetList) return
|
||||||
defaultListRemoveMultiple(state, list) {
|
targetList = targetList.list
|
||||||
list.forEach(musicInfo => {
|
list.forEach(musicInfo => {
|
||||||
let index = state.defaultList.list.indexOf(musicInfo)
|
let index = targetList.indexOf(musicInfo)
|
||||||
if (index < 0) return
|
if (index < 0) return
|
||||||
state.defaultList.list.splice(index, 1)
|
targetList.splice(index, 1)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
defaultListClear(state) {
|
listClear(state, id) {
|
||||||
state.defaultList.list.length = 0
|
let targetList = getList(state, id)
|
||||||
|
if (!targetList) return
|
||||||
|
targetList.list.length = 0
|
||||||
|
},
|
||||||
|
updateMusicInfo(state, { id, index, data }) {
|
||||||
|
let targetList = getList(state, id)
|
||||||
|
if (!targetList) return
|
||||||
|
Object.assign(targetList.list[index], data)
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,7 @@ export default {
|
||||||
...mapMutations(['setLeaderboard']),
|
...mapMutations(['setLeaderboard']),
|
||||||
...mapActions('leaderboard', ['getList']),
|
...mapActions('leaderboard', ['getList']),
|
||||||
...mapActions('download', ['createDownload', 'createDownloadMultiple']),
|
...mapActions('download', ['createDownload', 'createDownloadMultiple']),
|
||||||
...mapMutations('list', ['defaultListAdd', 'defaultListAddMultiple']),
|
...mapMutations('list', ['listAdd', 'listAddMultiple']),
|
||||||
...mapMutations('player', ['setList']),
|
...mapMutations('player', ['setList']),
|
||||||
handleListBtnClick(info) {
|
handleListBtnClick(info) {
|
||||||
switch (info.action) {
|
switch (info.action) {
|
||||||
|
@ -80,11 +80,11 @@ export default {
|
||||||
let targetSong
|
let targetSong
|
||||||
if (index == null) {
|
if (index == null) {
|
||||||
targetSong = this.selectdData[0]
|
targetSong = this.selectdData[0]
|
||||||
this.defaultListAddMultiple(this.selectdData)
|
this.listAddMultiple({ id: 'default', list: this.selectdData })
|
||||||
this.resetSelect()
|
this.resetSelect()
|
||||||
} else {
|
} else {
|
||||||
targetSong = this.list[index]
|
targetSong = this.list[index]
|
||||||
this.defaultListAdd(targetSong)
|
this.listAdd({ id: 'default', musicInfo: targetSong })
|
||||||
}
|
}
|
||||||
let targetIndex = this.defaultList.list.findIndex(
|
let targetIndex = this.defaultList.list.findIndex(
|
||||||
s => s.songmid === targetSong.songmid
|
s => s.songmid === targetSong.songmid
|
||||||
|
@ -134,7 +134,7 @@ export default {
|
||||||
this.testPlay()
|
this.testPlay()
|
||||||
break
|
break
|
||||||
case 'add':
|
case 'add':
|
||||||
this.defaultListAddMultiple(this.selectdData)
|
this.listAddMultiple({ id: 'default', list: this.selectdData })
|
||||||
this.resetSelect()
|
this.resetSelect()
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,6 +50,7 @@ export default {
|
||||||
name: 'List',
|
name: 'List',
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
listId: null,
|
||||||
clickTime: window.performance.now(),
|
clickTime: window.performance.now(),
|
||||||
clickIndex: -1,
|
clickIndex: -1,
|
||||||
isShowDownload: false,
|
isShowDownload: false,
|
||||||
|
@ -65,12 +66,15 @@ export default {
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters(['userInfo', 'setting']),
|
...mapGetters(['userInfo', 'setting']),
|
||||||
...mapGetters('list', ['defaultList', 'userList']),
|
...mapGetters('list', ['defaultList', 'loveList', 'userList']),
|
||||||
...mapGetters('player', ['listId', 'playIndex']),
|
...mapGetters('player', {
|
||||||
|
playerListId: 'listId',
|
||||||
|
playIndex: 'playIndex',
|
||||||
|
}),
|
||||||
isPlayList() {
|
isPlayList() {
|
||||||
return this.listId != 'download' && (
|
return this.playerListId != 'download' && (
|
||||||
((!this.$route.query.id || this.$route.query.id == 'test') && this.listId == 'test') ||
|
((!this.$route.query.id || this.$route.query.id == 'test') && this.playerListId == 'test') ||
|
||||||
this.$route.query.id == this.listId
|
this.$route.query.id == this.playerListId
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
list() {
|
list() {
|
||||||
|
@ -81,6 +85,22 @@ export default {
|
||||||
isAPITemp() {
|
isAPITemp() {
|
||||||
return this.setting.apiSource == 'temp'
|
return this.setting.apiSource == 'temp'
|
||||||
},
|
},
|
||||||
|
listData() {
|
||||||
|
if (this.listId == null) return this.defaultList
|
||||||
|
let targetList
|
||||||
|
switch (this.listId) {
|
||||||
|
case 'default':
|
||||||
|
targetList = this.defaultList
|
||||||
|
break
|
||||||
|
case 'love':
|
||||||
|
targetList = this.loveList
|
||||||
|
break
|
||||||
|
default:
|
||||||
|
targetList = this.userList.find(l => l.id === this.listId)
|
||||||
|
break
|
||||||
|
}
|
||||||
|
return targetList
|
||||||
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
selectdData(n) {
|
selectdData(n) {
|
||||||
|
@ -98,17 +118,11 @@ export default {
|
||||||
this.resetSelect()
|
this.resetSelect()
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// beforeRouteUpdate(to, from, next) {
|
beforeRouteUpdate(to, from, next) {
|
||||||
// // if (to.query.id === undefined) return
|
if (to.query.id === undefined) return
|
||||||
// // if (to.query.text === '') {
|
this.listId = to.query.id
|
||||||
// // this.clearList()
|
next()
|
||||||
// // } else {
|
},
|
||||||
// // this.text = to.query.text
|
|
||||||
// // this.page = 1
|
|
||||||
// // this.handleSearch(this.text, this.page)
|
|
||||||
// // }
|
|
||||||
// next()
|
|
||||||
// },
|
|
||||||
// mounted() {
|
// mounted() {
|
||||||
// console.log('mounted')
|
// console.log('mounted')
|
||||||
// if (this.$route.query.text === undefined) {
|
// if (this.$route.query.text === undefined) {
|
||||||
|
@ -137,22 +151,25 @@ export default {
|
||||||
}, 1000)
|
}, 1000)
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
if (this.list.length > 150) {
|
this.handleDelayShow()
|
||||||
setTimeout(() => {
|
|
||||||
this.delayShow = true
|
|
||||||
if (this.setting.list.scroll.enable && this.setting.list.scroll.location) {
|
|
||||||
this.$nextTick(() => this.$refs.dom_scrollContent.scrollTo(0, this.setting.list.scroll.location))
|
|
||||||
}
|
|
||||||
}, 200)
|
|
||||||
} else {
|
|
||||||
this.delayShow = true
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapMutations(['setListScroll']),
|
...mapMutations(['setListScroll']),
|
||||||
...mapMutations('list', ['defaultListRemove', 'defaultListRemoveMultiple']),
|
...mapMutations('list', ['listRemove', 'listRemoveMultiple']),
|
||||||
...mapActions('download', ['createDownload', 'createDownloadMultiple']),
|
...mapActions('download', ['createDownload', 'createDownloadMultiple']),
|
||||||
...mapMutations('player', ['setList']),
|
...mapMutations('player', ['setList']),
|
||||||
|
handleDelayShow() {
|
||||||
|
if (this.list.length > 150) {
|
||||||
|
setTimeout(() => {
|
||||||
|
this.delayShow = true
|
||||||
|
if (this.setting.list.scroll.enable && this.setting.list.scroll.location) {
|
||||||
|
this.$nextTick(() => this.$refs.dom_scrollContent.scrollTo(0, this.setting.list.scroll.location))
|
||||||
|
}
|
||||||
|
}, 200)
|
||||||
|
} else {
|
||||||
|
this.delayShow = true
|
||||||
|
}
|
||||||
|
},
|
||||||
handleDoubleClick(index) {
|
handleDoubleClick(index) {
|
||||||
if (
|
if (
|
||||||
window.performance.now() - this.clickTime > 400 ||
|
window.performance.now() - this.clickTime > 400 ||
|
||||||
|
@ -171,7 +188,7 @@ export default {
|
||||||
this.setList({ list: this.list, listId: 'test', index })
|
this.setList({ list: this.list, listId: 'test', index })
|
||||||
},
|
},
|
||||||
handleRemove(index) {
|
handleRemove(index) {
|
||||||
this.defaultListRemove(index)
|
this.listRemove({ id: 'default', index })
|
||||||
},
|
},
|
||||||
handleListBtnClick(info) {
|
handleListBtnClick(info) {
|
||||||
switch (info.action) {
|
switch (info.action) {
|
||||||
|
@ -215,7 +232,7 @@ export default {
|
||||||
this.isShowDownloadMultiple = true
|
this.isShowDownloadMultiple = true
|
||||||
break
|
break
|
||||||
case 'remove':
|
case 'remove':
|
||||||
this.defaultListRemoveMultiple(this.selectdData)
|
this.listRemoveMultiple({ id: 'default', list: this.selectdData })
|
||||||
this.resetSelect()
|
this.resetSelect()
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
|
@ -128,7 +128,7 @@ export default {
|
||||||
...mapActions('search', ['search']),
|
...mapActions('search', ['search']),
|
||||||
...mapActions('download', ['createDownload', 'createDownloadMultiple']),
|
...mapActions('download', ['createDownload', 'createDownloadMultiple']),
|
||||||
...mapMutations('search', ['clearList', 'setPage']),
|
...mapMutations('search', ['clearList', 'setPage']),
|
||||||
...mapMutations('list', ['defaultListAdd', 'defaultListAddMultiple']),
|
...mapMutations('list', ['listAdd', 'listAddMultiple']),
|
||||||
...mapMutations('player', ['setList']),
|
...mapMutations('player', ['setList']),
|
||||||
handleSearch(text, page) {
|
handleSearch(text, page) {
|
||||||
if (text === '') return this.clearList()
|
if (text === '') return this.clearList()
|
||||||
|
@ -172,11 +172,11 @@ export default {
|
||||||
let targetSong
|
let targetSong
|
||||||
if (index == null) {
|
if (index == null) {
|
||||||
targetSong = this.selectdData[0]
|
targetSong = this.selectdData[0]
|
||||||
this.defaultListAddMultiple(this.filterList(this.selectdData))
|
this.listAddMultiple({ id: 'default', list: this.filterList(this.selectdData) })
|
||||||
} else {
|
} else {
|
||||||
if ((this.isAPITemp && this.listInfo.list[index].source != 'kw') || this.listInfo.list[index].source == 'tx' || this.listInfo.list[index].source == 'wy') return
|
if ((this.isAPITemp && this.listInfo.list[index].source != 'kw') || this.listInfo.list[index].source == 'tx' || this.listInfo.list[index].source == 'wy') return
|
||||||
targetSong = this.listInfo.list[index]
|
targetSong = this.listInfo.list[index]
|
||||||
this.defaultListAdd(targetSong)
|
this.listAdd({ id: 'default', musicInfo: targetSong })
|
||||||
}
|
}
|
||||||
let targetIndex = this.defaultList.list.findIndex(
|
let targetIndex = this.defaultList.list.findIndex(
|
||||||
s => s.songmid === targetSong.songmid
|
s => s.songmid === targetSong.songmid
|
||||||
|
@ -218,7 +218,7 @@ export default {
|
||||||
this.resetSelect()
|
this.resetSelect()
|
||||||
break
|
break
|
||||||
case 'add':
|
case 'add':
|
||||||
this.defaultListAddMultiple(this.filterList(this.selectdData))
|
this.listAddMultiple({ id: 'default', list: this.filterList(this.selectdData) })
|
||||||
this.resetSelect()
|
this.resetSelect()
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
|
@ -286,7 +286,7 @@ export default {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapMutations(['setSetting', 'setVersionModalVisible']),
|
...mapMutations(['setSetting', 'setVersionModalVisible']),
|
||||||
...mapMutations('list', ['setDefaultList']),
|
...mapMutations('list', ['setList']),
|
||||||
init() {
|
init() {
|
||||||
this.current_setting = JSON.parse(JSON.stringify(this.setting))
|
this.current_setting = JSON.parse(JSON.stringify(this.setting))
|
||||||
},
|
},
|
||||||
|
@ -332,7 +332,7 @@ export default {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (defautlList.type !== 'defautlList') return
|
if (defautlList.type !== 'defautlList') return
|
||||||
this.setDefaultList(defautlList.data.list)
|
this.setList({ id: 'default', list: defautlList.data.list })
|
||||||
},
|
},
|
||||||
exportPlayList(path) {
|
exportPlayList(path) {
|
||||||
const data = {
|
const data = {
|
||||||
|
@ -353,7 +353,7 @@ export default {
|
||||||
if (allData.type !== 'allData') return
|
if (allData.type !== 'allData') return
|
||||||
this.setSetting(updateSetting(allData.setting))
|
this.setSetting(updateSetting(allData.setting))
|
||||||
this.init()
|
this.init()
|
||||||
this.setDefaultList(allData.defaultList.list)
|
this.setList({ id: 'default', list: allData.defaultList.list })
|
||||||
},
|
},
|
||||||
exportAllData(path) {
|
exportAllData(path) {
|
||||||
let allData = {
|
let allData = {
|
||||||
|
|
|
@ -121,7 +121,7 @@ export default {
|
||||||
...mapActions('songList', ['getTags', 'getList', 'getListDetail']),
|
...mapActions('songList', ['getTags', 'getList', 'getListDetail']),
|
||||||
...mapMutations('songList', ['setVisibleListDetail', 'setSelectListInfo', 'clearListDetail']),
|
...mapMutations('songList', ['setVisibleListDetail', 'setSelectListInfo', 'clearListDetail']),
|
||||||
...mapActions('download', ['createDownload', 'createDownloadMultiple']),
|
...mapActions('download', ['createDownload', 'createDownloadMultiple']),
|
||||||
...mapMutations('list', ['defaultListAdd', 'defaultListAddMultiple']),
|
...mapMutations('list', ['listAdd', 'listAddMultiple']),
|
||||||
...mapMutations('player', ['setList']),
|
...mapMutations('player', ['setList']),
|
||||||
handleListBtnClick(info) {
|
handleListBtnClick(info) {
|
||||||
switch (info.action) {
|
switch (info.action) {
|
||||||
|
@ -145,11 +145,11 @@ export default {
|
||||||
let targetSong
|
let targetSong
|
||||||
if (index == null) {
|
if (index == null) {
|
||||||
targetSong = this.selectdData[0]
|
targetSong = this.selectdData[0]
|
||||||
this.defaultListAddMultiple(this.selectdData)
|
this.listAddMultiple({ id: 'default', list: this.selectdData })
|
||||||
this.resetSelect()
|
this.resetSelect()
|
||||||
} else {
|
} else {
|
||||||
targetSong = this.listDetail.list[index]
|
targetSong = this.listDetail.list[index]
|
||||||
this.defaultListAdd(targetSong)
|
this.listAdd({ id: 'default', musicInfo: targetSong })
|
||||||
}
|
}
|
||||||
let targetIndex = this.defaultList.list.findIndex(
|
let targetIndex = this.defaultList.list.findIndex(
|
||||||
s => s.songmid === targetSong.songmid
|
s => s.songmid === targetSong.songmid
|
||||||
|
@ -216,7 +216,7 @@ export default {
|
||||||
this.testPlay()
|
this.testPlay()
|
||||||
break
|
break
|
||||||
case 'add':
|
case 'add':
|
||||||
this.defaultListAddMultiple(this.selectdData)
|
this.listAddMultiple({ id: 'default', list: this.selectdData })
|
||||||
this.resetSelect()
|
this.resetSelect()
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue