-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: complete the leaderboard interface
- Loading branch information
Showing
33 changed files
with
342 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,25 @@ | ||
import $script from 'scriptjs' | ||
import { noop } from '@/utils/index' | ||
|
||
const ICONFONT_URL = 'font_2132275_l43m9hqmon' | ||
|
||
// repair electron packaging '//' protocol problem | ||
$script('https://at.alicdn.com/t/font_2132275_l43m9hqmon.js', noop) | ||
$script(`https://at.alicdn.com/t/${ICONFONT_URL}.js`, noop) | ||
|
||
void (function() { | ||
if (document) { | ||
const iconfont = document.createElement('style') | ||
document.getElementsByTagName('head')[0].appendChild(iconfont) | ||
const iconfontSheet = document.styleSheets[document.styleSheets.length - 1] | ||
iconfontSheet.insertRule(` | ||
@font-face { | ||
font-family: 'iconfont'; | ||
src: url('https://at.alicdn.com/t/${ICONFONT_URL}.eot'); | ||
src: url('https://at.alicdn.com/t/${ICONFONT_URL}.eot?#iefix') format('embedded-opentype'), | ||
url('https://at.alicdn.com/t/${ICONFONT_URL}.woff2') format('woff2'), | ||
url('https://at.alicdn.com/t/${ICONFONT_URL}.woff') format('woff'), | ||
url('https://at.alicdn.com/t/${ICONFONT_URL}.ttf') format('truetype'), | ||
url('https://at.alicdn.com/t/${ICONFONT_URL}.svg#iconfont') format('svg'); | ||
}`) | ||
} | ||
})() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { state } from './state' | ||
import { actions, mutations } from './sage' | ||
|
||
export * from './state' | ||
export * from './sage' | ||
|
||
export const NAMESPACED = 'Artists' | ||
|
||
export default { | ||
namespaced: true, | ||
state, | ||
actions, | ||
mutations | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { MutationTree, ActionTree } from 'vuex' | ||
import { RootState } from '@/store/index' | ||
import { ArtistsState } from './state' | ||
|
||
export const enum ArtistsMutations {} | ||
|
||
export const enum ArtistsActions {} | ||
|
||
export const actions: ActionTree<ArtistsState, RootState> = {} | ||
export const mutations: MutationTree<ArtistsState> = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { GlobalBase } from '@/interface/index' | ||
|
||
export interface ArtistsState { | ||
[key: string]: string | ||
} | ||
|
||
export const state: ArtistsState = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.artists { | ||
display: block; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { defineComponent } from 'vue' | ||
import './index.less' | ||
|
||
export const Artists = defineComponent({ | ||
name: 'Artists', | ||
setup() { | ||
return () => <div class="artists"></div> | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import Recommend, { | ||
NAMESPACED as RecommendNameSpaced | ||
} from './recommend/module' | ||
import SongList, { NAMESPACED as SongListNameSpaced } from './song-list/module' | ||
import TopList, { NAMESPACED as TopListNameSpaced } from './top-list/module' | ||
import Artists, { NAMESPACED as ArtistsNameSpaced } from './artists/module' | ||
|
||
export { | ||
Recommend, | ||
RecommendNameSpaced, | ||
SongList, | ||
SongListNameSpaced, | ||
TopList, | ||
TopListNameSpaced, | ||
Artists, | ||
ArtistsNameSpaced | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { get } from '@/utils/http' | ||
import { Top } from '../state' | ||
|
||
export const getTopList = async < | ||
T extends { | ||
list: Top[] | ||
artistToplist: Top | ||
} | ||
>(): Promise<T> => { | ||
const data = await get<T>('/api/toplist/detail') | ||
return data | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { state } from './state' | ||
import { actions, mutations } from './sage' | ||
|
||
export * from './state' | ||
export * from './sage' | ||
|
||
export const NAMESPACED = 'TopList' | ||
|
||
export default { | ||
namespaced: true, | ||
state, | ||
actions, | ||
mutations | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { MutationTree, ActionTree } from 'vuex' | ||
import { RootState } from '@/store/index' | ||
import { TopListState } from './state' | ||
import { getTopList } from './api/index' | ||
|
||
export const enum TopListMutations { | ||
SET_TOP_LIST = 'SET_TOP_LIST' | ||
} | ||
|
||
export const enum TopListActions { | ||
SET_ACTION_TOP_LIST = 'SET_ACTION_TOP_LIST' | ||
} | ||
|
||
export const actions: ActionTree<TopListState, RootState> = { | ||
async [TopListActions.SET_ACTION_TOP_LIST]({ commit }) { | ||
const data = await getTopList() | ||
commit(TopListMutations.SET_TOP_LIST, data) | ||
} | ||
} | ||
export const mutations: MutationTree<TopListState> = { | ||
[TopListMutations.SET_TOP_LIST](state, data) { | ||
state.top = data.list | ||
state.artistTop = data.artistToplist | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { Song } from '@/interface/index' | ||
|
||
export interface Top extends Song { | ||
tracks: { | ||
first: string | ||
second: string | ||
}[] | ||
coverImgUrl: string | ||
description: string | ||
} | ||
|
||
export interface TopListState { | ||
top: Top[] | ||
artistTop: Partial<Top> | ||
} | ||
|
||
export const state: TopListState = { | ||
top: [], | ||
artistTop: {} | ||
} |
Oops, something went wrong.