This repository has been archived by the owner on Mar 9, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
89 changed files
with
4,364 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"presets": ['react', 'es2015-webpack'] | ||
} |
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,18 @@ | ||
# node.js | ||
# | ||
node_modules/ | ||
npm-debug.log | ||
|
||
# Vim | ||
# swap | ||
[._]*.s[a-w][a-z] | ||
[._]s[a-w][a-z] | ||
# session | ||
Session.vim | ||
# temporary | ||
.netrwhist | ||
*~ | ||
# auto-generated tag files | ||
tags | ||
|
||
dist/ |
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,31 @@ | ||
# NeteaseCloudMusic Electron | ||
|
||
网易云音乐Electron版 | ||
`` 开发中 `` | ||
|
||
## 进度 | ||
目前只有基本功能 | ||
* 搜索歌曲+播放(版权歌曲无法播放 | ||
* 播放列表 | ||
* 手机登陆 | ||
* 个人歌单(创建,收藏 | ||
* [TODO] 歌曲界面 | ||
* [TODO] 主页推荐 | ||
* [TODO] 私人FM | ||
![预览截图](http://7xn38i.com1.z0.glb.clouddn.com/snapshot5.png) | ||
|
||
## Build | ||
目前还没有打包,如果想预览开发效果可以按以下步骤自行构建 | ||
|
||
```bash | ||
git clone https://github.com/disoul/electron-cloud-music && cd electron-cloud-music | ||
npm install | ||
npm install webpack@2.1.0-beta.5 -g | ||
npm install webpack-dev-server@2.0.0-beta -g | ||
npm install electron-prebuilt -g | ||
webpack-dev-server --inline --compress --content-base=./ | ||
|
||
// run cloudmusic in proj root path | ||
// electron will load from 127.0.0.1:8080(webpack-dev-server | ||
electron ./ | ||
``` |
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,180 @@ | ||
'use strict' | ||
import { Search, Login, getPlayList, SonglistDetail } from '../server'; | ||
export function play() { | ||
return { type: 'PLAYER', state: 'PLAYER_PLAY' }; | ||
} | ||
|
||
export function pause() { | ||
return { type: 'PLAYER', state: 'PLAYER_PAUSE' }; | ||
} | ||
|
||
export function startSearch(keywords) { | ||
return { type: 'SEARCH', state: 'START', payload: { keywords: keywords }} | ||
} | ||
|
||
export function errorSearch(e) { | ||
return { type: 'SEARCH', state: 'ERROR', payload: e } | ||
} | ||
|
||
export function finishSearch(res) { | ||
return { type: 'SEARCH', state: 'FINISH', payload: res } | ||
} | ||
|
||
export function closeSearch() { | ||
return { type: 'SEARCH', state: 'CLOSE' } | ||
} | ||
|
||
export function search(keywords) { | ||
return dispatch => { | ||
dispatch(startSearch(keywords)); | ||
Search(keywords).then( res => { | ||
dispatch(finishSearch(res)); | ||
} ) | ||
.catch( e => { | ||
dispatch(errorSearch(e)); | ||
} ) | ||
}; | ||
} | ||
|
||
export function changeSong(song) { | ||
return { type: 'SONG', state: 'CHANGE', payload: song} | ||
} | ||
|
||
export function playFromList(index) { | ||
return { type: 'SONG', state: 'PLAYFROMLIST', payload: index} | ||
} | ||
|
||
export function addSong(song) { | ||
return { type: 'SONG', state: 'ADD', payload: song} | ||
} | ||
|
||
export function addSongList(songlist, isplay) { | ||
return { type: 'SONG', state: 'ADDLIST', payload: { | ||
songlist: songlist, | ||
play: isplay, | ||
} | ||
} | ||
} | ||
|
||
export function nextSong() { | ||
return { type: 'SONG', state: 'NEXT' } | ||
} | ||
|
||
export function previousSong() { | ||
return { type: 'SONG', state: 'PREVIOUS' } | ||
} | ||
|
||
export function changeRule() { | ||
return { type: 'SONG', state: 'CHANGERULE' } | ||
} | ||
|
||
export function showPlayList() { | ||
return { type: 'SONG', state: 'SHOWPLAYLIST' } | ||
} | ||
|
||
export function closePlayList() { | ||
return { type: 'SONG', state: 'CLOSEPLAYLIST' } | ||
} | ||
|
||
export function logging_in(form) { | ||
return { type: 'USER', state: 'LOGIN_STATE_LOGGING_IN', payload: form } | ||
}; | ||
|
||
export function logged_in(res) { | ||
return { type: 'USER', state: 'LOGIN_STATE_LOGGED_IN', payload: res } | ||
}; | ||
|
||
export function logged_failed(errorinfo) { | ||
return { type: 'USER', state: 'LOGIN_STATE_LOGGED_FAILED', payload: errorinfo } | ||
} | ||
|
||
export function loginform(flag) { | ||
return { type: 'USER', state: 'LOGINFORM', payload: flag } | ||
} | ||
|
||
export function toguest() { | ||
return { type: 'USER', state: 'GUEST' } | ||
} | ||
|
||
export function login(form) { | ||
return dispatch => { | ||
dispatch(logging_in(form)); | ||
Login(form.phone, form.password) | ||
.then(res => { | ||
localStorage.setItem('user', JSON.stringify(res)); | ||
dispatch(logged_in(res)); | ||
dispatch(fetchusersong(res.profile.userId)); | ||
}) | ||
.catch(error => { | ||
dispatch(logged_failed(error.toString())); | ||
}); | ||
} | ||
} | ||
|
||
export function fetchingusersong(id) { | ||
return { type: 'USERSONG', state: 'FETCHING', payload: id } | ||
} | ||
|
||
export function getusersong(res) { | ||
return { type: 'USERSONG', state: 'GET', payload: res } | ||
} | ||
|
||
export function fetchusersongerror(err) { | ||
return { type: 'USERSONG', state: 'ERROR', payload: err } | ||
} | ||
|
||
export function fetchusersong(uid) { | ||
return dispatch => { | ||
dispatch(fetchingusersong(uid)); | ||
getPlayList(uid) | ||
.then(res => { | ||
dispatch(getusersong(res.playlist)); | ||
}) | ||
.catch(err => { | ||
dispatch(fetchusersongerror(err)); | ||
}); | ||
} | ||
} | ||
|
||
// push content to routerstack | ||
export function push(content) { | ||
return { type: 'ROUTER', state: 'PUSH', payload: content } | ||
} | ||
|
||
export function pop() { | ||
return { type: 'ROUTER', state: 'PUSH' } | ||
} | ||
|
||
// 获取歌单内容 | ||
export function fetchsonglistdetail(id) { | ||
return dispatch => { | ||
dispatch(fetchingsonglistdetail(id)); | ||
SonglistDetail(id) | ||
.then( res => { | ||
dispatch(getsonglistdetail(res)); | ||
}) | ||
.catch(error => { | ||
dispatch(fetchsonglistdetailerror(error)); | ||
}); | ||
}; | ||
} | ||
|
||
export function fetchingsonglistdetail(id) { | ||
return { type: 'SONGLIST', state: 'FETCHING', payload: id } | ||
} | ||
|
||
export function getsonglistdetail(res) { | ||
return { type: 'SONGLIST', state: 'GET', payload: res } | ||
} | ||
|
||
export function fetchsonglistdetailerror(err) { | ||
return { type: 'SONGLIST', state: 'ERROR', payload: err } | ||
} | ||
|
||
export function showplaycontentmini() { | ||
return { type: 'PLAYCONTENT', state: 'SHOWMINI' } | ||
} | ||
|
||
export function hiddenplaycontentmini() { | ||
return { type: 'PLAYCONTENT', state: 'HIDDENMINI' } | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.