-
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 setting related functions
1. Support custom playback source 2. Fix the custom forward and backward BUG 3. Keep the current state
- Loading branch information
1 parent
a6b5949
commit f014352
Showing
22 changed files
with
491 additions
and
65 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ | |
); | ||
height: 100%; | ||
.content { | ||
position: relative; | ||
height: 100%; | ||
|
||
> 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
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 @@ | ||
export { Setting } from './view/index' |
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,15 @@ | ||
import { PlaySource } from '@/interface' | ||
|
||
export interface SettingState { | ||
source: PlaySource[] | ||
sourceAll: { | ||
name: string | ||
value: PlaySource | ||
disabled?: boolean | ||
}[] | ||
} | ||
|
||
export const enum SettingActions {} | ||
export const enum SettingMutations { | ||
SET_SOURCE = 'SET_SOURCE' | ||
} |
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,19 @@ | ||
import { actions, mutations } from './sage' | ||
import { state } from './state' | ||
import { uesModuleStore } from '@/hooks/index' | ||
import { SettingActions, SettingMutations, SettingState } from '@/interface' | ||
|
||
export const SettingNameSpaced = 'Setting' | ||
|
||
export const useSettingModule = () => { | ||
return uesModuleStore<SettingState, {}, SettingActions, SettingMutations>( | ||
SettingNameSpaced | ||
) | ||
} | ||
|
||
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,11 @@ | ||
import { MutationTree, ActionTree } from 'vuex' | ||
import { RootState } from '@/store/index' | ||
import { SettingMutations, SettingState, PlaySource } from '@/interface' | ||
|
||
export const actions: ActionTree<SettingState, RootState> = {} | ||
|
||
export const mutations: MutationTree<SettingState> = { | ||
[SettingMutations.SET_SOURCE](state, source: PlaySource[]) { | ||
state.source = source | ||
} | ||
} |
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,15 @@ | ||
import { SettingState } from '@/interface/index' | ||
|
||
export const state: SettingState = { | ||
source: ['qq', 'kuwo', 'migu'], | ||
sourceAll: [ | ||
{ name: 'QQ音乐', value: 'qq', disabled: true }, | ||
{ name: '酷我音乐', value: 'kuwo', disabled: true }, | ||
{ name: '咪咕音乐', value: 'migu', disabled: true }, | ||
{ name: '百度音乐', value: 'baidu' }, | ||
{ name: 'JOOX', value: 'joox' }, | ||
{ name: '酷狗音乐', value: 'kugou' }, | ||
{ name: '虾米音乐', value: 'xiami' } | ||
// { name: 'Youtube', value: 'youtube' } | ||
] | ||
} |
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,52 @@ | ||
@import '~@/theme/index.less'; | ||
|
||
.setting-view { | ||
display: flex; | ||
flex-direction: column; | ||
height: 100%; | ||
padding: 20px; | ||
overflow: auto; | ||
background-color: white; | ||
h1 { | ||
font-size: 20px; | ||
font-weight: bold; | ||
} | ||
h2 { | ||
margin-bottom: 10px; | ||
font-size: 18px; | ||
} | ||
&-route { | ||
padding-bottom: 20px; | ||
border-bottom: @lighter-border; | ||
&--active { | ||
font-weight: bold; | ||
} | ||
ul { | ||
display: flex; | ||
align-items: center; | ||
li { | ||
margin-right: 10px; | ||
cursor: pointer; | ||
} | ||
} | ||
} | ||
&-description { | ||
margin: 8px 0; | ||
font-size: 12px; | ||
} | ||
&-paragraph { | ||
line-height: 2; | ||
text-indent: 24px; | ||
ul { | ||
padding-left: 20px; | ||
} | ||
} | ||
&-contanier { | ||
flex: 1; | ||
height: 0; | ||
overflow: auto; | ||
> div { | ||
margin-top: 50px; | ||
} | ||
} | ||
} |
Oops, something went wrong.