完善翻译

This commit is contained in:
lyswhut
2020-03-12 21:12:12 +08:00
parent dd41e00691
commit 3fdff4e6eb
12 changed files with 57 additions and 43 deletions
+11 -2
View File
@@ -11,14 +11,23 @@ export default {
}
},
source(state) {
return music.sources.find(s => s.id === state.setting.sourceId) || music.sources[0]
const source = music.sources.find(s => s.id === state.setting.sourceId) || music.sources[0]
return { id: source.id, name: window.i18n.t('store.state.source_' + source.id) }
},
sources(state) {
return {
active: state.setting.sourceId,
list: music.sources,
list: music.sources.map(item => ({ id: item.id, name: window.i18n.t('store.state.source_' + item.id) })),
}
},
sourceNames() {
const sources = {}
for (const source of music.sources) {
sources[source.id] = window.i18n.t('store.state.source_' + source.id)
}
sources.all = window.i18n.t('store.state.source_all')
return sources
},
userInfo(state) {
return state.userInfo
},
+4 -2
View File
@@ -19,7 +19,9 @@ const state = {
// getters
const getters = {
sourceInfo: () => ({ sources, sourceList }),
sourceInfo(state, getters, rootState, { sourceNames }) {
return { sources: sources.map(item => ({ id: item.id, name: sourceNames[item.id] })), sourceList }
},
list(state) {
return state.list
},
@@ -37,7 +39,7 @@ const actions = {
getList({ state, rootState, commit }, page) {
let source = rootState.setting.leaderboard.source
let tabId = rootState.setting.leaderboard.tabId
let key = `${source}${tabId}${page}}`
let key = `${source}${tabId}${page}`
if (state.list.length && state.key == key) return true
commit('clearList')
return music[source].leaderboard.getList(tabId, page).then(result => commit('setList', { result, key }))
+3 -1
View File
@@ -35,7 +35,9 @@ const state = {
// getters
const getters = {
sources: () => sources,
sources(state, getters, rootState, { sourceNames }) {
return sources.map(item => ({ id: item.id, name: sourceNames[item.id] }))
},
sourceList: state => state.sourceList || [],
searchText: state => state.text,
allList: state => ({ list: state.list, allPage: state.allPage, page: state.page, total: state.total, limit: state.limit, sourceMaxPage: state.sourceMaxPage }),
+3 -1
View File
@@ -39,7 +39,9 @@ sources.forEach(source => {
// getters
const getters = {
sourceInfo: () => ({ sources, sortList }),
sourceInfo(state, getters, rootState, { sourceNames }) {
return { sources: sources.map(item => ({ id: item.id, name: sourceNames[item.id] })), sortList }
},
tags: state => state.tags,
isVisibleListDetail: state => state.isVisibleListDetail,
selectListInfo: state => state.selectListInfo,