Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rttmoa/react-redux-dianping
dianping-h5
https://github.com/rttmoa/react-redux-dianping
koa less react-redux reactjs
Last synced: 9 days ago
JSON representation
dianping-h5
- Host: GitHub
- URL: https://github.com/rttmoa/react-redux-dianping
- Owner: rttmoa
- License: other
- Created: 2023-02-09T15:31:11.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-09T03:37:28.000Z (4 months ago)
- Last Synced: 2024-11-07T22:13:24.077Z (2 months ago)
- Topics: koa, less, react-redux, reactjs
- Language: JavaScript
- Homepage:
- Size: 34.2 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 项目目录
**安装:**`npm install`
**启动:**`npm run mock & npm start`
**改动程序需多次重启服务**
**项目已备份**
**[Url](https://coding.imooc.com/class/chapter/313.html#Anchor](https://coding.imooc.com/class/chapter/313.html#Anchor))**
* [X] 端口:本地(8080),Mock(3000)
* [X] Webpack配置(开发与生产环境)
* [X] Class组件开发
* [X] 路由跳转 及 请求参数
* [X] 全局Less、IconFont图标(eot,svg,ttf,woff)的配置:[icomoon](https://icomoon.io/app/#/select)
* [X] 轮播图 | 超值特惠 | 猜你喜欢 本地图片渲染 & 远程地址(error)
* [X] import * as Name from ""```
import * as userInfoActionsFromOtherFile from'../actions/userinfo'
asuserInfoActionsFromOtherFilefrom: {__esModule: true, update: ƒ, User: ƒ}
导出所有as名称 可以使用所有属性方法
```
* [X] Redux使用```
export default connect( mapStateToProps, mapDispatchToProps )(Home)
```
* [X] Login页面登陆后、刷新页面、Redux数据消失 --> 解决办法 1、使用localstoreage 2、redux持久化(persist)
* [X] Login页面父子组件传值
* [X] User页面组件封装(订单评价)
* [X] User页面订单列表接口 & 提交评论接口
* [X] City页面```
Redux取值、Redux储存、localstoreage存储、history跳转
```
* [X] Search页面```
window.history.back()
hashHistory.push('/search/all/' + encodeURIComponent(value))
/api/search/0/北京/all/UserName长
根据城市名+文章+关键词发请求
滚动加载 获取数据 重新渲染
处理重新搜索:componentDidUpdate(prevProps, prevState) {
if (keyword === prevProps.keyword && category === prevProps.category) { return }
}
节流函数、滚动加载 组件 | window.addEventListener('scroll', function () {}
```
* [X] Detail页面```
购买拦截:hashHistory.push('/Login/' + encodeURIComponent('/detail/' + id))
获取首页数据: /api/detail/comment/1/5889520870693865
```