mirror of
https://github.com/ikun0014/lx-music-mobile.git
synced 2025-07-03 21:12:10 +08:00
同步功能新增对列表位置调整的支持
This commit is contained in:
parent
a9a5a4c2e0
commit
3151e1fe67
@ -1,6 +1,11 @@
|
|||||||
|
### 新增
|
||||||
|
|
||||||
|
- 同步功能新增对列表位置调整的支持(若你使用同步功能,请务必升级到此版本以上,不然会有问题)
|
||||||
|
|
||||||
### 优化
|
### 优化
|
||||||
|
|
||||||
- 修改对播放模块的调用,杜绝应用显示正在播放的歌曲与实际播放歌曲不一致的问题(这是播放模块歌曲队列与应用内歌曲队列在某些情况下出现不一致时导致的)
|
- 修改对播放模块的调用,杜绝应用显示正在播放的歌曲与实际播放歌曲不一致的问题(这是播放模块歌曲队列与应用内歌曲队列在某些情况下出现不一致时导致的)
|
||||||
|
- 支持PC端同步功能添加对列表顺序调整的控制,确保手动调整位置后的列表与不同的电脑同步时,列表位置不会被还原
|
||||||
|
|
||||||
### 修复
|
### 修复
|
||||||
|
|
||||||
|
@ -15,9 +15,7 @@ import {
|
|||||||
removeUserList,
|
removeUserList,
|
||||||
setUserListName,
|
setUserListName,
|
||||||
setMusicPosition,
|
setMusicPosition,
|
||||||
// moveupUserList,
|
setUserListPosition,
|
||||||
// movedownUserList,
|
|
||||||
// setUserListPosition,
|
|
||||||
} from '@/store/modules/list/action'
|
} from '@/store/modules/list/action'
|
||||||
|
|
||||||
const store = getStore()
|
const store = getStore()
|
||||||
@ -70,6 +68,9 @@ const handleListAction = enMsg => {
|
|||||||
case 'set_user_list_name':
|
case 'set_user_list_name':
|
||||||
store.dispatch(setUserListName(data))
|
store.dispatch(setUserListName(data))
|
||||||
break
|
break
|
||||||
|
case 'set_user_list_position':
|
||||||
|
store.dispatch(setUserListPosition(data))
|
||||||
|
break
|
||||||
case 'set_music_position':
|
case 'set_music_position':
|
||||||
store.dispatch(setMusicPosition(data))
|
store.dispatch(setMusicPosition(data))
|
||||||
break
|
break
|
||||||
|
@ -328,7 +328,11 @@ export const setUserListName = ({ id, name, isSync }) => async(dispatch, getStat
|
|||||||
const targetList = global.allList[id]
|
const targetList = global.allList[id]
|
||||||
await saveList(targetList)
|
await saveList(targetList)
|
||||||
}
|
}
|
||||||
export const setUserListPosition = ({ id, position }) => async(dispatch, getState) => {
|
export const setUserListPosition = ({ id, position, isSync }) => async(dispatch, getState) => {
|
||||||
|
if (!isSync) {
|
||||||
|
listSync.sendListAction('set_user_list_position', { id, position })
|
||||||
|
}
|
||||||
|
|
||||||
dispatch({
|
dispatch({
|
||||||
type: TYPES.setUserListPosition,
|
type: TYPES.setUserListPosition,
|
||||||
payload: { id, position },
|
payload: { id, position },
|
||||||
|
@ -253,6 +253,7 @@ const mutations = {
|
|||||||
if (position == null) {
|
if (position == null) {
|
||||||
userList.push(newList)
|
userList.push(newList)
|
||||||
} else {
|
} else {
|
||||||
|
newList.locationUpdateTime = Date.now()
|
||||||
userList.splice(position + 1, 0, newList)
|
userList.splice(position + 1, 0, newList)
|
||||||
}
|
}
|
||||||
newState.userList = userList
|
newState.userList = userList
|
||||||
@ -279,7 +280,7 @@ const mutations = {
|
|||||||
const index = state.userList.findIndex(targetList)
|
const index = state.userList.findIndex(targetList)
|
||||||
if (index < 0) return state
|
if (index < 0) return state
|
||||||
state.userList.splice(index, 1)
|
state.userList.splice(index, 1)
|
||||||
state.userList.splice(index, position, targetList)
|
state.userList.splice(Math.max(Math.min(position, state.userList.length - 1), 0), 0, targetList)
|
||||||
return updateStateList({ ...state }, [id])
|
return updateStateList({ ...state }, [id])
|
||||||
},
|
},
|
||||||
[TYPES.setMusicPosition](state, { id, position, list }) {
|
[TYPES.setMusicPosition](state, { id, position, list }) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user