Skip to content

Commit 31e3727

Browse files
author
coderwhy
committed
readme
1 parent f17b4b7 commit 31e3727

File tree

1 file changed

+92
-37
lines changed

1 file changed

+92
-37
lines changed

README.md

Lines changed: 92 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,123 @@
1-
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
1+
# React实战之云音乐项目
22

3-
## Available Scripts
3+
> 如果觉得不错,或者对你有帮助,点一个star~ coderwhy
44
5-
In the project directory, you can run:
5+
### 1.1. 项目简介
66

7-
### `yarn start`
7+
使用React编写的云音乐PC Web项目,接口来源于开源的接口,自己已经做了部署。
88

9-
Runs the app in the development mode.<br />
10-
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
9+
项目已经完成功能如下:(你可以下载下来自己体验一下)
1110

12-
The page will reload if you make edits.<br />
13-
You will also see any lint errors in the console.
11+
推荐页面:
1412

15-
### `yarn test`
13+
* 轮播图
14+
* 热门推荐
15+
* 新碟上架
16+
* 榜单
17+
* 等等
1618

17-
Launches the test runner in the interactive watch mode.<br />
18-
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
19+
![推荐页面](https://tva1.sinaimg.cn/large/007S8ZIlgy1ghv9kwh3cqj31ck0p37uj.jpg)
1920

20-
### `yarn build`
21+
![推荐页面](https://tva1.sinaimg.cn/large/007S8ZIlgy1ghva5bx7bvj31d10p6thq.jpg)
2122

22-
Builds the app for production to the `build` folder.<br />
23-
It correctly bundles React in production mode and optimizes the build for the best performance.
23+
歌曲播放:
2424

25-
The build is minified and the filenames include the hashes.<br />
26-
Your app is ready to be deployed!
25+
* 目前做了榜单中歌曲的点击播放;
26+
* 事实上其他页面只要将歌曲的id传入到redux中就可以,整个逻辑已经打通;
27+
* 做了歌曲的各种控制(暂停、播放、上一首、下一首、进度改变);
28+
* 做了播放循序切换:顺序播放、随机播放、单曲循环;
29+
* 做了歌词的解析、展示、滚动;
2730

28-
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
31+
![歌曲播放](https://tva1.sinaimg.cn/large/007S8ZIlgy1ghv9pc3ki6j30ws0ahti8.jpg)
2932

30-
### `yarn eject`
33+
排行榜页面:
3134

32-
**Note: this is a one-way operation. Once you `eject`, you can’t go back!**
35+
* 各种榜单的切换;
3336

34-
If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
37+
![排行榜页面](https://tva1.sinaimg.cn/large/007S8ZIlgy1ghv9qjg0m4j31d10p4ai3.jpg)
3538

36-
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
39+
歌单页面:
3740

38-
You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
41+
* 选择分类、选择分类后根据分类切换歌单;
42+
* 根据分类,歌单列表的展示;
43+
* 分页功能;
3944

40-
## Learn More
45+
![歌单页面](https://tva1.sinaimg.cn/large/007S8ZIlgy1ghv9rsp1stj31d10p44j2.jpg)
4146

42-
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
47+
主播电台:
4348

44-
To learn React, check out the [React documentation](https://reactjs.org/).
49+
* 电台分类的展示、滚动;
50+
* 不同分类展示不同的数据;
51+
* 电台排行榜展示、分页;
4552

46-
### Code Splitting
53+
![主播电台](https://tva1.sinaimg.cn/large/007S8ZIlgy1ghv9sxt3nqj31d10p4k4s.jpg)
4754

48-
This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting
55+
歌手页面:
4956

50-
### Analyzing the Bundle Size
57+
* 各种歌手分类(没找到接口,还自定义了一些数据)
58+
* 歌手字母分类、对应歌手展示;
5159

52-
This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size
60+
![歌手页面](https://tva1.sinaimg.cn/large/007S8ZIlgy1ghv9ts3h5dj31d10p4qfo.jpg)
5361

54-
### Making a Progressive Web App
62+
新碟上架页面:
5563

56-
This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app
64+
* 热门新碟;
65+
* 全部新碟、分页展示;
5766

58-
### Advanced Configuration
67+
![新碟上架页面](https://tva1.sinaimg.cn/large/007S8ZIlgy1ghv9uryexgj31d10p4aue.jpg)
5968

60-
This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration
6169

62-
### Deployment
6370

64-
This section has moved here: https://facebook.github.io/create-react-app/docs/deployment
71+
### 1.2. 项目规范
72+
73+
**项目规范:项目中有一些开发规范和代码风格**
74+
75+
* 1.文件夹、文件名称统一小写、多个单词以连接符(-)连接;
76+
* 2.JavaScript变量名称采用小驼峰标识,常量全部使用大写字母,组件采用大驼峰;
77+
* 3.CSS采用普通CSS和styled-component结合来编写(全局采用普通CSS、局部采用styled-component);
78+
* 4.整个项目不再使用class组件,统一使用函数式组件,并且全面使用Hooks;
79+
* 5.所有的函数式组件,为了避免不必要的渲染,全部使用memo进行包裹;
80+
* 6.组件内部的状态,使用useState、useReducer;业务数据全部放在redux中管理;
81+
* 7.函数组件内部基本按照如下顺序编写代码:
82+
* 组件内部state管理;
83+
* redux的hooks代码;
84+
* 其他组件hooks代码;
85+
* 其他逻辑代码;
86+
* 返回JSX代码;
87+
* 8.redux代码规范如下:
88+
* redux结合ImmutableJS
89+
* 每个模块有自己独立的reducer,通过combineReducer进行合并;
90+
* 异步请求代码使用redux-thunk,并且写在actionCreators中;
91+
* redux直接采用redux hooks方式编写,不再使用connect;
92+
* 9.网络请求采用axios
93+
* 对axios进行二次封装;
94+
* 所有的模块请求会放到一个请求文件中单独管理;
95+
* 10.项目使用AntDesign
96+
* 项目中某些AntDesign中的组件会被拿过来使用;
97+
* 但是多部分组件还是自己进行编写;
98+
* 其他规范在项目中根据实际情况决定和编写;
99+
100+
101+
102+
### 1.3. 项目运行
103+
104+
clone项目:
105+
106+
```
107+
git clone https://github.com/coderwhy/hy-react-web-music.git
108+
```
109+
110+
安装项目依赖:
111+
112+
```shell
113+
yarn install
114+
```
115+
116+
项目运行:
117+
118+
```shell
119+
yarn start
120+
```
121+
65122

66-
### `yarn build` fails to minify
67123

68-
This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify

0 commit comments

Comments
 (0)