Skip to content
This repository has been archived by the owner on Mar 9, 2019. It is now read-only.

Commit

Permalink
Merge branch 'release/0.0.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
disoul committed May 4, 2016
2 parents 95a4a23 + c9469b0 commit 2b48b1a
Show file tree
Hide file tree
Showing 89 changed files with 4,364 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ['react', 'es2015-webpack']
}
18 changes: 18 additions & 0 deletions .gitignore
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/
31 changes: 31 additions & 0 deletions README.md
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 ./
```
180 changes: 180 additions & 0 deletions app/actions/actions.js
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' }
}
Binary file added app/assets/icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
95 changes: 95 additions & 0 deletions app/assets/icon.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions app/assets/icon/add.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions app/assets/icon/close.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions app/assets/icon/loop.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions app/assets/icon/max.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions app/assets/icon/min.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions app/assets/icon/music.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions app/assets/icon/next.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions app/assets/icon/one.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions app/assets/icon/pause.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions app/assets/icon/play.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions app/assets/icon/playlist.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions app/assets/icon/previous.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions app/assets/icon/search.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2b48b1a

Please sign in to comment.