优化歌单、排行榜一键播放按钮的播放机制
This commit is contained in:
@@ -49,6 +49,7 @@ export const loveList = reactive({
|
||||
export const tempList = reactive({
|
||||
id: 'temp',
|
||||
name: '临时列表',
|
||||
meta: {},
|
||||
})
|
||||
|
||||
export const userLists = window.userLists = reactive([])
|
||||
@@ -88,13 +89,16 @@ export const updateList = ({
|
||||
list,
|
||||
source,
|
||||
sourceListId,
|
||||
meta,
|
||||
locationUpdateTime,
|
||||
}) => {
|
||||
let targetList
|
||||
switch (id) {
|
||||
case defaultList.id:
|
||||
case loveList.id:
|
||||
break
|
||||
case tempList.id:
|
||||
tempList.meta = meta || {}
|
||||
break
|
||||
default:
|
||||
targetList = userLists.find(l => l.id == id)
|
||||
|
||||
@@ -39,14 +39,17 @@ const useInitEnvParamPlay = () => {
|
||||
const playSongListDetail = async(source, link, playIndex) => {
|
||||
if (link == null) return
|
||||
let list
|
||||
let id
|
||||
try {
|
||||
list = await getListDetailAll({ source, id: decodeURIComponent(link) })
|
||||
id = decodeURIComponent(link)
|
||||
list = await getListDetailAll({ source, id })
|
||||
} catch (err) {
|
||||
console.log(err)
|
||||
}
|
||||
setTempList({
|
||||
list,
|
||||
index: getListPlayIndex(list, playIndex),
|
||||
id: `${source}__${id}`,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user