完成聚合搜索功能

This commit is contained in:
lyswhut
2019-09-21 20:05:56 +08:00
parent ef9eb83a75
commit 5321469c1d
6 changed files with 151 additions and 112 deletions
+7 -5
View File
@@ -1,8 +1,5 @@
import music from '../../utils/music'
const sources = [{
id: 'all',
name: '聚合搜索',
}]
const sources = []
const sourceList = {}
const sourceMaxPage = {}
for (const source of music.sources) {
@@ -19,6 +16,11 @@ for (const source of music.sources) {
sourceMaxPage[source.id] = 0
}
sources.push({
id: 'all',
name: '聚合搜索',
})
// state
const state = {
sourceList,
@@ -80,7 +82,7 @@ const mutations = {
total += source.total
limit += source.limit
}
list.sort()
list.sort((a, b) => b.name.charCodeAt(0) - a.name.charCodeAt(0))
state.allPage = Math.max(...pages)
state.total = total
state.limit = limit