{"id":22746402,"url":"https://github.com/zhujiaming/zhihudailyrn","last_synced_at":"2025-07-10T20:33:55.123Z","repository":{"id":120627412,"uuid":"98080008","full_name":"zhujiaming/zhihudailyrn","owner":"zhujiaming","description":"一款使用ReactNative 0.45编写的高仿《知乎日报》的app","archived":false,"fork":false,"pushed_at":"2017-12-28T03:41:42.000Z","size":20022,"stargazers_count":20,"open_issues_count":2,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-14T10:21:49.190Z","etag":null,"topics":["android","ios","javascript","react-native","react-redux","react-router","reactnativedemo"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zhujiaming.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-07-23T06:49:12.000Z","updated_at":"2022-10-11T03:55:46.000Z","dependencies_parsed_at":null,"dependency_job_id":"d36df467-299e-48d1-ab7c-c04ca808d8f2","html_url":"https://github.com/zhujiaming/zhihudailyrn","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zhujiaming/zhihudailyrn","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhujiaming%2Fzhihudailyrn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhujiaming%2Fzhihudailyrn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhujiaming%2Fzhihudailyrn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhujiaming%2Fzhihudailyrn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zhujiaming","download_url":"https://codeload.github.com/zhujiaming/zhihudailyrn/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhujiaming%2Fzhihudailyrn/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264652769,"owners_count":23644328,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","ios","javascript","react-native","react-redux","react-router","reactnativedemo"],"created_at":"2024-12-11T02:13:12.837Z","updated_at":"2025-07-10T20:33:55.118Z","avatar_url":"https://github.com/zhujiaming.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![](https://img.shields.io/badge/ReactNative%E6%8A%80%E6%9C%AF%E5%AD%A6%E4%B9%A0%E4%BA%A4%E6%B5%81%E7%BE%A4-632963422-green.svg)\r\n#### 下载安装( for android)\r\n---\r\n![](https://www.pgyer.com/app/qrcode/Z0xA)\r\n#### 简介\r\n---\r\n\u003e 这是一款使用ReactNative技术写的高仿《知乎日报》的客户端。\r\n主要目的为学习ReactNative，掌握其API使用及原理等知识。\r\n\u003e  主要实现了《知乎日报》App的首页，详情页，评论页，专题页，抽屉页，登录页，主编页等页面的绘制与数据处理，以及日夜切换模式。（目前仅实现了Android端的适配。。）几乎90%+的代码在ReactNative端编写。\r\n\r\n\r\n\r\n- 框架\r\n\r\n项目使用的ReactNative版本为0.45.1，遵循ES6语法特性。\r\n本着学习的目的，尽管项目不是大型项目，但还是采用了Redux架构，加深对Redux架构的理解，并且为之后的拓展打基础。并且采用了redux-thunk 中间件，来更加灵活的处理各类的异步操作。\r\n\r\n- 页面路由\r\n\r\n项目路由导航机制采用了时下facebook官方推荐的React-Navigation导航组件，其也采用了redux的架构思想，通过action的dispatch灵活进行路由操作，个人觉得与44版本之前的Navigator组件差别不是很大，甚至更加灵活。\r\n\r\n- 数据缓存\r\n\r\n项目中加入了数据缓存机制，对于不同页面的网络数据采用了不同的缓存策略（具体可参看源码注释），本来可以使用AsyncStorage来实现缓存，偶然发现了react-native-storage这个对AsyncStorage进一步封装的第三方JS库，功能挺完善，挺强大，由RN中文网维护。\r\n\r\n- 网络\r\n\r\n网络框架方面，对ReactNative提供的Fetch对象进行了简单的封装，通过添加定时任务，完善网络请求的超时功能，并且封装了统一请求头，请求类型等，对外返回Promise对象，异步处理请求结果。\r\n\r\n- 动画\r\n\r\n动画方面，既有ReactNative方面的动画涉及，也有android原生动画涉及，例如启动页的icon动画，与原App几乎无差别，但在有些地方想通过RN实现原生的动画确实有些困难，达不到那种流畅效果。\r\n\r\n- web网页加载\r\n\r\nweb网页显示确实在当前RN版本中存在着一些坑，比如rn的webView控件在安卓端未提供网页滚动事件的监听而无法实现一些特殊效果，项目中的做法干脆就是直接通过原生WebView自定义RN的WebView,向RN回调滚动事件，效果还行。\r\n\r\n- 其他\r\n\r\n其他方面涉及到一些自定义View，各类ListView的使用，页面的绘制，一些效果的实现，以及遇到的一些坑等，会在其他笔记文章中记录及分析。\r\n\r\n（默默的感谢下该知乎日报API的提供者）\r\n#### ScreenShot\r\n---\r\n\r\n\r\n![欢迎页-首页](http://upload-images.jianshu.io/upload_images/1948083-1406060e235ba90b.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/800)\r\n\r\n\r\n\r\n\r\n![22222.jpg](http://upload-images.jianshu.io/upload_images/1948083-904c2d7d8d3688a5.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/800)\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n![3333.jpg](http://upload-images.jianshu.io/upload_images/1948083-50d429b86aa68b29.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/800)\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n![4444.jpg](http://upload-images.jianshu.io/upload_images/1948083-e42aab5516007d1e.jpg?imageMogr2/auto-orient/strip%7CimageView2/2/w/800)\r\n\r\n\r\n#### 第三方依赖\r\n---\r\n- [react-redux/redux/redux-thunk](http://www.ruanyifeng.com/blog/2016/09/redux_tutorial_part_one_basic_usages.html)\r\n-  [react-navigation](https://reactnavigation.org)\r\n- [react-native-extra-dimensions-android](https://github.com/Sunhat/react-native-extra-dimensions-android)\r\n- [react-native-storage](https://github.com/sunnylqm/react-native-storage)\r\n- [react-native-svg](https://github.com/react-native-community/react-native-svg)\r\n\r\n\r\n\r\n#### 安装配置\r\n---\r\n 1.clone the repo\r\n\r\n\u003e git clone https://git.oschina.net/null_711_9174/zhihudailyrn.git\r\n\r\n\u003ecd zhihudailyrn\r\n\r\n 2.install dependencies \r\n\u003e npm install\r\n\r\n 3.run on android \r\n\u003e react-native run-android\r\n\r\n#### 最后\r\n\r\n#####    觉得还行可以给个 star 鼓励下哦  (￣▽￣)~*\r\n\r\n由于擅长Android开发，加上最近并行其他项目，所以目前仅适配了Android端。\r\n\r\n项目中还有很多问题和待优化的地方，我会持续更新这个项目。\r\n如果发现有问题的地方或者建议等，很希望能告知联系，大家相互学习，共同进步😉。\r\n\r\n该项目的目的仅供学习交流，如果有侵犯他人权益，还望指出。\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhujiaming%2Fzhihudailyrn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzhujiaming%2Fzhihudailyrn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhujiaming%2Fzhihudailyrn/lists"}