Skip to content

Commit

Permalink
🎨
Browse files Browse the repository at this point in the history
  • Loading branch information
hzzly committed Dec 15, 2018
1 parent b580a19 commit f831d48
Show file tree
Hide file tree
Showing 32 changed files with 2,788 additions and 2,728 deletions.
Binary file added desgin.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 7 additions & 4 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "magic-music",
"version": "1.0.0",
"version": "1.0.1",
"description": "A Vue.js project",
"author": "hzzly",
"private": true,
Expand All @@ -11,6 +11,7 @@
},
"dependencies": {
"axios": "^0.16.1",
"better-scroll": "^1.13.2",
"node-sass": "^4.5.2",
"qs": "^6.4.0",
"sass-loader": "^6.0.3",
Expand Down Expand Up @@ -39,18 +40,20 @@
"friendly-errors-webpack-plugin": "^1.1.3",
"html-webpack-plugin": "^2.28.0",
"http-proxy-middleware": "^0.17.3",
"webpack-bundle-analyzer": "^2.2.1",
"semver": "^5.3.0",
"shelljs": "^0.7.6",
"node-sass": "^4.11.0",
"opn": "^4.0.2",
"optimize-css-assets-webpack-plugin": "^1.3.0",
"ora": "^1.1.0",
"rimraf": "^2.6.0",
"sass-loader": "^6.0.7",
"semver": "^5.3.0",
"shelljs": "^0.7.6",
"url-loader": "^0.5.8",
"vue-loader": "^11.1.4",
"vue-style-loader": "^2.0.0",
"vue-template-compiler": "^2.2.4",
"webpack": "^2.2.1",
"webpack-bundle-analyzer": "^2.2.1",
"webpack-dev-middleware": "^1.10.0",
"webpack-hot-middleware": "^2.16.1",
"webpack-merge": "^2.6.1"
Expand Down
146 changes: 81 additions & 65 deletions src/api/index.js
Expand Up @@ -6,80 +6,96 @@ axios.defaults.timeout = 10000;
axios.defaults.baseURL = 'http://localhost:3000';

export function fetchGet(url, param) {
return new Promise((resolve, reject) => {
axios.get(url, {params: param})
.then(response => {
resolve(response.data)
}, err => {
reject(err)
})
.catch((error) => {
reject(error)
})
})
return new Promise((resolve, reject) => {
axios.get(url, {
params: param
})
.then(response => {
resolve(response.data)
}, err => {
reject(err)
})
.catch((error) => {
reject(error)
})
})
}
export default {
/**
* 用户登录
*/
Login(params) {
return fetchGet('/login', params)
},
/**
* 用户登录
*/
Login(params) {
return fetchGet('/login', params)
},

/**
* popularmusic列表
*/
PopularList() {
return fetchGet('/playlist/detail', {id: 3778678})
},
/**
* popularmusic列表
*/
PopularList() {
return fetchGet('/playlist/detail', {
id: 3778678
})
},

/**
* classicalmusic列表
*/
ClassicalList() {
return fetchGet('/playlist/detail', {id: 71384707})
},
/**
* classicalmusic列表
*/
ClassicalList() {
return fetchGet('/playlist/detail', {
id: 71384707
})
},

/**
* lightmusic列表
*/
LightList() {
return fetchGet('/playlist/detail', {id: 26467411})
},
/**
* lightmusic列表
*/
LightList() {
return fetchGet('/playlist/detail', {
id: 26467411
})
},

/**
* radiomusic列表
*/
RadioList() {
return fetchGet('/playlist/detail', {id: 897089})
},
/**
* radiomusic列表
*/
RadioList() {
return fetchGet('/playlist/detail', {
id: 897089
})
},

/**
* music歌词
*/
MusicUrl(id) {
return fetchGet('/music/url', {id})
},
/**
* music歌词
*/
MusicUrl(id) {
return fetchGet('/song/url', {
id
})
},

/**
* music歌词
*/
MusicLyric(id) {
return fetchGet('/lyric', id)
},
/**
* music歌词
*/
MusicLyric(id) {
return fetchGet('/lyric', id)
},

/**
* music搜索
*/
MusicSearch(keywords) {
return fetchGet('/search', {keywords})
},
/**
* music搜索
*/
MusicSearch(keywords) {
return fetchGet('/search', {
keywords
})
},

/**
* 排行榜
*/
MusicRank(idx) {
return fetchGet('/top/list', {idx})
},
/**
* 排行榜
*/
MusicRank(idx) {
return fetchGet('/top/list', {
idx
})
},

}
4 changes: 2 additions & 2 deletions src/assets/css/function.scss
@@ -1,3 +1,3 @@
@function px2rem($px, $base-font-size: 75px) {
@return ($px / $base-font-size) * 1rem;
}
@return ($px / $base-font-size) * 1rem;
}

0 comments on commit f831d48

Please sign in to comment.