like idea
This commit is contained in:
parent
a4e2ebe315
commit
5fd02b4fe3
@ -44,6 +44,9 @@
|
|||||||
// 在什么时机发送musicList?
|
// 在什么时机发送musicList?
|
||||||
// 通道准备好时即可发送
|
// 通道准备好时即可发送
|
||||||
|
|
||||||
|
// 获取对方的音乐列表
|
||||||
|
// like对方的条目时亮起(双方高亮)(本地缓存)(可由对比缓存实现)
|
||||||
|
// ban对方的条目时灰掉(也禁止对方播放)(并保持ban表)(由插件实现)
|
||||||
|
|
||||||
clientList.on('channel')
|
clientList.on('channel')
|
||||||
|
|
||||||
|
@ -73,6 +73,13 @@ export default class MusicList {
|
|||||||
event.stopPropagation()
|
event.stopPropagation()
|
||||||
this.delete(item)
|
this.delete(item)
|
||||||
}
|
}
|
||||||
|
}),
|
||||||
|
Button({
|
||||||
|
innerText: '喜欢',
|
||||||
|
onclick: event => {
|
||||||
|
event.stopPropagation()
|
||||||
|
// 留存到本地
|
||||||
|
}
|
||||||
})
|
})
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
@ -80,7 +87,14 @@ export default class MusicList {
|
|||||||
}
|
}
|
||||||
// 叠加数据(双方数据计数器上升)
|
// 叠加数据(双方数据计数器上升)
|
||||||
async push(item) {
|
async push(item) {
|
||||||
console.log('叠加数据:', item)
|
console.log('叠加数据: 只增加UI不存储本地', item)
|
||||||
|
// 先检测是否已经存在
|
||||||
|
const data = await this.store.get(item.id)
|
||||||
|
if (data) {
|
||||||
|
console.log('数据已存在:', data)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.__add(item)
|
||||||
}
|
}
|
||||||
// 添加数据并添加UI
|
// 添加数据并添加UI
|
||||||
add(item) {
|
add(item) {
|
||||||
|
Loading…
Reference in New Issue
Block a user