├── .buckconfig ├── .eslintrc.js ├── .flowconfig ├── .gitattributes ├── .gitignore ├── .prettierrc.js ├── .vscode ├── launch.json └── settings.json ├── .watchmanconfig ├── README.md ├── __tests__ └── App-test.js ├── android ├── app │ ├── BUCK │ ├── build.gradle │ ├── build_defs.bzl │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ ├── proguard-rules.pro │ ├── release │ │ └── output.json │ └── src │ │ ├── debug │ │ └── AndroidManifest.xml │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── assets │ │ └── fonts │ │ │ ├── AntDesign.ttf │ │ │ ├── Entypo.ttf │ │ │ ├── EvilIcons.ttf │ │ │ ├── Feather.ttf │ │ │ ├── FontAwesome.ttf │ │ │ ├── FontAwesome5_Brands.ttf │ │ │ ├── FontAwesome5_Regular.ttf │ │ │ ├── FontAwesome5_Solid.ttf │ │ │ ├── Foundation.ttf │ │ │ ├── Ionicons.ttf │ │ │ ├── MaterialCommunityIcons.ttf │ │ │ ├── MaterialIcons.ttf │ │ │ ├── Octicons.ttf │ │ │ ├── Roboto.ttf │ │ │ ├── Roboto_medium.ttf │ │ │ ├── SimpleLineIcons.ttf │ │ │ ├── Zocial.ttf │ │ │ └── rubicon-icon-font.ttf │ │ ├── java │ │ └── com │ │ │ └── react_native_project │ │ │ ├── MainActivity.java │ │ │ ├── MainApplication.java │ │ │ ├── module │ │ │ ├── LocationModule.java │ │ │ └── LocationReactPackage.java │ │ │ └── wxapi │ │ │ └── WXEntryActivity.java │ │ └── res │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ ├── ic_launcher1.png │ │ ├── ic_launcher_round.png │ │ └── ic_launcher_round1.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ ├── ic_launcher1.png │ │ ├── ic_launcher_round.png │ │ └── ic_launcher_round1.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ ├── ic_launcher1.png │ │ ├── ic_launcher_round.png │ │ └── ic_launcher_round1.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ ├── ic_launcher1.png │ │ ├── ic_launcher_round.png │ │ └── ic_launcher_round1.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ ├── ic_launcher1.png │ │ ├── ic_launcher_round.png │ │ └── ic_launcher_round1.png │ │ ├── values │ │ ├── colors.xml │ │ ├── strings.xml │ │ └── styles.xml │ │ └── xml │ │ └── network_security_config.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── lib │ ├── kotlin-reflect-sources.jar │ ├── kotlin-reflect.jar │ ├── kotlin-stdlib-sources.jar │ ├── kotlin-stdlib.jar │ ├── kotlin-test-sources.jar │ └── kotlin-test.jar └── settings.gradle ├── app.json ├── babel.config.js ├── index.js ├── ios ├── Podfile ├── react_native_project-tvOS │ └── Info.plist ├── react_native_project-tvOSTests │ └── Info.plist ├── react_native_project.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ │ └── xcschemes │ │ ├── react_native_project-tvOS.xcscheme │ │ └── react_native_project.xcscheme ├── react_native_project │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Base.lproj │ │ └── LaunchScreen.xib │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── Contents.json │ ├── Info.plist │ └── main.m └── react_native_projectTests │ ├── Info.plist │ └── react_native_projectTests.m ├── metro.config.js ├── package.json └── src ├── App.js ├── assets ├── images │ ├── 1.png │ ├── 2.jpg │ ├── activeicon_home.png │ ├── activeicon_me.png │ ├── activeicon_message.png │ ├── activeicon_recommend.png │ ├── aloe_vera.png │ ├── audio.png │ ├── bg.jpg │ ├── branch.png │ ├── exam_icon.png │ ├── filePng │ │ ├── audio.png │ │ ├── dir.png │ │ ├── doc.png │ │ ├── img.png │ │ ├── pdf.png │ │ ├── ppt.png │ │ ├── qsz.jpg │ │ ├── txt.png │ │ ├── unknown.png │ │ ├── video.png │ │ ├── xls.png │ │ ├── xml.png │ │ └── zip.png │ ├── flower.png │ ├── grade.png │ ├── headbg.png │ ├── icon_home.png │ ├── icon_me.png │ ├── icon_message.png │ ├── icon_recommend.png │ ├── information.png │ ├── logo.png │ ├── mushroom.png │ ├── mydisk.png │ ├── noAudio.jpg │ ├── noPicture.jpg │ ├── others.png │ ├── question.png │ ├── sound.png │ ├── sound_active.png │ ├── spring_leaves.png │ ├── study.png │ ├── user_avatar.png │ └── video │ │ ├── icon_back.png │ │ ├── icon_back@2x.png │ │ ├── icon_back@3x.png │ │ ├── icon_control_full_screen.png │ │ ├── icon_control_full_screen@2x.png │ │ ├── icon_control_full_screen@3x.png │ │ ├── icon_control_pause.png │ │ ├── icon_control_play.png │ │ ├── icon_control_shrink_screen.png │ │ ├── icon_control_shrink_screen@2x.png │ │ ├── icon_control_shrink_screen@3x.png │ │ ├── icon_control_slider.png │ │ ├── icon_control_slider@2x.png │ │ ├── icon_control_slider@3x.png │ │ ├── icon_right.png │ │ ├── icon_share_qq@2x.png │ │ ├── icon_share_wxsession@2x.png │ │ ├── icon_share_wxtimeline@2x.png │ │ ├── icon_video_collected.png │ │ ├── icon_video_download.png │ │ ├── icon_video_favorite.png │ │ ├── icon_video_lock.png │ │ ├── icon_video_more.png │ │ ├── icon_video_mute.png │ │ ├── icon_video_muted.png │ │ ├── icon_video_pause.png │ │ ├── icon_video_play.png │ │ ├── icon_video_share.png │ │ ├── icon_volume_off.png │ │ ├── icon_volume_up.png │ │ ├── img_bottom_shadow.png │ │ └── img_top_shadow.png ├── imgPath │ ├── answerQuestion.js │ ├── examList.js │ ├── homePage.js │ ├── loginPage.js │ ├── netDisk.js │ └── userCenter.js ├── index.js └── styles │ ├── components │ ├── CardDialog.js │ ├── dialog.js │ ├── imageAudioTab.js │ ├── listItem.js │ ├── loading.js │ ├── resultOption.js │ └── typeBtn.js │ ├── homePage.js │ └── pages │ ├── exam │ ├── addExam.js │ ├── answerQuestion.js │ ├── examList.js │ └── resultStatistics.js │ ├── login │ └── loginPage.js │ ├── netDisk │ └── netDisk.js │ ├── test │ └── tab.js │ └── user │ └── userCenter.js ├── components ├── CardDialog.js ├── Dialog.js ├── Loading.js ├── common │ └── PictureView.js ├── exam │ ├── ImageAudioTab.js │ ├── ResultOption.js │ └── TypeBtn.js ├── user │ └── ListItem.js └── video │ ├── VideoMoreSetting.js │ └── VideoShare.js ├── navigation ├── baseStyle.js ├── exam │ └── examList.js ├── index.js ├── test │ └── test.js └── video │ └── audio.js ├── pages ├── HomePage.js ├── exam │ ├── AddExam.js │ ├── AnswerQuestion.js │ ├── ExamList.js │ └── ResultStatistics.js ├── login │ └── LoginPage.js ├── netDisk │ └── NetDisk.js ├── test │ ├── Tab1.js │ ├── Tab2.js │ ├── Tab3.js │ ├── Tab4.js │ ├── TestModule1.js │ ├── TestModule2.js │ └── TestModule3.js ├── user │ ├── Search.js │ └── UserCenter.js └── video │ ├── VideoList.js │ └── VideoPlayer.js └── utils ├── constant.js ├── file.js ├── globalVar.js ├── request.js └── screen.js /.buckconfig: -------------------------------------------------------------------------------- 1 | 2 | [android] 3 | target = Google Inc.:Google APIs:23 4 | 5 | [maven_repositories] 6 | central = https://repo1.maven.org/maven2 7 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | "env": { 3 | "browser": true, 4 | "es6": true, 5 | "commonjs": true, 6 | }, 7 | "extends": [ 8 | "eslint:recommended", 9 | 'plugin:react/recommended' 10 | ], 11 | "globals": { 12 | "Atomics": "readonly", 13 | "SharedArrayBuffer": "readonly" 14 | }, 15 | "parser": "babel-eslint", 16 | "parserOptions": { 17 | "ecmaFeatures": { 18 | "jsx": true 19 | }, 20 | "ecmaVersion": 2018, 21 | "sourceType": "module" 22 | }, 23 | "plugins": [ 24 | "react", 25 | "react-native" 26 | ], 27 | "rules": { 28 | "indent": [ 29 | "off", 30 | "tab" 31 | ], 32 | "linebreak-style": [ 33 | "off", 34 | "windows" 35 | ], 36 | "quotes": [ 37 | "error", 38 | "single" 39 | ], 40 | "semi": [ 41 | "error", 42 | "always" 43 | ], 44 | "react/jsx-indent-props": [ 45 | "error", 46 | 4 47 | ], 48 | "react/no-direct-mutation-state": 2, 49 | "no-console": 0, 50 | "no-debugger": 2, 51 | "react/prop-types":0 52 | } 53 | }; -------------------------------------------------------------------------------- /.flowconfig: -------------------------------------------------------------------------------- 1 | [ignore] 2 | ; We fork some components by platform 3 | .*/*[.]android.js 4 | 5 | ; Ignore "BUCK" generated dirs 6 | /\.buckd/ 7 | 8 | ; Ignore unexpected extra "@providesModule" 9 | .*/node_modules/.*/node_modules/fbjs/.* 10 | 11 | ; Ignore duplicate module providers 12 | ; For RN Apps installed via npm, "Libraries" folder is inside 13 | ; "node_modules/react-native" but in the source repo it is in the root 14 | node_modules/react-native/Libraries/react-native/React.js 15 | 16 | ; Ignore polyfills 17 | node_modules/react-native/Libraries/polyfills/.* 18 | 19 | ; These should not be required directly 20 | ; require from fbjs/lib instead: require('fbjs/lib/warning') 21 | node_modules/warning/.* 22 | 23 | ; Flow doesn't support platforms 24 | .*/Libraries/Utilities/HMRLoadingView.js 25 | 26 | [untyped] 27 | .*/node_modules/@react-native-community/cli/.*/.* 28 | 29 | [include] 30 | 31 | [libs] 32 | node_modules/react-native/Libraries/react-native/react-native-interface.js 33 | node_modules/react-native/flow/ 34 | 35 | [options] 36 | emoji=true 37 | 38 | esproposal.optional_chaining=enable 39 | esproposal.nullish_coalescing=enable 40 | 41 | module.file_ext=.js 42 | module.file_ext=.json 43 | module.file_ext=.ios.js 44 | 45 | module.system=haste 46 | module.system.haste.use_name_reducers=true 47 | # get basename 48 | module.system.haste.name_reducers='^.*/\([a-zA-Z0-9$_.-]+\.js\(\.flow\)?\)$' -> '\1' 49 | # strip .js or .js.flow suffix 50 | module.system.haste.name_reducers='^\(.*\)\.js\(\.flow\)?$' -> '\1' 51 | # strip .ios suffix 52 | module.system.haste.name_reducers='^\(.*\)\.ios$' -> '\1' 53 | module.system.haste.name_reducers='^\(.*\)\.android$' -> '\1' 54 | module.system.haste.name_reducers='^\(.*\)\.native$' -> '\1' 55 | module.system.haste.paths.blacklist=.*/__tests__/.* 56 | module.system.haste.paths.blacklist=.*/__mocks__/.* 57 | module.system.haste.paths.whitelist=/node_modules/react-native/Libraries/.* 58 | module.system.haste.paths.whitelist=/node_modules/react-native/RNTester/.* 59 | module.system.haste.paths.whitelist=/node_modules/react-native/IntegrationTests/.* 60 | module.system.haste.paths.blacklist=/node_modules/react-native/Libraries/react-native/react-native-implementation.js 61 | module.system.haste.paths.blacklist=/node_modules/react-native/Libraries/Animated/src/polyfills/.* 62 | 63 | munge_underscores=true 64 | 65 | module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub' 66 | 67 | suppress_type=$FlowIssue 68 | suppress_type=$FlowFixMe 69 | suppress_type=$FlowFixMeProps 70 | suppress_type=$FlowFixMeState 71 | 72 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\) 73 | suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)?:? #[0-9]+ 74 | suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError 75 | 76 | [lints] 77 | sketchy-null-number=warn 78 | sketchy-null-mixed=warn 79 | sketchy-number=warn 80 | untyped-type-import=warn 81 | nonstrict-import=warn 82 | deprecated-type=warn 83 | unsafe-getters-setters=warn 84 | inexact-spread=warn 85 | unnecessary-invariant=warn 86 | signature-verification-failure=warn 87 | deprecated-utility=error 88 | 89 | [strict] 90 | deprecated-type 91 | nonstrict-import 92 | sketchy-null 93 | unclear-type 94 | unsafe-getters-setters 95 | untyped-import 96 | untyped-type-import 97 | 98 | [version] 99 | ^0.98.0 100 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.pbxproj -text 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | project.xcworkspace 24 | 25 | # Android/IntelliJ 26 | # 27 | build/ 28 | .idea 29 | .gradle 30 | local.properties 31 | *.iml 32 | 33 | # node.js 34 | # 35 | node_modules/ 36 | npm-debug.log 37 | yarn-error.log 38 | yarn.lock 39 | package-lock.json 40 | 41 | # BUCK 42 | buck-out/ 43 | \.buckd/ 44 | *.keystore 45 | 46 | # fastlane 47 | # 48 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 49 | # screenshots whenever they are needed. 50 | # For more information about the recommended setup visit: 51 | # https://docs.fastlane.tools/best-practices/source-control/ 52 | 53 | */fastlane/report.xml 54 | */fastlane/Preview.html 55 | */fastlane/screenshots 56 | 57 | # Bundle artifact 58 | *.jsbundle 59 | 60 | # CocoaPods 61 | /ios/Pods/ 62 | -------------------------------------------------------------------------------- /.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | bracketSpacing: false, 3 | jsxBracketSameLine: true, 4 | singleQuote: true, 5 | trailingComma: 'all', 6 | }; 7 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "type": "node", 9 | "request": "launch", 10 | "name": "Launch Program", 11 | "program": "${workspaceFolder}\\start" 12 | } 13 | ] 14 | } -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "eslint.autoFixOnSave": true, 3 | "eslint.validate": [ 4 | "javascript", 5 | "javascriptreact" 6 | ], 7 | } -------------------------------------------------------------------------------- /.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## 一、框架介绍 2 | 3 | (1)react-native 项目用得框架以及插件版本号如下所示: 4 | 5 | | 工具名称 | 版本号 | 6 | | -------------- | ------- | 7 | | node.js | 11.12.0 | 8 | | npm | 6.7.0 | 9 | | yarn | 1.17.3 | 10 | | Android Studio | 3.4.1 | 11 | | JDK | 1.8 | 12 | | react | 16.8.6 | 13 | | react-native | 0.60.5 | 14 | 15 | (2)项目的主要功能点如下: 16 | 17 | ![1](.\src\assets\images\1.png) 18 | 19 | (3)项目完成的一些功能界面如下所示: 20 | 21 | ![2](.\src\assets\images\2.jpg) 22 | 23 | 24 | 25 | ## 二、项目启动 26 | 27 | ``` bash 28 | 1、安装 yarn、react-native 的命令行工具 29 | $ npm install -g yarn react-native-cli 30 | 31 | 2、安装完 yarn 后需要设置镜像源 32 | $ yarn config set registry https://registry.npm.taobao.org --global 33 | $ yarn config set disturl https://npm.taobao.org/dist --global 34 | 35 | 3、进入到目录底下,安装插件,例如 react_native_project 目录底下 36 | $ yarn 37 | 38 | 4、Android Studio 的配置不做介绍(weex 开发过,这一步不需要更改),参照:react-native 官网:https://reactnative.cn/docs/getting-started/ 39 | 40 | 5、编译并运行项目 41 | $ react-native run-android 42 | 43 | 6、第 5 步后,如果真机或模拟器提示,Metro 没有启动,可关闭第 5 步开启的 node 窗口,再重启 Metro: 44 | $ npm start 45 | 46 | 7、本项目的服务端接口为本作者的另一开源项目:https://github.com/fengshi123/express_project 47 | ``` 48 | 49 | ## 三、项目结构 50 | 51 | ``` 52 | ├─ .vscode 编辑器配置 53 | ├─ android android 原生目录 54 | ├─ ios ios 原生目录 55 | ├─node_modules 项目依赖包 56 | ├─ src 代码主目录 57 | │ ├─assets 存放样式文件 58 | │ │ ├─images 存放图片 59 | │ │ └─styles 样式文件的 js 目录 60 | │ │ ├─index.js 存放图片路径,可以参照主页面模块写法 61 | │ ├─components 存放块级组件 62 | │ ├─navigation 存放导航配置 63 | │ │ ├─ index.js 导航配置主文件 64 | │ ├─pages 存放页面级组件,不同模块不同目录 65 | │ └─utils 存放工具方法 66 | │ │ ├─ constant.js 一些常量配置,例如:服务器 IP 端口等 67 | │ │ ├─ globalVar.js 一些全部变量 68 | │ │ └─ request.js ajax 请求 69 | ├─.eslintrc.js eslint 配置 70 | ├─.gitignore.js git 忽略配置 71 | ├─index.js 项目入口 72 | ├─package.json 项目依赖包配置 73 | ``` 74 | 75 | 76 | 77 | ## 四、react 代码规范 78 | 79 | ### **1、组件文件的代码结构:** 80 | 81 | - constructor 82 | - 钩子函数 83 | - 方法 84 | - jsx 85 | 86 | ### **2、事件处理的写法** 87 | 88 | 事件处理有以下 4 种写法: 89 | 90 | 推荐使用第 3 种,如果向子组件传递回调函数时 ,则使用第 4 种; 91 | 92 | ```javascript 93 | 1、构造函数中绑定 94 | 缺点:不能传特定的参数; 95 | constructor(props) { 96 | // 为了在回调中使用 `this`,这个绑定是必不可少的 97 | this.handleClick = this.handleClick.bind(this); 98 | 99 | 102 | } 103 | 104 | 2、public class fields 语法 105 | 缺点:不能传特定的参数 106 | handleClick = () => { 107 | console.log('this is:', this); 108 | } 109 | 112 | 113 | 3、在回调中使用箭头函数 114 | 优点:可以传特定参数;rn 的绝大部分 api 写法都是这么写的; 115 | 缺点:react 官网中写 该回调函数作为 prop 传入子组件时,这些组件可能会进行额外的重新渲染。 116 | 117 | 118 | 119 | 120 | 4、第二种 bind 方式 121 | 优点:可以传递特定参数 122 | 123 | ``` 124 | 125 | ### **3、state 避免滥用** 126 | 127 | 更新 state 会对应重新渲染 render,所以对于有些属性,当其值更改时,不需要重新渲染的,那么其没必要放入 state 中; 128 | 129 | ``` 130 | constructor(props) { 131 | super(props); 132 | this.state = { 133 | ... 134 | }; 135 | this.examName = ''; 136 | } 137 | ``` 138 | 139 | ### **4、样式写法** 140 | 141 | 1、样式代码在之前对象的基础上,加上官网建议的 StyleSheet.create(虽然没看出区别,规范下写法) 142 | 143 | 2、样式导入后,统一用 style 这个变量,容易区分 144 | 145 | ```javascript 146 | // 样式定义 147 | import { StyleSheet } from 'react-native'; 148 | export default StyleSheet.create({ 149 | .... 150 | }) 151 | 152 | // 样式导入 153 | import style from '../../assets/styles/pages/exam/addExam'; 154 | 155 | ``` 156 | 157 | ### **5、按模块区分** 158 | 159 | 页面级组件 pages 、导航配置 navigation 、样式文件 styles/pages 、图片路径配置 styles/index.js 160 | 161 | 162 | 163 | ### **6、名称命名** 164 | 165 | - 组件名称采用大驼峰命名规则,例如:LoginPage.js 166 | - 其它如变量、其它文件命名等采用小驼峰命名规则,例如:baseStyle.js 167 | - NativeBase 组件库的组件命名进行区分,例如:import { Button as NbButton, Icon as NbIcon, Text as NbText} from 'native-base'; 168 | 169 | ### 7、请求模块封装 170 | 171 | - 采用 axios 第三方插件; 172 | - options 参数如下: 173 | 174 | ```javascript 175 | let param = { 176 | uid: '1', 177 | password: '111' 178 | }; 179 | let options = { 180 | url: '/getToken', // 请求 url 181 | method: 'POST', // 请求 method,默认 post 类型 182 | data: param // 请求携带参数 183 | tipFlag: false, // 默认统一提示,如果需要自定义提示,传入 true 184 | }; 185 | ``` 186 | 187 | - 封装的请求会 console.log 出每次的请求参数、响应参数; 188 | 189 | ### 8、设备屏幕的宽高获取 190 | 191 | 已经放到 ./utils/screen.js 路径中,有需要的页面可以进行导入; 192 | 193 | -------------------------------------------------------------------------------- /__tests__/App-test.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @format 3 | */ 4 | 5 | import 'react-native'; 6 | import React from 'react'; 7 | import App from '../App'; 8 | 9 | // Note: test renderer must be required after react-native. 10 | import renderer from 'react-test-renderer'; 11 | 12 | it('renders correctly', () => { 13 | renderer.create(); 14 | }); 15 | -------------------------------------------------------------------------------- /android/app/BUCK: -------------------------------------------------------------------------------- 1 | # To learn about Buck see [Docs](https://buckbuild.com/). 2 | # To run your application with Buck: 3 | # - install Buck 4 | # - `npm start` - to start the packager 5 | # - `cd android` 6 | # - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"` 7 | # - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck 8 | # - `buck install -r android/app` - compile, install and run application 9 | # 10 | 11 | load(":build_defs.bzl", "create_aar_targets", "create_jar_targets") 12 | 13 | lib_deps = [] 14 | 15 | create_aar_targets(glob(["libs/*.aar"])) 16 | 17 | create_jar_targets(glob(["libs/*.jar"])) 18 | 19 | android_library( 20 | name = "all-libs", 21 | exported_deps = lib_deps, 22 | ) 23 | 24 | android_library( 25 | name = "app-code", 26 | srcs = glob([ 27 | "src/main/java/**/*.java", 28 | ]), 29 | deps = [ 30 | ":all-libs", 31 | ":build_config", 32 | ":res", 33 | ], 34 | ) 35 | 36 | android_build_config( 37 | name = "build_config", 38 | package = "com.react_native_project", 39 | ) 40 | 41 | android_resource( 42 | name = "res", 43 | package = "com.react_native_project", 44 | res = "src/main/res", 45 | ) 46 | 47 | android_binary( 48 | name = "app", 49 | keystore = "//android/keystores:debug", 50 | manifest = "src/main/AndroidManifest.xml", 51 | package_type = "debug", 52 | deps = [ 53 | ":app-code", 54 | ], 55 | ) 56 | -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "com.android.application" 2 | 3 | import com.android.build.OutputFile 4 | 5 | /** 6 | * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets 7 | * and bundleReleaseJsAndAssets). 8 | * These basically call `react-native bundle` with the correct arguments during the Android build 9 | * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the 10 | * bundle directly from the development server. Below you can see all the possible configurations 11 | * and their defaults. If you decide to add a configuration block, make sure to add it before the 12 | * `apply from: "../../node_modules/react-native/react.gradle"` line. 13 | * 14 | * project.ext.react = [ 15 | * // the name of the generated asset file containing your JS bundle 16 | * bundleAssetName: "index.android.bundle", 17 | * 18 | * // the entry file for bundle generation 19 | * entryFile: "index.android.js", 20 | * 21 | * // https://facebook.github.io/react-native/docs/performance#enable-the-ram-format 22 | * bundleCommand: "ram-bundle", 23 | * 24 | * // whether to bundle JS and assets in debug mode 25 | * bundleInDebug: false, 26 | * 27 | * // whether to bundle JS and assets in release mode 28 | * bundleInRelease: true, 29 | * 30 | * // whether to bundle JS and assets in another build variant (if configured). 31 | * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants 32 | * // The configuration property can be in the following formats 33 | * // 'bundleIn${productFlavor}${buildType}' 34 | * // 'bundleIn${buildType}' 35 | * // bundleInFreeDebug: true, 36 | * // bundleInPaidRelease: true, 37 | * // bundleInBeta: true, 38 | * 39 | * // whether to disable dev mode in custom build variants (by default only disabled in release) 40 | * // for example: to disable dev mode in the staging build type (if configured) 41 | * devDisabledInStaging: true, 42 | * // The configuration property can be in the following formats 43 | * // 'devDisabledIn${productFlavor}${buildType}' 44 | * // 'devDisabledIn${buildType}' 45 | * 46 | * // the root of your project, i.e. where "package.json" lives 47 | * root: "../../", 48 | * 49 | * // where to put the JS bundle asset in debug mode 50 | * jsBundleDirDebug: "$buildDir/intermediates/assets/debug", 51 | * 52 | * // where to put the JS bundle asset in release mode 53 | * jsBundleDirRelease: "$buildDir/intermediates/assets/release", 54 | * 55 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 56 | * // require('./image.png')), in debug mode 57 | * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug", 58 | * 59 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 60 | * // require('./image.png')), in release mode 61 | * resourcesDirRelease: "$buildDir/intermediates/res/merged/release", 62 | * 63 | * // by default the gradle tasks are skipped if none of the JS files or assets change; this means 64 | * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to 65 | * // date; if you have any other folders that you want to ignore for performance reasons (gradle 66 | * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/ 67 | * // for example, you might want to remove it from here. 68 | * inputExcludes: ["android/**", "ios/**"], 69 | * 70 | * // override which node gets called and with what additional arguments 71 | * nodeExecutableAndArgs: ["node"], 72 | * 73 | * // supply additional arguments to the packager 74 | * extraPackagerArgs: [] 75 | * ] 76 | */ 77 | 78 | project.ext.react = [ 79 | entryFile: "index.js", 80 | enableHermes: false, // clean and rebuild if changing 81 | bundleInDebug: true, // todo 暂时解决模拟器标红报错 82 | ] 83 | 84 | apply from: "../../node_modules/react-native/react.gradle" 85 | 86 | /** 87 | * Set this to true to create two separate APKs instead of one: 88 | * - An APK that only works on ARM devices 89 | * - An APK that only works on x86 devices 90 | * The advantage is the size of the APK is reduced by about 4MB. 91 | * Upload all the APKs to the Play Store and people will download 92 | * the correct one based on the CPU architecture of their device. 93 | */ 94 | def enableSeparateBuildPerCPUArchitecture = false 95 | 96 | /** 97 | * Run Proguard to shrink the Java bytecode in release builds. 98 | */ 99 | def enableProguardInReleaseBuilds = false 100 | 101 | /** 102 | * The preferred build flavor of JavaScriptCore. 103 | * 104 | * For example, to use the international variant, you can use: 105 | * `def jscFlavor = 'org.webkit:android-jsc-intl:+'` 106 | * 107 | * The international variant includes ICU i18n library and necessary data 108 | * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that 109 | * give correct results when using with locales other than en-US. Note that 110 | * this variant is about 6MiB larger per architecture than default. 111 | */ 112 | def jscFlavor = 'org.webkit:android-jsc:+' 113 | 114 | /** 115 | * Whether to enable the Hermes VM. 116 | * 117 | * This should be set on project.ext.react and mirrored here. If it is not set 118 | * on project.ext.react, JavaScript will not be compiled to Hermes Bytecode 119 | * and the benefits of using Hermes will therefore be sharply reduced. 120 | */ 121 | def enableHermes = project.ext.react.get("enableHermes", false); 122 | 123 | android { 124 | compileSdkVersion rootProject.ext.compileSdkVersion 125 | 126 | lintOptions { 127 | checkReleaseBuilds false 128 | abortOnError false 129 | } 130 | 131 | compileOptions { 132 | sourceCompatibility JavaVersion.VERSION_1_8 133 | targetCompatibility JavaVersion.VERSION_1_8 134 | } 135 | 136 | defaultConfig { 137 | applicationId "com.react_native_project" 138 | minSdkVersion rootProject.ext.minSdkVersion 139 | targetSdkVersion rootProject.ext.targetSdkVersion 140 | versionCode 1 141 | versionName "1.0" 142 | vectorDrawables.useSupportLibrary = true 143 | } 144 | splits { 145 | abi { 146 | reset() 147 | enable enableSeparateBuildPerCPUArchitecture 148 | universalApk false // If true, also generate a universal APK 149 | include "armeabi-v7a", "x86", "arm64-v8a", "x86_64" 150 | } 151 | } 152 | signingConfigs { 153 | debug { 154 | storeFile file('debug.keystore') 155 | storePassword 'android' 156 | keyAlias 'androiddebugkey' 157 | keyPassword 'android' 158 | } 159 | } 160 | buildTypes { 161 | debug { 162 | signingConfig signingConfigs.debug 163 | } 164 | release { 165 | // Caution! In production, you need to generate your own keystore file. 166 | // see https://facebook.github.io/react-native/docs/signed-apk-android. 167 | signingConfig signingConfigs.debug 168 | minifyEnabled enableProguardInReleaseBuilds 169 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" 170 | } 171 | } 172 | // applicationVariants are e.g. debug, release 173 | applicationVariants.all { variant -> 174 | variant.outputs.each { output -> 175 | // For each separate APK per architecture, set a unique version code as described here: 176 | // https://developer.android.com/studio/build/configure-apk-splits.html 177 | def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4] 178 | def abi = output.getFilter(OutputFile.ABI) 179 | if (abi != null) { // null for the universal-debug, universal-release variants 180 | output.versionCodeOverride = 181 | versionCodes.get(abi) * 1048576 + defaultConfig.versionCode 182 | } 183 | 184 | } 185 | } 186 | 187 | packagingOptions { 188 | // pickFirst '**/armeabi-v7a/libc++_shared.so' 189 | pickFirst '**/x86/libc++_shared.so' 190 | pickFirst '**/arm64-v8a/libc++_shared.so' 191 | pickFirst '**/x86_64/libc++_shared.so' 192 | pickFirst '**/x86/libjsc.so' 193 | // pickFirst '**/armeabi-v7a/libjsc.so' 194 | exclude '**/armeabi-v7a/libjsc.so' 195 | exclude '**/armeabi-v7a/libc++_shared.so' 196 | } 197 | } 198 | 199 | dependencies { 200 | // method 1 201 | compile project(':RCTWeChat') 202 | compile project(':react-native-audio') 203 | compile project(':react-native-doc-viewer') 204 | // ------ 205 | implementation fileTree(dir: "libs", include: ["*.jar"]) 206 | implementation "com.facebook.react:react-native:+" // From node_modules 207 | 208 | if (enableHermes) { 209 | def hermesPath = "../../node_modules/hermesvm/android/"; 210 | debugImplementation files(hermesPath + "hermes-debug.aar") 211 | releaseImplementation files(hermesPath + "hermes-release.aar") 212 | } else { 213 | implementation jscFlavor 214 | } 215 | } 216 | 217 | // Run this once to be able to run the application with BUCK 218 | // puts all compile dependencies into folder libs for BUCK to use 219 | task copyDownloadableDepsToLibs(type: Copy) { 220 | from configurations.compile 221 | into 'libs' 222 | } 223 | apply from: "../../node_modules/react-native-vector-icons/fonts.gradle" 224 | apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project) 225 | -------------------------------------------------------------------------------- /android/app/build_defs.bzl: -------------------------------------------------------------------------------- 1 | """Helper definitions to glob .aar and .jar targets""" 2 | 3 | def create_aar_targets(aarfiles): 4 | for aarfile in aarfiles: 5 | name = "aars__" + aarfile[aarfile.rindex("/") + 1:aarfile.rindex(".aar")] 6 | lib_deps.append(":" + name) 7 | android_prebuilt_aar( 8 | name = name, 9 | aar = aarfile, 10 | ) 11 | 12 | def create_jar_targets(jarfiles): 13 | for jarfile in jarfiles: 14 | name = "jars__" + jarfile[jarfile.rindex("/") + 1:jarfile.rindex(".jar")] 15 | lib_deps.append(":" + name) 16 | prebuilt_jar( 17 | name = name, 18 | binary_jar = jarfile, 19 | ) 20 | -------------------------------------------------------------------------------- /android/app/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/android/app/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /android/app/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /android/app/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Attempt to set APP_HOME 10 | # Resolve links: $0 may be a link 11 | PRG="$0" 12 | # Need this for relative symlinks. 13 | while [ -h "$PRG" ] ; do 14 | ls=`ls -ld "$PRG"` 15 | link=`expr "$ls" : '.*-> \(.*\)$'` 16 | if expr "$link" : '/.*' > /dev/null; then 17 | PRG="$link" 18 | else 19 | PRG=`dirname "$PRG"`"/$link" 20 | fi 21 | done 22 | SAVED="`pwd`" 23 | cd "`dirname \"$PRG\"`/" >/dev/null 24 | APP_HOME="`pwd -P`" 25 | cd "$SAVED" >/dev/null 26 | 27 | APP_NAME="Gradle" 28 | APP_BASE_NAME=`basename "$0"` 29 | 30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 31 | DEFAULT_JVM_OPTS="" 32 | 33 | # Use the maximum available, or set MAX_FD != -1 to use that value. 34 | MAX_FD="maximum" 35 | 36 | warn () { 37 | echo "$*" 38 | } 39 | 40 | die () { 41 | echo 42 | echo "$*" 43 | echo 44 | exit 1 45 | } 46 | 47 | # OS specific support (must be 'true' or 'false'). 48 | cygwin=false 49 | msys=false 50 | darwin=false 51 | nonstop=false 52 | case "`uname`" in 53 | CYGWIN* ) 54 | cygwin=true 55 | ;; 56 | Darwin* ) 57 | darwin=true 58 | ;; 59 | MINGW* ) 60 | msys=true 61 | ;; 62 | NONSTOP* ) 63 | nonstop=true 64 | ;; 65 | esac 66 | 67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 68 | 69 | # Determine the Java command to use to start the JVM. 70 | if [ -n "$JAVA_HOME" ] ; then 71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 72 | # IBM's JDK on AIX uses strange locations for the executables 73 | JAVACMD="$JAVA_HOME/jre/sh/java" 74 | else 75 | JAVACMD="$JAVA_HOME/bin/java" 76 | fi 77 | if [ ! -x "$JAVACMD" ] ; then 78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 79 | 80 | Please set the JAVA_HOME variable in your environment to match the 81 | location of your Java installation." 82 | fi 83 | else 84 | JAVACMD="java" 85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 86 | 87 | Please set the JAVA_HOME variable in your environment to match the 88 | location of your Java installation." 89 | fi 90 | 91 | # Increase the maximum file descriptors if we can. 92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 93 | MAX_FD_LIMIT=`ulimit -H -n` 94 | if [ $? -eq 0 ] ; then 95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 96 | MAX_FD="$MAX_FD_LIMIT" 97 | fi 98 | ulimit -n $MAX_FD 99 | if [ $? -ne 0 ] ; then 100 | warn "Could not set maximum file descriptor limit: $MAX_FD" 101 | fi 102 | else 103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 104 | fi 105 | fi 106 | 107 | # For Darwin, add options to specify how the application appears in the dock 108 | if $darwin; then 109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 110 | fi 111 | 112 | # For Cygwin, switch paths to Windows format before running java 113 | if $cygwin ; then 114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 116 | JAVACMD=`cygpath --unix "$JAVACMD"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Escape application args 158 | save () { 159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 160 | echo " " 161 | } 162 | APP_ARGS=$(save "$@") 163 | 164 | # Collect all arguments for the java command, following the shell quoting and substitution rules 165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 166 | 167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong 168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then 169 | cd "$(dirname "$0")" 170 | fi 171 | 172 | exec "$JAVACMD" "$@" 173 | -------------------------------------------------------------------------------- /android/app/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /android/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | -keep class com.tencent.mm.sdk.** { 12 | *; 13 | } 14 | -------------------------------------------------------------------------------- /android/app/release/output.json: -------------------------------------------------------------------------------- 1 | [{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":1,"versionName":"1.0","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}] -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 27 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/AntDesign.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/android/app/src/main/assets/fonts/AntDesign.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Entypo.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/android/app/src/main/assets/fonts/Entypo.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/EvilIcons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/android/app/src/main/assets/fonts/EvilIcons.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Feather.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/android/app/src/main/assets/fonts/Feather.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/FontAwesome.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/android/app/src/main/assets/fonts/FontAwesome.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/FontAwesome5_Brands.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/android/app/src/main/assets/fonts/FontAwesome5_Brands.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/FontAwesome5_Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/android/app/src/main/assets/fonts/FontAwesome5_Regular.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/FontAwesome5_Solid.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/android/app/src/main/assets/fonts/FontAwesome5_Solid.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Foundation.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/android/app/src/main/assets/fonts/Foundation.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Ionicons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/android/app/src/main/assets/fonts/Ionicons.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/MaterialCommunityIcons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/android/app/src/main/assets/fonts/MaterialCommunityIcons.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/MaterialIcons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/android/app/src/main/assets/fonts/MaterialIcons.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Octicons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/android/app/src/main/assets/fonts/Octicons.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Roboto.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/android/app/src/main/assets/fonts/Roboto.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Roboto_medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/android/app/src/main/assets/fonts/Roboto_medium.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/SimpleLineIcons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/android/app/src/main/assets/fonts/SimpleLineIcons.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Zocial.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/android/app/src/main/assets/fonts/Zocial.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/rubicon-icon-font.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/android/app/src/main/assets/fonts/rubicon-icon-font.ttf -------------------------------------------------------------------------------- /android/app/src/main/java/com/react_native_project/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.react_native_project; 2 | 3 | import com.facebook.react.ReactActivity; 4 | import com.theweflex.react.WeChatPackage; 5 | 6 | public class MainActivity extends ReactActivity { 7 | 8 | /** 9 | * Returns the name of the main component registered from JavaScript. 10 | * This is used to schedule rendering of the component. 11 | */ 12 | @Override 13 | protected String getMainComponentName() { 14 | return "react_native_project"; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/react_native_project/MainApplication.java: -------------------------------------------------------------------------------- 1 | package com.react_native_project; 2 | 3 | import android.app.Application; 4 | 5 | import com.facebook.react.PackageList; 6 | import com.facebook.react.ReactApplication; 7 | import com.facebook.react.ReactNativeHost; 8 | import com.facebook.react.ReactPackage; 9 | import com.facebook.soloader.SoLoader; 10 | import com.react_native_project.module.LocationReactPackage; 11 | import com.theweflex.react.WeChatPackage; 12 | //import com.rnim.rn.audio.ReactNativeAudioPackage; 13 | 14 | import java.util.List; 15 | 16 | public class MainApplication extends Application implements ReactApplication { 17 | 18 | private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) { 19 | @Override 20 | public boolean getUseDeveloperSupport() { 21 | return BuildConfig.DEBUG; 22 | } 23 | 24 | @Override 25 | protected List getPackages() { 26 | @SuppressWarnings("UnnecessaryLocalVariable") 27 | List packages = new PackageList(this).getPackages(); 28 | // Packages that cannot be autolinked yet can be added manually here, for example: 29 | // packages.add(new MyReactNativePackage()); 30 | packages.add(new LocationReactPackage()); 31 | packages.add(new WeChatPackage()); 32 | // packages.add(new ReactNativeAudioPackage()); 33 | return packages; 34 | } 35 | 36 | @Override 37 | protected String getJSMainModuleName() { 38 | return "index"; 39 | } 40 | }; 41 | 42 | @Override 43 | public ReactNativeHost getReactNativeHost() { 44 | return mReactNativeHost; 45 | } 46 | 47 | @Override 48 | public void onCreate() { 49 | super.onCreate(); 50 | SoLoader.init(this, /* native exopackage */ false); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/react_native_project/module/LocationModule.java: -------------------------------------------------------------------------------- 1 | package com.react_native_project.module; 2 | 3 | import android.content.Context; 4 | import android.location.Address; 5 | import android.location.Criteria; 6 | import android.location.Geocoder; 7 | import android.location.Location; 8 | import android.location.LocationManager; 9 | 10 | import com.facebook.react.bridge.Callback; 11 | import com.facebook.react.bridge.ReactApplicationContext; 12 | import com.facebook.react.bridge.ReactContextBaseJavaModule; 13 | import com.facebook.react.bridge.ReactMethod; 14 | 15 | import java.io.IOException; 16 | import java.util.List; 17 | import java.util.Locale; 18 | 19 | public class LocationModule extends ReactContextBaseJavaModule { 20 | private final ReactApplicationContext mContext; 21 | public LocationModule(ReactApplicationContext reactContext) { 22 | super(reactContext); 23 | mContext = reactContext; 24 | } 25 | 26 | /** 27 | * @return js调用的模块名 28 | */ 29 | @Override 30 | public String getName() { 31 | return "LocationModule"; 32 | } 33 | 34 | 35 | /** 36 | * 使用ReactMethod注解,使这个方法被js调用 37 | */ 38 | @ReactMethod 39 | public void getLocation(Callback locationCallback) { 40 | // 设置配置信息 41 | Criteria c = new Criteria(); 42 | // 设置耗电量为低耗电 43 | c.setPowerRequirement(Criteria.POWER_LOW); 44 | // 设置海拔不需要 45 | c.setAltitudeRequired(false); 46 | // 设置导向不需要 47 | c.setBearingRequired(false); 48 | // 设置精度为低 49 | c.setAccuracy(Criteria.ACCURACY_LOW); 50 | // 设置成本为不需要 51 | c.setCostAllowed(false); 52 | 53 | LocationManager manager = (LocationManager) mContext.getSystemService(Context.LOCATION_SERVICE); 54 | String bestProvider = manager.getBestProvider(c, true); 55 | // 得到定位信息 56 | Location location = null; 57 | location = manager.getLastKnownLocation(bestProvider); 58 | // 如果没有最好的定位方案则手动配置 59 | if (null == location){ 60 | if (manager.isProviderEnabled(LocationManager.GPS_PROVIDER)){ 61 | location = manager.getLastKnownLocation(LocationManager.GPS_PROVIDER); 62 | }else if (manager.isProviderEnabled(LocationManager.NETWORK_PROVIDER)) { 63 | location = manager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER); 64 | }else if (manager.isProviderEnabled(LocationManager.PASSIVE_PROVIDER)){ 65 | location = manager.getLastKnownLocation(LocationManager.GPS_PROVIDER); 66 | } 67 | } 68 | 69 | if(null != location){ 70 | // 获取纬度 71 | double lat = location.getLatitude(); 72 | // 获取经度 73 | double lng = location.getLongitude(); 74 | 75 | // 通过地理编码的到具体位置信息 76 | Geocoder geocoder = new Geocoder(mContext, Locale.CHINESE); 77 | List
addresses = null; 78 | try { 79 | addresses = geocoder.getFromLocation(location.getLatitude(), location.getLongitude(), 1); 80 | } catch (IOException e) { 81 | e.printStackTrace(); 82 | } 83 | // if (addresses.size()<=0){ 84 | // // Log.i(TAG, "获取地址失败!"); 85 | // } 86 | Address address = addresses.get(0); 87 | String country = address.getCountryName();//得到国家 88 | String locality = address.getLocality();//得到城市 89 | 90 | locationCallback.invoke(lat,lng,country,locality); 91 | }else{ 92 | locationCallback.invoke(false); 93 | } 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/react_native_project/module/LocationReactPackage.java: -------------------------------------------------------------------------------- 1 | package com.react_native_project.module; 2 | 3 | import com.facebook.react.ReactPackage; 4 | import com.facebook.react.bridge.NativeModule; 5 | import com.facebook.react.bridge.ReactApplicationContext; 6 | import com.facebook.react.uimanager.ViewManager; 7 | 8 | import java.util.ArrayList; 9 | import java.util.Collections; 10 | import java.util.List; 11 | 12 | public class LocationReactPackage implements ReactPackage { 13 | /** 14 | * 15 | * @param reactContext 上下文 16 | * @return 需要调用的原生控件 17 | */ 18 | @Override 19 | public List createViewManagers(ReactApplicationContext reactContext) { 20 | return Collections.emptyList(); 21 | } 22 | 23 | /** 24 | * 25 | * @param reactContext 上下文 26 | * @return 需要调用的原生模块 27 | */ 28 | @Override 29 | public List createNativeModules( 30 | ReactApplicationContext reactContext) { 31 | List modules = new ArrayList<>(); 32 | modules.add(new LocationModule(reactContext)); 33 | return modules; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/react_native_project/wxapi/WXEntryActivity.java: -------------------------------------------------------------------------------- 1 | package com.react_native_project; 2 | 3 | import android.app.Activity; 4 | import android.os.Bundle; 5 | import com.theweflex.react.WeChatModule; 6 | 7 | public class WXEntryActivity extends Activity { 8 | @Override 9 | protected void onCreate(Bundle savedInstanceState) { 10 | super.onCreate(savedInstanceState); 11 | WeChatModule.handleIntent(getIntent()); 12 | finish(); 13 | } 14 | } -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/android/app/src/main/res/mipmap-hdpi/ic_launcher1.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher_round1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/android/app/src/main/res/mipmap-hdpi/ic_launcher_round1.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/android/app/src/main/res/mipmap-mdpi/ic_launcher1.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher_round1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/android/app/src/main/res/mipmap-mdpi/ic_launcher_round1.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/android/app/src/main/res/mipmap-xhdpi/ic_launcher1.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher_round1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round1.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher1.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round1.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher1.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round1.png -------------------------------------------------------------------------------- /android/app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | RN APP 3 | 4 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /android/app/src/main/res/xml/network_security_config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 172.20.111.30 6 | localhost 7 | 10.0.1.1 8 | 9 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | ext { 5 | buildToolsVersion = "28.0.3" 6 | minSdkVersion = 16 7 | compileSdkVersion = 28 8 | targetSdkVersion = 28 9 | supportLibVersion = "28.0.0" 10 | } 11 | repositories { 12 | google() 13 | // jcenter() 14 | maven{url 'http://maven.aliyun.com/nexus/content/groups/public/'} 15 | mavenLocal() 16 | jcenter() 17 | 18 | mavenCentral() 19 | // google() 20 | } 21 | dependencies { 22 | classpath("com.android.tools.build:gradle:3.4.1") 23 | 24 | // NOTE: Do not place your application dependencies here; they belong 25 | // in the individual module build.gradle files 26 | } 27 | } 28 | 29 | allprojects { 30 | repositories { 31 | google() 32 | maven{url 'http://maven.aliyun.com/nexus/content/groups/public/'} 33 | mavenLocal() 34 | maven { 35 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 36 | url("$rootDir/../node_modules/react-native/android") 37 | } 38 | maven { 39 | // Android JSC is installed from npm 40 | url("$rootDir/../node_modules/jsc-android/dist") 41 | } 42 | // add for file-selector 43 | maven { 44 | url "http://dl.bintray.com/lukaville/maven" 45 | } 46 | // ADD THIS 47 | maven { url 'https://maven.google.com' } 48 | // ADD THIS 49 | maven { url "https://jitpack.io" } 50 | 51 | // google() 52 | mavenLocal() 53 | jcenter() 54 | mavenCentral() 55 | // jcenter() 56 | // google() 57 | } 58 | } -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | 20 | android.useAndroidX=true 21 | android.enableJetifier=true 22 | kotlinVersion=1.3.30 -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /android/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | # 4 | # Copyright 2015 the original author or authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | ## 21 | ## Gradle start up script for UN*X 22 | ## 23 | ############################################################################## 24 | 25 | # Attempt to set APP_HOME 26 | # Resolve links: $0 may be a link 27 | PRG="$0" 28 | # Need this for relative symlinks. 29 | while [ -h "$PRG" ] ; do 30 | ls=`ls -ld "$PRG"` 31 | link=`expr "$ls" : '.*-> \(.*\)$'` 32 | if expr "$link" : '/.*' > /dev/null; then 33 | PRG="$link" 34 | else 35 | PRG=`dirname "$PRG"`"/$link" 36 | fi 37 | done 38 | SAVED="`pwd`" 39 | cd "`dirname \"$PRG\"`/" >/dev/null 40 | APP_HOME="`pwd -P`" 41 | cd "$SAVED" >/dev/null 42 | 43 | APP_NAME="Gradle" 44 | APP_BASE_NAME=`basename "$0"` 45 | 46 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 47 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 48 | 49 | # Use the maximum available, or set MAX_FD != -1 to use that value. 50 | MAX_FD="maximum" 51 | 52 | warn () { 53 | echo "$*" 54 | } 55 | 56 | die () { 57 | echo 58 | echo "$*" 59 | echo 60 | exit 1 61 | } 62 | 63 | # OS specific support (must be 'true' or 'false'). 64 | cygwin=false 65 | msys=false 66 | darwin=false 67 | nonstop=false 68 | case "`uname`" in 69 | CYGWIN* ) 70 | cygwin=true 71 | ;; 72 | Darwin* ) 73 | darwin=true 74 | ;; 75 | MINGW* ) 76 | msys=true 77 | ;; 78 | NONSTOP* ) 79 | nonstop=true 80 | ;; 81 | esac 82 | 83 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 84 | 85 | # Determine the Java command to use to start the JVM. 86 | if [ -n "$JAVA_HOME" ] ; then 87 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 88 | # IBM's JDK on AIX uses strange locations for the executables 89 | JAVACMD="$JAVA_HOME/jre/sh/java" 90 | else 91 | JAVACMD="$JAVA_HOME/bin/java" 92 | fi 93 | if [ ! -x "$JAVACMD" ] ; then 94 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 95 | 96 | Please set the JAVA_HOME variable in your environment to match the 97 | location of your Java installation." 98 | fi 99 | else 100 | JAVACMD="java" 101 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 102 | 103 | Please set the JAVA_HOME variable in your environment to match the 104 | location of your Java installation." 105 | fi 106 | 107 | # Increase the maximum file descriptors if we can. 108 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 109 | MAX_FD_LIMIT=`ulimit -H -n` 110 | if [ $? -eq 0 ] ; then 111 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 112 | MAX_FD="$MAX_FD_LIMIT" 113 | fi 114 | ulimit -n $MAX_FD 115 | if [ $? -ne 0 ] ; then 116 | warn "Could not set maximum file descriptor limit: $MAX_FD" 117 | fi 118 | else 119 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 120 | fi 121 | fi 122 | 123 | # For Darwin, add options to specify how the application appears in the dock 124 | if $darwin; then 125 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 126 | fi 127 | 128 | # For Cygwin, switch paths to Windows format before running java 129 | if $cygwin ; then 130 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 131 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 132 | JAVACMD=`cygpath --unix "$JAVACMD"` 133 | 134 | # We build the pattern for arguments to be converted via cygpath 135 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 136 | SEP="" 137 | for dir in $ROOTDIRSRAW ; do 138 | ROOTDIRS="$ROOTDIRS$SEP$dir" 139 | SEP="|" 140 | done 141 | OURCYGPATTERN="(^($ROOTDIRS))" 142 | # Add a user-defined pattern to the cygpath arguments 143 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 144 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 145 | fi 146 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 147 | i=0 148 | for arg in "$@" ; do 149 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 150 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 151 | 152 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 153 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 154 | else 155 | eval `echo args$i`="\"$arg\"" 156 | fi 157 | i=$((i+1)) 158 | done 159 | case $i in 160 | (0) set -- ;; 161 | (1) set -- "$args0" ;; 162 | (2) set -- "$args0" "$args1" ;; 163 | (3) set -- "$args0" "$args1" "$args2" ;; 164 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 165 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 166 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 167 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 168 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 169 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 170 | esac 171 | fi 172 | 173 | # Escape application args 174 | save () { 175 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 176 | echo " " 177 | } 178 | APP_ARGS=$(save "$@") 179 | 180 | # Collect all arguments for the java command, following the shell quoting and substitution rules 181 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 182 | 183 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong 184 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then 185 | cd "$(dirname "$0")" 186 | fi 187 | 188 | exec "$JAVACMD" "$@" 189 | -------------------------------------------------------------------------------- /android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem http://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%" == "" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%" == "" set DIRNAME=. 29 | set APP_BASE_NAME=%~n0 30 | set APP_HOME=%DIRNAME% 31 | 32 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 33 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 34 | 35 | @rem Find java.exe 36 | if defined JAVA_HOME goto findJavaFromJavaHome 37 | 38 | set JAVA_EXE=java.exe 39 | %JAVA_EXE% -version >NUL 2>&1 40 | if "%ERRORLEVEL%" == "0" goto init 41 | 42 | echo. 43 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 44 | echo. 45 | echo Please set the JAVA_HOME variable in your environment to match the 46 | echo location of your Java installation. 47 | 48 | goto fail 49 | 50 | :findJavaFromJavaHome 51 | set JAVA_HOME=%JAVA_HOME:"=% 52 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 53 | 54 | if exist "%JAVA_EXE%" goto init 55 | 56 | echo. 57 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 58 | echo. 59 | echo Please set the JAVA_HOME variable in your environment to match the 60 | echo location of your Java installation. 61 | 62 | goto fail 63 | 64 | :init 65 | @rem Get command-line arguments, handling Windows variants 66 | 67 | if not "%OS%" == "Windows_NT" goto win9xME_args 68 | 69 | :win9xME_args 70 | @rem Slurp the command line arguments. 71 | set CMD_LINE_ARGS= 72 | set _SKIP=2 73 | 74 | :win9xME_args_slurp 75 | if "x%~1" == "x" goto execute 76 | 77 | set CMD_LINE_ARGS=%* 78 | 79 | :execute 80 | @rem Setup the command line 81 | 82 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 83 | 84 | @rem Execute Gradle 85 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 86 | 87 | :end 88 | @rem End local scope for the variables with windows NT shell 89 | if "%ERRORLEVEL%"=="0" goto mainEnd 90 | 91 | :fail 92 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 93 | rem the _cmd.exe /c_ return code! 94 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 95 | exit /b 1 96 | 97 | :mainEnd 98 | if "%OS%"=="Windows_NT" endlocal 99 | 100 | :omega 101 | -------------------------------------------------------------------------------- /android/lib/kotlin-reflect-sources.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/android/lib/kotlin-reflect-sources.jar -------------------------------------------------------------------------------- /android/lib/kotlin-reflect.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/android/lib/kotlin-reflect.jar -------------------------------------------------------------------------------- /android/lib/kotlin-stdlib-sources.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/android/lib/kotlin-stdlib-sources.jar -------------------------------------------------------------------------------- /android/lib/kotlin-stdlib.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/android/lib/kotlin-stdlib.jar -------------------------------------------------------------------------------- /android/lib/kotlin-test-sources.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/android/lib/kotlin-test-sources.jar -------------------------------------------------------------------------------- /android/lib/kotlin-test.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/android/lib/kotlin-test.jar -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'react_native_project' 2 | apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings) 3 | include ':app' 4 | // method 1 5 | include ':RCTWeChat' 6 | project(':RCTWeChat').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-wechat/android') 7 | include ':react-native-audio' 8 | project(':react-native-audio').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-audio/android') 9 | // ------ 10 | 11 | include ':rn-fetch-blob' 12 | project(':rn-fetch-blob').projectDir = new File(rootProject.projectDir, '../node_modules/rn-fetch-blob/android') 13 | 14 | include ':react-native-doc-viewer' 15 | project(':react-native-doc-viewer').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-doc-viewer/android') -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react_native_project", 3 | "displayName": "react_native_project", 4 | "version":"1.0.1" 5 | } -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: ['module:metro-react-native-babel-preset'], 3 | }; 4 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @format 3 | */ 4 | 5 | import {AppRegistry} from 'react-native'; 6 | import App from './src/App'; 7 | import {name as appName} from './app.json'; 8 | 9 | AppRegistry.registerComponent(appName, () => App); 10 | -------------------------------------------------------------------------------- /ios/Podfile: -------------------------------------------------------------------------------- 1 | platform :ios, '9.0' 2 | require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' 3 | 4 | target 'react_native_project' do 5 | # Pods for react_native_project 6 | pod 'React', :path => '../node_modules/react-native/' 7 | pod 'React-Core', :path => '../node_modules/react-native/React' 8 | pod 'React-DevSupport', :path => '../node_modules/react-native/React' 9 | pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS' 10 | pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation' 11 | pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob' 12 | pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image' 13 | pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS' 14 | pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network' 15 | pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings' 16 | pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text' 17 | pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration' 18 | pod 'React-RCTWebSocket', :path => '../node_modules/react-native/Libraries/WebSocket' 19 | 20 | pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact' 21 | pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi' 22 | pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor' 23 | pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector' 24 | pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga' 25 | 26 | pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec' 27 | pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec' 28 | pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec' 29 | 30 | 31 | target 'react_native_projectTests' do 32 | inherit! :search_paths 33 | # Pods for testing 34 | end 35 | 36 | use_native_modules! 37 | end 38 | 39 | target 'react_native_project-tvOS' do 40 | # Pods for react_native_project-tvOS 41 | 42 | target 'react_native_project-tvOSTests' do 43 | inherit! :search_paths 44 | # Pods for testing 45 | end 46 | 47 | end 48 | -------------------------------------------------------------------------------- /ios/react_native_project-tvOS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | NSAppTransportSecurity 26 | 27 | NSExceptionDomains 28 | 29 | localhost 30 | 31 | NSExceptionAllowsInsecureHTTPLoads 32 | 33 | 34 | 35 | 36 | NSLocationWhenInUseUsageDescription 37 | 38 | UILaunchStoryboardName 39 | LaunchScreen 40 | UIRequiredDeviceCapabilities 41 | 42 | armv7 43 | 44 | UISupportedInterfaceOrientations 45 | 46 | UIInterfaceOrientationPortrait 47 | UIInterfaceOrientationLandscapeLeft 48 | UIInterfaceOrientationLandscapeRight 49 | 50 | UIViewControllerBasedStatusBarAppearance 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /ios/react_native_project-tvOSTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /ios/react_native_project.xcodeproj/xcshareddata/xcschemes/react_native_project-tvOS.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 43 | 49 | 50 | 51 | 52 | 53 | 58 | 59 | 61 | 67 | 68 | 69 | 70 | 71 | 77 | 78 | 79 | 80 | 81 | 82 | 92 | 94 | 100 | 101 | 102 | 103 | 104 | 105 | 111 | 113 | 119 | 120 | 121 | 122 | 124 | 125 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /ios/react_native_project.xcodeproj/xcshareddata/xcschemes/react_native_project.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 43 | 49 | 50 | 51 | 52 | 53 | 58 | 59 | 61 | 67 | 68 | 69 | 70 | 71 | 77 | 78 | 79 | 80 | 81 | 82 | 92 | 94 | 100 | 101 | 102 | 103 | 104 | 105 | 111 | 113 | 119 | 120 | 121 | 122 | 124 | 125 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /ios/react_native_project/AppDelegate.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Facebook, Inc. and its affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #import 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (nonatomic, strong) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /ios/react_native_project/AppDelegate.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Facebook, Inc. and its affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #import "AppDelegate.h" 9 | 10 | #import 11 | #import 12 | #import 13 | 14 | @implementation AppDelegate 15 | 16 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 17 | { 18 | RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions]; 19 | RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge 20 | moduleName:@"react_native_project" 21 | initialProperties:nil]; 22 | 23 | rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1]; 24 | 25 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 26 | UIViewController *rootViewController = [UIViewController new]; 27 | rootViewController.view = rootView; 28 | self.window.rootViewController = rootViewController; 29 | [self.window makeKeyAndVisible]; 30 | return YES; 31 | } 32 | 33 | - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge 34 | { 35 | #if DEBUG 36 | return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil]; 37 | #else 38 | return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; 39 | #endif 40 | } 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /ios/react_native_project/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 21 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /ios/react_native_project/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /ios/react_native_project/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /ios/react_native_project/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | react_native_project 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSRequiresIPhoneOS 26 | 27 | NSAppTransportSecurity 28 | 29 | NSAllowsArbitraryLoads 30 | 31 | NSExceptionDomains 32 | 33 | localhost 34 | 35 | NSExceptionAllowsInsecureHTTPLoads 36 | 37 | 38 | 39 | 40 | NSLocationWhenInUseUsageDescription 41 | 42 | UILaunchStoryboardName 43 | LaunchScreen 44 | UIRequiredDeviceCapabilities 45 | 46 | armv7 47 | 48 | UISupportedInterfaceOrientations 49 | 50 | UIInterfaceOrientationPortrait 51 | UIInterfaceOrientationLandscapeLeft 52 | UIInterfaceOrientationLandscapeRight 53 | 54 | UIViewControllerBasedStatusBarAppearance 55 | 56 | UIAppFonts 57 | 58 | AntDesign.ttf 59 | Entypo.ttf 60 | EvilIcons.ttf 61 | Feather.ttf 62 | FontAwesome.ttf 63 | FontAwesome5_Brands.ttf 64 | FontAwesome5_Regular.ttf 65 | FontAwesome5_Solid.ttf 66 | Foundation.ttf 67 | Ionicons.ttf 68 | MaterialCommunityIcons.ttf 69 | MaterialIcons.ttf 70 | Octicons.ttf 71 | Roboto_medium.ttf 72 | Roboto.ttf 73 | rubicon-icon-font.ttf 74 | SimpleLineIcons.ttf 75 | Zocial.ttf 76 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /ios/react_native_project/main.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Facebook, Inc. and its affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #import 9 | 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /ios/react_native_projectTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /ios/react_native_projectTests/react_native_projectTests.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Facebook, Inc. and its affiliates. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #import 9 | #import 10 | 11 | #import 12 | #import 13 | 14 | #define TIMEOUT_SECONDS 600 15 | #define TEXT_TO_LOOK_FOR @"Welcome to React Native!" 16 | 17 | @interface react_native_projectTests : XCTestCase 18 | 19 | @end 20 | 21 | @implementation react_native_projectTests 22 | 23 | - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test 24 | { 25 | if (test(view)) { 26 | return YES; 27 | } 28 | for (UIView *subview in [view subviews]) { 29 | if ([self findSubviewInView:subview matching:test]) { 30 | return YES; 31 | } 32 | } 33 | return NO; 34 | } 35 | 36 | - (void)testRendersWelcomeScreen 37 | { 38 | UIViewController *vc = [[[RCTSharedApplication() delegate] window] rootViewController]; 39 | NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS]; 40 | BOOL foundElement = NO; 41 | 42 | __block NSString *redboxError = nil; 43 | RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) { 44 | if (level >= RCTLogLevelError) { 45 | redboxError = message; 46 | } 47 | }); 48 | 49 | while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) { 50 | [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 51 | [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 52 | 53 | foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) { 54 | if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) { 55 | return YES; 56 | } 57 | return NO; 58 | }]; 59 | } 60 | 61 | RCTSetLogFunction(RCTDefaultLogFunction); 62 | 63 | XCTAssertNil(redboxError, @"RedBox error: %@", redboxError); 64 | XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS); 65 | } 66 | 67 | 68 | @end 69 | -------------------------------------------------------------------------------- /metro.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Metro configuration for React Native 3 | * https://github.com/facebook/react-native 4 | * 5 | * @format 6 | */ 7 | 8 | module.exports = { 9 | transformer: { 10 | getTransformOptions: async () => ({ 11 | transform: { 12 | experimentalImportSupport: false, 13 | inlineRequires: false, 14 | }, 15 | }), 16 | }, 17 | }; 18 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react_native_project", 3 | "version": "1.0.1", 4 | "private": true, 5 | "scripts": { 6 | "start": "react-native start", 7 | "android": "react-native run-android", 8 | "test": "jest" 9 | }, 10 | "dependencies": { 11 | "@react-native-community/netinfo": "^4.2.2", 12 | "axios": "^0.19.0", 13 | "jetifier": "^1.6.4", 14 | "native-base": "^2.13.7", 15 | "path": "^0.12.7", 16 | "react": "16.8.6", 17 | "react-native": "0.60.5", 18 | "react-native-audio": "^4.3.0", 19 | "react-native-doc-viewer": "^2.7.8", 20 | "react-native-file-selector": "^1.0.0", 21 | "react-native-gesture-handler": "^1.4.1", 22 | "react-native-image-crop-picker": "^0.25.1", 23 | "react-native-image-zoom-viewer": "^2.2.27", 24 | "react-native-orientation": "^3.1.3", 25 | "react-native-popup-menu": "^0.15.6", 26 | "react-native-reanimated": "^1.2.0", 27 | "react-native-sound": "^0.11.0", 28 | "react-native-spinkit": "^1.5.0", 29 | "react-native-svg": "^9.9.9", 30 | "react-native-swipe-list-view": "^2.0.1", 31 | "react-native-vector-icons": "^6.6.0", 32 | "react-native-video": "^5.0.2", 33 | "react-native-webview": "^7.4.2", 34 | "react-native-wechat": "^1.9.12", 35 | "react-navigation": "^3.12.1", 36 | "rn-fetch-blob": "0.10.16", 37 | "victory-native": "^33.0.0" 38 | }, 39 | "devDependencies": { 40 | "@babel/core": "^7.5.0", 41 | "@babel/runtime": "^7.5.0", 42 | "@react-native-community/eslint-config": "^0.0.3", 43 | "babel-jest": "^24.1.0", 44 | "eslint": "^6.3.0", 45 | "eslint-plugin-react": "^7.14.3", 46 | "jest": "^24.1.0", 47 | "metro-react-native-babel-preset": "0.54.1", 48 | "react-test-renderer": "16.8.6" 49 | }, 50 | "jest": { 51 | "preset": "react-native" 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/App.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Sample React Native App 3 | * https://github.com/facebook/react-native 4 | * 5 | * @format 6 | * @flow 7 | */ 8 | 9 | import React from 'react'; 10 | import AppContainer from './navigation/index'; 11 | import { 12 | Root as NbRoot 13 | } from 'native-base'; 14 | export default class App extends React.Component { 15 | render() { 16 | return ( 17 | 18 | 19 | 20 | ); 21 | } 22 | } -------------------------------------------------------------------------------- /src/assets/images/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/1.png -------------------------------------------------------------------------------- /src/assets/images/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/2.jpg -------------------------------------------------------------------------------- /src/assets/images/activeicon_home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/activeicon_home.png -------------------------------------------------------------------------------- /src/assets/images/activeicon_me.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/activeicon_me.png -------------------------------------------------------------------------------- /src/assets/images/activeicon_message.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/activeicon_message.png -------------------------------------------------------------------------------- /src/assets/images/activeicon_recommend.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/activeicon_recommend.png -------------------------------------------------------------------------------- /src/assets/images/aloe_vera.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/aloe_vera.png -------------------------------------------------------------------------------- /src/assets/images/audio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/audio.png -------------------------------------------------------------------------------- /src/assets/images/bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/bg.jpg -------------------------------------------------------------------------------- /src/assets/images/branch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/branch.png -------------------------------------------------------------------------------- /src/assets/images/exam_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/exam_icon.png -------------------------------------------------------------------------------- /src/assets/images/filePng/audio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/filePng/audio.png -------------------------------------------------------------------------------- /src/assets/images/filePng/dir.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/filePng/dir.png -------------------------------------------------------------------------------- /src/assets/images/filePng/doc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/filePng/doc.png -------------------------------------------------------------------------------- /src/assets/images/filePng/img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/filePng/img.png -------------------------------------------------------------------------------- /src/assets/images/filePng/pdf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/filePng/pdf.png -------------------------------------------------------------------------------- /src/assets/images/filePng/ppt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/filePng/ppt.png -------------------------------------------------------------------------------- /src/assets/images/filePng/qsz.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/filePng/qsz.jpg -------------------------------------------------------------------------------- /src/assets/images/filePng/txt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/filePng/txt.png -------------------------------------------------------------------------------- /src/assets/images/filePng/unknown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/filePng/unknown.png -------------------------------------------------------------------------------- /src/assets/images/filePng/video.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/filePng/video.png -------------------------------------------------------------------------------- /src/assets/images/filePng/xls.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/filePng/xls.png -------------------------------------------------------------------------------- /src/assets/images/filePng/xml.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/filePng/xml.png -------------------------------------------------------------------------------- /src/assets/images/filePng/zip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/filePng/zip.png -------------------------------------------------------------------------------- /src/assets/images/flower.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/flower.png -------------------------------------------------------------------------------- /src/assets/images/grade.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/grade.png -------------------------------------------------------------------------------- /src/assets/images/headbg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/headbg.png -------------------------------------------------------------------------------- /src/assets/images/icon_home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/icon_home.png -------------------------------------------------------------------------------- /src/assets/images/icon_me.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/icon_me.png -------------------------------------------------------------------------------- /src/assets/images/icon_message.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/icon_message.png -------------------------------------------------------------------------------- /src/assets/images/icon_recommend.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/icon_recommend.png -------------------------------------------------------------------------------- /src/assets/images/information.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/information.png -------------------------------------------------------------------------------- /src/assets/images/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/logo.png -------------------------------------------------------------------------------- /src/assets/images/mushroom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/mushroom.png -------------------------------------------------------------------------------- /src/assets/images/mydisk.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/mydisk.png -------------------------------------------------------------------------------- /src/assets/images/noAudio.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/noAudio.jpg -------------------------------------------------------------------------------- /src/assets/images/noPicture.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/noPicture.jpg -------------------------------------------------------------------------------- /src/assets/images/others.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/others.png -------------------------------------------------------------------------------- /src/assets/images/question.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/question.png -------------------------------------------------------------------------------- /src/assets/images/sound.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/sound.png -------------------------------------------------------------------------------- /src/assets/images/sound_active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/sound_active.png -------------------------------------------------------------------------------- /src/assets/images/spring_leaves.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/spring_leaves.png -------------------------------------------------------------------------------- /src/assets/images/study.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/study.png -------------------------------------------------------------------------------- /src/assets/images/user_avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/user_avatar.png -------------------------------------------------------------------------------- /src/assets/images/video/icon_back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/video/icon_back.png -------------------------------------------------------------------------------- /src/assets/images/video/icon_back@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/video/icon_back@2x.png -------------------------------------------------------------------------------- /src/assets/images/video/icon_back@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/video/icon_back@3x.png -------------------------------------------------------------------------------- /src/assets/images/video/icon_control_full_screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/video/icon_control_full_screen.png -------------------------------------------------------------------------------- /src/assets/images/video/icon_control_full_screen@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/video/icon_control_full_screen@2x.png -------------------------------------------------------------------------------- /src/assets/images/video/icon_control_full_screen@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/video/icon_control_full_screen@3x.png -------------------------------------------------------------------------------- /src/assets/images/video/icon_control_pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/video/icon_control_pause.png -------------------------------------------------------------------------------- /src/assets/images/video/icon_control_play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/video/icon_control_play.png -------------------------------------------------------------------------------- /src/assets/images/video/icon_control_shrink_screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/video/icon_control_shrink_screen.png -------------------------------------------------------------------------------- /src/assets/images/video/icon_control_shrink_screen@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/video/icon_control_shrink_screen@2x.png -------------------------------------------------------------------------------- /src/assets/images/video/icon_control_shrink_screen@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/video/icon_control_shrink_screen@3x.png -------------------------------------------------------------------------------- /src/assets/images/video/icon_control_slider.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/video/icon_control_slider.png -------------------------------------------------------------------------------- /src/assets/images/video/icon_control_slider@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/video/icon_control_slider@2x.png -------------------------------------------------------------------------------- /src/assets/images/video/icon_control_slider@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/video/icon_control_slider@3x.png -------------------------------------------------------------------------------- /src/assets/images/video/icon_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/video/icon_right.png -------------------------------------------------------------------------------- /src/assets/images/video/icon_share_qq@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/video/icon_share_qq@2x.png -------------------------------------------------------------------------------- /src/assets/images/video/icon_share_wxsession@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/video/icon_share_wxsession@2x.png -------------------------------------------------------------------------------- /src/assets/images/video/icon_share_wxtimeline@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/video/icon_share_wxtimeline@2x.png -------------------------------------------------------------------------------- /src/assets/images/video/icon_video_collected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/video/icon_video_collected.png -------------------------------------------------------------------------------- /src/assets/images/video/icon_video_download.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/video/icon_video_download.png -------------------------------------------------------------------------------- /src/assets/images/video/icon_video_favorite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/video/icon_video_favorite.png -------------------------------------------------------------------------------- /src/assets/images/video/icon_video_lock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/video/icon_video_lock.png -------------------------------------------------------------------------------- /src/assets/images/video/icon_video_more.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/video/icon_video_more.png -------------------------------------------------------------------------------- /src/assets/images/video/icon_video_mute.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/video/icon_video_mute.png -------------------------------------------------------------------------------- /src/assets/images/video/icon_video_muted.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/video/icon_video_muted.png -------------------------------------------------------------------------------- /src/assets/images/video/icon_video_pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/video/icon_video_pause.png -------------------------------------------------------------------------------- /src/assets/images/video/icon_video_play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/video/icon_video_play.png -------------------------------------------------------------------------------- /src/assets/images/video/icon_video_share.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/video/icon_video_share.png -------------------------------------------------------------------------------- /src/assets/images/video/icon_volume_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/video/icon_volume_off.png -------------------------------------------------------------------------------- /src/assets/images/video/icon_volume_up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/video/icon_volume_up.png -------------------------------------------------------------------------------- /src/assets/images/video/img_bottom_shadow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/video/img_bottom_shadow.png -------------------------------------------------------------------------------- /src/assets/images/video/img_top_shadow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fengshi123/react_native_project/f251b2071db51c123eddd31b0b9a1e489e6dc28b/src/assets/images/video/img_top_shadow.png -------------------------------------------------------------------------------- /src/assets/imgPath/answerQuestion.js: -------------------------------------------------------------------------------- 1 | export default { 2 | // 答题页面 3 | noPicture: require('../images/noPicture.jpg'), 4 | noAudio: require('../images/noAudio.jpg') 5 | }; -------------------------------------------------------------------------------- /src/assets/imgPath/examList.js: -------------------------------------------------------------------------------- 1 | export default { 2 | // 试卷列表界面 3 | exam_icon: require('../images/exam_icon.png'), 4 | // 添加试卷 5 | exam_audio: require('../images/audio.png'), 6 | sound: require('../images/sound.png'), 7 | sound_active: require('../images/sound_active.png'), 8 | }; -------------------------------------------------------------------------------- /src/assets/imgPath/homePage.js: -------------------------------------------------------------------------------- 1 | export default { 2 | // 主界面 3 | headbg: require('../images/headbg.png'), 4 | mydisk: require('../images/mydisk.png'), 5 | question: require('../images/question.png'), 6 | study: require('../images/study.png'), 7 | others: require('../images/others.png'), 8 | grade: require('../images/grade.png'), 9 | information: require('../images/information.png'), 10 | icon_home: require('../images/icon_home.png'), 11 | activeicon_home: require('../images/activeicon_home.png'), 12 | icon_me: require('../images/icon_me.png'), 13 | activeicon_me: require('../images/activeicon_me.png'), 14 | icon_message: require('../images/icon_message.png'), 15 | activeicon_message: require('../images/activeicon_message.png'), 16 | icon_recommend: require('../images/icon_recommend.png'), 17 | activeicon_recommend: require('../images/activeicon_recommend.png'), 18 | }; -------------------------------------------------------------------------------- /src/assets/imgPath/loginPage.js: -------------------------------------------------------------------------------- 1 | export default { 2 | // 登录界面 3 | logo: require('../images/logo.png'), 4 | bg: require('../images/bg.jpg') 5 | }; -------------------------------------------------------------------------------- /src/assets/imgPath/netDisk.js: -------------------------------------------------------------------------------- 1 | const netFilesIcon = '../images/filePng/'; 2 | 3 | export default { 4 | audio: require(`${netFilesIcon}audio.png`), 5 | dir: require(`${netFilesIcon}dir.png`), 6 | doc: require(`${netFilesIcon}doc.png`), 7 | img: require(`${netFilesIcon}img.png`), 8 | pdf: require(`${netFilesIcon}pdf.png`), 9 | ppt: require(`${netFilesIcon}ppt.png`), 10 | txt: require(`${netFilesIcon}txt.png`), 11 | unknown: require(`${netFilesIcon}unknown.png`), 12 | video: require(`${netFilesIcon}video.png`), 13 | xls: require(`${netFilesIcon}xls.png`), 14 | zip: require(`${netFilesIcon}zip.png`), 15 | xml: require(`${netFilesIcon}xml.png`), 16 | }; -------------------------------------------------------------------------------- /src/assets/imgPath/userCenter.js: -------------------------------------------------------------------------------- 1 | export default { 2 | // 用户中心 3 | userAvatar: require('../images/user_avatar.png'), 4 | aloeVera: require('../images/aloe_vera.png'), 5 | springLeaves: require('../images/spring_leaves.png'), 6 | mushroom: require('../images/mushroom.png'), 7 | branch: require('../images/branch.png'), 8 | flower: require('../images/flower.png'), 9 | }; -------------------------------------------------------------------------------- /src/assets/index.js: -------------------------------------------------------------------------------- 1 | 2 | import homePage from './imgPath/homePage'; 3 | import netDisk from './imgPath/netDisk'; 4 | import loginPage from './imgPath/loginPage'; 5 | import examList from './imgPath/examList'; 6 | import userCenter from './imgPath/userCenter'; 7 | import answerQuestion from './imgPath/answerQuestion'; 8 | 9 | const imgSite = { 10 | // 主界面 11 | ...homePage, 12 | // 登录 13 | ...loginPage, 14 | // 试题 15 | ...examList, 16 | ...answerQuestion, 17 | // 网盘 18 | ...netDisk, 19 | // 视听 20 | 21 | // 用户中心 22 | ...userCenter, 23 | 24 | }; 25 | 26 | export default imgSite; -------------------------------------------------------------------------------- /src/assets/styles/components/CardDialog.js: -------------------------------------------------------------------------------- 1 | import { StyleSheet } from 'react-native'; 2 | 3 | export default StyleSheet.create({ 4 | modal: { 5 | backgroundColor: 'rgba(0, 0, 0, 0.5)', 6 | width: '100%', 7 | height: '100%' 8 | 9 | }, 10 | modalContent: { 11 | backgroundColor:'white', 12 | top: '50%', 13 | left: '50%', 14 | marginLeft: -125, 15 | marginTop: -50, 16 | width: 250, 17 | height: 100, 18 | borderRadius: 8, 19 | }, 20 | modalText: { 21 | fontSize: 32, 22 | color: '#fff', 23 | }, 24 | input: { 25 | width: 230, 26 | height: 50, 27 | marginLeft: 10, 28 | }, 29 | footer: { 30 | height:50, 31 | width:250, 32 | flexDirection: 'row', 33 | alignItems: 'center', 34 | borderTopColor: '#EEEEEE', 35 | borderTopWidth:1, 36 | }, 37 | confirmDel: { 38 | height: 50, 39 | lineHeight: 50, 40 | fontSize: 18, 41 | paddingLeft:10, 42 | textAlign:'center', 43 | }, 44 | itemBtn: { 45 | justifyContent: 'center', 46 | textAlign:'center', 47 | zIndex: 10 48 | }, 49 | btnOk: { 50 | width:125, 51 | color: 'red', 52 | textAlign:'center', 53 | fontSize: 18 54 | }, 55 | btnCancel: { 56 | width:125, 57 | textAlign:'center', 58 | color: 'green', 59 | fontSize: 18 60 | } 61 | }); -------------------------------------------------------------------------------- /src/assets/styles/components/dialog.js: -------------------------------------------------------------------------------- 1 | import { StyleSheet } from 'react-native'; 2 | 3 | export default StyleSheet.create({ 4 | modal: { 5 | backgroundColor: 'rgba(0, 0, 0, 0.5)', 6 | width: '100%', 7 | height: '100%', 8 | justifyContent:'center', 9 | alignItems:'center' 10 | 11 | }, 12 | modalContent: { 13 | backgroundColor:'#fff', 14 | justifyContent:'center', 15 | width: 280, 16 | borderRadius: 8, 17 | }, 18 | footer: { 19 | width:280, 20 | flexDirection: 'row', 21 | justifyContent:'flex-end', 22 | alignItems:'center', 23 | height:60 24 | }, 25 | btn: { 26 | width:60, 27 | color: '#3eb4ff', 28 | fontSize: 16, 29 | } 30 | }); -------------------------------------------------------------------------------- /src/assets/styles/components/imageAudioTab.js: -------------------------------------------------------------------------------- 1 | import { StyleSheet } from 'react-native'; 2 | 3 | export default StyleSheet.create({ 4 | main:{ 5 | flex: 1, 6 | }, 7 | stemImg: { 8 | width: 50, 9 | height: 50, 10 | marginTop: 5, 11 | marginRight: 2 12 | }, 13 | stemImgView:{ 14 | flexDirection: 'row', 15 | margin:10, 16 | }, 17 | stemImgAdd:{ 18 | fontSize: 50, 19 | color: '#3eb4ff' 20 | }, 21 | tabs:{ 22 | marginTop:3 23 | }, 24 | tabsBar:{ 25 | borderBottomWidth:3, 26 | borderColor:'#3eb4ff', 27 | }, 28 | tab:{ 29 | backgroundColor:'#fff', 30 | }, 31 | activeTab:{ 32 | backgroundColor:'#fff', 33 | }, 34 | tabText:{ 35 | color:'#999', 36 | }, 37 | activeTabText:{ 38 | color:'#3eb4ff', 39 | }, 40 | audio:{ 41 | width:48, 42 | height:48, 43 | margin:10, 44 | }, 45 | audioTouch:{ 46 | alignSelf:'center', 47 | }, 48 | audioView:{ 49 | flexDirection: 'row', 50 | marginLeft:3, 51 | }, 52 | audioImg:{ 53 | width:32, 54 | height:32, 55 | alignSelf:'center', 56 | }, 57 | audioText:{ 58 | alignSelf:'center', 59 | }, 60 | stemAudioView:{ 61 | flexDirection: 'row', 62 | }, 63 | spinkit:{ 64 | marginLeft:6, 65 | width:41, 66 | color:'#3eb4ff' 67 | } 68 | }); -------------------------------------------------------------------------------- /src/assets/styles/components/listItem.js: -------------------------------------------------------------------------------- 1 | import { StyleSheet } from 'react-native'; 2 | import screen from '../../../utils/screen'; 3 | export default StyleSheet.create({ 4 | swtichView: { 5 | flexDirection: 'row', 6 | alignItems: 'center', 7 | backgroundColor: '#fff', 8 | marginTop: 1, 9 | height: 48 10 | }, 11 | switchImg: { 12 | width: 36, 13 | height: 36, 14 | marginLeft: 15, 15 | }, 16 | switchText: { 17 | width: screen.width - 130, 18 | fontSize: 14, 19 | color: '#666', 20 | marginLeft: 15 21 | }, 22 | version: { 23 | flexDirection: 'row', 24 | alignItems: 'center', 25 | justifyContent: 'center' 26 | }, 27 | iconInfo: { 28 | backgroundColor: '#ff0000', 29 | height: 20, 30 | width: 18, 31 | borderRadius: 30, 32 | marginLeft: 15 33 | }, 34 | iconText: { 35 | color: '#fff', 36 | alignSelf: 'center' 37 | }, 38 | iconRight: { 39 | marginLeft: 10, 40 | fontSize: 25, 41 | color: '#999', 42 | }, 43 | logoutBtn: { 44 | marginTop: 20, 45 | alignSelf: 'center', 46 | width: screen.width - 40, 47 | }, 48 | versionView: { 49 | marginTop: 15, 50 | marginLeft: 15, 51 | marginBottom: 0 52 | }, 53 | versionTitle: { 54 | fontSize: 16, 55 | }, 56 | versionContext: { 57 | marginTop: 10, 58 | marginBottom:10, 59 | marginLeft:4, 60 | fontSize: 14, 61 | color: '#666' 62 | }, 63 | upgradeView: { 64 | marginTop: 15, 65 | marginLeft: 15, 66 | marginBottom: 0 67 | }, 68 | upgradeTitle: { 69 | fontSize: 18, 70 | }, 71 | upgradeTitle2:{ 72 | marginTop:10, 73 | fontSize: 16, 74 | }, 75 | upgradeContext: { 76 | marginTop: 5, 77 | marginLeft:5, 78 | fontSize: 14, 79 | color: '#666' 80 | } 81 | }); -------------------------------------------------------------------------------- /src/assets/styles/components/loading.js: -------------------------------------------------------------------------------- 1 | import { StyleSheet } from 'react-native'; 2 | import screen from '../../../utils/screen'; 3 | export default StyleSheet.create({ 4 | LoadingPage:{ 5 | position: 'absolute', 6 | width:screen.width, 7 | height:screen.height, 8 | zIndex:1000, 9 | alignItems: 'center', 10 | }, 11 | indicator:{ 12 | top:screen.height/2-150, 13 | color:'#3eb4ff' 14 | }, 15 | indicatorText:{ 16 | top:screen.height/2-135, 17 | color:'#3eb4ff', 18 | fontSize:16, 19 | } 20 | }); -------------------------------------------------------------------------------- /src/assets/styles/components/resultOption.js: -------------------------------------------------------------------------------- 1 | import { StyleSheet } from 'react-native'; 2 | import screen from '../../../utils/screen'; 3 | export default StyleSheet.create({ 4 | mainView:{ 5 | flexDirection: 'row', 6 | alignItems:'center', 7 | marginLeft:5 8 | }, 9 | text:{ 10 | fontSize:16, 11 | color:'#666', 12 | height:30, 13 | textAlignVertical:'center', 14 | marginRight:5 15 | }, 16 | textInput:{ 17 | width: screen.width-100, 18 | borderColor: '#999', 19 | borderBottomWidth: 1 20 | } 21 | }); -------------------------------------------------------------------------------- /src/assets/styles/components/typeBtn.js: -------------------------------------------------------------------------------- 1 | import { StyleSheet } from 'react-native'; 2 | 3 | const typeBtn ={ 4 | width:70, 5 | height:38, 6 | marginRight:5, 7 | justifyContent:'center', 8 | borderWidth:1, 9 | borderColor:'#3eb4ff', 10 | }; 11 | const typeIcon ={ 12 | fontSize: 16, 13 | marginLeft:-4 14 | }; 15 | const typeText ={ 16 | marginLeft:-10, 17 | }; 18 | 19 | export default StyleSheet.create({ 20 | typeView: { 21 | flexDirection: 'row' 22 | }, 23 | typeBtn:{ 24 | ...typeBtn, 25 | backgroundColor:'#fff', 26 | }, 27 | typeBtnActive:{ 28 | ...typeBtn, 29 | backgroundColor:'#3eb4ff' 30 | }, 31 | typeIcon:{ 32 | ...typeIcon, 33 | color: '#3eb4ff', 34 | }, 35 | typeIconActive:{ 36 | ...typeIcon, 37 | color: '#fff', 38 | }, 39 | typeText:{ 40 | ...typeText, 41 | color: '#3eb4ff', 42 | }, 43 | typeTextActive:{ 44 | ...typeText, 45 | color:'#fff', 46 | } 47 | }); -------------------------------------------------------------------------------- /src/assets/styles/homePage.js: -------------------------------------------------------------------------------- 1 | import { StyleSheet } from 'react-native'; 2 | 3 | export default StyleSheet.create({ 4 | bgImage: { 5 | width: null, 6 | height: 200, 7 | marginBottom: 40 8 | }, 9 | opImg:{ 10 | width: 80, 11 | height: 80 12 | }, 13 | opText:{ 14 | width: 80, 15 | height: 40 , 16 | textAlign: 'center', 17 | color: '#666' 18 | } 19 | }); -------------------------------------------------------------------------------- /src/assets/styles/pages/exam/addExam.js: -------------------------------------------------------------------------------- 1 | import { StyleSheet } from 'react-native'; 2 | import screen from '../../../../utils/screen'; 3 | 4 | export default StyleSheet.create({ 5 | main:{ 6 | flex: 1, 7 | width: screen.width - 6, 8 | backgroundColor:'#f7f7f7', 9 | }, 10 | name:{ 11 | marginTop:8, 12 | marginBottom:8, 13 | backgroundColor:'#fff', 14 | }, 15 | nameLabel:{ 16 | marginLeft:10, 17 | color:'#333', 18 | fontSize:18 19 | }, 20 | nameInput:{ 21 | marginLeft:-25, 22 | marginRight:35 23 | }, 24 | iconSuccess:{ 25 | color: '#5cb85c', 26 | position:'absolute', 27 | right:5 28 | }, 29 | iconError:{ 30 | color: '#ed2f2f', 31 | position:'absolute', 32 | right:5 33 | }, 34 | flatListView:{ 35 | flex: 1, 36 | paddingBottom:40, 37 | marginBottom:25 , 38 | backgroundColor:'#fff', 39 | }, 40 | sureAdd: { 41 | marginRight: 8, 42 | fontSize: 16, 43 | color: '#fff' 44 | }, 45 | stemImg: { 46 | width: 50, 47 | height: 50, 48 | marginTop: 5, 49 | marginRight: 2 50 | }, 51 | title:{ 52 | flexDirection: 'row', 53 | height: 40, 54 | alignItems: 'center', 55 | marginLeft:10, 56 | marginRight:10 57 | }, 58 | body:{ 59 | marginLeft:10, 60 | marginRight:10 61 | }, 62 | titleNum:{ 63 | fontWeight: 'bold', 64 | fontSize: 18 65 | }, 66 | deleteTouch:{ 67 | fontSize: 26, 68 | color: '#3eb4ff', 69 | right: 1, 70 | position: 'absolute' 71 | }, 72 | deleteIcon:{ 73 | color: '#3eb4ff' 74 | }, 75 | textContent:{ 76 | fontSize: 16, 77 | color: '#666', 78 | height: 30, 79 | textAlignVertical: 'center', 80 | }, 81 | textAnswer:{ 82 | marginTop:10, 83 | marginBottom:-10, 84 | fontSize: 16, 85 | color: '#666', 86 | height: 30, 87 | textAlignVertical: 'center', 88 | }, 89 | fab:{ 90 | backgroundColor: '#3eb4ff' 91 | }, 92 | fabIcon:{ 93 | color: '#fff' 94 | }, 95 | typeBtnTouch:{ 96 | marginLeft: 10 97 | }, 98 | inputResult:{ 99 | width: 250, 100 | borderColor: '#999', 101 | borderBottomWidth: 1 102 | }, 103 | indicatorView:{ 104 | position: 'absolute', 105 | backgroundColor:'#eee', 106 | width:screen.width, 107 | height:screen.height, 108 | opacity:0.5, 109 | zIndex:1000, 110 | alignItems: 'center' 111 | }, 112 | indicator:{ 113 | top:screen.height/2-150, 114 | color:'#3eb4ff' 115 | }, 116 | indicatorText:{ 117 | top:screen.height/2-135, 118 | color:'#333', 119 | fontSize:16 120 | } 121 | }); 122 | -------------------------------------------------------------------------------- /src/assets/styles/pages/exam/answerQuestion.js: -------------------------------------------------------------------------------- 1 | import { StyleSheet } from 'react-native'; 2 | import screen from '../../../../utils/screen'; 3 | 4 | export default StyleSheet.create({ 5 | main: { 6 | width:screen.width - 20, 7 | backgroundColor: '#eee', 8 | marginTop: 10, 9 | marginLeft: 10, 10 | borderRadius: 7 11 | }, 12 | property: { 13 | width: screen.width - 36, 14 | // width:325, 15 | backgroundColor: '#fff', 16 | padding: 10, 17 | marginTop: 8, 18 | flexDirection: 'row', 19 | alignSelf: 'center' 20 | }, 21 | label: { 22 | width: 5, 23 | height: 25, 24 | backgroundColor: '#3eb4ff', 25 | borderRadius: 10 26 | }, 27 | type: { 28 | marginLeft: 5, 29 | fontSize: 18, 30 | fontWeight:'bold', 31 | color:'#333' 32 | }, 33 | questionId: { 34 | position: 'absolute', 35 | top: 10, 36 | right: 25, 37 | fontSize: 20 38 | }, 39 | sum: { 40 | position: 'absolute', 41 | right: 7, 42 | top: 15, 43 | fontSize: 14, 44 | color: '#777' 45 | }, 46 | content: { 47 | backgroundColor: '#fff', 48 | marginTop: 8, 49 | width: screen.width - 36, 50 | marginLeft: 8, 51 | borderBottomWidth: 1, 52 | borderColor: '#cecece' 53 | }, 54 | problem: { 55 | color: '#636363', 56 | fontSize: 16, 57 | marginTop: 10, 58 | padding: 10 59 | }, 60 | img: { 61 | width: 50, 62 | height: 50, 63 | marginTop: 5, 64 | marginLeft: 5, 65 | marginBottom: 3 66 | }, 67 | slider:{ 68 | width: 250, 69 | height: 32, 70 | alignSelf:'center', 71 | }, 72 | input: { 73 | backgroundColor: '#fff', 74 | borderWidth: 1, 75 | borderColor:'#3eb4ff', 76 | width: screen.width - 52, 77 | fontSize: 16, 78 | borderRadius: 7, 79 | marginLeft: 8, 80 | marginTop: 10 81 | }, 82 | answer: { 83 | flexDirection: 'row', 84 | height: 50 85 | }, 86 | result: { 87 | fontSize: 16, 88 | color: '#ff0000', 89 | marginLeft: 10, 90 | marginTop: 15 91 | }, 92 | wrongIcon: { 93 | color: '#ff0000', 94 | position: 'absolute', 95 | right: 10, 96 | top: 10 97 | }, 98 | rightIcon: { 99 | color: '#1eee0b', 100 | position: 'absolute', 101 | right: 10, 102 | top: 10 103 | }, 104 | buttonView: { 105 | marginTop: 20, 106 | width: screen.width - 50, 107 | alignSelf: 'center', 108 | height: 100, 109 | }, 110 | button:{ 111 | marginTop:20, 112 | height:40, 113 | borderRadius:30, 114 | fontSize:20, 115 | backgroundColor:'#3eb4ff', 116 | color:'#3eb4ff', 117 | justifyContent:'center' 118 | }, 119 | buttonText:{ 120 | color:'#fff', 121 | fontSize:16, 122 | }, 123 | audioView:{ 124 | flexDirection: 'row', 125 | marginLeft:3, 126 | marginTop:20 127 | }, 128 | audioImg:{ 129 | width:32, 130 | height:32, 131 | alignSelf:'center', 132 | marginLeft: 5 133 | }, 134 | audioText:{ 135 | alignSelf:'center', 136 | }, 137 | spinkit:{ 138 | marginLeft: 6, 139 | width: 42, 140 | color:'#3eb4ff', 141 | marginTop: 20 142 | }, 143 | contentView:{ 144 | marginTop:8, 145 | marginLeft:8, 146 | paddingBottom:10, 147 | backgroundColor:'#fff', 148 | width: screen.width - 36, 149 | } 150 | }); -------------------------------------------------------------------------------- /src/assets/styles/pages/exam/examList.js: -------------------------------------------------------------------------------- 1 | import { StyleSheet } from 'react-native'; 2 | 3 | export default StyleSheet.create({ 4 | img:{ 5 | width: 55, 6 | height: 35 7 | }, 8 | imgf:{ 9 | width: 55, 10 | height: 35, 11 | opacity: 0.5 12 | }, 13 | namef:{ 14 | fontSize: 16, 15 | color: '#afafaf', 16 | }, 17 | name:{ 18 | fontSize: 16, 19 | }, 20 | is_finish:{ 21 | fontSize: 12, 22 | color: '#ff0000' 23 | }, 24 | emptyPage:{ 25 | marginTop: 220 26 | }, 27 | emptyImg:{ 28 | alignSelf: 'center', 29 | width: 100, 30 | height: 80, 31 | opacity: 0.5 32 | }, 33 | empty:{ 34 | alignSelf: 'center', 35 | fontSize: 15, 36 | color: '#cecece' 37 | } 38 | }); -------------------------------------------------------------------------------- /src/assets/styles/pages/exam/resultStatistics.js: -------------------------------------------------------------------------------- 1 | import { StyleSheet } from 'react-native'; 2 | 3 | export default StyleSheet.create({ 4 | pie:{ 5 | marginTop:15, 6 | paddingBottom: 20, 7 | alignSelf: 'center', 8 | justifyContent: 'center' 9 | }, 10 | name:{ 11 | alignSelf: 'center', 12 | borderWidth: 1, 13 | borderColor: '#cecece', 14 | borderRadius: 7, 15 | padding: 2.5, 16 | marginTop: 20 17 | } 18 | }); -------------------------------------------------------------------------------- /src/assets/styles/pages/login/loginPage.js: -------------------------------------------------------------------------------- 1 | import { StyleSheet } from 'react-native'; 2 | import screen from '../../../../utils/screen'; 3 | 4 | export default StyleSheet.create({ 5 | bg:{ 6 | width: screen.width, 7 | height: screen.height, 8 | position: 'absolute' 9 | }, 10 | main:{ 11 | flex: 1 12 | }, 13 | title:{ 14 | width: 100, 15 | fontSize: 20, 16 | color: '#fff', 17 | marginLeft: 85 18 | }, 19 | img:{ 20 | width: 70, 21 | height: 37, 22 | marginLeft: 30 23 | }, 24 | head:{ 25 | width: 250, 26 | height: 100, 27 | alignSelf: 'center', 28 | marginTop: 50, 29 | borderLeftWidth: 1, 30 | borderLeftColor: '#fff', 31 | borderRadius: 1 32 | }, 33 | headText:{ 34 | fontSize: 25, 35 | color: '#fff', 36 | marginLeft: 30 37 | }, 38 | loginText:{ 39 | fontSize: 15, 40 | color: '#fff', 41 | marginLeft: 30, 42 | opacity: 0.7 43 | }, 44 | spinkit:{ 45 | position: 'absolute', 46 | top: 65, 47 | right: 40 48 | }, 49 | userPassword:{ 50 | width: 320, 51 | alignSelf: 'center', 52 | borderRadius: 10, 53 | marginTop: 30 54 | }, 55 | input:{ 56 | width: 320, 57 | height: 50, 58 | marginTop: 20, 59 | flexDirection: 'row', 60 | }, 61 | icon:{ 62 | width: 45, 63 | marginTop: 15, 64 | marginLeft: 20, 65 | color: '#fff' 66 | }, 67 | inputBorder:{ 68 | width: 220, 69 | borderBottomWidth: 0.5, 70 | borderColor: '#eeeeee' 71 | }, 72 | block:{ 73 | marginTop:50, 74 | height: 100, 75 | }, 76 | nbButton:{ 77 | width: 310, 78 | alignSelf: 'center', 79 | marginTop: 25, 80 | justifyContent: 'center', 81 | backgroundColor: '#3eb4ff' 82 | }, 83 | buttonText:{ 84 | fontSize: 18, 85 | color: '#fff' 86 | }, 87 | row:{ 88 | marginTop: 20, 89 | marginBottom: 50, 90 | flexDirection: 'row', 91 | justifyContent: 'center' 92 | }, 93 | text:{ 94 | fontSize: 15, 95 | color: '#fff' 96 | } 97 | }); -------------------------------------------------------------------------------- /src/assets/styles/pages/netDisk/netDisk.js: -------------------------------------------------------------------------------- 1 | import { StyleSheet } from 'react-native'; 2 | 3 | export default StyleSheet.create({ 4 | container: { 5 | flex: 1, 6 | flexDirection: 'row', 7 | justifyContent: 'center', 8 | alignItems: 'center', 9 | backgroundColor: '#F5FCFF' 10 | }, 11 | rightContainer: { 12 | flex: 1 13 | }, 14 | title: { 15 | fontSize: 20, 16 | marginLeft: 10, 17 | lineHeight: 40 18 | }, 19 | year: { 20 | }, 21 | rowFront: { 22 | padding:1, 23 | alignItems: 'center', 24 | backgroundColor: 'white', 25 | borderBottomColor: '#FDF5E6', 26 | borderBottomWidth: 1, 27 | justifyContent: 'center', 28 | height: 52, 29 | }, 30 | thumbnail: { 31 | width: 30, 32 | height:30, 33 | }, 34 | list: { 35 | padding: 4, 36 | // backgroundColor: '#F5FCFF' 37 | }, 38 | standaloneRowBack: { 39 | alignItems: 'center', 40 | backgroundColor: '#8BC645', 41 | flex: 1, 42 | flexDirection: 'row', 43 | justifyContent: 'space-between', 44 | padding: 15 45 | }, 46 | backRightBtn: { 47 | height:52, 48 | alignItems: 'center', 49 | bottom: 0, 50 | justifyContent: 'center', 51 | position: 'absolute', 52 | top: 0, 53 | width: 75 54 | }, 55 | backRightBtnLeft: { 56 | backgroundColor: '#00BFFF', 57 | right: 75 58 | }, 59 | backRightBtnRight: { 60 | backgroundColor: 'red', 61 | right: 0 62 | }, 63 | plusBtn: { 64 | zIndex: 10, 65 | width: 60, 66 | height: 60, 67 | lineHeight: 60, 68 | right: -280, // -300 靠右 69 | bottom: 20 70 | }, 71 | plus: { 72 | fontSize: 30, 73 | color: '#fff', 74 | marginLeft: 19 75 | } 76 | }); -------------------------------------------------------------------------------- /src/assets/styles/pages/test/tab.js: -------------------------------------------------------------------------------- 1 | export default { 2 | imgSize: { 3 | width:30, 4 | height:30 5 | } 6 | } -------------------------------------------------------------------------------- /src/assets/styles/pages/user/userCenter.js: -------------------------------------------------------------------------------- 1 | import { StyleSheet } from 'react-native'; 2 | import screen from '../../../../utils/screen'; 3 | 4 | export default StyleSheet.create({ 5 | main:{ 6 | backgroundColor:'#f7f7f7', 7 | height:screen.height 8 | }, 9 | userMain:{ 10 | flexDirection: 'row', 11 | backgroundColor:'#fff', 12 | marginTop:15, 13 | marginBottom:15 14 | }, 15 | userAvatar:{ 16 | width: 50, 17 | height: 80, 18 | marginTop:10, 19 | marginLeft:20, 20 | marginBottom:10 21 | }, 22 | userFont:{ 23 | justifyContent:'center', 24 | height: 90, 25 | marginLeft:30, 26 | }, 27 | userFont1:{ 28 | fontSize: 26, 29 | height: 40, 30 | color:'#666' 31 | }, 32 | userFont2:{ 33 | fontSize:16, 34 | color: '#999' 35 | }, 36 | logoutView:{ 37 | marginTop:60, 38 | alignSelf:'center', 39 | width:screen.width - 40, 40 | }, 41 | logoutBtn:{ 42 | backgroundColor:'#3eb4ff', 43 | justifyContent:'center', 44 | borderRadius:30 45 | }, 46 | logoutText:{ 47 | fontSize:18, 48 | letterSpacing:20, 49 | color:'#fff' 50 | } 51 | }); -------------------------------------------------------------------------------- /src/components/CardDialog.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import { View, Alert, Modal } from 'react-native'; 3 | import { Button as NbButton, Text as NbText, Input } from 'native-base'; 4 | import styles from '../assets/styles/components/CardDialog'; 5 | 6 | export default class CardDialog extends Component { 7 | 8 | constructor(props) { 9 | super(props); 10 | } 11 | 12 | render() { 13 | const modalVisible = this.props.modalVisible; 14 | const hasInputText = this.props.hasInputText; 15 | const confirmText = this.props.confirmText; 16 | let inputVal = this.props.inputVal; 17 | const dialogType = this.props.dialogType; 18 | return ( 19 | { 24 | this.props.onSetModalVisible(false); 25 | }}> 26 | 27 | 28 | { 29 | hasInputText ? 30 | 31 | { 32 | this.props.onSetInputVal(val); 33 | }}/> 34 | : {confirmText} 35 | } 36 | 37 | 38 | { 40 | this.props[`on${dialogType}`](); 41 | } 42 | }> 43 | 确定 44 | 45 | 46 | 47 | { 49 | this.props.onSetModalVisible(false); 50 | } 51 | }> 52 | 取消 53 | 54 | 55 | 56 | 57 | 58 | 59 | ); 60 | } 61 | } -------------------------------------------------------------------------------- /src/components/Dialog.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import { 3 | View, 4 | Modal, 5 | Text, 6 | TouchableOpacity, 7 | } from 'react-native'; 8 | import styles from '../assets/styles/components/dialog'; 9 | import PropTypes from 'prop-types'; 10 | 11 | export default class Dialog extends Component { 12 | 13 | constructor(props) { 14 | super(props); 15 | } 16 | render() { 17 | const modalVisible = this.props.modalVisible; 18 | const handleSure = this.props.handleSure; 19 | const handleCancel = this.props.handleCancel; 20 | return ( 21 | 26 | 27 | 28 | {this.props.children} 29 | 30 | { 31 | this.props.cancel && 32 | 35 | 取消 36 | 37 | } 38 | 41 | 确定 42 | 43 | 44 | 45 | 46 | 47 | ); 48 | } 49 | } 50 | 51 | Dialog.defaultProps = { 52 | cancel: true 53 | }; 54 | Dialog.propTypes = { 55 | cancel: PropTypes.bool 56 | }; 57 | 58 | -------------------------------------------------------------------------------- /src/components/Loading.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import { 3 | Text, 4 | View, 5 | ActivityIndicator 6 | } from 'react-native'; 7 | import style from '../assets/styles/components/loading'; 8 | export default class loading extends Component { 9 | constructor(props) { 10 | super(props); 11 | } 12 | render() { 13 | return ( 14 | 15 | 19 | {this.props.loadingContent} 20 | 21 | ); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/components/common/PictureView.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import {Modal, CameraRoll, ToastAndroid} from 'react-native'; 3 | import ImageViewer from 'react-native-image-zoom-viewer'; 4 | 5 | export default class PictureView extends React.Component { 6 | 7 | 8 | constructor(props) { 9 | super(props); 10 | } 11 | // 保存图片 12 | saveImg(url) { 13 | let promise = CameraRoll.saveToCameraRoll(url); 14 | promise.then((result) => { 15 | console.log(result); 16 | ToastAndroid.show('已保存到相册', ToastAndroid.SHORT); 17 | }).catch((error) => { 18 | console.log(error); 19 | ToastAndroid.show('保存失败', ToastAndroid.SHORT); 20 | }); 21 | } 22 | render() { 23 | const imgModalVisible = this.props.imgModalVisible; // 是否显示 modal 24 | const images = this.props.images; //图片数组,[{url:''},{url:''}] 25 | const imgIndex = this.props.imgIndex; // 被预览图片对应的图片数组位置,0 表示第一张 26 | return ( 27 | this.props.closeImg()}> 31 | this.props.closeImg()} 33 | onClick={(onCancel) => {onCancel();}} 34 | onSave={(url) => this.saveImg(url)} 35 | saveToLocalByLongPress={true} 36 | imageUrls={images} 37 | index={imgIndex} 38 | doubleClickInterval={1000} 39 | menuContext={{ 'saveToLocal': '保存到相册', 'cancel': '取消' }}/> 40 | 41 | ); 42 | } 43 | } -------------------------------------------------------------------------------- /src/components/exam/ResultOption.js: -------------------------------------------------------------------------------- 1 | 2 | import React, { Component } from 'react'; 3 | import { 4 | View, 5 | Text, 6 | TextInput 7 | } from 'react-native'; 8 | import { 9 | CheckBox as NbCheckBox 10 | } from 'native-base'; 11 | import style from '../../assets/styles/components/resultOption'; 12 | 13 | export default class ResultOption extends Component { 14 | constructor(props) { 15 | super(props); 16 | } 17 | render() { 18 | let { type, qsIndex, checked, changeOptionContent, checkPress } = this.props; 19 | if (type === 3) { 20 | return ( 21 | changeOptionContent(qsIndex, 0, content)} /> 24 | ); 25 | } else { 26 | let choiceList = ['A', 'B', 'C', 'D']; 27 | let judgeList = ['Y', 'N']; 28 | let itemList = type === 2 ? judgeList : choiceList; 29 | return itemList.map((item, index) => { 30 | return ( 31 | 32 | {item}: 33 | changeOptionContent(qsIndex, index, content)} /> 36 | checkPress(qsIndex, index)}> 39 | 40 | 41 | ); 42 | }); 43 | } 44 | } 45 | } -------------------------------------------------------------------------------- /src/components/exam/TypeBtn.js: -------------------------------------------------------------------------------- 1 | 2 | import React, { Component } from 'react'; 3 | import { 4 | View, 5 | Text 6 | } from 'react-native'; 7 | import { 8 | Button as NbButton, 9 | Icon as NbIcon 10 | } from 'native-base'; 11 | import style from '../../assets/styles/components/typeBtn'; 12 | 13 | export default class TypeBtn extends Component { 14 | constructor(props) { 15 | super(props); 16 | this.state = { 17 | selectIndex: 0 18 | }; 19 | } 20 | typePress(qsIndex, index) { 21 | this.setState({selectIndex:index}); 22 | this.props.typePress(qsIndex, index); 23 | } 24 | render() { 25 | let typeList = [ 26 | '单选', '多选', '判断', '填空' 27 | ]; 28 | let qsIndex = this.props.qsIndex; 29 | return ( 30 | 31 | { 32 | typeList.map((item, index) => { 33 | return ( 34 | this.typePress(qsIndex, index)}> 38 | 42 | {item} 43 | 44 | ); 45 | } 46 | ) 47 | } 48 | 49 | 50 | ); 51 | } 52 | } -------------------------------------------------------------------------------- /src/components/video/VideoMoreSetting.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import {View, Image, Text, TouchableOpacity, Slider, PixelRatio, StyleSheet} from 'react-native'; 3 | import PropTypes from 'prop-types'; 4 | 5 | export default class VideoMoreSetting extends React.Component { 6 | 7 | // static defaultProps = { 8 | // selectedRate: 1.0, 9 | // selectedEndTimeIndex: -1, 10 | // isMuted: false, 11 | // isDownload: false, 12 | // volume: 1.0 13 | // }; 14 | 15 | static propTypes = { 16 | onCloseWindow: PropTypes.func, 17 | onPlayRateChanged: PropTypes.func, 18 | onEndTimeSelected: PropTypes.func, 19 | onFavoriteTapped: PropTypes.func, 20 | onDownloadTapped: PropTypes.func, 21 | onMuteVolumeTapped: PropTypes.func, 22 | onVolumeChange: PropTypes.func, 23 | }; 24 | 25 | constructor(props) { 26 | super(props); 27 | this.state = { 28 | isMute: this.props.isMuted, 29 | isDownload: this.props.isDownload, 30 | volume: this.props.volume, 31 | selectedRate: this.props.selectedRate, 32 | selectedEndTimeIndex: this.props.selectedEndTimeIndex 33 | }; 34 | } 35 | 36 | render() { 37 | return ( 38 | 43 | 44 | 45 | {/* 46 | 50 | 缓存 51 | */} 52 | 53 | 57 | 静音 58 | 59 | 60 | 61 | 多倍速播放 62 | { 63 | playRateItems.map((item, index) => { 64 | let isSelected = (this.state.selectedRate === item); 65 | return ( 66 | this.onChangeRate(item)} 70 | > 71 | {item}X 72 | 73 | ); 74 | }) 75 | } 76 | 77 | 78 | 调整音量 79 | 83 | 93 | 97 | 98 | 99 | 100 | ); 101 | } 102 | 103 | _onTapBackground = () => { 104 | this.props.onCloseWindow && this.props.onCloseWindow(); 105 | }; 106 | 107 | _onTapFavorite = () => { 108 | this.props.onFavoriteTapped && this.props.onFavoriteTapped(); 109 | }; 110 | 111 | _onTapDownload = () => { 112 | this.props.onDownloadTapped && this.props.onDownloadTapped(); 113 | }; 114 | 115 | _onTapMute = () => { 116 | let isMute = !this.state.isMute; 117 | this.props.onMuteVolumeTapped && this.props.onMuteVolumeTapped(isMute); 118 | }; 119 | 120 | _onSliderValueChange = (value) => { 121 | let isMute = (value === 0); 122 | this.setState({ 123 | volume: value, 124 | isMute: isMute, 125 | }); 126 | this.props.onVolumeChange && this.props.onVolumeChange(value); 127 | }; 128 | 129 | onChangeRate(item) { 130 | this.setState({ 131 | selectedRate: item, 132 | }); 133 | this.props.onPlayRateChanged && this.props.onPlayRateChanged(item); 134 | } 135 | 136 | onChangeEndTime(index) { 137 | this.setState({ 138 | selectedEndTimeIndex: index, 139 | }); 140 | this.props.onEndTimeSelected && this.props.onEndTimeSelected(); 141 | } 142 | } 143 | 144 | const playRateItems = [1.0, 1.25, 1.5, 2.0]; 145 | const maxVolume = 1; 146 | 147 | export const onePixel = 1/PixelRatio.get(); 148 | const styles = StyleSheet.create({ 149 | container: { 150 | backgroundColor: 'rgba(0, 0, 0, 0.6)', 151 | alignItems:'center', 152 | justifyContent:'center' 153 | }, 154 | contentView: { 155 | width: 400, 156 | alignItems:'center', 157 | }, 158 | optionView: { 159 | flexDirection:'row', 160 | alignItems:'center', 161 | paddingTop: 10, 162 | paddingBottom: 10, 163 | borderBottomWidth:onePixel, 164 | borderBottomColor: 'white', 165 | width: 400, 166 | height: 80, 167 | }, 168 | itemView: { 169 | alignItems:'center', 170 | justifyContent:'center' 171 | }, 172 | imageItem: { 173 | width: 30, 174 | height: 30, 175 | }, 176 | textItem: { 177 | fontSize: 14, 178 | color:'white', 179 | marginTop: 5 180 | }, 181 | optionText: { 182 | fontSize: 14, 183 | color:'white', 184 | }, 185 | optionText_active: { 186 | color: '#ff5500' 187 | }, 188 | optionItem: { 189 | marginLeft: 40 190 | } 191 | }); -------------------------------------------------------------------------------- /src/components/video/VideoShare.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import {View, Image, Text, TouchableOpacity, StyleSheet, ToastAndroid,} from 'react-native'; 3 | import PropTypes from 'prop-types'; 4 | import * as WeChat from 'react-native-wechat'; 5 | import CONSTANT from '../../utils/constant'; 6 | 7 | // const wxAppId = ''; // 微信开放平台注册的app id 8 | // const wxAppSecret = ''; // 微信开放平台注册得到的app secret 9 | // WeChat.registerApp(wxAppId); 10 | 11 | export default class VideoShare extends React.Component { 12 | 13 | static propTypes = { 14 | onShareItemSelected: PropTypes.func, 15 | onCloseWindow: PropTypes.func 16 | }; 17 | 18 | constructor(props) { 19 | super(props); 20 | this.state = { 21 | videoUrl: this.props.videoUrl, 22 | videoTitle: this.props.videoTitle, 23 | }; 24 | } 25 | 26 | componentDidMount (){ 27 | WeChat.registerApp('wxbfb30e9fa2da4f0d'); 28 | } 29 | 30 | render() { 31 | return ( 32 | 37 | 分享至 38 | 39 | { 40 | shareOptions.map((item, index) => { 41 | return ( 42 | {this.shareItemSelectedAtIndex(index);}} 47 | > 48 | 52 | {item.title} 53 | 54 | ); 55 | }) 56 | } 57 | 58 | 59 | ); 60 | } 61 | 62 | _onTapBackground = () => { 63 | this.props.onCloseWindow && this.props.onCloseWindow(); 64 | }; 65 | 66 | shareItemSelectedAtIndex(index) { 67 | // this.props.onShareItemSelected && this.props.onShareItemSelected(index); 68 | WeChat.isWXAppInstalled().then((isInstalled) => { 69 | this.setState({ 70 | isWXInstalled: isInstalled 71 | }); 72 | if (isInstalled && index === 0) { 73 | WeChat.shareToSession({ 74 | title: this.state.videoTitle, 75 | type: 'video', 76 | videoUrl: CONSTANT.SERVER_URL + '/' + this.state.videoUrl 77 | }).catch((error) => { 78 | ToastAndroid.show( 79 | error.message, 80 | ToastAndroid.SHORT, 81 | ToastAndroid.CENTER 82 | ); 83 | }); 84 | } else if (isInstalled && index === 1) { 85 | WeChat.shareToTimeline({ 86 | title: this.state.videoTitle, 87 | type: 'video', 88 | videoUrl: CONSTANT.SERVER_URL + '/' + this.state.videoUrl 89 | }).catch((error) => { 90 | ToastAndroid.show( 91 | error.message, 92 | ToastAndroid.SHORT, 93 | ToastAndroid.CENTER 94 | ); 95 | }); 96 | } else { 97 | ToastAndroid.show( 98 | '微信未安装', 99 | ToastAndroid.SHORT, 100 | ToastAndroid.CENTER 101 | ); 102 | } 103 | }); 104 | } 105 | } 106 | 107 | const shareOptions = [ 108 | // {imageRef:require('../../assets/images/video/icon_share_qq.png'), title:'QQ'}, 109 | {imageRef:require('../../assets/images/video/icon_share_wxsession.png'), title:'微信'}, 110 | {imageRef:require('../../assets/images/video/icon_share_wxtimeline.png'), title:'朋友圈'}, 111 | ]; 112 | 113 | const styles = StyleSheet.create({ 114 | container: { 115 | backgroundColor: 'rgba(0, 0, 0, 0.5)', 116 | alignItems:'center', 117 | justifyContent:'center' 118 | }, 119 | shareMenuView: { 120 | flexDirection:'row', 121 | flexWrap:'wrap', 122 | alignItems:'center', 123 | marginTop: 10, 124 | width: 200, 125 | }, 126 | shareTitle: { 127 | fontSize: 16, 128 | color: 'white', 129 | }, 130 | shareItem: { 131 | alignItems:'center', 132 | justifyContent:'center', 133 | margin: 20 134 | }, 135 | image: { 136 | width:60, 137 | height:60 138 | }, 139 | title: { 140 | marginTop: 5, 141 | fontSize:13, 142 | color: 'white' 143 | } 144 | }); -------------------------------------------------------------------------------- /src/navigation/baseStyle.js: -------------------------------------------------------------------------------- 1 | const baseStyle = { 2 | defaultNavigationOptions: { 3 | headerStyle: { 4 | backgroundColor: '#3eb4ff', 5 | }, 6 | headerTintColor: '#fff', 7 | headerTitleStyle: { 8 | flex:1, 9 | textAlign: 'center', 10 | fontSize:18, 11 | letterSpacing:5 12 | }, 13 | }, 14 | }; 15 | export default baseStyle; -------------------------------------------------------------------------------- /src/navigation/exam/examList.js: -------------------------------------------------------------------------------- 1 | import ExamList from '../../pages/exam/ExamList'; 2 | import AddExam from '../../pages/exam/AddExam'; 3 | import ResultStatistics from '../../pages/exam/ResultStatistics'; 4 | import AnswerQuestion from '../../pages/exam/AnswerQuestion'; 5 | import React from 'react'; 6 | import { View } from 'react-native'; 7 | export default { 8 | ExamList: { 9 | screen: ExamList, 10 | navigationOptions: { 11 | title: '试卷列表', 12 | headerRight: 13 | }, 14 | 15 | }, 16 | AddExam: { 17 | screen: AddExam, 18 | }, 19 | AnswerQuestion: { 20 | screen: AnswerQuestion, 21 | navigationOptions: { 22 | title: '答题', 23 | headerRight: 24 | } 25 | }, 26 | ResultStatistics: { 27 | screen: ResultStatistics, 28 | navigationOptions: { 29 | title: '成绩统计' 30 | } 31 | } 32 | }; -------------------------------------------------------------------------------- /src/navigation/index.js: -------------------------------------------------------------------------------- 1 | import { 2 | createStackNavigator, 3 | createBottomTabNavigator, 4 | createSwitchNavigator, 5 | createAppContainer 6 | } from 'react-navigation'; 7 | import { Image } from 'react-native'; 8 | import React from 'react'; 9 | import baseStyle from './baseStyle'; 10 | import tab from '../assets/styles/pages/test/tab'; 11 | import imgSite from '../assets/index'; 12 | import Test from './test/test'; 13 | import ExamList from './exam/examList'; 14 | import Video from './video/audio'; 15 | 16 | import LoginPage from '../pages/login/LoginPage'; 17 | import HomePage from '../pages/HomePage'; 18 | import Search from '../pages/user/Search'; 19 | import NetDisk from '../pages/netDisk/NetDisk'; 20 | import UserCenter from '../pages/user/UserCenter'; 21 | 22 | var commonCreateTabStack = (Page, title, activeImg, img) => { 23 | const commonStack = createStackNavigator({ 24 | tempTab: { 25 | screen: Page, 26 | navigationOptions: { 27 | headerTitle: title 28 | } 29 | } 30 | }, 31 | Object.assign({}, baseStyle) 32 | ); 33 | 34 | const commonTab = { 35 | screen: commonStack, 36 | navigationOptions: { 37 | title: title, 38 | // eslint-disable-next-line react/display-name 39 | tabBarIcon: ({focused }) => 40 | 43 | } 44 | }; 45 | return commonTab; 46 | }; 47 | 48 | const TabNavigator = createBottomTabNavigator({ 49 | Tab1: commonCreateTabStack(HomePage, '主页', imgSite.activeicon_home, imgSite.icon_home), 50 | Tab2: commonCreateTabStack(Search, '搜索', imgSite.activeicon_recommend, imgSite.icon_recommend), 51 | Tab3: commonCreateTabStack(NetDisk, '网盘', imgSite.activeicon_message, imgSite.icon_message), 52 | Tab4: commonCreateTabStack(UserCenter, '我的', imgSite.activeicon_me, imgSite.icon_me), 53 | 54 | }); 55 | 56 | const HomeStackNavigator = createStackNavigator({ 57 | HomePage: { 58 | screen: TabNavigator, 59 | title: '主界面', 60 | navigationOptions: { 61 | header: null 62 | } 63 | }, 64 | ...Test, 65 | // 试题 66 | ...ExamList, 67 | // 网盘 68 | 69 | // 视听 70 | ...Video 71 | }, 72 | Object.assign({}, baseStyle) 73 | ); 74 | 75 | const AppNavigator = createSwitchNavigator({ 76 | LoginPage: { screen: LoginPage, title: '登录页面' }, 77 | Home: HomeStackNavigator, 78 | }, 79 | Object.assign({}, { initialRouteName: 'LoginPage' }, baseStyle) 80 | ); 81 | 82 | const AppContainer = createAppContainer(AppNavigator); 83 | 84 | export default AppContainer; -------------------------------------------------------------------------------- /src/navigation/test/test.js: -------------------------------------------------------------------------------- 1 | import TestModule2 from '../../pages/test/TestModule2'; 2 | import TestModule3 from '../../pages/test/TestModule3'; 3 | export default { 4 | TestModule2: { 5 | screen: TestModule2, 6 | navigationOptions: { 7 | title: '测试界面' 8 | } 9 | }, 10 | TestModule3: { 11 | screen: TestModule3, 12 | navigationOptions: { 13 | title: '测试界面' 14 | } 15 | } 16 | }; -------------------------------------------------------------------------------- /src/navigation/video/audio.js: -------------------------------------------------------------------------------- 1 | import VideoList from '../../pages/video/VideoList'; 2 | import VideoPlayer from '../../pages/video/VideoPlayer'; 3 | export default { 4 | VideoList: { 5 | screen: VideoList, 6 | navigationOptions: { 7 | title: '视频列表' 8 | } 9 | }, 10 | VideoPlayer: { 11 | screen: VideoPlayer, 12 | navigationOptions: { 13 | title: '视频播放' 14 | } 15 | }, 16 | }; -------------------------------------------------------------------------------- /src/pages/HomePage.js: -------------------------------------------------------------------------------- 1 | 2 | import React, { Component } from 'react'; 3 | import { 4 | Text, 5 | View, 6 | Image, 7 | TouchableOpacity, 8 | ToastAndroid, 9 | } from 'react-native'; 10 | 11 | import imgSite from '../assets/index'; 12 | import style from '../assets/styles/homePage'; 13 | export default class HomePage extends Component { 14 | handlePress(path) { 15 | if (path === 'ExamList1' || path === 'ExamList2') { 16 | let mark = path === 'ExamList1' ? 1 : 0; 17 | this.props.navigation.navigate('ExamList', { 18 | mark: mark 19 | }); 20 | } else if (path === 'learnPoint' || path === 'suggestedFeedback') { 21 | ToastAndroid.show('该功能还在路上...', ToastAndroid.SHORT); 22 | } else { 23 | this.props.navigation.navigate(path); 24 | } 25 | } 26 | render() { 27 | let itemList = [ 28 | [ 29 | { 30 | title: '添加试卷', 31 | image: imgSite.study, 32 | path: 'AddExam' 33 | }, 34 | { 35 | title: '试题问答', 36 | image: imgSite.question, 37 | path: 'ExamList1' 38 | }, 39 | { 40 | title: '成绩统计', 41 | image: imgSite.mydisk, 42 | path: 'ExamList2' 43 | }, 44 | ], 45 | [ 46 | { 47 | title: '视听空间', 48 | image: imgSite.grade, 49 | path: 'VideoList' 50 | }, 51 | { 52 | title: '学习积分', 53 | image: imgSite.others, 54 | path: 'learnPoint' 55 | }, 56 | { 57 | title: '建议反馈', 58 | image: imgSite.information, 59 | path: 'suggestedFeedback' 60 | } 61 | ] 62 | ]; 63 | 64 | const listItems = itemList.map((itemArray, i) => { 65 | return ( 66 | 70 | {itemArray.map((item) => { 71 | return ( 72 | { this.handlePress(item.path); }} 75 | > 76 | 77 | 81 | {item.title} 82 | 83 | 84 | ); 85 | }) 86 | } 87 | 88 | ); 89 | } 90 | ); 91 | 92 | return ( 93 | 94 | 98 | {listItems} 99 | 100 | ); 101 | } 102 | } -------------------------------------------------------------------------------- /src/pages/exam/ExamList.js: -------------------------------------------------------------------------------- 1 | 2 | import React, { Component } from 'react'; 3 | import { 4 | ScrollView, 5 | View, 6 | Image, 7 | Text, 8 | ToastAndroid 9 | } from 'react-native'; 10 | import { 11 | List as NbList, 12 | ListItem as NbListItem, 13 | Left as NbLeft, 14 | Body as NbBody, 15 | Right as NbRight, 16 | Text as NbText, 17 | } from 'native-base'; 18 | import request from '../../utils/request'; 19 | import Loading from '../../components/Loading'; 20 | import imgSite from '../../assets/index'; 21 | import style from '../../assets/styles/pages/exam/examList'; 22 | 23 | export default class ExamList extends Component { 24 | constructor(props) { 25 | super(props); 26 | this.state = { 27 | eList: [], 28 | isLoading: true 29 | }; 30 | this.questionList = []; 31 | this.mark = parseInt(this.props.navigation.state.params.mark); 32 | } 33 | 34 | componentDidMount() { 35 | this.subs = [ 36 | this.props.navigation.addListener('didFocus', () => this.handleGetall()), 37 | ]; 38 | } 39 | 40 | componentWillUnmount() { 41 | this.subs.forEach(sub => sub.remove()); 42 | } 43 | 44 | handleGetall() { 45 | let options = { 46 | url: '/exam/queryExamId', 47 | method: 'get' 48 | }; 49 | let vm = this; 50 | request(options).then(function (res) { 51 | let result = res.data; 52 | let exam = []; 53 | if (result.code === 0) { 54 | if (vm.mark === 1) { 55 | vm.setState({ 56 | eList: result.data, 57 | isLoading: false 58 | }); 59 | } else { 60 | for (var i = 0; i < result.data.length; i++) { 61 | if (result.data[i].is_finish === 1) { 62 | exam.push(result.data[i]); 63 | } 64 | } 65 | vm.setState({ 66 | eList: exam, 67 | isLoading: false 68 | }); 69 | } 70 | } 71 | }); 72 | } 73 | 74 | comeInExam(examId, name) { 75 | if (this.mark === 1) { 76 | let options = { 77 | url: '/exam/queryQuestionById?exam_id=' + examId, 78 | method: 'get' 79 | }; 80 | let vm = this; 81 | request(options).then(function (res) { 82 | let result = res.data; 83 | if (result.code === 0) { 84 | vm.questionList = result.data; 85 | if (vm.questionList.length === 0) { 86 | ToastAndroid.show('此试卷为空', ToastAndroid.SHORT); 87 | } else { 88 | let tab; 89 | if (vm.state.eList[vm.state.eList.length - examId].is_finish === 1) { 90 | // 试卷已完成,进入答案阅览模式 91 | tab = 1; 92 | } else { 93 | // 试卷未完成,进入答题模式 94 | tab = 0; 95 | } 96 | vm.props.navigation.navigate('AnswerQuestion', { 97 | tab: tab, 98 | questionList: vm.questionList, 99 | refresh: () => { vm.handleGetall(); } 100 | }); 101 | } 102 | } 103 | }); 104 | } else { 105 | this.props.navigation.navigate('ResultStatistics', { 106 | exam_id: examId, 107 | name: name 108 | }); 109 | } 110 | } 111 | 112 | // loading 113 | getLoading() { 114 | if (this.state.isLoading === true) { 115 | return ( 116 | 117 | ); 118 | } 119 | } 120 | 121 | examEmpty() { 122 | if (this.state.eList.length === 0 && this.state.isLoading === false) { 123 | return ( 124 | 125 | 129 | 空空如也... 130 | 131 | ); 132 | } else { 133 | return null; 134 | } 135 | } 136 | 137 | render() { 138 | return ( 139 | 140 | {this.getLoading()} 141 | 142 | 143 | {this.state.eList.map((item, index) => { 144 | return ( 145 | this.comeInExam(item.exam_id, item.name)} 148 | > 149 | 150 | { 151 | item.is_finish === 1 ? 152 | 156 | : 157 | 161 | } 162 | 163 | 164 | 165 | { 166 | item.is_finish === 1 ? 167 | {item.name} 168 | : 169 | {item.name} 170 | } 171 | { 172 | item.is_finish === 1 ? 173 | 已完成 174 | : 175 | null 176 | } 177 | 178 | 179 | 180 | { 181 | item.is_finish === 1 ? 182 | {item.create_time} 183 | : 184 | {item.create_time} 185 | } 186 | 187 | ); 188 | })} 189 | 190 | {this.examEmpty()} 191 | 192 | 193 | ); 194 | } 195 | } -------------------------------------------------------------------------------- /src/pages/exam/ResultStatistics.js: -------------------------------------------------------------------------------- 1 | 2 | import React, { Component } from 'react'; 3 | import { View } from 'react-native'; 4 | import { 5 | VictoryPie, 6 | VictoryLegend, 7 | VictoryTooltip 8 | } from 'victory-native'; 9 | import request from '../../utils/request'; 10 | import Loading from '../../components/Loading'; 11 | import style from '../../assets/styles/pages/exam/resultStatistics'; 12 | 13 | export default class ResultStatistics extends Component { 14 | constructor(props) { 15 | super(props); 16 | this.state = { 17 | userSum: 0, 18 | questionLength: 0, 19 | rightsum: [], 20 | isLoading: false, 21 | result: [2,2,2,2] 22 | }; 23 | this.exam_id = this.props.navigation.state.params.exam_id; 24 | this.name = this.props.navigation.state.params.name; 25 | } 26 | 27 | componentDidMount() { 28 | this.setState({ 29 | isLoading: true 30 | }); 31 | this.getContent(); 32 | } 33 | 34 | getContent() { 35 | let options = { 36 | url: '/exam/queryQuestionById?exam_id=' + this.exam_id, 37 | method: 'get' 38 | }; 39 | let vm = this; 40 | request(options).then(function (res) { 41 | let result = res.data; 42 | if (result.code === 0) { 43 | vm.setState({ 44 | questionLength: result.data.length 45 | }); 46 | vm.getUserSum(); 47 | } 48 | }); 49 | } 50 | 51 | getUserSum() { 52 | let options = { 53 | url: '/exam/queryUserById?exam_id=' + this.exam_id, 54 | method: 'get' 55 | }; 56 | let vm = this; 57 | request(options).then(function (res) { 58 | let result = res.data; 59 | if (result.code === 0) { 60 | vm.setState({ 61 | userSum: result.data.length 62 | }); 63 | vm.getScore(); 64 | } 65 | }); 66 | } 67 | 68 | getScore() { 69 | let options = { 70 | url: '/exam/queryScoreById?exam_id=' + this.exam_id, 71 | method: 'get' 72 | }; 73 | let vm = this; 74 | request(options).then(function (res) { 75 | let result = res.data; 76 | if (result.code === 0) { 77 | vm.setState({ 78 | rightsum: result.data, 79 | isLoading: false 80 | }); 81 | vm.getResult(); 82 | } 83 | }); 84 | } 85 | 86 | getResult(){ 87 | let rightSum; 88 | var sum = new Array(0, 0, 0, 0); 89 | var scores = new Array(); 90 | for (var i = 0; i < this.state.userSum; i++) { 91 | if (this.state.rightsum[i] === undefined) { 92 | rightSum = 0; 93 | } else { 94 | rightSum = this.state.rightsum[i].rightSum; 95 | } 96 | var sc = rightSum / this.state.questionLength * 100; 97 | scores.push(sc); 98 | if (scores[i] >= 85){ 99 | sum[0]++; 100 | } else if (scores[i] >= 75 && scores[i] < 85) { 101 | sum[1]++; 102 | } else if (scores[i] >= 60 && scores[i] < 75) { 103 | sum[2]++; 104 | } else { 105 | sum[3]++; 106 | } 107 | } 108 | this.setState({ 109 | result: sum 110 | }); 111 | } 112 | 113 | // loading 114 | getLoading(){ 115 | if(this.state.isLoading === true){ 116 | return ( 117 | 118 | ); 119 | } 120 | } 121 | 122 | render() { 123 | const colorScale = ['#c23531', '#61a0a8', '#d48265', '#bda29a']; 124 | return ( 125 | 126 | 127 | 85 分', 144 | symbol: { fill: colorScale[3], type: 'square' }, 145 | } 146 | ]} 147 | width={180} 148 | height={125} 149 | /> 150 | datum.y === 0 ? false : true} 167 | constrainToVisibleArea={true} 168 | flyoutHeight={30} 169 | flyoutStyle={{ strokeWidth: 0.1}} 170 | /> 171 | } 172 | /> 173 | 174 | {this.getLoading()} 175 | 176 | ); 177 | } 178 | } -------------------------------------------------------------------------------- /src/pages/login/LoginPage.js: -------------------------------------------------------------------------------- 1 | 2 | import React, { Component } from 'react'; 3 | import { 4 | Text, 5 | View, 6 | Image, 7 | ImageBackground, 8 | TextInput, 9 | ToastAndroid 10 | } from 'react-native'; 11 | import { 12 | Button as NbButton, 13 | Text as NbText, 14 | } from 'native-base'; 15 | import request from '../../utils/request'; 16 | import globalVar from '../../utils/globalVar.js'; 17 | import EvilIcons from 'react-native-vector-icons/EvilIcons'; 18 | import Spinkit from 'react-native-spinkit'; 19 | 20 | import imgSite from '../../assets/index'; 21 | import style from '../../assets/styles/pages/login/loginPage'; 22 | 23 | export default class LoginPage extends Component { 24 | constructor (props) { 25 | super(props); 26 | this.uid = ''; 27 | this.password = ''; 28 | } 29 | handleClick() { 30 | if (!this.uid || !this.password) { 31 | // this.uid = '1'; 32 | // this.password = '111'; 33 | ToastAndroid.show('用户名密码不能为空', ToastAndroid.SHORT); 34 | return; 35 | } 36 | let param = { 37 | uid: this.uid, 38 | password: this.password 39 | }; 40 | let options = { 41 | url: '/getToken', 42 | method: 'POST', 43 | data: param, 44 | tipFlag: true 45 | }; 46 | request(options).then((res)=> { 47 | let result = res.data; 48 | if (result.code === 0) { 49 | let data = result.data; 50 | globalVar.token = 'Bearer ' + data.token; 51 | globalVar.name = data.name; 52 | globalVar.sex = data.sex; 53 | this.props.navigation.navigate('Home'); 54 | }else{ 55 | ToastAndroid.show('用户名密码错误', ToastAndroid.SHORT); 56 | } 57 | }).catch(()=>{ 58 | ToastAndroid.show('服务器访问出错啦', ToastAndroid.SHORT); 59 | }); 60 | } 61 | 62 | render() { 63 | return ( 64 | 65 | 69 | 70 | 71 | 75 | 云课堂 76 | Login to your Acount 77 | 84 | 85 | 86 | 87 | 92 | this.uid = text} 96 | /> 97 | 98 | 99 | 104 | this.password = text} 109 | /> 110 | 111 | 112 | 113 | 114 | this.handleClick()} 116 | style={style.nbButton} 117 | > 118 | 登 录 119 | 120 | 121 | 免费注册 122 | | 123 | 忘记密码? 124 | 125 | 126 | 127 | ); 128 | } 129 | } -------------------------------------------------------------------------------- /src/pages/test/Tab1.js: -------------------------------------------------------------------------------- 1 | 2 | import React, { Component } from 'react'; 3 | import { Text, View,Button} from 'react-native'; 4 | 5 | export default class Tab1 extends Component { 6 | render() { 7 | return ( 8 | 9 |