├── .gitattributes
├── .gitignore
├── README.md
├── imooc_ReactNative
├── .babelrc
├── .buckconfig
├── .flowconfig
├── .gitattributes
├── .gitignore
├── .watchmanconfig
├── App.js
├── android
│ ├── app
│ │ ├── BUCK
│ │ ├── build.gradle
│ │ ├── proguard-rules.pro
│ │ └── src
│ │ │ └── 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
│ │ │ │ ├── SimpleLineIcons.ttf
│ │ │ │ └── Zocial.ttf
│ │ │ ├── java
│ │ │ └── com
│ │ │ │ └── imooc_reactnative
│ │ │ │ ├── MainActivity.java
│ │ │ │ └── MainApplication.java
│ │ │ └── res
│ │ │ ├── mipmap-hdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-mdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xhdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ │ └── values
│ │ │ ├── strings.xml
│ │ │ └── styles.xml
│ ├── build.gradle
│ ├── gradle.properties
│ ├── gradle
│ │ └── wrapper
│ │ │ ├── gradle-wrapper.jar
│ │ │ └── gradle-wrapper.properties
│ ├── gradlew
│ ├── gradlew.bat
│ ├── keystores
│ │ ├── BUCK
│ │ └── debug.keystore.properties
│ └── settings.gradle
├── app.json
├── app
│ ├── image
│ │ ├── home-active.png
│ │ ├── home.png
│ │ ├── hot-active.png
│ │ ├── hot.png
│ │ ├── message-active.png
│ │ ├── message.png
│ │ ├── my-active.png
│ │ └── my.png
│ ├── navigation
│ │ ├── TopBar.js
│ │ └── index.js
│ ├── pages
│ │ ├── Five.js
│ │ ├── Six.js
│ │ ├── collection.js
│ │ ├── hot.js
│ │ ├── my.js
│ │ ├── trend.js
│ │ └── welcome.js
│ └── utils
│ │ └── NavigationUtils.js
├── index.js
├── ios
│ ├── imooc_ReactNative-tvOS
│ │ └── Info.plist
│ ├── imooc_ReactNative-tvOSTests
│ │ └── Info.plist
│ ├── imooc_ReactNative.xcodeproj
│ │ ├── project.pbxproj
│ │ └── xcshareddata
│ │ │ └── xcschemes
│ │ │ ├── imooc_ReactNative-tvOS.xcscheme
│ │ │ └── imooc_ReactNative.xcscheme
│ ├── imooc_ReactNative
│ │ ├── AppDelegate.h
│ │ ├── AppDelegate.m
│ │ ├── Base.lproj
│ │ │ └── LaunchScreen.xib
│ │ ├── Images.xcassets
│ │ │ ├── AppIcon.appiconset
│ │ │ │ └── Contents.json
│ │ │ └── Contents.json
│ │ ├── Info.plist
│ │ └── main.m
│ └── imooc_ReactNativeTests
│ │ ├── Info.plist
│ │ └── imooc_ReactNativeTests.m
├── package.json
└── yarn.lock
├── mkDemo
├── .babelrc
├── .buckconfig
├── .flowconfig
├── .gitattributes
├── .gitignore
├── .watchmanconfig
├── App.js
├── android
│ ├── app
│ │ ├── BUCK
│ │ ├── build.gradle
│ │ ├── proguard-rules.pro
│ │ └── src
│ │ │ └── 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
│ │ │ │ ├── SimpleLineIcons.ttf
│ │ │ │ └── Zocial.ttf
│ │ │ ├── java
│ │ │ └── com
│ │ │ │ └── demo
│ │ │ │ ├── MainActivity.java
│ │ │ │ └── MainApplication.java
│ │ │ └── res
│ │ │ ├── mipmap-hdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-mdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xhdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ ├── ic_launcher.png
│ │ │ └── ic_launcher_round.png
│ │ │ └── values
│ │ │ ├── strings.xml
│ │ │ └── styles.xml
│ ├── build.gradle
│ ├── gradle.properties
│ ├── gradle
│ │ └── wrapper
│ │ │ ├── gradle-wrapper.jar
│ │ │ └── gradle-wrapper.properties
│ ├── gradlew
│ ├── gradlew.bat
│ ├── keystores
│ │ ├── BUCK
│ │ └── debug.keystore.properties
│ └── settings.gradle
├── app.json
├── app
│ ├── components
│ │ └── PopularTab
│ │ │ ├── PopularTab.js
│ │ │ └── Tabitem.js
│ ├── config
│ │ └── config.js
│ ├── page
│ │ ├── Favorite
│ │ │ └── Favorite.js
│ │ ├── MoreMenu
│ │ │ └── MoreMenu.js
│ │ ├── My
│ │ │ ├── CustomLabel
│ │ │ │ └── CustomLabel.js
│ │ │ └── My.js
│ │ ├── Puplar
│ │ │ └── Popular.js
│ │ ├── Search
│ │ │ └── Search.js
│ │ └── Trending
│ │ │ └── Trending.js
│ ├── public
│ │ ├── check.png
│ │ └── uncheck.png
│ ├── routes
│ │ ├── App.js
│ │ ├── RouerConfig.js
│ │ └── tabBarRoutes
│ │ │ └── index.js
│ └── utils
│ │ ├── Storage.js
│ │ ├── data
│ │ └── keys.json
│ │ └── initData.js
├── index.js
├── ios
│ ├── demo-tvOS
│ │ └── Info.plist
│ ├── demo-tvOSTests
│ │ └── Info.plist
│ ├── demo.xcodeproj
│ │ ├── project.pbxproj
│ │ └── xcshareddata
│ │ │ └── xcschemes
│ │ │ ├── demo-tvOS.xcscheme
│ │ │ └── demo.xcscheme
│ ├── demo
│ │ ├── AppDelegate.h
│ │ ├── AppDelegate.m
│ │ ├── Base.lproj
│ │ │ └── LaunchScreen.xib
│ │ ├── Images.xcassets
│ │ │ ├── AppIcon.appiconset
│ │ │ │ └── Contents.json
│ │ │ └── Contents.json
│ │ ├── Info.plist
│ │ └── main.m
│ └── demoTests
│ │ ├── Info.plist
│ │ └── demoTests.m
├── package-lock.json
├── package.json
└── yarn.lock
├── pinduoduo
├── .babelrc
├── .buckconfig
├── .flowconfig
├── .gitattributes
├── .gitignore
├── .watchmanconfig
├── android
│ ├── app
│ │ ├── BUCK
│ │ ├── build.gradle
│ │ ├── libs
│ │ │ ├── umeng-common-1.5.1.jar
│ │ │ ├── umeng-debug-1.0.0.jar
│ │ │ ├── umeng-share-QQ-simplify-6.9.1.jar
│ │ │ ├── umeng-share-core-6.9.1.jar
│ │ │ ├── umeng-share-sina-simplify-6.9.1.jar
│ │ │ ├── umeng-share-wechat-simplify-6.9.1.jar
│ │ │ └── umeng-sharetool-6.9.1.jar
│ │ ├── proguard-rules.pro
│ │ └── src
│ │ │ └── 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
│ │ │ │ ├── SimpleLineIcons.ttf
│ │ │ │ └── Zocial.ttf
│ │ │ ├── java
│ │ │ └── com
│ │ │ │ └── pinduoduo
│ │ │ │ ├── MainActivity.java
│ │ │ │ ├── MainApplication.java
│ │ │ │ └── module
│ │ │ │ ├── ShareModule.java
│ │ │ │ ├── SharePackage.java
│ │ │ │ └── utils
│ │ │ │ └── BitMapUtil.java
│ │ │ ├── res
│ │ │ ├── drawable-hdpi
│ │ │ │ └── splash.png
│ │ │ ├── drawable-mdpi
│ │ │ │ └── splash.png
│ │ │ ├── drawable-xhdpi
│ │ │ │ └── splash.png
│ │ │ ├── drawable-xxhdpi
│ │ │ │ └── splash.png
│ │ │ ├── drawable-xxxhdpi
│ │ │ │ └── splash.png
│ │ │ ├── layout
│ │ │ │ └── launch_screen.xml
│ │ │ ├── mipmap-hdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-mdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ └── values
│ │ │ │ ├── colors.xml
│ │ │ │ ├── strings.xml
│ │ │ │ └── styles.xml
│ │ │ └── wxapi
│ │ │ └── WXEntryActivity.java
│ ├── build.gradle
│ ├── gradle.properties
│ ├── gradle
│ │ └── wrapper
│ │ │ ├── gradle-wrapper.jar
│ │ │ └── gradle-wrapper.properties
│ ├── gradlew
│ ├── gradlew.bat
│ ├── keystores
│ │ ├── BUCK
│ │ └── debug.keystore.properties
│ └── settings.gradle
├── app.json
├── app
│ ├── components
│ │ ├── Welcome.js
│ │ └── base.js
│ ├── public
│ │ └── images
│ │ │ └── Home
│ │ │ └── Popular
│ │ │ ├── 08e1f8db7f6c9ce11f546cc05c9176ce.webp
│ │ │ ├── 0ad6a91690c74dedf124d06e8ef51b5f.webp
│ │ │ ├── 0c17288d4a879610343eae586fabbc70.webp
│ │ │ ├── 152611d19c6d53f94220d06b02a4d75e.webp
│ │ │ ├── 1bbff73a685197888f2b0805dc2a2df8.gif
│ │ │ ├── 23e66d95e126bac54960f8b58c60022b.webp
│ │ │ ├── 26c916947489c6b2ddd188ecdb54fd8d.webp
│ │ │ ├── 4ad66f8d7d28d6237a9f25b9a6d19f3e.webp
│ │ │ ├── 54958a7298eb208b54dd4d4d0dcac55b.jpg
│ │ │ ├── 5c0c9d938b49cc18fa1b77b3d4eaca56.webp
│ │ │ ├── 67c60a1882411f9fc45765a0f7406141.webp
│ │ │ ├── 6ee7aa359a495098f7c67af813e35f18.webp
│ │ │ ├── 864e35ace6c3c090ec8121e05c7b0604.webp
│ │ │ ├── 896a52a854723aa5f4e0406d9b7149e1.png
│ │ │ ├── 92498f7f180eb07547f0d1735b7203c8.webp
│ │ │ ├── 9281dd01fa3c88cedf5164d77384c6b2.webp
│ │ │ ├── 96f2dca329442071e7745f7831b7dbd1.jpg
│ │ │ ├── 994635c2294e4d5acd768d796b4cd7b6.webp
│ │ │ ├── a666ac01e718dd06231a722baa6fa935.webp
│ │ │ ├── activityPhoto.png
│ │ │ ├── c2ba677bcd16ecad6c335e5e04a1cf1e.webp
│ │ │ ├── c671f2c49805658697cc0f72fff87eb3.webp
│ │ │ ├── cce88276d606e3f3115ee26d6a380d13.webp
│ │ │ ├── d20eead7a6ffb6a7309707cf6ec0f97f.webp
│ │ │ ├── deddd05761d7a5709521c690810af417.webp
│ │ │ ├── e1ecb559c183e2443b8c1866e708366e.webp
│ │ │ ├── edcaa84386e49f5854244c2b565bf075.webp
│ │ │ └── topbuttom.png
│ ├── routes
│ │ ├── App.js
│ │ ├── RouterConfig.js
│ │ ├── tabBarRouter.js
│ │ └── tabBars
│ │ │ └── Home.js
│ ├── share
│ │ ├── SharePlatform.js
│ │ └── share.js
│ ├── src
│ │ ├── chatWith
│ │ │ └── IM.js
│ │ ├── home
│ │ │ ├── Car
│ │ │ │ └── Car.js
│ │ │ ├── Device
│ │ │ │ └── Device.js
│ │ │ ├── Food
│ │ │ │ └── Food.js
│ │ │ ├── Motion
│ │ │ │ └── Motion.js
│ │ │ ├── Phone
│ │ │ │ └── Phone.js
│ │ │ ├── Popular
│ │ │ │ ├── Popular.js
│ │ │ │ ├── components
│ │ │ │ │ ├── menu.js
│ │ │ │ │ ├── stopList.js
│ │ │ │ │ ├── swiper.js
│ │ │ │ │ └── topButtonShow.js
│ │ │ │ └── store
│ │ │ │ │ ├── actionCreators.js
│ │ │ │ │ ├── actionTypes.js
│ │ │ │ │ ├── index.js
│ │ │ │ │ └── reducer.js
│ │ │ ├── Shoe
│ │ │ │ └── Shoe.js
│ │ │ ├── Store
│ │ │ │ └── Store.js
│ │ │ └── Woman
│ │ │ │ └── Woman.js
│ │ ├── productDetails
│ │ │ └── ProductDetails.js
│ │ └── tabBar
│ │ │ ├── ChatWith.js
│ │ │ ├── Home.js
│ │ │ ├── Personal.js
│ │ │ ├── Recommend.js
│ │ │ └── Search.js
│ ├── store
│ │ ├── actionCreators.js
│ │ ├── actionTypes.js
│ │ ├── index.js
│ │ └── reducer.js
│ └── utils
│ │ ├── index.js
│ │ └── response.js
├── index.js
├── ios
│ ├── pinduoduo-tvOS
│ │ └── Info.plist
│ ├── pinduoduo-tvOSTests
│ │ └── Info.plist
│ ├── pinduoduo.xcodeproj
│ │ ├── project.pbxproj
│ │ └── xcshareddata
│ │ │ └── xcschemes
│ │ │ ├── pinduoduo-tvOS.xcscheme
│ │ │ └── pinduoduo.xcscheme
│ ├── pinduoduo
│ │ ├── AppDelegate.h
│ │ ├── AppDelegate.m
│ │ ├── Base.lproj
│ │ │ └── LaunchScreen.xib
│ │ ├── Images.xcassets
│ │ │ ├── AppIcon.appiconset
│ │ │ │ └── Contents.json
│ │ │ └── Contents.json
│ │ ├── Info.plist
│ │ └── main.m
│ └── pinduoduoTests
│ │ ├── Info.plist
│ │ └── pinduoduoTests.m
├── package-lock.json
├── package.json
└── yarn.lock
└── planned_project
├── .babelrc
├── .buckconfig
├── .flowconfig
├── .gitattributes
├── .gitignore
├── .watchmanconfig
├── App.js
├── LICENSE
├── README.md
├── android
├── app
│ ├── BUCK
│ ├── build.gradle
│ ├── proguard-rules.pro
│ └── src
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ └── com
│ │ │ └── planned_project
│ │ │ ├── MainActivity.java
│ │ │ └── MainApplication.java
│ │ └── res
│ │ ├── mipmap-hdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-mdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ └── values
│ │ ├── strings.xml
│ │ └── styles.xml
├── build.gradle
├── gradle.properties
├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── keystores
│ ├── BUCK
│ └── debug.keystore.properties
└── settings.gradle
├── app.json
├── app
├── Common
│ ├── Icon.js
│ ├── Image.js
│ ├── TabBar-beta.js
│ ├── TabBar.js
│ └── TabHeader.js
├── Image
│ └── public
│ │ ├── back-write.png
│ │ ├── back.png
│ │ ├── colse.png
│ │ ├── home.png
│ │ ├── homeActive.png
│ │ ├── menu-icon.png
│ │ ├── my.png
│ │ ├── myActive.png
│ │ ├── shezhi.png
│ │ ├── shopping.png
│ │ ├── shoppingActive.png
│ │ ├── sort.png
│ │ ├── sortActive.png
│ │ └── wenz.png
├── Routes
│ ├── Router.js
│ ├── RouterConfig.js
│ ├── TabBar
│ │ ├── Category.js
│ │ ├── Main.js
│ │ ├── My.js
│ │ └── OrderList.js
│ └── TabBarRouter.js
├── Utils
│ └── Storage.js
└── View
│ ├── My
│ └── Registry
│ │ └── Registry.js
│ └── TabBar
│ ├── Category
│ └── Category.js
│ ├── Main
│ └── Main.js
│ ├── My
│ └── My.js
│ ├── OnlineDoctor
│ └── OnlineDoctor.js
│ └── OrderList
│ └── OrderList.js
├── index.js
├── ios
├── planned_project-tvOS
│ └── Info.plist
├── planned_project-tvOSTests
│ └── Info.plist
├── planned_project.xcodeproj
│ ├── project.pbxproj
│ └── xcshareddata
│ │ └── xcschemes
│ │ ├── planned_project-tvOS.xcscheme
│ │ └── planned_project.xcscheme
├── planned_project
│ ├── AppDelegate.h
│ ├── AppDelegate.m
│ ├── Base.lproj
│ │ └── LaunchScreen.xib
│ ├── Images.xcassets
│ │ ├── AppIcon.appiconset
│ │ │ └── Contents.json
│ │ └── Contents.json
│ ├── Info.plist
│ └── main.m
└── planned_projectTests
│ ├── Info.plist
│ └── planned_projectTests.m
├── package.json
└── yarn.lock
/.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 |
39 | # BUCK
40 | buck-out/
41 | \.buckd/
42 | *.keystore
43 |
44 | # fastlane
45 | #
46 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
47 | # screenshots whenever they are needed.
48 | # For more information about the recommended setup visit:
49 | # https://docs.fastlane.tools/best-practices/source-control/
50 |
51 | */fastlane/report.xml
52 | */fastlane/Preview.html
53 | */fastlane/screenshots
54 |
55 | # Bundle artifact
56 | *.jsbundle
57 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # RN
2 |
3 | > 仿照拼多多的一个 RNapp
4 |
5 | 
6 |
7 |
8 |
9 | ### 几乎必备的插件
10 |
11 | React Navigation 3.x 顺带安装RN的图标库
12 |
13 | ```bash
14 | yarn add react-navigation // RN导航库
15 | yarn add react-native-gesture-handler // RN 导航库依赖
16 | npm install react-native-vector-icons --save //图标库
17 | npm install react-navigation-material-bottom-tabs react-native-paper // 懒加载底部路由
18 | npm install react-native-splash-screen --save // 启动页面 解决闪屏问题
19 | npm install axios --save
20 | react-native link
21 | ```
22 |
23 | > react-native link 我的理解是 将 这个库中的底层代码与android IOS系统做连接,类似于 "注册" 吧
24 |
25 |
26 |
27 | ### 使用redux的需要安装的全部插件
28 |
29 | ```bash
30 | npm install redux --save
31 | npm install react-redux --save
32 | npm install immutable --save
33 | npm install redux-thunk --save
34 | ```
35 |
36 | ### 解决打开APP闪屏问题
37 |
38 | 解决闪屏问题插件,我先使用的是`rn-splash-screen`,开发环境没有问题,但是打包总是失败,后面就换了[**react-native-splash-screen**](https://github.com/crazycodeboy/react-native-splash-screen),这个 测试 打包都可以 不过 使用上比前者复杂一点
39 |
40 |
41 |
42 | ### 定位服务
43 |
44 | 感觉定位插件,选择很多样,我也是没怎么挑选,使用了[react-native-amap-geolocatio](https://github.com/qiuxiang/react-native-amap-geolocation)
45 |
46 |
47 |
48 | ### 第三方集成
49 |
50 | > 例如 分享到 qq 微信 朋友圈 以及第三方登录等等
51 |
52 | 使用**友盟**完成的第三方集成[react-native-share](https://github.com/songxiaoliang/react-native-share)
53 |
54 |
55 |
56 | ### 消息推送
57 |
58 | 消息推送使用的是 **极光推送** [jpush-react-native](https://github.com/jpush/jpush-react-native)
59 |
60 |
61 |
62 | ### IM聊天
63 |
64 | [react-native-gifted-chat](https://github.com/FaridSafi/react-native-gifted-chat)
65 |
66 | [aurora-imui](https://github.com/jpush/aurora-imui/blob/master/README_zh.md) 2选一
67 |
68 |
69 |
70 | ### 相关文章
71 |
72 | [RN配置沉浸式状态栏]()
73 |
74 | [React-Native项目中使用Redux](https://www.cnblogs.com/wuvkcyan/p/10081874.html)
75 |
76 | [React-Native使用极光进行消息推送](https://github.com/vkcyan/text/blob/master/react/React-Native%E4%BD%BF%E7%94%A8%E6%9E%81%E5%85%89%E8%BF%9B%E8%A1%8C%E6%B6%88%E6%81%AF%E6%8E%A8%E9%80%81.md)
77 |
78 |
--------------------------------------------------------------------------------
/imooc_ReactNative/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": ["module:metro-react-native-babel-preset"]
3 | }
4 |
--------------------------------------------------------------------------------
/imooc_ReactNative/.buckconfig:
--------------------------------------------------------------------------------
1 |
2 | [android]
3 | target = Google Inc.:Google APIs:23
4 |
5 | [maven_repositories]
6 | central = https://repo1.maven.org/maven2
7 |
--------------------------------------------------------------------------------
/imooc_ReactNative/.gitattributes:
--------------------------------------------------------------------------------
1 | *.pbxproj -text
2 |
--------------------------------------------------------------------------------
/imooc_ReactNative/.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 |
39 | # BUCK
40 | buck-out/
41 | \.buckd/
42 | *.keystore
43 |
44 | # fastlane
45 | #
46 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
47 | # screenshots whenever they are needed.
48 | # For more information about the recommended setup visit:
49 | # https://docs.fastlane.tools/best-practices/source-control/
50 |
51 | */fastlane/report.xml
52 | */fastlane/Preview.html
53 | */fastlane/screenshots
54 |
55 | # Bundle artifact
56 | *.jsbundle
57 |
--------------------------------------------------------------------------------
/imooc_ReactNative/.watchmanconfig:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------
/imooc_ReactNative/App.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 | import { View, StatusBar, Platform } from 'react-native'
3 | import Navigation from './app/navigation'
4 |
5 | export default class App extends Component {
6 | componentDidMount() {
7 | console.log(Platform.OS)
8 | console.log(StatusBar.currentHeight)
9 | StatusBar.setTranslucent(true)
10 | if (Platform.OS == 'android') {
11 | // Storage.setStorage('TabHeight', StatusBar.currentHeight.toString())
12 | } else {
13 | // console.log('苹果手机等待适配')
14 | }
15 | StatusBar.setBackgroundColor('rgba(0,0,0,0.4)')
16 | StatusBar.setBarStyle('dark-content')
17 |
18 | }
19 | render() {
20 | return
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/imooc_ReactNative/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 | lib_deps = []
12 |
13 | for jarfile in glob(['libs/*.jar']):
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 |
21 | for aarfile in glob(['libs/*.aar']):
22 | name = 'aars__' + aarfile[aarfile.rindex('/') + 1: aarfile.rindex('.aar')]
23 | lib_deps.append(':' + name)
24 | android_prebuilt_aar(
25 | name = name,
26 | aar = aarfile,
27 | )
28 |
29 | android_library(
30 | name = "all-libs",
31 | exported_deps = lib_deps,
32 | )
33 |
34 | android_library(
35 | name = "app-code",
36 | srcs = glob([
37 | "src/main/java/**/*.java",
38 | ]),
39 | deps = [
40 | ":all-libs",
41 | ":build_config",
42 | ":res",
43 | ],
44 | )
45 |
46 | android_build_config(
47 | name = "build_config",
48 | package = "com.imooc_reactnative",
49 | )
50 |
51 | android_resource(
52 | name = "res",
53 | package = "com.imooc_reactnative",
54 | res = "src/main/res",
55 | )
56 |
57 | android_binary(
58 | name = "app",
59 | keystore = "//android/keystores:debug",
60 | manifest = "src/main/AndroidManifest.xml",
61 | package_type = "debug",
62 | deps = [
63 | ":app-code",
64 | ],
65 | )
66 |
--------------------------------------------------------------------------------
/imooc_ReactNative/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 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/imooc_ReactNative/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
13 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/imooc_ReactNative/android/app/src/main/assets/fonts/AntDesign.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/imooc_ReactNative/android/app/src/main/assets/fonts/AntDesign.ttf
--------------------------------------------------------------------------------
/imooc_ReactNative/android/app/src/main/assets/fonts/Entypo.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/imooc_ReactNative/android/app/src/main/assets/fonts/Entypo.ttf
--------------------------------------------------------------------------------
/imooc_ReactNative/android/app/src/main/assets/fonts/EvilIcons.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/imooc_ReactNative/android/app/src/main/assets/fonts/EvilIcons.ttf
--------------------------------------------------------------------------------
/imooc_ReactNative/android/app/src/main/assets/fonts/Feather.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/imooc_ReactNative/android/app/src/main/assets/fonts/Feather.ttf
--------------------------------------------------------------------------------
/imooc_ReactNative/android/app/src/main/assets/fonts/FontAwesome.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/imooc_ReactNative/android/app/src/main/assets/fonts/FontAwesome.ttf
--------------------------------------------------------------------------------
/imooc_ReactNative/android/app/src/main/assets/fonts/FontAwesome5_Brands.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/imooc_ReactNative/android/app/src/main/assets/fonts/FontAwesome5_Brands.ttf
--------------------------------------------------------------------------------
/imooc_ReactNative/android/app/src/main/assets/fonts/FontAwesome5_Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/imooc_ReactNative/android/app/src/main/assets/fonts/FontAwesome5_Regular.ttf
--------------------------------------------------------------------------------
/imooc_ReactNative/android/app/src/main/assets/fonts/FontAwesome5_Solid.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/imooc_ReactNative/android/app/src/main/assets/fonts/FontAwesome5_Solid.ttf
--------------------------------------------------------------------------------
/imooc_ReactNative/android/app/src/main/assets/fonts/Foundation.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/imooc_ReactNative/android/app/src/main/assets/fonts/Foundation.ttf
--------------------------------------------------------------------------------
/imooc_ReactNative/android/app/src/main/assets/fonts/Ionicons.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/imooc_ReactNative/android/app/src/main/assets/fonts/Ionicons.ttf
--------------------------------------------------------------------------------
/imooc_ReactNative/android/app/src/main/assets/fonts/MaterialCommunityIcons.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/imooc_ReactNative/android/app/src/main/assets/fonts/MaterialCommunityIcons.ttf
--------------------------------------------------------------------------------
/imooc_ReactNative/android/app/src/main/assets/fonts/MaterialIcons.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/imooc_ReactNative/android/app/src/main/assets/fonts/MaterialIcons.ttf
--------------------------------------------------------------------------------
/imooc_ReactNative/android/app/src/main/assets/fonts/Octicons.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/imooc_ReactNative/android/app/src/main/assets/fonts/Octicons.ttf
--------------------------------------------------------------------------------
/imooc_ReactNative/android/app/src/main/assets/fonts/SimpleLineIcons.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/imooc_ReactNative/android/app/src/main/assets/fonts/SimpleLineIcons.ttf
--------------------------------------------------------------------------------
/imooc_ReactNative/android/app/src/main/assets/fonts/Zocial.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/imooc_ReactNative/android/app/src/main/assets/fonts/Zocial.ttf
--------------------------------------------------------------------------------
/imooc_ReactNative/android/app/src/main/java/com/imooc_reactnative/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.imooc_reactnative;
2 |
3 | import com.facebook.react.ReactActivity;
4 |
5 | public class MainActivity extends ReactActivity {
6 |
7 | /**
8 | * Returns the name of the main component registered from JavaScript.
9 | * This is used to schedule rendering of the component.
10 | */
11 | @Override
12 | protected String getMainComponentName() {
13 | return "imooc_ReactNative";
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/imooc_ReactNative/android/app/src/main/java/com/imooc_reactnative/MainApplication.java:
--------------------------------------------------------------------------------
1 | package com.imooc_reactnative;
2 |
3 | import android.app.Application;
4 |
5 | import com.facebook.react.ReactApplication;
6 | import com.oblador.vectoricons.VectorIconsPackage;
7 | import com.swmansion.gesturehandler.react.RNGestureHandlerPackage;
8 | import com.facebook.react.ReactNativeHost;
9 | import com.facebook.react.ReactPackage;
10 | import com.facebook.react.shell.MainReactPackage;
11 | import com.facebook.soloader.SoLoader;
12 |
13 | import java.util.Arrays;
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 | return Arrays.asList(
27 | new MainReactPackage(),
28 | new VectorIconsPackage(),
29 | new RNGestureHandlerPackage()
30 | );
31 | }
32 |
33 | @Override
34 | protected String getJSMainModuleName() {
35 | return "index";
36 | }
37 | };
38 |
39 | @Override
40 | public ReactNativeHost getReactNativeHost() {
41 | return mReactNativeHost;
42 | }
43 |
44 | @Override
45 | public void onCreate() {
46 | super.onCreate();
47 | SoLoader.init(this, /* native exopackage */ false);
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/imooc_ReactNative/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/imooc_ReactNative/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/imooc_ReactNative/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/imooc_ReactNative/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/imooc_ReactNative/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/imooc_ReactNative/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/imooc_ReactNative/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/imooc_ReactNative/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/imooc_ReactNative/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/imooc_ReactNative/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/imooc_ReactNative/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/imooc_ReactNative/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/imooc_ReactNative/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/imooc_ReactNative/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/imooc_ReactNative/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/imooc_ReactNative/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/imooc_ReactNative/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/imooc_ReactNative/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/imooc_ReactNative/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/imooc_ReactNative/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/imooc_ReactNative/android/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | imooc_ReactNative
3 |
4 |
--------------------------------------------------------------------------------
/imooc_ReactNative/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/imooc_ReactNative/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 = "27.0.3"
6 | minSdkVersion = 16
7 | compileSdkVersion = 27
8 | targetSdkVersion = 26
9 | supportLibVersion = "27.1.1"
10 | }
11 | repositories {
12 | google()
13 | jcenter()
14 | }
15 | dependencies {
16 | classpath 'com.android.tools.build:gradle:3.1.4'
17 |
18 | // NOTE: Do not place your application dependencies here; they belong
19 | // in the individual module build.gradle files
20 | }
21 | }
22 |
23 | allprojects {
24 | repositories {
25 | mavenLocal()
26 | google()
27 | jcenter()
28 | maven {
29 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
30 | url "$rootDir/../node_modules/react-native/android"
31 | }
32 | }
33 | }
34 |
35 |
36 | task wrapper(type: Wrapper) {
37 | gradleVersion = '4.4'
38 | distributionUrl = distributionUrl.replace("bin", "all")
39 | }
40 |
--------------------------------------------------------------------------------
/imooc_ReactNative/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 |
--------------------------------------------------------------------------------
/imooc_ReactNative/android/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/imooc_ReactNative/android/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/imooc_ReactNative/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | zipStoreBase=GRADLE_USER_HOME
4 | zipStorePath=wrapper/dists
5 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
6 |
--------------------------------------------------------------------------------
/imooc_ReactNative/android/keystores/BUCK:
--------------------------------------------------------------------------------
1 | keystore(
2 | name = "debug",
3 | properties = "debug.keystore.properties",
4 | store = "debug.keystore",
5 | visibility = [
6 | "PUBLIC",
7 | ],
8 | )
9 |
--------------------------------------------------------------------------------
/imooc_ReactNative/android/keystores/debug.keystore.properties:
--------------------------------------------------------------------------------
1 | key.store=debug.keystore
2 | key.alias=androiddebugkey
3 | key.store.password=android
4 | key.alias.password=android
5 |
--------------------------------------------------------------------------------
/imooc_ReactNative/android/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'imooc_ReactNative'
2 | include ':react-native-vector-icons'
3 | project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')
4 | include ':react-native-gesture-handler'
5 | project(':react-native-gesture-handler').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-gesture-handler/android')
6 |
7 | include ':app'
8 |
--------------------------------------------------------------------------------
/imooc_ReactNative/app.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "imooc_ReactNative",
3 | "displayName": "imooc_ReactNative"
4 | }
--------------------------------------------------------------------------------
/imooc_ReactNative/app/image/home-active.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/imooc_ReactNative/app/image/home-active.png
--------------------------------------------------------------------------------
/imooc_ReactNative/app/image/home.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/imooc_ReactNative/app/image/home.png
--------------------------------------------------------------------------------
/imooc_ReactNative/app/image/hot-active.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/imooc_ReactNative/app/image/hot-active.png
--------------------------------------------------------------------------------
/imooc_ReactNative/app/image/hot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/imooc_ReactNative/app/image/hot.png
--------------------------------------------------------------------------------
/imooc_ReactNative/app/image/message-active.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/imooc_ReactNative/app/image/message-active.png
--------------------------------------------------------------------------------
/imooc_ReactNative/app/image/message.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/imooc_ReactNative/app/image/message.png
--------------------------------------------------------------------------------
/imooc_ReactNative/app/image/my-active.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/imooc_ReactNative/app/image/my-active.png
--------------------------------------------------------------------------------
/imooc_ReactNative/app/image/my.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/imooc_ReactNative/app/image/my.png
--------------------------------------------------------------------------------
/imooc_ReactNative/app/navigation/TopBar.js:
--------------------------------------------------------------------------------
1 | import {
2 | createAppContainer,
3 | createMaterialTopTabNavigator
4 | } from 'react-navigation'
5 | import One from '../pages/hot'
6 | import Four from '../pages/my'
7 |
8 | export default createAppContainer(
9 | createMaterialTopTabNavigator(
10 | {
11 | One: {
12 | screen: Four, // 配置页面
13 | navigationOptions: {
14 | tabBarLabel: 'One'
15 | }
16 | },
17 | Four: {
18 | screen: Four,
19 | navigationOptions: {
20 | tabBarLabel: 'Four'
21 | }
22 | }
23 | },
24 | {
25 | initialRouteName: 'One',
26 | lazy: true,
27 | tabBarPosition: 'top',
28 | optimizationsEnabled: true, // 时候将Tab也嵌套到页面中,如果是改tab也失去焦点,将会被移除当前页,提高内存使用率
29 | tabBarOptions: {
30 | scrollEnabled: true,
31 | upperCaseLabel: false, // 是否大写
32 | activeTintColor: 'red', // 活动选项卡
33 | inactiveTintColor: 'red', // "非活动" 选项卡
34 | tabStyle: {
35 | paddingBottom: 4
36 | },
37 | pressColor: 'gray', // 添加点击动效
38 | style: {
39 | backgroundColor: 'white' // 头部导航栏样式
40 | },
41 | indicatorStyle: {
42 | backgroundColor: 'red' // 指示器样式
43 | }
44 | }
45 | }
46 | )
47 | )
48 |
--------------------------------------------------------------------------------
/imooc_ReactNative/app/pages/Five.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 | import { Text, View, Button } from 'react-native'
3 |
4 | export default class Five extends Component {
5 | render() {
6 | return (
7 |
8 | Five页面
9 |
20 | )
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/imooc_ReactNative/app/pages/Six.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 | import { Text, View, Button } from 'react-native'
3 |
4 | export default class Six extends Component {
5 | render() {
6 | return (
7 |
8 | this.props.navigation.openDrawer()}
10 | title="打开抽屉"
11 | />
12 | six页面
13 |
14 | )
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/imooc_ReactNative/app/pages/collection.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 | import { Text, View } from 'react-native'
3 |
4 | export default class Three extends Component {
5 | render() {
6 | return (
7 |
8 | Three
9 |
10 | )
11 | }
12 | }
--------------------------------------------------------------------------------
/imooc_ReactNative/app/pages/hot.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 | import { Text, View, Button, StyleSheet } from 'react-native'
3 | import TopBar from '../navigation/TopBar'
4 | import NavigationUtils from '../utils/NavigationUtils'
5 | export default class Hot extends Component {
6 | render() {
7 | NavigationUtils.Navigation = this.props.navigation
8 | return (
9 |
10 |
11 |
12 | )
13 | }
14 | }
15 |
16 | class HotTab extends Component {
17 | render() {
18 | const { tabLabel } = this.props
19 |
20 | return (
21 |
22 | {tabLabel}
23 |
24 | )
25 | }
26 | }
27 |
28 | const styles = StyleSheet.create({
29 | conatiner: {
30 | flex: 1
31 | }
32 | })
33 |
34 | {
35 | /* {
38 | this.props.navigation.navigate('trend')
39 | }}
40 | />
41 | {
44 | this.props.navigation.navigate('collection')
45 | }}
46 | />
47 | {
50 | this.props.navigation.navigate('Four')
51 | }}
52 | />
53 | {
56 | this.props.navigation.navigate('Five')
57 | }}
58 | /> */
59 | }
60 |
--------------------------------------------------------------------------------
/imooc_ReactNative/app/pages/my.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 | import { Text, View, Button } from 'react-native'
3 | import NavigationUtils from '../utils/NavigationUtils'
4 | export default class Four extends Component {
5 | render() {
6 | return (
7 |
8 | Four
9 | {
12 | console.log('跳转');
13 | // this.props.navigation.navigate('collection')
14 | NavigationUtils.goPage('collection')
15 | }}
16 | />
17 |
18 | )
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/imooc_ReactNative/app/pages/trend.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 | import { Text, View } from 'react-native'
3 |
4 | export default class Two extends Component {
5 | render() {
6 | return (
7 |
8 | Two
9 |
10 | )
11 | }
12 | }
--------------------------------------------------------------------------------
/imooc_ReactNative/app/pages/welcome.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 | import { Text, View, Button } from 'react-native'
3 | import NavigationUtils from '../utils/NavigationUtils'
4 | export default class Welcome extends Component {
5 | render() {
6 | NavigationUtils.Navigation = this.props.navigation
7 | return (
8 |
9 | 首屏
10 | {
13 | this.props.navigation.navigate('hot')
14 | NavigationUtils.goPage('hot')
15 | }}
16 | />
17 |
18 | )
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/imooc_ReactNative/app/utils/NavigationUtils.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @export 全局导航跳转工具类
3 | * @class NavigationUtils
4 | */
5 | export default class NavigationUtils {
6 | /**
7 | * 返回上一页
8 | * @param {Object} navigation
9 | */
10 | static goBack(navigation) {
11 | navigation.goBack()
12 | }
13 | /**
14 | * 回到首页
15 | * @param {Object} navigation
16 | */
17 | static resetToHomePage(navigation) {
18 | navigation.navigate('Hot')
19 | }
20 | /**
21 | *
22 | *
23 | * 跳转页面
24 | * @param {*} navigation
25 | * @param {*} page
26 | * @param {*} [params={}]
27 | * @memberof NavigationUtils
28 | */
29 | static goPage(page, params = {}) {
30 | const navigation = NavigationUtils.Navigation
31 | navigation.navigate(page, params)
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/imooc_ReactNative/index.js:
--------------------------------------------------------------------------------
1 | /** @format */
2 |
3 | import {AppRegistry} from 'react-native';
4 | import App from './App';
5 | import {name as appName} from './app.json';
6 |
7 | AppRegistry.registerComponent(appName, () => App);
8 |
--------------------------------------------------------------------------------
/imooc_ReactNative/ios/imooc_ReactNative-tvOS/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 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIRequiredDeviceCapabilities
28 |
29 | armv7
30 |
31 | UISupportedInterfaceOrientations
32 |
33 | UIInterfaceOrientationPortrait
34 | UIInterfaceOrientationLandscapeLeft
35 | UIInterfaceOrientationLandscapeRight
36 |
37 | UIViewControllerBasedStatusBarAppearance
38 |
39 | NSLocationWhenInUseUsageDescription
40 |
41 | NSAppTransportSecurity
42 |
43 |
44 | NSExceptionDomains
45 |
46 | localhost
47 |
48 | NSExceptionAllowsInsecureHTTPLoads
49 |
50 |
51 |
52 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/imooc_ReactNative/ios/imooc_ReactNative-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 |
--------------------------------------------------------------------------------
/imooc_ReactNative/ios/imooc_ReactNative/AppDelegate.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015-present, Facebook, Inc.
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 | @interface AppDelegate : UIResponder
11 |
12 | @property (nonatomic, strong) UIWindow *window;
13 |
14 | @end
15 |
--------------------------------------------------------------------------------
/imooc_ReactNative/ios/imooc_ReactNative/AppDelegate.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015-present, Facebook, Inc.
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 |
13 | @implementation AppDelegate
14 |
15 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
16 | {
17 | NSURL *jsCodeLocation;
18 |
19 | #ifdef DEBUG
20 | jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
21 | #else
22 | jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
23 | #endif
24 |
25 | RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
26 | moduleName:@"imooc_ReactNative"
27 | initialProperties:nil
28 | launchOptions:launchOptions];
29 | rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];
30 |
31 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
32 | UIViewController *rootViewController = [UIViewController new];
33 | rootViewController.view = rootView;
34 | self.window.rootViewController = rootViewController;
35 | [self.window makeKeyAndVisible];
36 | return YES;
37 | }
38 |
39 | @end
40 |
--------------------------------------------------------------------------------
/imooc_ReactNative/ios/imooc_ReactNative/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 | }
--------------------------------------------------------------------------------
/imooc_ReactNative/ios/imooc_ReactNative/Images.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/imooc_ReactNative/ios/imooc_ReactNative/main.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015-present, Facebook, Inc.
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 |
--------------------------------------------------------------------------------
/imooc_ReactNative/ios/imooc_ReactNativeTests/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 |
--------------------------------------------------------------------------------
/imooc_ReactNative/ios/imooc_ReactNativeTests/imooc_ReactNativeTests.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015-present, Facebook, Inc.
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 imooc_ReactNativeTests : XCTestCase
18 |
19 | @end
20 |
21 | @implementation imooc_ReactNativeTests
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 |
--------------------------------------------------------------------------------
/imooc_ReactNative/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "imooc_ReactNative",
3 | "version": "0.0.1",
4 | "private": true,
5 | "scripts": {
6 | "start": "node node_modules/react-native/local-cli/cli.js start",
7 | "test": "jest"
8 | },
9 | "dependencies": {
10 | "axios": "^0.18.0",
11 | "react": "16.6.3",
12 | "react-native": "0.57.8",
13 | "react-native-gesture-handler": "^1.0.12",
14 | "react-native-paper": "^2.4.0",
15 | "react-native-vector-icons": "^6.1.0",
16 | "react-navigation": "^3.0.9",
17 | "react-navigation-material-bottom-tabs": "^1.0.0",
18 | "react-redux": "^6.0.0",
19 | "redux": "^4.0.1",
20 | "redux-logger": "^3.0.6",
21 | "redux-thunk": "^2.3.0"
22 | },
23 | "devDependencies": {
24 | "babel-jest": "23.6.0",
25 | "jest": "23.6.0",
26 | "metro-react-native-babel-preset": "0.51.1",
27 | "react-test-renderer": "16.6.3"
28 | },
29 | "jest": {
30 | "preset": "react-native"
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/mkDemo/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": ["module:metro-react-native-babel-preset"]
3 | }
4 |
--------------------------------------------------------------------------------
/mkDemo/.buckconfig:
--------------------------------------------------------------------------------
1 |
2 | [android]
3 | target = Google Inc.:Google APIs:23
4 |
5 | [maven_repositories]
6 | central = https://repo1.maven.org/maven2
7 |
--------------------------------------------------------------------------------
/mkDemo/.gitattributes:
--------------------------------------------------------------------------------
1 | *.pbxproj -text
2 |
--------------------------------------------------------------------------------
/mkDemo/.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 |
39 | # BUCK
40 | buck-out/
41 | \.buckd/
42 | *.keystore
43 |
44 | # fastlane
45 | #
46 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
47 | # screenshots whenever they are needed.
48 | # For more information about the recommended setup visit:
49 | # https://docs.fastlane.tools/best-practices/source-control/
50 |
51 | */fastlane/report.xml
52 | */fastlane/Preview.html
53 | */fastlane/screenshots
54 |
55 | # Bundle artifact
56 | *.jsbundle
57 |
--------------------------------------------------------------------------------
/mkDemo/.watchmanconfig:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------
/mkDemo/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, {Component} from 'react';
10 | import {Platform, StyleSheet, Text, View} from 'react-native';
11 |
12 | const instructions = Platform.select({
13 | ios: 'Press Cmd+R to reload,\n' + 'Cmd+D or shake for dev menu',
14 | android:
15 | 'Double tap R on your keyboard to reload,\n' +
16 | 'Shake or press menu button for dev menu',
17 | });
18 |
19 | export default class App extends Component {
20 | render() {
21 | return (
22 |
23 | Welcome to React Native!
24 | To get started, edit App.js
25 | {instructions}
26 |
27 | );
28 | }
29 | }
30 |
31 | const styles = StyleSheet.create({
32 | container: {
33 | flex: 1,
34 | justifyContent: 'center',
35 | alignItems: 'center',
36 | backgroundColor: '#F5FCFF',
37 | },
38 | welcome: {
39 | fontSize: 20,
40 | textAlign: 'center',
41 | margin: 10,
42 | },
43 | instructions: {
44 | textAlign: 'center',
45 | color: '#333333',
46 | marginBottom: 5,
47 | },
48 | });
49 |
--------------------------------------------------------------------------------
/mkDemo/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 | lib_deps = []
12 |
13 | for jarfile in glob(['libs/*.jar']):
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 |
21 | for aarfile in glob(['libs/*.aar']):
22 | name = 'aars__' + aarfile[aarfile.rindex('/') + 1: aarfile.rindex('.aar')]
23 | lib_deps.append(':' + name)
24 | android_prebuilt_aar(
25 | name = name,
26 | aar = aarfile,
27 | )
28 |
29 | android_library(
30 | name = "all-libs",
31 | exported_deps = lib_deps,
32 | )
33 |
34 | android_library(
35 | name = "app-code",
36 | srcs = glob([
37 | "src/main/java/**/*.java",
38 | ]),
39 | deps = [
40 | ":all-libs",
41 | ":build_config",
42 | ":res",
43 | ],
44 | )
45 |
46 | android_build_config(
47 | name = "build_config",
48 | package = "com.demo",
49 | )
50 |
51 | android_resource(
52 | name = "res",
53 | package = "com.demo",
54 | res = "src/main/res",
55 | )
56 |
57 | android_binary(
58 | name = "app",
59 | keystore = "//android/keystores:debug",
60 | manifest = "src/main/AndroidManifest.xml",
61 | package_type = "debug",
62 | deps = [
63 | ":app-code",
64 | ],
65 | )
66 |
--------------------------------------------------------------------------------
/mkDemo/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 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/mkDemo/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
13 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/mkDemo/android/app/src/main/assets/fonts/AntDesign.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/mkDemo/android/app/src/main/assets/fonts/AntDesign.ttf
--------------------------------------------------------------------------------
/mkDemo/android/app/src/main/assets/fonts/Entypo.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/mkDemo/android/app/src/main/assets/fonts/Entypo.ttf
--------------------------------------------------------------------------------
/mkDemo/android/app/src/main/assets/fonts/EvilIcons.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/mkDemo/android/app/src/main/assets/fonts/EvilIcons.ttf
--------------------------------------------------------------------------------
/mkDemo/android/app/src/main/assets/fonts/Feather.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/mkDemo/android/app/src/main/assets/fonts/Feather.ttf
--------------------------------------------------------------------------------
/mkDemo/android/app/src/main/assets/fonts/FontAwesome.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/mkDemo/android/app/src/main/assets/fonts/FontAwesome.ttf
--------------------------------------------------------------------------------
/mkDemo/android/app/src/main/assets/fonts/FontAwesome5_Brands.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/mkDemo/android/app/src/main/assets/fonts/FontAwesome5_Brands.ttf
--------------------------------------------------------------------------------
/mkDemo/android/app/src/main/assets/fonts/FontAwesome5_Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/mkDemo/android/app/src/main/assets/fonts/FontAwesome5_Regular.ttf
--------------------------------------------------------------------------------
/mkDemo/android/app/src/main/assets/fonts/FontAwesome5_Solid.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/mkDemo/android/app/src/main/assets/fonts/FontAwesome5_Solid.ttf
--------------------------------------------------------------------------------
/mkDemo/android/app/src/main/assets/fonts/Foundation.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/mkDemo/android/app/src/main/assets/fonts/Foundation.ttf
--------------------------------------------------------------------------------
/mkDemo/android/app/src/main/assets/fonts/Ionicons.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/mkDemo/android/app/src/main/assets/fonts/Ionicons.ttf
--------------------------------------------------------------------------------
/mkDemo/android/app/src/main/assets/fonts/MaterialCommunityIcons.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/mkDemo/android/app/src/main/assets/fonts/MaterialCommunityIcons.ttf
--------------------------------------------------------------------------------
/mkDemo/android/app/src/main/assets/fonts/MaterialIcons.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/mkDemo/android/app/src/main/assets/fonts/MaterialIcons.ttf
--------------------------------------------------------------------------------
/mkDemo/android/app/src/main/assets/fonts/Octicons.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/mkDemo/android/app/src/main/assets/fonts/Octicons.ttf
--------------------------------------------------------------------------------
/mkDemo/android/app/src/main/assets/fonts/SimpleLineIcons.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/mkDemo/android/app/src/main/assets/fonts/SimpleLineIcons.ttf
--------------------------------------------------------------------------------
/mkDemo/android/app/src/main/assets/fonts/Zocial.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/mkDemo/android/app/src/main/assets/fonts/Zocial.ttf
--------------------------------------------------------------------------------
/mkDemo/android/app/src/main/java/com/demo/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.demo;
2 |
3 | import com.facebook.react.ReactActivity;
4 |
5 | public class MainActivity extends ReactActivity {
6 |
7 | /**
8 | * Returns the name of the main component registered from JavaScript.
9 | * This is used to schedule rendering of the component.
10 | */
11 | @Override
12 | protected String getMainComponentName() {
13 | return "demo";
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/mkDemo/android/app/src/main/java/com/demo/MainApplication.java:
--------------------------------------------------------------------------------
1 | package com.demo;
2 |
3 | import android.app.Application;
4 |
5 | import com.facebook.react.ReactApplication;
6 | import com.swmansion.gesturehandler.react.RNGestureHandlerPackage;
7 | import org.devio.rn.splashscreen.SplashScreenReactPackage;
8 | import com.oblador.vectoricons.VectorIconsPackage;
9 | import com.facebook.react.ReactNativeHost;
10 | import com.facebook.react.ReactPackage;
11 | import com.facebook.react.shell.MainReactPackage;
12 | import com.facebook.soloader.SoLoader;
13 |
14 | import java.util.Arrays;
15 | import java.util.List;
16 |
17 | public class MainApplication extends Application implements ReactApplication {
18 |
19 | private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
20 | @Override
21 | public boolean getUseDeveloperSupport() {
22 | return BuildConfig.DEBUG;
23 | }
24 |
25 | @Override
26 | protected List getPackages() {
27 | return Arrays.asList(
28 | new MainReactPackage(),
29 | new RNGestureHandlerPackage(),
30 | new SplashScreenReactPackage(),
31 | new VectorIconsPackage()
32 | );
33 | }
34 |
35 | @Override
36 | protected String getJSMainModuleName() {
37 | return "index";
38 | }
39 | };
40 |
41 | @Override
42 | public ReactNativeHost getReactNativeHost() {
43 | return mReactNativeHost;
44 | }
45 |
46 | @Override
47 | public void onCreate() {
48 | super.onCreate();
49 | SoLoader.init(this, /* native exopackage */ false);
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/mkDemo/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/mkDemo/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/mkDemo/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/mkDemo/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/mkDemo/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/mkDemo/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/mkDemo/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/mkDemo/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/mkDemo/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/mkDemo/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/mkDemo/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/mkDemo/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/mkDemo/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/mkDemo/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/mkDemo/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/mkDemo/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/mkDemo/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/mkDemo/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/mkDemo/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/mkDemo/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/mkDemo/android/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | demo
3 |
4 |
--------------------------------------------------------------------------------
/mkDemo/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/mkDemo/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 = "27.0.3"
6 | minSdkVersion = 16
7 | compileSdkVersion = 27
8 | targetSdkVersion = 26
9 | supportLibVersion = "27.1.1"
10 | }
11 | repositories {
12 | google()
13 | jcenter()
14 | }
15 | dependencies {
16 | classpath 'com.android.tools.build:gradle:3.1.4'
17 |
18 | // NOTE: Do not place your application dependencies here; they belong
19 | // in the individual module build.gradle files
20 | }
21 | }
22 |
23 | allprojects {
24 | repositories {
25 | mavenLocal()
26 | google()
27 | jcenter()
28 | maven {
29 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
30 | url "$rootDir/../node_modules/react-native/android"
31 | }
32 | }
33 | }
34 |
35 |
36 | task wrapper(type: Wrapper) {
37 | gradleVersion = '4.4'
38 | distributionUrl = distributionUrl.replace("bin", "all")
39 | }
40 |
--------------------------------------------------------------------------------
/mkDemo/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 |
--------------------------------------------------------------------------------
/mkDemo/android/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/mkDemo/android/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/mkDemo/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | zipStoreBase=GRADLE_USER_HOME
4 | zipStorePath=wrapper/dists
5 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
6 |
--------------------------------------------------------------------------------
/mkDemo/android/keystores/BUCK:
--------------------------------------------------------------------------------
1 | keystore(
2 | name = "debug",
3 | properties = "debug.keystore.properties",
4 | store = "debug.keystore",
5 | visibility = [
6 | "PUBLIC",
7 | ],
8 | )
9 |
--------------------------------------------------------------------------------
/mkDemo/android/keystores/debug.keystore.properties:
--------------------------------------------------------------------------------
1 | key.store=debug.keystore
2 | key.alias=androiddebugkey
3 | key.store.password=android
4 | key.alias.password=android
5 |
--------------------------------------------------------------------------------
/mkDemo/android/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'demo'
2 | include ':react-native-gesture-handler'
3 | project(':react-native-gesture-handler').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-gesture-handler/android')
4 | include ':react-native-splash-screen'
5 | project(':react-native-splash-screen').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-splash-screen/android')
6 | include ':react-native-vector-icons'
7 | project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')
8 |
9 | include ':app'
10 |
--------------------------------------------------------------------------------
/mkDemo/app.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "demo",
3 | "displayName": "demo"
4 | }
--------------------------------------------------------------------------------
/mkDemo/app/components/PopularTab/PopularTab.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 | import { View, FlatList, RefreshControl } from 'react-native'
3 | import { getUrl } from '../../config/config'
4 | import axios from 'axios'
5 |
6 | import Tabitem from './Tabitem'
7 | export default class PopularTab extends Component {
8 | constructor() {
9 | super()
10 | this.state = {
11 | text: '',
12 | loading: false
13 | }
14 | }
15 | componentDidMount() {
16 | this.onload()
17 | }
18 | render() {
19 | return (
20 |
21 | {
25 | return item.id.toString()
26 | }}
27 | refreshControl={ { // 下拉属性的回调
31 | this.onload()
32 | }}
33 | />}
34 | />
35 |
36 | )
37 | }
38 |
39 | renderItem = item => {
40 | let { full_name, description, owner, stargazers_count } = item.item
41 | return (
42 |
48 | )
49 | }
50 |
51 | onload = () => {
52 | this.setState({
53 | loading: true
54 | })
55 | console.log(getUrl(this.props.tabLabel))
56 | axios.get(getUrl(this.props.tabLabel)).then(res => {
57 | console.log(res)
58 | this.setState({
59 | text: res.data.items,
60 | loading: false
61 | })
62 | })
63 | .catch(err => {
64 | console.log(err);
65 | })
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/mkDemo/app/components/PopularTab/Tabitem.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 | import { Text, StyleSheet, View, Image } from 'react-native'
3 | import AntDesign from 'react-native-vector-icons/AntDesign'
4 | export default class Tabitem extends Component {
5 | render() {
6 | let { full_name, description, owner, stargazers_count } = this.props
7 | return (
8 |
9 | {full_name}
10 | 描述:{description}
11 |
12 |
13 | 头像:
14 |
15 |
16 |
17 | 点赞:{stargazers_count}
18 |
19 |
20 |
21 |
22 |
23 |
24 | )
25 | }
26 | }
27 |
28 | const styles = StyleSheet.create({
29 | itemcontainers: {
30 | flex: 1,
31 | marginHorizontal : 5,
32 | paddingLeft: 8,
33 | paddingTop: 5,
34 | paddingBottom: 5,
35 | paddingRight: 8,
36 | borderRadius: 2,
37 | borderWidth: 0.5,
38 | borderColor: '#dddddd',
39 | marginVertical: 3,
40 | // ios
41 | shadowColor: 'gray',
42 | shadowOffset: {
43 | width: 0.5,
44 | height: 0.5
45 | },
46 | shadowOpacity: 0.4,
47 | shadowRadius: 1,
48 | // android
49 | elevation: 2
50 | },
51 | fullName: {
52 | fontSize:16,
53 | marginBottom: 2,
54 | color: '#212121'
55 | },
56 | description: {
57 | fontSize:14,
58 | marginBottom: 2,
59 | color: '#757575'
60 | },
61 | tabBottom: {
62 | flexDirection: 'row',
63 | justifyContent: 'space-between',
64 | alignItems: 'center',
65 | flex: 1
66 | },
67 | bottomLeft: {
68 | flexDirection: 'row'
69 | },
70 | images: {
71 | width: 20,
72 | height: 20,
73 | marginLeft: 2,
74 | marginRight: 2,
75 | }
76 | })
77 |
--------------------------------------------------------------------------------
/mkDemo/app/config/config.js:
--------------------------------------------------------------------------------
1 | export function getUrl(url) {
2 | return `https://api.github.com/search/repositories?q=${url}&sore=start`
3 | }
4 |
--------------------------------------------------------------------------------
/mkDemo/app/page/Favorite/Favorite.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 | import { Text, StyleSheet, View } from 'react-native'
3 |
4 | export default class Favorite extends Component {
5 | render() {
6 | return (
7 |
8 | 收藏
9 |
10 | )
11 | }
12 | }
13 |
14 | const styles = StyleSheet.create({})
15 |
--------------------------------------------------------------------------------
/mkDemo/app/page/MoreMenu/MoreMenu.js:
--------------------------------------------------------------------------------
1 |
2 | import React, { Component } from 'react'
3 | import { Text, StyleSheet, View } from 'react-native'
4 |
5 | export default class MoreMenu extends Component {
6 | render() {
7 | return (
8 |
9 | 未定
10 |
11 | )
12 | }
13 | }
14 |
15 | const styles = StyleSheet.create({})
16 |
--------------------------------------------------------------------------------
/mkDemo/app/page/My/My.js:
--------------------------------------------------------------------------------
1 |
2 | import React, { Component } from 'react'
3 | import { Text, StyleSheet, View } from 'react-native'
4 |
5 | export default class My extends Component {
6 | render() {
7 | return (
8 |
9 | 我的
10 | 自定义标签
11 |
12 | )
13 | }
14 | gotoCustomLabel = () => {
15 | this.props.navigation.navigate('CustomLabel')
16 | }
17 | }
18 |
19 | const styles = StyleSheet.create({})
20 |
--------------------------------------------------------------------------------
/mkDemo/app/page/Puplar/Popular.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 | import { StyleSheet, View,StatusBar } from 'react-native'
3 | import ScrollableTabView, {
4 | ScrollableTabBar
5 | } from 'react-native-scrollable-tab-view'
6 | import PopularTab from '../../components/PopularTab/PopularTab'
7 |
8 | export default class Popular extends Component {
9 | constructor() {
10 | super()
11 | }
12 | render() {
13 | return (
14 |
15 |
18 |
19 | }
21 | locked={false}
22 | tabBarBackgroundColor='#2196f3'
23 | tabBarActiveTextColor='white'
24 | tabBarInactiveTextColor='mintcream'
25 | tabBarUnderlineStyle={{
26 | backgroundColor: '#e7e7e7',
27 | height: 2
28 | }}
29 | >
30 |
31 |
32 |
33 |
34 |
35 |
36 | )
37 | }
38 | }
39 |
40 | const styles = StyleSheet.create({})
41 |
--------------------------------------------------------------------------------
/mkDemo/app/page/Search/Search.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 | import { Text, StyleSheet, View } from 'react-native'
3 |
4 | export default class Search extends Component {
5 | render() {
6 | return (
7 |
8 | 未定
9 |
10 | )
11 | }
12 | }
13 |
14 | const styles = StyleSheet.create({})
15 |
--------------------------------------------------------------------------------
/mkDemo/app/public/check.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/mkDemo/app/public/check.png
--------------------------------------------------------------------------------
/mkDemo/app/public/uncheck.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/mkDemo/app/public/uncheck.png
--------------------------------------------------------------------------------
/mkDemo/app/routes/App.js:
--------------------------------------------------------------------------------
1 | import { createStackNavigator, createAppContainer } from 'react-navigation'
2 | import RouerConfig from './RouerConfig'
3 |
4 | const HomeStack = createStackNavigator(RouerConfig, {
5 | mode: 'card',
6 | headerMode: 'screen',
7 | defaultNavigationOptions: {
8 | headerStyle: {
9 | backgroundColor: '#2196f3'
10 | },
11 | headerTintColor: '#fff', // 定义导航条的字体颜色 会覆盖headerTitleStyle的颜色
12 | headerTitleStyle: {
13 | fontWeight: 'bold'
14 | }
15 | }
16 | })
17 |
18 | export default createAppContainer(HomeStack)
19 |
--------------------------------------------------------------------------------
/mkDemo/app/routes/RouerConfig.js:
--------------------------------------------------------------------------------
1 | import tabBarRoutes from './tabBarRoutes'
2 | import CustomLabel from '../page/My/CustomLabel/CustomLabel'
3 | export default {
4 | tabBar: {
5 | screen: tabBarRoutes,
6 | navigationOptions: () => ({
7 | header: null
8 | })
9 | },
10 | CustomLabel: {
11 | screen: CustomLabel,
12 | navigationOptions: () => ({
13 | title: '标签'
14 | })
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/mkDemo/app/routes/tabBarRoutes/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { createMaterialBottomTabNavigator } from 'react-navigation-material-bottom-tabs'
3 | import AntDesign from 'react-native-vector-icons/AntDesign'
4 | import Feather from 'react-native-vector-icons/Feather'
5 | import FontAwesome5 from 'react-native-vector-icons/FontAwesome5'
6 | import Popular from '../../page/Puplar/Popular'
7 | import Trending from '../../page/Trending/Trending'
8 | import Favorite from '../../page/Favorite/Favorite'
9 | import My from '../../page/My/My'
10 |
11 | export default createMaterialBottomTabNavigator(
12 | {
13 | Home: {
14 | screen: Popular,
15 | navigationOptions: {
16 | tabBarLabel: '最热',
17 | tabBarIcon: (
18 | { tintColor } // 页面图标
19 | ) => ,
20 | tabBarColor: 'white' // 页面背景色
21 | }
22 | },
23 | Trending: {
24 | screen: Trending,
25 | navigationOptions: {
26 | tabBarLabel: '趋势',
27 | tabBarIcon: (
28 | { tintColor } // 页面图标
29 | ) =>
30 | }
31 | },
32 | Favorite: {
33 | screen: Favorite,
34 | navigationOptions: {
35 | tabBarLabel: '收藏',
36 | tabBarIcon: (
37 | { tintColor } // 页面图标
38 | ) =>
39 | }
40 | },
41 | My: {
42 | screen: My,
43 | navigationOptions: {
44 | tabBarLabel: '我的',
45 | tabBarIcon: (
46 | { tintColor } // 页面图标
47 | ) =>
48 | }
49 | }
50 | },
51 | {
52 | initialRouteName: 'Home',
53 | activeColor: '#E80707', // 选中的菜单颜色
54 | inactiveColor: '#6D6D6D', // 非选中的菜单颜色
55 | barStyle: { backgroundColor: 'white' }, // 底部导航栏样式
56 | shifting: false
57 |
58 | }
59 | )
60 |
--------------------------------------------------------------------------------
/mkDemo/app/utils/Storage.js:
--------------------------------------------------------------------------------
1 | import { AsyncStorage } from 'react-native'
2 |
3 | /**
4 | *
5 | * @param {string} key
6 | */
7 | function getStorage(key) {
8 | return new Promise((resolve, reject) => {
9 | AsyncStorage.getItem(key, (err,value) => {
10 | if (!err) {
11 | resolve(value)
12 | } else {
13 | reject(err)
14 | }
15 | })
16 | })
17 | }
18 | /**
19 | *
20 | * @param {Array} value
21 | */
22 | function getAllStorageKey() {
23 | return new Promise((resolve, reject) => {
24 | AsyncStorage.getAllKeys((err, value) => {
25 | console.log(err, value)
26 | if (!err) {
27 | resolve(value)
28 | } else {
29 | reject(err)
30 | }
31 | })
32 | })
33 | }
34 |
35 | function setStorage(key,value) {
36 | return new Promise((resolve,reject) => {
37 | AsyncStorage.setItem(key,value,(err) => {
38 | if (!err) {
39 | resolve()
40 | } else {
41 | reject(err)
42 | }
43 | })
44 | })
45 | }
46 | function removeStorage() {}
47 |
48 | export default {
49 | getStorage,
50 | setStorage,
51 | getAllStorageKey
52 | }
53 |
--------------------------------------------------------------------------------
/mkDemo/app/utils/data/keys.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 |
4 | "path": "stars:>1",
5 | "name": "ALL",
6 | "short_name": "ALL",
7 | "checked": true
8 | },
9 | {
10 | "path": "Android",
11 | "name": "Android",
12 | "checked": true
13 | },
14 | {
15 | "path": "iOS",
16 | "name": "iOS",
17 | "checked": true
18 | },
19 | {
20 | "path": "react-native",
21 | "name": "React Native",
22 | "checked": false
23 | },
24 | {
25 | "path": "MySQL",
26 | "name": "MySQL",
27 | "checked": false
28 | },
29 | {
30 | "path": " AngularJS",
31 | "name": " AngularJS",
32 | "checked": false
33 | },
34 | {
35 | "path": " jQuery",
36 | "name": " jQuery",
37 | "checked": false
38 | },
39 | {
40 | "path": " react",
41 | "name": " React",
42 | "checked": false
43 | }
44 | ]
45 |
--------------------------------------------------------------------------------
/mkDemo/app/utils/initData.js:
--------------------------------------------------------------------------------
1 | import Storage from './Storage'
2 | import value from './data/keys.json'
3 |
4 | let config = {
5 | pupdata: 'pup'
6 | }
7 |
8 | // 初始化数据
9 | /**
10 | * @param {string} key
11 | */
12 | function initData(key) {
13 | if (key == config.pupdata) {
14 | return initdata_pup()
15 | }
16 | }
17 |
18 | async function initdata_pup() {
19 | try {
20 | const res = await Storage.getStorage(config.pupdata)
21 | if (res) {
22 | // Storage.setStorage('pup', JSON.stringify(value))
23 | return res
24 | } else {
25 | // 数据不存在就添加数据
26 | Storage.setStorage('pup', JSON.stringify(value))
27 | .then(() => {
28 | return initdata_pup()
29 | })
30 | .catch(res_1 => {
31 | console.error(res_1)
32 | return res_1
33 | })
34 | }
35 | } catch (res_2) {
36 | console.error(res_2)
37 | return res_2
38 | }
39 | }
40 |
41 | export { config, initData }
42 |
--------------------------------------------------------------------------------
/mkDemo/index.js:
--------------------------------------------------------------------------------
1 | /** @format */
2 |
3 | import {AppRegistry} from 'react-native';
4 | import App from './app/routes/App';
5 | import {name as appName} from './app.json';
6 |
7 | AppRegistry.registerComponent(appName, () => App);
8 |
--------------------------------------------------------------------------------
/mkDemo/ios/demo-tvOS/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 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIRequiredDeviceCapabilities
28 |
29 | armv7
30 |
31 | UISupportedInterfaceOrientations
32 |
33 | UIInterfaceOrientationPortrait
34 | UIInterfaceOrientationLandscapeLeft
35 | UIInterfaceOrientationLandscapeRight
36 |
37 | UIViewControllerBasedStatusBarAppearance
38 |
39 | NSLocationWhenInUseUsageDescription
40 |
41 | NSAppTransportSecurity
42 |
43 |
44 | NSExceptionDomains
45 |
46 | localhost
47 |
48 | NSExceptionAllowsInsecureHTTPLoads
49 |
50 |
51 |
52 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/mkDemo/ios/demo-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 |
--------------------------------------------------------------------------------
/mkDemo/ios/demo/AppDelegate.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015-present, Facebook, Inc.
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 | @interface AppDelegate : UIResponder
11 |
12 | @property (nonatomic, strong) UIWindow *window;
13 |
14 | @end
15 |
--------------------------------------------------------------------------------
/mkDemo/ios/demo/AppDelegate.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015-present, Facebook, Inc.
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 |
13 | @implementation AppDelegate
14 |
15 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
16 | {
17 | NSURL *jsCodeLocation;
18 |
19 | jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
20 |
21 | RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
22 | moduleName:@"demo"
23 | initialProperties:nil
24 | launchOptions:launchOptions];
25 | rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];
26 |
27 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
28 | UIViewController *rootViewController = [UIViewController new];
29 | rootViewController.view = rootView;
30 | self.window.rootViewController = rootViewController;
31 | [self.window makeKeyAndVisible];
32 | return YES;
33 | }
34 |
35 | @end
36 |
--------------------------------------------------------------------------------
/mkDemo/ios/demo/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 | }
--------------------------------------------------------------------------------
/mkDemo/ios/demo/Images.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/mkDemo/ios/demo/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | demo
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 | NSLocationWhenInUseUsageDescription
28 |
29 | UILaunchStoryboardName
30 | LaunchScreen
31 | UIRequiredDeviceCapabilities
32 |
33 | armv7
34 |
35 | UISupportedInterfaceOrientations
36 |
37 | UIInterfaceOrientationPortrait
38 | UIInterfaceOrientationLandscapeLeft
39 | UIInterfaceOrientationLandscapeRight
40 |
41 | UIViewControllerBasedStatusBarAppearance
42 |
43 | NSAppTransportSecurity
44 |
45 | NSAllowsArbitraryLoads
46 |
47 | NSExceptionDomains
48 |
49 | localhost
50 |
51 | NSExceptionAllowsInsecureHTTPLoads
52 |
53 |
54 |
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 | SimpleLineIcons.ttf
72 | Zocial.ttf
73 |
74 |
75 |
76 |
--------------------------------------------------------------------------------
/mkDemo/ios/demo/main.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015-present, Facebook, Inc.
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 |
--------------------------------------------------------------------------------
/mkDemo/ios/demoTests/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 |
--------------------------------------------------------------------------------
/mkDemo/ios/demoTests/demoTests.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015-present, Facebook, Inc.
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 demoTests : XCTestCase
18 |
19 | @end
20 |
21 | @implementation demoTests
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 |
--------------------------------------------------------------------------------
/mkDemo/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "demo",
3 | "version": "0.0.1",
4 | "private": true,
5 | "scripts": {
6 | "start": "node node_modules/react-native/local-cli/cli.js start",
7 | "test": "jest"
8 | },
9 | "dependencies": {
10 | "axios": "^0.18.0",
11 | "react": "16.6.1",
12 | "react-native": "0.57.7",
13 | "react-native-check-box": "^2.1.7",
14 | "react-native-easy-toast": "^1.1.0",
15 | "react-native-gesture-handler": "^1.0.10",
16 | "react-native-paper": "^2.3.0",
17 | "react-native-scrollable-tab-view": "^0.10.0",
18 | "react-native-splash-screen": "^3.1.1",
19 | "react-native-vector-icons": "^6.1.0",
20 | "react-navigation": "^3.0.8",
21 | "react-navigation-material-bottom-tabs": "^1.0.0"
22 | },
23 | "devDependencies": {
24 | "babel-jest": "23.6.0",
25 | "jest": "23.6.0",
26 | "metro-react-native-babel-preset": "0.50.0",
27 | "react-test-renderer": "16.6.1"
28 | },
29 | "jest": {
30 | "preset": "react-native"
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/pinduoduo/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": ["module:metro-react-native-babel-preset"]
3 | }
4 |
--------------------------------------------------------------------------------
/pinduoduo/.buckconfig:
--------------------------------------------------------------------------------
1 |
2 | [android]
3 | target = Google Inc.:Google APIs:23
4 |
5 | [maven_repositories]
6 | central = https://repo1.maven.org/maven2
7 |
--------------------------------------------------------------------------------
/pinduoduo/.gitattributes:
--------------------------------------------------------------------------------
1 | *.pbxproj -text
2 |
--------------------------------------------------------------------------------
/pinduoduo/.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 | first
39 |
40 | # BUCK
41 | buck-out/
42 | \.buckd/
43 | *.keystore
44 |
45 | # fastlane
46 | #
47 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
48 | # screenshots whenever they are needed.
49 | # For more information about the recommended setup visit:
50 | # https://docs.fastlane.tools/best-practices/source-control/
51 |
52 | */fastlane/report.xml
53 | */fastlane/Preview.html
54 | */fastlane/screenshots
55 |
56 | # Bundle artifact
57 | *.jsbundle
58 |
--------------------------------------------------------------------------------
/pinduoduo/.watchmanconfig:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------
/pinduoduo/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 | lib_deps = []
12 |
13 | for jarfile in glob(['libs/*.jar']):
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 |
21 | for aarfile in glob(['libs/*.aar']):
22 | name = 'aars__' + aarfile[aarfile.rindex('/') + 1: aarfile.rindex('.aar')]
23 | lib_deps.append(':' + name)
24 | android_prebuilt_aar(
25 | name = name,
26 | aar = aarfile,
27 | )
28 |
29 | android_library(
30 | name = "all-libs",
31 | exported_deps = lib_deps,
32 | )
33 |
34 | android_library(
35 | name = "app-code",
36 | srcs = glob([
37 | "src/main/java/**/*.java",
38 | ]),
39 | deps = [
40 | ":all-libs",
41 | ":build_config",
42 | ":res",
43 | ],
44 | )
45 |
46 | android_build_config(
47 | name = "build_config",
48 | package = "com.pinduoduo",
49 | )
50 |
51 | android_resource(
52 | name = "res",
53 | package = "com.pinduoduo",
54 | res = "src/main/res",
55 | )
56 |
57 | android_binary(
58 | name = "app",
59 | keystore = "//android/keystores:debug",
60 | manifest = "src/main/AndroidManifest.xml",
61 | package_type = "debug",
62 | deps = [
63 | ":app-code",
64 | ],
65 | )
66 |
--------------------------------------------------------------------------------
/pinduoduo/android/app/libs/umeng-common-1.5.1.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/pinduoduo/android/app/libs/umeng-common-1.5.1.jar
--------------------------------------------------------------------------------
/pinduoduo/android/app/libs/umeng-debug-1.0.0.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/pinduoduo/android/app/libs/umeng-debug-1.0.0.jar
--------------------------------------------------------------------------------
/pinduoduo/android/app/libs/umeng-share-QQ-simplify-6.9.1.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/pinduoduo/android/app/libs/umeng-share-QQ-simplify-6.9.1.jar
--------------------------------------------------------------------------------
/pinduoduo/android/app/libs/umeng-share-core-6.9.1.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/pinduoduo/android/app/libs/umeng-share-core-6.9.1.jar
--------------------------------------------------------------------------------
/pinduoduo/android/app/libs/umeng-share-sina-simplify-6.9.1.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/pinduoduo/android/app/libs/umeng-share-sina-simplify-6.9.1.jar
--------------------------------------------------------------------------------
/pinduoduo/android/app/libs/umeng-share-wechat-simplify-6.9.1.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/pinduoduo/android/app/libs/umeng-share-wechat-simplify-6.9.1.jar
--------------------------------------------------------------------------------
/pinduoduo/android/app/libs/umeng-sharetool-6.9.1.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/pinduoduo/android/app/libs/umeng-sharetool-6.9.1.jar
--------------------------------------------------------------------------------
/pinduoduo/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 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 | -keep class cn.jiguang.imui.** { *; }
19 |
--------------------------------------------------------------------------------
/pinduoduo/android/app/src/main/assets/fonts/AntDesign.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/pinduoduo/android/app/src/main/assets/fonts/AntDesign.ttf
--------------------------------------------------------------------------------
/pinduoduo/android/app/src/main/assets/fonts/Entypo.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/pinduoduo/android/app/src/main/assets/fonts/Entypo.ttf
--------------------------------------------------------------------------------
/pinduoduo/android/app/src/main/assets/fonts/EvilIcons.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/pinduoduo/android/app/src/main/assets/fonts/EvilIcons.ttf
--------------------------------------------------------------------------------
/pinduoduo/android/app/src/main/assets/fonts/Feather.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/pinduoduo/android/app/src/main/assets/fonts/Feather.ttf
--------------------------------------------------------------------------------
/pinduoduo/android/app/src/main/assets/fonts/FontAwesome.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/pinduoduo/android/app/src/main/assets/fonts/FontAwesome.ttf
--------------------------------------------------------------------------------
/pinduoduo/android/app/src/main/assets/fonts/FontAwesome5_Brands.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/pinduoduo/android/app/src/main/assets/fonts/FontAwesome5_Brands.ttf
--------------------------------------------------------------------------------
/pinduoduo/android/app/src/main/assets/fonts/FontAwesome5_Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/pinduoduo/android/app/src/main/assets/fonts/FontAwesome5_Regular.ttf
--------------------------------------------------------------------------------
/pinduoduo/android/app/src/main/assets/fonts/FontAwesome5_Solid.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/pinduoduo/android/app/src/main/assets/fonts/FontAwesome5_Solid.ttf
--------------------------------------------------------------------------------
/pinduoduo/android/app/src/main/assets/fonts/Foundation.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/pinduoduo/android/app/src/main/assets/fonts/Foundation.ttf
--------------------------------------------------------------------------------
/pinduoduo/android/app/src/main/assets/fonts/Ionicons.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/pinduoduo/android/app/src/main/assets/fonts/Ionicons.ttf
--------------------------------------------------------------------------------
/pinduoduo/android/app/src/main/assets/fonts/MaterialCommunityIcons.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/pinduoduo/android/app/src/main/assets/fonts/MaterialCommunityIcons.ttf
--------------------------------------------------------------------------------
/pinduoduo/android/app/src/main/assets/fonts/MaterialIcons.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/pinduoduo/android/app/src/main/assets/fonts/MaterialIcons.ttf
--------------------------------------------------------------------------------
/pinduoduo/android/app/src/main/assets/fonts/Octicons.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/pinduoduo/android/app/src/main/assets/fonts/Octicons.ttf
--------------------------------------------------------------------------------
/pinduoduo/android/app/src/main/assets/fonts/SimpleLineIcons.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/pinduoduo/android/app/src/main/assets/fonts/SimpleLineIcons.ttf
--------------------------------------------------------------------------------
/pinduoduo/android/app/src/main/assets/fonts/Zocial.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/pinduoduo/android/app/src/main/assets/fonts/Zocial.ttf
--------------------------------------------------------------------------------
/pinduoduo/android/app/src/main/java/com/pinduoduo/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.pinduoduo;
2 |
3 | import android.os.Bundle; // here
4 | import com.facebook.react.ReactActivity;
5 |
6 | import android.content.Intent;
7 | import org.devio.rn.splashscreen.SplashScreen; // here
8 | import cn.jpush.android.api.JPushInterface;
9 | import com.pinduoduo.module.ShareModule;
10 | import com.umeng.socialize.UMShareAPI;
11 |
12 | public class MainActivity extends ReactActivity {
13 |
14 | /**
15 | * Returns the name of the main component registered from JavaScript.
16 | * This is used to schedule rendering of the component.
17 | */
18 | @Override
19 | protected void onCreate(Bundle savedInstanceState) {
20 | super.onCreate(savedInstanceState);
21 | SplashScreen.show(this); // here
22 | JPushInterface.init(this);
23 | ShareModule.initActivity(this);
24 | }
25 | @Override
26 | protected void onPause() {
27 | super.onPause();
28 | JPushInterface.onPause(this);
29 | }
30 | @Override
31 | protected void onResume() {
32 | super.onResume();
33 | JPushInterface.onResume(this);
34 | }
35 | @Override
36 | protected void onDestroy() {
37 | super.onDestroy();
38 | UMShareAPI.get(this).release();
39 | }
40 | @Override
41 | public void onActivityResult(int requestCode, int resultCode, Intent data) {
42 | super.onActivityResult(requestCode, resultCode, data);
43 | UMShareAPI.get(this).onActivityResult(requestCode, resultCode, data);
44 | }
45 | @Override
46 | protected String getMainComponentName() {
47 | return "pinduoduo";
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/pinduoduo/android/app/src/main/java/com/pinduoduo/module/SharePackage.java:
--------------------------------------------------------------------------------
1 | package com.pinduoduo.module;
2 |
3 | import com.facebook.react.ReactPackage;
4 | import com.facebook.react.bridge.JavaScriptModule;
5 | import com.facebook.react.bridge.NativeModule;
6 | import com.facebook.react.bridge.ReactApplicationContext;
7 | import com.facebook.react.uimanager.ViewManager;
8 |
9 | import java.util.ArrayList;
10 | import java.util.Collections;
11 | import java.util.List;
12 |
13 | /**
14 | * Created by Song on 2017/7/10.
15 | */
16 |
17 | public class SharePackage implements ReactPackage {
18 |
19 | @Override
20 | public List createNativeModules(ReactApplicationContext reactContext) {
21 | List modules = new ArrayList<>();
22 | modules.add(new ShareModule(reactContext));
23 | return modules;
24 | }
25 |
26 | public List> createJSModules() {
27 | return Collections.emptyList();
28 | }
29 |
30 | @Override
31 | public List createViewManagers(ReactApplicationContext reactContext) {
32 | return Collections.emptyList();
33 | }
34 | }
--------------------------------------------------------------------------------
/pinduoduo/android/app/src/main/res/drawable-hdpi/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/pinduoduo/android/app/src/main/res/drawable-hdpi/splash.png
--------------------------------------------------------------------------------
/pinduoduo/android/app/src/main/res/drawable-mdpi/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/pinduoduo/android/app/src/main/res/drawable-mdpi/splash.png
--------------------------------------------------------------------------------
/pinduoduo/android/app/src/main/res/drawable-xhdpi/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/pinduoduo/android/app/src/main/res/drawable-xhdpi/splash.png
--------------------------------------------------------------------------------
/pinduoduo/android/app/src/main/res/drawable-xxhdpi/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/pinduoduo/android/app/src/main/res/drawable-xxhdpi/splash.png
--------------------------------------------------------------------------------
/pinduoduo/android/app/src/main/res/drawable-xxxhdpi/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/pinduoduo/android/app/src/main/res/drawable-xxxhdpi/splash.png
--------------------------------------------------------------------------------
/pinduoduo/android/app/src/main/res/layout/launch_screen.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
--------------------------------------------------------------------------------
/pinduoduo/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/pinduoduo/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/pinduoduo/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/pinduoduo/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/pinduoduo/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/pinduoduo/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/pinduoduo/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/pinduoduo/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/pinduoduo/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/pinduoduo/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/pinduoduo/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/pinduoduo/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/pinduoduo/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/pinduoduo/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/pinduoduo/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/pinduoduo/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/pinduoduo/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/pinduoduo/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/pinduoduo/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/pinduoduo/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/pinduoduo/android/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #000000
4 | #000000
5 |
--------------------------------------------------------------------------------
/pinduoduo/android/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | pinduoduo
3 |
4 |
--------------------------------------------------------------------------------
/pinduoduo/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/pinduoduo/android/app/src/main/wxapi/WXEntryActivity.java:
--------------------------------------------------------------------------------
1 | package com.pinduoduo;
2 |
3 | import com.umeng.socialize.weixin.view.WXCallbackActivity;
4 |
5 | public class WXEntryActivity extends WXCallbackActivity {
6 |
7 | }
--------------------------------------------------------------------------------
/pinduoduo/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 = "27.0.3"
6 | minSdkVersion = 16
7 | compileSdkVersion = 27
8 | targetSdkVersion = 26
9 | supportLibVersion = "27.1.1"
10 | }
11 | repositories {
12 | google()
13 | jcenter()
14 | }
15 | dependencies {
16 | classpath 'com.android.tools.build:gradle:3.1.4'
17 |
18 | // NOTE: Do not place your application dependencies here; they belong
19 | // in the individual module build.gradle files
20 | }
21 | }
22 |
23 | allprojects {
24 | repositories {
25 | mavenLocal()
26 | google()
27 | jcenter()
28 | maven {
29 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
30 | url "$rootDir/../node_modules/react-native/android"
31 | }
32 | }
33 | }
34 |
35 |
36 | task wrapper(type: Wrapper) {
37 | gradleVersion = '4.4'
38 | distributionUrl = distributionUrl.replace("bin", "all")
39 | }
40 |
--------------------------------------------------------------------------------
/pinduoduo/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 |
--------------------------------------------------------------------------------
/pinduoduo/android/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/pinduoduo/android/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/pinduoduo/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | zipStoreBase=GRADLE_USER_HOME
4 | zipStorePath=wrapper/dists
5 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
6 |
--------------------------------------------------------------------------------
/pinduoduo/android/keystores/BUCK:
--------------------------------------------------------------------------------
1 | keystore(
2 | name = "debug",
3 | properties = "debug.keystore.properties",
4 | store = "debug.keystore",
5 | visibility = [
6 | "PUBLIC",
7 | ],
8 | )
9 |
--------------------------------------------------------------------------------
/pinduoduo/android/keystores/debug.keystore.properties:
--------------------------------------------------------------------------------
1 | key.store=debug.keystore
2 | key.alias=androiddebugkey
3 | key.store.password=android
4 | key.alias.password=android
5 |
--------------------------------------------------------------------------------
/pinduoduo/android/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'pinduoduo'
2 | include ':react-native-amap-geolocation'
3 | project(':react-native-amap-geolocation').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-amap-geolocation/lib/android')
4 | include ':jpush-react-native'
5 | project(':jpush-react-native').projectDir = new File(rootProject.projectDir, '../node_modules/jpush-react-native/android')
6 | include ':jcore-react-native'
7 | project(':jcore-react-native').projectDir = new File(rootProject.projectDir, '../node_modules/jcore-react-native/android')
8 |
9 | include ':jpush-react-native'
10 | project(':jpush-react-native').projectDir = new File(rootProject.projectDir, '../node_modules/jpush-react-native/android')
11 |
12 | include ':react-native-splash-screen'
13 | project(':react-native-splash-screen').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-splash-screen/android')
14 | include ':react-native-vector-icons'
15 | project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')
16 | include ':react-native-gesture-handler'
17 | project(':react-native-gesture-handler').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-gesture-handler/android')
18 | include ':app', ':aurora-imui-react-native'
19 | project(':aurora-imui-react-native').projectDir = new File(rootProject.projectDir, '../node_modules/aurora-imui-react-native/ReactNative/android')
20 | include ':app'
21 |
--------------------------------------------------------------------------------
/pinduoduo/app.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "pinduoduo",
3 | "displayName": "pinduoduo"
4 | }
--------------------------------------------------------------------------------
/pinduoduo/app/components/Welcome.js:
--------------------------------------------------------------------------------
1 | // 启动页面
2 | import React, { Component } from 'react'
3 | import { Text, StyleSheet, View, TouchableHighlight } from 'react-native'
4 |
5 | export default class Welcome extends Component {
6 | render() {
7 | return (
8 |
9 | Welcome
10 |
11 | {
14 | console.log(this.props.navigation);
15 | this.props.navigation.navigate('BottomTab')
16 | }}
17 | >
18 | 进入首页
19 |
20 |
21 |
22 | )
23 | }
24 | }
25 |
26 | const styles = StyleSheet.create({
27 | container: {},
28 | gotoHome: {
29 | backgroundColor: 'blue'
30 | },
31 | Text: {
32 | color: 'white'
33 | }
34 | })
35 |
--------------------------------------------------------------------------------
/pinduoduo/app/components/base.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/pinduoduo/app/components/base.js
--------------------------------------------------------------------------------
/pinduoduo/app/public/images/Home/Popular/08e1f8db7f6c9ce11f546cc05c9176ce.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/pinduoduo/app/public/images/Home/Popular/08e1f8db7f6c9ce11f546cc05c9176ce.webp
--------------------------------------------------------------------------------
/pinduoduo/app/public/images/Home/Popular/0ad6a91690c74dedf124d06e8ef51b5f.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/pinduoduo/app/public/images/Home/Popular/0ad6a91690c74dedf124d06e8ef51b5f.webp
--------------------------------------------------------------------------------
/pinduoduo/app/public/images/Home/Popular/0c17288d4a879610343eae586fabbc70.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/pinduoduo/app/public/images/Home/Popular/0c17288d4a879610343eae586fabbc70.webp
--------------------------------------------------------------------------------
/pinduoduo/app/public/images/Home/Popular/152611d19c6d53f94220d06b02a4d75e.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/pinduoduo/app/public/images/Home/Popular/152611d19c6d53f94220d06b02a4d75e.webp
--------------------------------------------------------------------------------
/pinduoduo/app/public/images/Home/Popular/1bbff73a685197888f2b0805dc2a2df8.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/pinduoduo/app/public/images/Home/Popular/1bbff73a685197888f2b0805dc2a2df8.gif
--------------------------------------------------------------------------------
/pinduoduo/app/public/images/Home/Popular/23e66d95e126bac54960f8b58c60022b.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/pinduoduo/app/public/images/Home/Popular/23e66d95e126bac54960f8b58c60022b.webp
--------------------------------------------------------------------------------
/pinduoduo/app/public/images/Home/Popular/26c916947489c6b2ddd188ecdb54fd8d.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/pinduoduo/app/public/images/Home/Popular/26c916947489c6b2ddd188ecdb54fd8d.webp
--------------------------------------------------------------------------------
/pinduoduo/app/public/images/Home/Popular/4ad66f8d7d28d6237a9f25b9a6d19f3e.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/pinduoduo/app/public/images/Home/Popular/4ad66f8d7d28d6237a9f25b9a6d19f3e.webp
--------------------------------------------------------------------------------
/pinduoduo/app/public/images/Home/Popular/54958a7298eb208b54dd4d4d0dcac55b.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/pinduoduo/app/public/images/Home/Popular/54958a7298eb208b54dd4d4d0dcac55b.jpg
--------------------------------------------------------------------------------
/pinduoduo/app/public/images/Home/Popular/5c0c9d938b49cc18fa1b77b3d4eaca56.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/pinduoduo/app/public/images/Home/Popular/5c0c9d938b49cc18fa1b77b3d4eaca56.webp
--------------------------------------------------------------------------------
/pinduoduo/app/public/images/Home/Popular/67c60a1882411f9fc45765a0f7406141.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/pinduoduo/app/public/images/Home/Popular/67c60a1882411f9fc45765a0f7406141.webp
--------------------------------------------------------------------------------
/pinduoduo/app/public/images/Home/Popular/6ee7aa359a495098f7c67af813e35f18.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/pinduoduo/app/public/images/Home/Popular/6ee7aa359a495098f7c67af813e35f18.webp
--------------------------------------------------------------------------------
/pinduoduo/app/public/images/Home/Popular/864e35ace6c3c090ec8121e05c7b0604.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/pinduoduo/app/public/images/Home/Popular/864e35ace6c3c090ec8121e05c7b0604.webp
--------------------------------------------------------------------------------
/pinduoduo/app/public/images/Home/Popular/896a52a854723aa5f4e0406d9b7149e1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/pinduoduo/app/public/images/Home/Popular/896a52a854723aa5f4e0406d9b7149e1.png
--------------------------------------------------------------------------------
/pinduoduo/app/public/images/Home/Popular/92498f7f180eb07547f0d1735b7203c8.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/pinduoduo/app/public/images/Home/Popular/92498f7f180eb07547f0d1735b7203c8.webp
--------------------------------------------------------------------------------
/pinduoduo/app/public/images/Home/Popular/9281dd01fa3c88cedf5164d77384c6b2.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/pinduoduo/app/public/images/Home/Popular/9281dd01fa3c88cedf5164d77384c6b2.webp
--------------------------------------------------------------------------------
/pinduoduo/app/public/images/Home/Popular/96f2dca329442071e7745f7831b7dbd1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/pinduoduo/app/public/images/Home/Popular/96f2dca329442071e7745f7831b7dbd1.jpg
--------------------------------------------------------------------------------
/pinduoduo/app/public/images/Home/Popular/994635c2294e4d5acd768d796b4cd7b6.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/pinduoduo/app/public/images/Home/Popular/994635c2294e4d5acd768d796b4cd7b6.webp
--------------------------------------------------------------------------------
/pinduoduo/app/public/images/Home/Popular/a666ac01e718dd06231a722baa6fa935.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/pinduoduo/app/public/images/Home/Popular/a666ac01e718dd06231a722baa6fa935.webp
--------------------------------------------------------------------------------
/pinduoduo/app/public/images/Home/Popular/activityPhoto.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/pinduoduo/app/public/images/Home/Popular/activityPhoto.png
--------------------------------------------------------------------------------
/pinduoduo/app/public/images/Home/Popular/c2ba677bcd16ecad6c335e5e04a1cf1e.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/pinduoduo/app/public/images/Home/Popular/c2ba677bcd16ecad6c335e5e04a1cf1e.webp
--------------------------------------------------------------------------------
/pinduoduo/app/public/images/Home/Popular/c671f2c49805658697cc0f72fff87eb3.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/pinduoduo/app/public/images/Home/Popular/c671f2c49805658697cc0f72fff87eb3.webp
--------------------------------------------------------------------------------
/pinduoduo/app/public/images/Home/Popular/cce88276d606e3f3115ee26d6a380d13.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/pinduoduo/app/public/images/Home/Popular/cce88276d606e3f3115ee26d6a380d13.webp
--------------------------------------------------------------------------------
/pinduoduo/app/public/images/Home/Popular/d20eead7a6ffb6a7309707cf6ec0f97f.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/pinduoduo/app/public/images/Home/Popular/d20eead7a6ffb6a7309707cf6ec0f97f.webp
--------------------------------------------------------------------------------
/pinduoduo/app/public/images/Home/Popular/deddd05761d7a5709521c690810af417.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/pinduoduo/app/public/images/Home/Popular/deddd05761d7a5709521c690810af417.webp
--------------------------------------------------------------------------------
/pinduoduo/app/public/images/Home/Popular/e1ecb559c183e2443b8c1866e708366e.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/pinduoduo/app/public/images/Home/Popular/e1ecb559c183e2443b8c1866e708366e.webp
--------------------------------------------------------------------------------
/pinduoduo/app/public/images/Home/Popular/edcaa84386e49f5854244c2b565bf075.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/pinduoduo/app/public/images/Home/Popular/edcaa84386e49f5854244c2b565bf075.webp
--------------------------------------------------------------------------------
/pinduoduo/app/public/images/Home/Popular/topbuttom.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/pinduoduo/app/public/images/Home/Popular/topbuttom.png
--------------------------------------------------------------------------------
/pinduoduo/app/routes/App.js:
--------------------------------------------------------------------------------
1 | import { createStackNavigator, createAppContainer } from 'react-navigation'
2 | import RouterConfig from './RouterConfig'
3 |
4 |
5 | const HomeStack = createStackNavigator(RouterConfig, {
6 | mode: 'card ',
7 | headerMode: 'screen', // none 隐藏上标签栏 | float 苹果默认效果 | screen 安卓默认效果
8 | defaultNavigationOptions: {
9 | gesturesEnabled: true,
10 | headerStyle: {
11 | backgroundColor: '#f4511e',
12 | },
13 | headerTintColor: '#fff', // 定义导航条的字体颜色 会覆盖headerTitleStyle的颜色
14 |
15 | headerTitleStyle: {
16 | fontWeight: 'bold'
17 | }
18 | }
19 | })
20 |
21 | export default createAppContainer(HomeStack)
--------------------------------------------------------------------------------
/pinduoduo/app/routes/RouterConfig.js:
--------------------------------------------------------------------------------
1 | import tabBarRouter from './tabBarRouter'
2 | import ProductDetails from '../src/productDetails/ProductDetails'
3 | import Welcome from '../components/Welcome'
4 | import IM from '../src/chatWith/IM'
5 | export default {
6 | BottomTab: {
7 | //头部导航栏页面
8 | screen: tabBarRouter,
9 | navigationOptions: () => ({
10 | header: null
11 | })
12 | },
13 | ProductDetails: {
14 | screen: ProductDetails
15 | },
16 | // 聊天页面
17 | Livechat: {
18 | screen: IM,
19 | navigationOptions: () => ({
20 | title: '聊天'
21 | })
22 | },
23 | // 欢迎页面
24 | Welcome: {
25 | screen: Welcome,
26 | navigationOptions: () => ({
27 | header: null
28 | })
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/pinduoduo/app/routes/tabBarRouter.js:
--------------------------------------------------------------------------------
1 | import { createMaterialBottomTabNavigator } from 'react-navigation-material-bottom-tabs'
2 | import Ionicons from 'react-native-vector-icons/Ionicons'
3 | import AntDesign from 'react-native-vector-icons/AntDesign'
4 | import MaterialIcons from 'react-native-vector-icons/MaterialIcons'
5 | import React from 'react'
6 | // 页面组件
7 | import Home from './tabBars/Home'
8 | // import Home from '../src/tabBar/Home'
9 | import Recommend from '../src/tabBar/Recommend'
10 | import Search from '../src/tabBar/Search'
11 | import ChatWith from '../src/tabBar/ChatWith'
12 | import Personal from '../src/tabBar/Personal'
13 |
14 | export default createMaterialBottomTabNavigator(
15 | {
16 | Home: {
17 | screen: Home, // 配置底部组件信息
18 | navigationOptions: {
19 | tabBarLabel: '首页',
20 | tabBarIcon: (
21 | { tintColor } // 页面图标
22 | ) => ,
23 | tabBarColor: 'white' // 页面背景色
24 | }
25 | },
26 | Recommend: {
27 | screen: Recommend,
28 | navigationOptions: {
29 | tabBarLabel: '推荐',
30 | tabBarIcon: (
31 | { tintColor } // 页面图标
32 | ) => ,
33 | tabBarColor: 'white' // 页面背景色
34 | }
35 | },
36 | Search: {
37 | screen: Search,
38 | navigationOptions: {
39 | tabBarLabel: '搜索',
40 | tabBarIcon: (
41 | { tintColor } // 页面图标
42 | ) =>
43 | }
44 | },
45 | ChatWith: {
46 | screen: ChatWith,
47 | navigationOptions: {
48 | tabBarLabel: '聊天',
49 | tabBarIcon: (
50 | { tintColor } // 页面图标
51 | ) =>
52 | }
53 | },
54 | Personal: {
55 | screen: Personal,
56 | navigationOptions: {
57 | tabBarLabel: '个人',
58 | tabBarIcon: (
59 | { tintColor } // 页面图标
60 | ) =>
61 | }
62 | }
63 | },
64 | {
65 | initialRouteName: 'Home', // 初始化页面
66 | activeColor: '#E80707', // 选中的菜单颜色
67 | inactiveColor: '#6D6D6D', // 非选中的菜单颜色
68 | barStyle: { backgroundColor: 'white' }, // 底部导航栏样式
69 | shifting: false
70 | //labeled: true // 当为true的时候,未选中的菜单不会显示文字
71 | }
72 | )
73 |
--------------------------------------------------------------------------------
/pinduoduo/app/routes/tabBars/Home.js:
--------------------------------------------------------------------------------
1 | import { createMaterialTopTabNavigator } from 'react-navigation'
2 | import Popular from '../../src/home/Popular/Popular'
3 | import Store from '../../src/home/Store/Store'
4 | import Phone from '../../src/home/Phone/Phone'
5 | import Device from '../../src/home/Device/Device'
6 | import Woman from '../../src/home/Woman/Woman'
7 | import Food from '../../src/home/Food/Food'
8 | import Motion from '../../src/home/Motion/Motion'
9 | import Car from '../../src/home/Car/Car'
10 | import Shoe from '../../src/home/Shoe/Shoe'
11 | export default createMaterialTopTabNavigator(
12 | {
13 | Popular: {
14 | screen: Popular, // 配置页面
15 | navigationOptions: {
16 | tabBarLabel: '热门' // 头部标签名称
17 | }
18 | },
19 | Store: {
20 | screen: Store,
21 | navigationOptions: {
22 | tabBarLabel: '列表' //'百货'
23 | }
24 | },
25 | Phone: {
26 | screen: Phone,
27 | navigationOptions: {
28 | tabBarLabel: '分列'
29 | }
30 | },
31 | Device: {
32 | screen: Device,
33 | navigationOptions: {
34 | tabBarLabel: '电器'
35 | }
36 | },
37 | Woman: {
38 | screen: Woman,
39 | navigationOptions: {
40 | tabBarLabel: '女装'
41 | }
42 | },
43 | Food: {
44 | screen: Food,
45 | navigationOptions: {
46 | tabBarLabel: '食物'
47 | }
48 | },
49 | Motion: {
50 | screen: Motion,
51 | navigationOptions: {
52 | tabBarLabel: '运动'
53 | }
54 | },
55 | Car: {
56 | screen: Car,
57 | navigationOptions: {
58 | tabBarLabel: '汽车'
59 | }
60 | },
61 | Shoe: {
62 | screen: Shoe,
63 | navigationOptions: {
64 | tabBarLabel: '鞋子'
65 | }
66 | }
67 | },
68 | {
69 | initialRouteName: 'Popular',
70 | lazy: true,
71 | tabBarOptions: {
72 | scrollEnabled: true,
73 | upperCaseLabel: false, // 是否大写
74 | activeTintColor: 'red', // 活动选项卡
75 | inactiveTintColor: 'red', // "非活动" 选项卡
76 | tabStyle: {
77 | // 选项卡样式
78 | width: 60,
79 | // paddingTop: 35,
80 | paddingBottom: 4
81 | },
82 | style: {
83 | backgroundColor: 'white' // 头部导航栏样式
84 | },
85 | indicatorStyle: {
86 | backgroundColor: 'red' // 指示器样式
87 | }
88 | }
89 | }
90 | )
91 |
--------------------------------------------------------------------------------
/pinduoduo/app/share/SharePlatform.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 平台
3 | */
4 | const SharePlatform = {
5 | QQ: 0,
6 | SINA: 1,
7 | WECHAT: 2,
8 | WECHATMOMENT: 3,
9 | QQZONE: 4,
10 | FACEBOOK: 5
11 | }
12 | export default SharePlatform;
--------------------------------------------------------------------------------
/pinduoduo/app/share/share.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 原生桥接
3 | */
4 | import {
5 | NativeModules
6 | } from 'react-native';
7 |
8 | export default NativeModules.sharemodule;
--------------------------------------------------------------------------------
/pinduoduo/app/src/home/Car/Car.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 | import { Text, StyleSheet, View } from 'react-native'
3 |
4 | export default class Car extends Component {
5 | render() {
6 | return (
7 |
8 | Car
9 |
10 | )
11 | }
12 | }
13 |
14 | const styles = StyleSheet.create({})
15 |
--------------------------------------------------------------------------------
/pinduoduo/app/src/home/Device/Device.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 | import { Text, StyleSheet, View } from 'react-native'
3 |
4 | export default class Device extends Component {
5 | render() {
6 | return (
7 |
8 | Device
9 |
10 | )
11 | }
12 | }
13 |
14 | const styles = StyleSheet.create({})
15 |
--------------------------------------------------------------------------------
/pinduoduo/app/src/home/Food/Food.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 | import { Text, StyleSheet, View } from 'react-native'
3 |
4 | export default class Food extends Component {
5 | render() {
6 | return (
7 |
8 | Food
9 |
10 | )
11 | }
12 | }
13 |
14 | const styles = StyleSheet.create({})
15 |
--------------------------------------------------------------------------------
/pinduoduo/app/src/home/Motion/Motion.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 | import { Text, StyleSheet, View } from 'react-native'
3 |
4 | export default class Motion extends Component {
5 | render() {
6 | return (
7 |
8 | Motion
9 |
10 | )
11 | }
12 | }
13 |
14 | const styles = StyleSheet.create({})
15 |
--------------------------------------------------------------------------------
/pinduoduo/app/src/home/Phone/Phone.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 | import {
3 | Text,
4 | StyleSheet,
5 | View,
6 | SectionList,
7 | RefreshControl,
8 | ActivityIndicator
9 | } from 'react-native'
10 |
11 | export default class Phone extends Component {
12 | constructor(props) {
13 | super(props)
14 | this.state = {
15 | data: [
16 | {
17 | title: '一线城市',
18 | data: ['北京', '上海', '广州', '深圳']
19 | },
20 | {
21 | title: '二线城市',
22 | data: ['杭州', '苏州', '成都', '武汉', '郑州']
23 | },
24 | {
25 | title: '三线城市',
26 | data: ['洛阳', '厦门', '青岛', '拉萨']
27 | }
28 | ]
29 | }
30 | }
31 |
32 | render() {
33 | return (
34 |
35 | this._renderItem(data)} //渲染视图
38 | renderSectionHeader={data => this._renderHeader(data)}
39 | ItemSeparatorComponent ={()=> }
40 | stickySectionHeadersEnabled="true"
41 | />
42 |
43 | )
44 | }
45 | _initData = () => {
46 | setTimeout(() => {
47 | let newState = [...this.state.city, '安徽']
48 | this.setState({
49 | city: newState
50 | })
51 | }, 3000)
52 | }
53 | _renderItem = data => {
54 | return (
55 |
56 | {data.item}
57 |
58 | )
59 | }
60 | _renderHeader = data => {
61 | let { title } = data.section
62 | return (
63 |
64 | {title}
65 |
66 | )
67 | }
68 | }
69 |
70 | const styles = StyleSheet.create({
71 | item: {
72 | height: 100,
73 | flex: 1,
74 | backgroundColor: '#169',
75 | alignItems: 'center',
76 | justifyContent: 'center',
77 | },
78 | sectionHeader: {
79 | height: 50,
80 | flex: 1,
81 | backgroundColor: '#93ebbe',
82 | alignItems: 'center',
83 | justifyContent: 'center'
84 | },
85 | separator: {
86 | height: 1,
87 | backgroundColor: 'gray',
88 | flex: 1
89 | }
90 | })
91 |
--------------------------------------------------------------------------------
/pinduoduo/app/src/home/Popular/components/topButtonShow.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 | import { Text, StyleSheet, View, Image, TouchableHighlight } from 'react-native'
3 | import { connect } from 'react-redux'
4 | class TopButtonShow extends Component {
5 | render() {
6 | if (this.props.isTopButton) {
7 | return (
8 |
9 |
10 |
11 |
15 | 顶部
16 |
17 |
18 |
19 | )
20 | } else {
21 | return
22 | }
23 | }
24 | }
25 |
26 | const styles = StyleSheet.create({
27 | container: {
28 | position: 'absolute',
29 | bottom: 10,
30 | right: 10,
31 | justifyContent: 'center',
32 | alignItems: 'center'
33 | },
34 | TopButtom: {
35 | width: 40,
36 | height: 40,
37 | borderRadius: 40,
38 | backgroundColor: 'rgba(220,220,220, 0.6)'
39 | },
40 | TopButtomImg: {
41 | width: 20,
42 | height: 20,
43 | marginLeft: 10
44 | },
45 | TopButtomText: {
46 | fontSize: 12,
47 | textAlign: 'center'
48 | }
49 | })
50 |
51 | const mapState = state => {
52 | return {
53 | isTopButton: state.homePopular.get('isTopButton')
54 | }
55 | }
56 |
57 | export default connect(
58 | mapState,
59 | null
60 | )(TopButtonShow)
61 |
--------------------------------------------------------------------------------
/pinduoduo/app/src/home/Popular/store/actionCreators.js:
--------------------------------------------------------------------------------
1 | import actionTypes from './actionTypes'
2 |
3 | export function showchangeTopButton () {
4 | return {
5 | type: actionTypes.SHOWCHANGETOPBUTTON
6 | }
7 | }
8 |
9 | export function unShowchangeTopButton() {
10 | return {
11 | type: actionTypes.UNSHOWCHANGETOPBUTTON
12 | }
13 | }
--------------------------------------------------------------------------------
/pinduoduo/app/src/home/Popular/store/actionTypes.js:
--------------------------------------------------------------------------------
1 | export default {
2 | SHOWCHANGETOPBUTTON: 'show_change_top_button',
3 | UNSHOWCHANGETOPBUTTON: 'unshow_change_top_button',
4 | }
--------------------------------------------------------------------------------
/pinduoduo/app/src/home/Popular/store/index.js:
--------------------------------------------------------------------------------
1 | import reducer from './reducer'
2 | import actionCreators from './actionCreators'
3 | import actionTypes from './actionTypes'
4 |
5 | export { reducer, actionCreators, actionTypes }
6 |
--------------------------------------------------------------------------------
/pinduoduo/app/src/home/Shoe/Shoe.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 | import { Text, StyleSheet, View } from 'react-native'
3 |
4 | export default class Shoe extends Component {
5 | render() {
6 | return (
7 |
8 | Shoe
9 |
10 | )
11 | }
12 | }
13 |
14 | const styles = StyleSheet.create({})
15 |
--------------------------------------------------------------------------------
/pinduoduo/app/src/home/Woman/Woman.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 | import { Text, StyleSheet, View } from 'react-native'
3 |
4 | export default class Woman extends Component {
5 | render() {
6 | return (
7 |
8 | Woman
9 |
10 | )
11 | }
12 | }
13 |
14 | const styles = StyleSheet.create({})
15 |
--------------------------------------------------------------------------------
/pinduoduo/app/src/productDetails/ProductDetails.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 | import { Text, StyleSheet, View } from 'react-native'
3 |
4 | export default class ProductDetails extends Component {
5 | render() {
6 | const { params } = this.props.navigation.state
7 | return (
8 |
9 | {params.title}
10 |
11 | )
12 | }
13 | }
14 |
15 | const styles = StyleSheet.create({})
16 |
--------------------------------------------------------------------------------
/pinduoduo/app/src/tabBar/Home.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 | import { Text, StyleSheet, View } from 'react-native'
3 |
4 | export default class Home extends Component {
5 | render() {
6 | return (
7 |
8 | Home
9 |
10 | )
11 | }
12 | }
13 |
14 | const styles = StyleSheet.create({})
15 |
--------------------------------------------------------------------------------
/pinduoduo/app/src/tabBar/Personal.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 | import { Text, StyleSheet, View } from 'react-native'
3 |
4 | export default class Personal extends Component {
5 | render() {
6 | return (
7 |
8 | Personal
9 |
10 | )
11 | }
12 | }
13 |
14 | const styles = StyleSheet.create({
15 | containers: {
16 | paddingTop: 20
17 | }
18 | })
19 |
--------------------------------------------------------------------------------
/pinduoduo/app/src/tabBar/Search.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 | import { Text, StyleSheet, View } from 'react-native'
3 |
4 | export default class Search extends Component {
5 | render() {
6 | return (
7 |
8 | Search
9 |
10 | )
11 | }
12 | }
13 |
14 | const styles = StyleSheet.create({
15 | containers: {
16 | paddingTop: 20
17 | }
18 | })
19 |
--------------------------------------------------------------------------------
/pinduoduo/app/store/actionCreators.js:
--------------------------------------------------------------------------------
1 | import actionTypes from './actionTypes'
2 | export function change() {
3 | return {
4 | type: actionTypes.CHANGE
5 | }
6 | }
--------------------------------------------------------------------------------
/pinduoduo/app/store/actionTypes.js:
--------------------------------------------------------------------------------
1 | export default {
2 | CHANGE: 'change'
3 | }
--------------------------------------------------------------------------------
/pinduoduo/app/store/index.js:
--------------------------------------------------------------------------------
1 | import { createStore,applyMiddleware } from 'redux'
2 | import thunk from 'redux-thunk'
3 | import reducer from './reducer'
4 |
5 |
6 | export default createStore(
7 | reducer,
8 | applyMiddleware(thunk)
9 | )
--------------------------------------------------------------------------------
/pinduoduo/app/store/reducer.js:
--------------------------------------------------------------------------------
1 | import { combineReducers } from 'redux'
2 | import { reducer as homePopular } from '../src/home/Popular/store/index'
3 |
4 |
5 |
6 | export default combineReducers ({
7 | homePopular: homePopular
8 | })
9 |
--------------------------------------------------------------------------------
/pinduoduo/app/utils/index.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios'
2 | import { Alert } from 'react-native'
3 | //请求拦截器
4 | axios.interceptors.request.use(
5 | function(config) {
6 | // 添加响应头等等设置
7 | config.headers.userToken = 'this is my token'
8 | return config
9 | },
10 | function(error) {
11 | return Promise.reject(error) // 请求出错
12 | }
13 | )
14 |
15 | //返回拦截器
16 | axios.interceptors.response.use(
17 | function(response) {
18 | if (response.data.data.result != 1) {
19 | let { retMsg } = response.data.data
20 | // 服务端出现了一些问题的情况下
21 | Alert.alert('温馨提示', retMsg)
22 | // 等等按钮事件
23 | return Promise.reject(retMsg)
24 | } else {
25 | // 服务端一切正常 返回data数据
26 | return response.data
27 | }
28 | },
29 | function(error) {
30 | return Promise.reject(error)
31 | }
32 | )
33 |
34 | const defaultData = {}
35 | const defatltUrl = ''
36 | function PostAxios(url = defatltUrl, data = defaultData) {
37 | return axios({
38 | method: 'POST',
39 | url,
40 | data
41 | })
42 | }
43 |
44 | function GetAxios(url = defatltUrl, data = defaultData) {
45 | return axios({
46 | method: 'GET',
47 | url,
48 | data
49 | })
50 | }
51 |
52 | export default {
53 | PostAxios,
54 | GetAxios
55 | }
56 |
--------------------------------------------------------------------------------
/pinduoduo/app/utils/response.js:
--------------------------------------------------------------------------------
1 | export default {
2 | listData: 'https://www.easy-mock.com/mock/5afc389de5c64d22cc1ca565/data/react-native-mock-one'
3 | }
--------------------------------------------------------------------------------
/pinduoduo/index.js:
--------------------------------------------------------------------------------
1 | /** @format */
2 | import React, { Component } from 'react'
3 | import { Provider } from 'react-redux'
4 | import { AppRegistry } from 'react-native'
5 | import SplashScreen from 'react-native-splash-screen'
6 | import store from './app/store'
7 | import App from './app/routes/App'
8 | import { name } from './app.json'
9 | // import './app/mock/home'
10 |
11 | class Apps extends Component {
12 | componentWillMount() {
13 | SplashScreen.hide()
14 | }
15 | render() {
16 | return (
17 |
18 |
19 |
20 | )
21 | }
22 | }
23 | AppRegistry.registerComponent(name, () => Apps)
24 |
--------------------------------------------------------------------------------
/pinduoduo/ios/pinduoduo-tvOS/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 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIRequiredDeviceCapabilities
28 |
29 | armv7
30 |
31 | UISupportedInterfaceOrientations
32 |
33 | UIInterfaceOrientationPortrait
34 | UIInterfaceOrientationLandscapeLeft
35 | UIInterfaceOrientationLandscapeRight
36 |
37 | UIViewControllerBasedStatusBarAppearance
38 |
39 | NSLocationWhenInUseUsageDescription
40 |
41 | NSAppTransportSecurity
42 |
43 |
44 | NSExceptionDomains
45 |
46 | localhost
47 |
48 | NSExceptionAllowsInsecureHTTPLoads
49 |
50 |
51 |
52 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/pinduoduo/ios/pinduoduo-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 |
--------------------------------------------------------------------------------
/pinduoduo/ios/pinduoduo/AppDelegate.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015-present, Facebook, Inc.
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 | @interface AppDelegate : UIResponder
11 |
12 | @property (nonatomic, strong) UIWindow *window;
13 |
14 | @end
15 |
--------------------------------------------------------------------------------
/pinduoduo/ios/pinduoduo/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 | }
--------------------------------------------------------------------------------
/pinduoduo/ios/pinduoduo/Images.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/pinduoduo/ios/pinduoduo/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | pinduoduo
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 | NSLocationWhenInUseUsageDescription
28 |
29 | UILaunchStoryboardName
30 | LaunchScreen
31 | UIRequiredDeviceCapabilities
32 |
33 | armv7
34 |
35 | UISupportedInterfaceOrientations
36 |
37 | UIInterfaceOrientationPortrait
38 | UIInterfaceOrientationLandscapeLeft
39 | UIInterfaceOrientationLandscapeRight
40 |
41 | UIViewControllerBasedStatusBarAppearance
42 |
43 | NSAppTransportSecurity
44 |
45 | NSAllowsArbitraryLoads
46 |
47 | NSExceptionDomains
48 |
49 | localhost
50 |
51 | NSExceptionAllowsInsecureHTTPLoads
52 |
53 |
54 |
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 | SimpleLineIcons.ttf
72 | Zocial.ttf
73 |
74 |
75 |
76 |
--------------------------------------------------------------------------------
/pinduoduo/ios/pinduoduo/main.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015-present, Facebook, Inc.
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 |
--------------------------------------------------------------------------------
/pinduoduo/ios/pinduoduoTests/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 |
--------------------------------------------------------------------------------
/pinduoduo/ios/pinduoduoTests/pinduoduoTests.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015-present, Facebook, Inc.
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 pinduoduoTests : XCTestCase
18 |
19 | @end
20 |
21 | @implementation pinduoduoTests
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 |
--------------------------------------------------------------------------------
/pinduoduo/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "pinduoduo",
3 | "version": "0.0.1",
4 | "private": true,
5 | "scripts": {
6 | "start": "node node_modules/react-native/local-cli/cli.js start",
7 | "test": "jest"
8 | },
9 | "dependencies": {
10 | "aurora-imui-react-native": "^0.12.7",
11 | "axios": "^0.18.0",
12 | "immutable": "^4.0.0-rc.12",
13 | "jcore-react-native": "^1.3.0",
14 | "jpush-react-native": "^2.4.0",
15 | "mock": "^0.1.1",
16 | "react": "16.6.1",
17 | "react-native": "0.57.7",
18 | "react-native-amap-geolocation": "^0.3.2",
19 | "react-native-gesture-handler": "^1.0.10",
20 | "react-native-paper": "^2.2.8",
21 | "react-native-splash-screen": "^3.1.1",
22 | "react-native-swiper": "^1.5.14",
23 | "react-native-vector-icons": "^6.1.0",
24 | "react-navigation": "^3.0.4",
25 | "react-navigation-material-bottom-tabs": "^1.0.0",
26 | "react-redux": "^6.0.0",
27 | "redux": "^4.0.1",
28 | "redux-thunk": "^2.3.0"
29 | },
30 | "devDependencies": {
31 | "babel-jest": "23.6.0",
32 | "jest": "23.6.0",
33 | "metro-react-native-babel-preset": "0.50.0",
34 | "react-test-renderer": "16.6.1"
35 | },
36 | "jest": {
37 | "preset": "react-native"
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/planned_project/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": ["module:metro-react-native-babel-preset"]
3 | }
4 |
--------------------------------------------------------------------------------
/planned_project/.buckconfig:
--------------------------------------------------------------------------------
1 |
2 | [android]
3 | target = Google Inc.:Google APIs:23
4 |
5 | [maven_repositories]
6 | central = https://repo1.maven.org/maven2
7 |
--------------------------------------------------------------------------------
/planned_project/.gitattributes:
--------------------------------------------------------------------------------
1 | *.pbxproj -text
2 |
--------------------------------------------------------------------------------
/planned_project/.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 |
39 | # BUCK
40 | buck-out/
41 | \.buckd/
42 | *.keystore
43 |
44 | # fastlane
45 | #
46 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
47 | # screenshots whenever they are needed.
48 | # For more information about the recommended setup visit:
49 | # https://docs.fastlane.tools/best-practices/source-control/
50 |
51 | */fastlane/report.xml
52 | */fastlane/Preview.html
53 | */fastlane/screenshots
54 |
55 | # Bundle artifact
56 | *.jsbundle
57 |
--------------------------------------------------------------------------------
/planned_project/.watchmanconfig:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------
/planned_project/App.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 | import { View, StatusBar, Platform } from 'react-native'
3 | import AppContainer from './app/Routes/Router'
4 | import Storage from './app/Utils/Storage'
5 |
6 |
7 | export default class App extends Component {
8 | componentDidMount() {
9 | console.log(Platform.OS)
10 | console.log(StatusBar.currentHeight)
11 | StatusBar.setTranslucent(true)
12 | if (Platform.OS == 'android') {
13 | Storage.setStorage('TabHeight', StatusBar.currentHeight.toString())
14 | } else {
15 | console.log('苹果手机等待适配')
16 | }
17 | StatusBar.setBackgroundColor('rgba(0,0,0,0.4)')
18 | StatusBar.setBarStyle('dark-content')
19 | }
20 | render() {
21 | return
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/planned_project/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019 红茶
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/planned_project/README.md:
--------------------------------------------------------------------------------
1 | # React Native的自定义底部导航器与自定义头部标题栏
2 |
3 | 之前公司准备些移动端APP的,但是到现在为止都还没有启动,关于这个仓库也是之前实现这个技术的可行性做出的Demo
4 |
5 | - 自定义底部导航器
6 | - 自定义头部标题栏
7 |
8 | 
--------------------------------------------------------------------------------
/planned_project/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 | lib_deps = []
12 |
13 | for jarfile in glob(['libs/*.jar']):
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 |
21 | for aarfile in glob(['libs/*.aar']):
22 | name = 'aars__' + aarfile[aarfile.rindex('/') + 1: aarfile.rindex('.aar')]
23 | lib_deps.append(':' + name)
24 | android_prebuilt_aar(
25 | name = name,
26 | aar = aarfile,
27 | )
28 |
29 | android_library(
30 | name = "all-libs",
31 | exported_deps = lib_deps,
32 | )
33 |
34 | android_library(
35 | name = "app-code",
36 | srcs = glob([
37 | "src/main/java/**/*.java",
38 | ]),
39 | deps = [
40 | ":all-libs",
41 | ":build_config",
42 | ":res",
43 | ],
44 | )
45 |
46 | android_build_config(
47 | name = "build_config",
48 | package = "com.planned_project",
49 | )
50 |
51 | android_resource(
52 | name = "res",
53 | package = "com.planned_project",
54 | res = "src/main/res",
55 | )
56 |
57 | android_binary(
58 | name = "app",
59 | keystore = "//android/keystores:debug",
60 | manifest = "src/main/AndroidManifest.xml",
61 | package_type = "debug",
62 | deps = [
63 | ":app-code",
64 | ],
65 | )
66 |
--------------------------------------------------------------------------------
/planned_project/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 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/planned_project/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
13 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/planned_project/android/app/src/main/java/com/planned_project/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.planned_project;
2 |
3 | import com.facebook.react.ReactActivity;
4 |
5 | public class MainActivity extends ReactActivity {
6 |
7 | /**
8 | * Returns the name of the main component registered from JavaScript.
9 | * This is used to schedule rendering of the component.
10 | */
11 | @Override
12 | protected String getMainComponentName() {
13 | return "planned_project";
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/planned_project/android/app/src/main/java/com/planned_project/MainApplication.java:
--------------------------------------------------------------------------------
1 | package com.planned_project;
2 |
3 | import android.app.Application;
4 |
5 | import com.facebook.react.ReactApplication;
6 | import com.horcrux.svg.SvgPackage;
7 | import com.swmansion.gesturehandler.react.RNGestureHandlerPackage;
8 | import com.facebook.react.ReactNativeHost;
9 | import com.facebook.react.ReactPackage;
10 | import com.facebook.react.shell.MainReactPackage;
11 | import com.facebook.soloader.SoLoader;
12 |
13 | import java.util.Arrays;
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 | return Arrays.asList(
27 | new MainReactPackage(),
28 | new SvgPackage(),
29 | new RNGestureHandlerPackage()
30 | );
31 | }
32 |
33 | @Override
34 | protected String getJSMainModuleName() {
35 | return "index";
36 | }
37 | };
38 |
39 | @Override
40 | public ReactNativeHost getReactNativeHost() {
41 | return mReactNativeHost;
42 | }
43 |
44 | @Override
45 | public void onCreate() {
46 | super.onCreate();
47 | SoLoader.init(this, /* native exopackage */ false);
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/planned_project/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/planned_project/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/planned_project/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/planned_project/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/planned_project/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/planned_project/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/planned_project/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/planned_project/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/planned_project/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/planned_project/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/planned_project/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/planned_project/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/planned_project/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/planned_project/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/planned_project/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/planned_project/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/planned_project/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/planned_project/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/planned_project/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/planned_project/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/planned_project/android/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | planned_project
3 |
4 |
--------------------------------------------------------------------------------
/planned_project/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/planned_project/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 = "27.0.3"
6 | minSdkVersion = 16
7 | compileSdkVersion = 27
8 | targetSdkVersion = 26
9 | supportLibVersion = "27.1.1"
10 | }
11 | repositories {
12 | google()
13 | jcenter()
14 | }
15 | dependencies {
16 | classpath 'com.android.tools.build:gradle:3.1.4'
17 |
18 | // NOTE: Do not place your application dependencies here; they belong
19 | // in the individual module build.gradle files
20 | }
21 | }
22 |
23 | allprojects {
24 | repositories {
25 | mavenLocal()
26 | google()
27 | jcenter()
28 | maven {
29 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
30 | url "$rootDir/../node_modules/react-native/android"
31 | }
32 | }
33 | }
34 |
35 |
36 | task wrapper(type: Wrapper) {
37 | gradleVersion = '4.4'
38 | distributionUrl = distributionUrl.replace("bin", "all")
39 | }
40 |
--------------------------------------------------------------------------------
/planned_project/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 |
--------------------------------------------------------------------------------
/planned_project/android/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/planned_project/android/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/planned_project/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | zipStoreBase=GRADLE_USER_HOME
4 | zipStorePath=wrapper/dists
5 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
6 |
--------------------------------------------------------------------------------
/planned_project/android/keystores/BUCK:
--------------------------------------------------------------------------------
1 | keystore(
2 | name = "debug",
3 | properties = "debug.keystore.properties",
4 | store = "debug.keystore",
5 | visibility = [
6 | "PUBLIC",
7 | ],
8 | )
9 |
--------------------------------------------------------------------------------
/planned_project/android/keystores/debug.keystore.properties:
--------------------------------------------------------------------------------
1 | key.store=debug.keystore
2 | key.alias=androiddebugkey
3 | key.store.password=android
4 | key.alias.password=android
5 |
--------------------------------------------------------------------------------
/planned_project/android/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'planned_project'
2 | include ':react-native-svg'
3 | project(':react-native-svg').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-svg/android')
4 | include ':react-native-gesture-handler'
5 | project(':react-native-gesture-handler').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-gesture-handler/android')
6 |
7 | include ':app'
8 |
--------------------------------------------------------------------------------
/planned_project/app.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "planned_project",
3 | "displayName": "planned_project"
4 | }
--------------------------------------------------------------------------------
/planned_project/app/Common/Icon.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { Image } from 'react-native'
3 | import { TabIcon } from './Image'
4 |
5 | const Icon = ({ name, style, size }) => {
6 | const icon = TabIcon[name]
7 | return (
8 |
12 | )
13 | }
14 |
15 | export default Icon
16 |
--------------------------------------------------------------------------------
/planned_project/app/Common/Image.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 所有的图片资源都从这里统一管理
3 | */
4 | // 底部导航栏的图片资源
5 | export const TabIcon = {
6 | main: require('../Image/public/home.png'),
7 | mainActive: require('../Image/public/homeActive.png'),
8 | Category: require('../Image/public/sort.png'),
9 | CategoryActive: require('../Image/public/sortActive.png'),
10 | onLine: require('../Image/public/wenz.png'),
11 | onLineActive: require('../Image/public/wenz.png'),
12 | OrderList: require('../Image/public/shopping.png'),
13 | OrderListActive: require('../Image/public/shoppingActive.png'),
14 | My: require('../Image/public/my.png'),
15 | MyActive: require('../Image/public/myActive.png')
16 | }
17 | export const backIcon = require('../Image/public/back.png')
18 |
--------------------------------------------------------------------------------
/planned_project/app/Common/TabHeader.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 | import { View, Text, StyleSheet,Image,TouchableOpacity } from 'react-native'
3 | import { withNavigation } from 'react-navigation'
4 |
5 | import { backIcon } from './Image'
6 | import Storage from '../Utils/Storage'
7 |
8 |
9 | const TabHeaderTextPaddingTop = 11 // 字上方间距
10 | const TabHeaderTextPaddingButtom = 11 // 字下方间距
11 |
12 |
13 | class TabHeader extends Component {
14 | constructor(props) {
15 | super(props)
16 | this.state = {
17 | TabHeight: 0
18 | }
19 | }
20 | componentDidMount() {
21 | Storage.getStorage('TabHeight').then(res => {
22 | console.log(res)
23 | this.setState({
24 | TabHeight: Number(res)
25 | })
26 | })
27 | }
28 | render() {
29 | let {
30 | backGround, // 导航栏背景颜色
31 | text
32 | } = this.props
33 | return (
34 |
43 | {text}
44 |
45 |
46 |
47 |
48 | )
49 | }
50 | gotoBack = () => {
51 | this.props.navigation.goBack()
52 | }
53 | }
54 |
55 | const Style = StyleSheet.create({
56 | constainer: {
57 | paddingBottom: TabHeaderTextPaddingButtom,
58 | justifyContent: 'center',
59 | alignItems: 'center',
60 | },
61 | HeaderText: {
62 | fontSize: 16,
63 | },
64 | LeftButtom: {
65 | padding: 10,
66 | position: 'absolute',
67 | left: 6,
68 | },
69 | LeftImage: {
70 | width: 20,
71 | height: 16
72 | }
73 | })
74 |
75 | export default withNavigation(TabHeader);
76 |
--------------------------------------------------------------------------------
/planned_project/app/Image/public/back-write.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/planned_project/app/Image/public/back-write.png
--------------------------------------------------------------------------------
/planned_project/app/Image/public/back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/planned_project/app/Image/public/back.png
--------------------------------------------------------------------------------
/planned_project/app/Image/public/colse.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/planned_project/app/Image/public/colse.png
--------------------------------------------------------------------------------
/planned_project/app/Image/public/home.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/planned_project/app/Image/public/home.png
--------------------------------------------------------------------------------
/planned_project/app/Image/public/homeActive.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/planned_project/app/Image/public/homeActive.png
--------------------------------------------------------------------------------
/planned_project/app/Image/public/menu-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/planned_project/app/Image/public/menu-icon.png
--------------------------------------------------------------------------------
/planned_project/app/Image/public/my.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/planned_project/app/Image/public/my.png
--------------------------------------------------------------------------------
/planned_project/app/Image/public/myActive.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/planned_project/app/Image/public/myActive.png
--------------------------------------------------------------------------------
/planned_project/app/Image/public/shezhi.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/planned_project/app/Image/public/shezhi.png
--------------------------------------------------------------------------------
/planned_project/app/Image/public/shopping.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/planned_project/app/Image/public/shopping.png
--------------------------------------------------------------------------------
/planned_project/app/Image/public/shoppingActive.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/planned_project/app/Image/public/shoppingActive.png
--------------------------------------------------------------------------------
/planned_project/app/Image/public/sort.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/planned_project/app/Image/public/sort.png
--------------------------------------------------------------------------------
/planned_project/app/Image/public/sortActive.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/planned_project/app/Image/public/sortActive.png
--------------------------------------------------------------------------------
/planned_project/app/Image/public/wenz.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/planned_project/app/Image/public/wenz.png
--------------------------------------------------------------------------------
/planned_project/app/Routes/Router.js:
--------------------------------------------------------------------------------
1 | import { createStackNavigator, createAppContainer } from 'react-navigation'
2 | import RouterConfig from './RouterConfig'
3 |
4 | const HomeStack = createStackNavigator(RouterConfig, {
5 | initialRouteName: 'TabBar',
6 | mode: 'modal',
7 | headerMode: 'screen', // none 隐藏上标签栏 | float 苹果默认效果 | screen 安卓默认效果
8 | defaultNavigationOptions: {
9 | gesturesEnabled: true,
10 | headerStyle: {
11 | backgroundColor: '#f4511e'
12 | },
13 | headerTintColor: '#fff', // 定义导航条的字体颜色 会覆盖headerTitleStyle的颜色
14 |
15 | headerTitleStyle: {
16 | fontWeight: 'bold'
17 | }
18 | }
19 | })
20 |
21 | export default createAppContainer(HomeStack)
22 |
--------------------------------------------------------------------------------
/planned_project/app/Routes/RouterConfig.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { Image } from 'react-native'
3 |
4 | import TabBarRouter from './TabBarRouter'
5 | import Registry from '../View/My/Registry/Registry'
6 | export default {
7 | TabBar: {
8 | screen: TabBarRouter,
9 | navigationOptions: () => ({
10 | header: null
11 | })
12 | },
13 | Registry: {
14 | screen: Registry,
15 | navigationOptions: () => ({
16 | header:null,
17 | headerStyle: {
18 | backgroundColor: '#F9F9F9'
19 | },
20 | headerTintColor: 'black',
21 | })
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/planned_project/app/Routes/TabBar/Category.js:
--------------------------------------------------------------------------------
1 | // 暂时没有用 项目可能用到相关多页面配置
2 |
--------------------------------------------------------------------------------
/planned_project/app/Routes/TabBar/Main.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/planned_project/app/Routes/TabBar/Main.js
--------------------------------------------------------------------------------
/planned_project/app/Routes/TabBar/My.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/planned_project/app/Routes/TabBar/My.js
--------------------------------------------------------------------------------
/planned_project/app/Routes/TabBar/OrderList.js:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/BlueDancers/RN-code/43bbbc9590432aa687d579ba07800921ddfb9f40/planned_project/app/Routes/TabBar/OrderList.js
--------------------------------------------------------------------------------
/planned_project/app/Utils/Storage.js:
--------------------------------------------------------------------------------
1 | import { AsyncStorage } from 'react-native'
2 |
3 | /**
4 | *
5 | * @param {string} key
6 | */
7 | function getStorage(key) {
8 | return new Promise((resolve, reject) => {
9 | AsyncStorage.getItem(key, (err,value) => {
10 | if (!err) {
11 | resolve(value)
12 | } else {
13 | reject(err)
14 | }
15 | })
16 | })
17 | }
18 | /**
19 | *
20 | * @param {Array} value
21 | */
22 | function getAllStorageKey() {
23 | return new Promise((resolve, reject) => {
24 | AsyncStorage.getAllKeys((err, value) => {
25 | console.log(err, value)
26 | if (!err) {
27 | resolve(value)
28 | } else {
29 | reject(err)
30 | }
31 | })
32 | })
33 | }
34 |
35 | function setStorage(key,value) {
36 | return new Promise((resolve,reject) => {
37 | AsyncStorage.setItem(key,value,(err) => {
38 | if (!err) {
39 | resolve()
40 | } else {
41 | reject(err)
42 | }
43 | })
44 | })
45 | }
46 | function removeStorage() {}
47 |
48 | export default {
49 | getStorage,
50 | setStorage,
51 | getAllStorageKey
52 | }
--------------------------------------------------------------------------------
/planned_project/app/View/My/Registry/Registry.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 | import { Text, View, StatusBar, Button, StyleSheet } from 'react-native'
3 | import { StackActions } from 'react-navigation'
4 | import TabHeader from '../../../Common/TabHeader'
5 |
6 | export default class Registry extends Component {
7 | render() {
8 | const { goBack,dispatch } = this.props.navigation
9 | return (
10 |
11 |
12 | 注册
13 | {
16 | dispatch(StackActions.popToTop())
17 | }}
18 | />
19 |
20 | )
21 | }
22 | }
23 |
24 | const Style = StyleSheet.create({
25 | Containers: {
26 | flex: 1,
27 | backgroundColor: '#F9F9F9'
28 | }
29 | })
30 |
--------------------------------------------------------------------------------
/planned_project/app/View/TabBar/Category/Category.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 | import { Text, View } from 'react-native'
3 |
4 | export default class Category extends Component {
5 | render() {
6 | return (
7 |
8 | Category
9 |
10 | )
11 | }
12 | }
--------------------------------------------------------------------------------
/planned_project/app/View/TabBar/Main/Main.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 | import { Text, View, StatusBar } from 'react-native'
3 |
4 | export default class Main extends Component {
5 | componentDidMount() {}
6 | render() {
7 | return (
8 |
9 | Main
10 |
11 | )
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/planned_project/app/View/TabBar/My/My.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 | import { Text, View, Button, StatusBar } from 'react-native'
3 | import TabHeader from '../../../Common/TabHeader'
4 | export default class My extends Component {
5 | constructor(props) {
6 | super(props)
7 | }
8 | componentDidMount() {
9 | console.log('完成挂载');
10 | }
11 | componentDidUpdate () {
12 | console.log('组件完成更新');
13 | }
14 | componentWillReceiveProps() {
15 | console.log('props发生变化');
16 | }
17 | render() {
18 | return (
19 |
20 |
21 | My
22 | {
25 | this.props.navigation.navigate('Registry')
26 | }}
27 | />
28 |
29 | )
30 | }
31 | gotoLogin = () => {
32 | console.log('跳转')
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/planned_project/app/View/TabBar/OnlineDoctor/OnlineDoctor.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 | import { Text, View } from 'react-native'
3 |
4 | export default class OnlineDoctor extends Component {
5 | render() {
6 | return (
7 |
8 | OnlineDoctor
9 |
10 | )
11 | }
12 | }
--------------------------------------------------------------------------------
/planned_project/app/View/TabBar/OrderList/OrderList.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 | import { Text, View } from 'react-native'
3 |
4 | export default class OrderList extends Component {
5 | render() {
6 | return (
7 |
8 | OrderList
9 |
10 | )
11 | }
12 | }
--------------------------------------------------------------------------------
/planned_project/index.js:
--------------------------------------------------------------------------------
1 | /** @format */
2 |
3 | import {AppRegistry} from 'react-native';
4 | import App from './App';
5 | import {name as appName} from './app.json';
6 |
7 | AppRegistry.registerComponent(appName, () => App);
8 |
--------------------------------------------------------------------------------
/planned_project/ios/planned_project-tvOS/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 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIRequiredDeviceCapabilities
28 |
29 | armv7
30 |
31 | UISupportedInterfaceOrientations
32 |
33 | UIInterfaceOrientationPortrait
34 | UIInterfaceOrientationLandscapeLeft
35 | UIInterfaceOrientationLandscapeRight
36 |
37 | UIViewControllerBasedStatusBarAppearance
38 |
39 | NSLocationWhenInUseUsageDescription
40 |
41 | NSAppTransportSecurity
42 |
43 |
44 | NSExceptionDomains
45 |
46 | localhost
47 |
48 | NSExceptionAllowsInsecureHTTPLoads
49 |
50 |
51 |
52 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/planned_project/ios/planned_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 |
--------------------------------------------------------------------------------
/planned_project/ios/planned_project/AppDelegate.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015-present, Facebook, Inc.
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 | @interface AppDelegate : UIResponder
11 |
12 | @property (nonatomic, strong) UIWindow *window;
13 |
14 | @end
15 |
--------------------------------------------------------------------------------
/planned_project/ios/planned_project/AppDelegate.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015-present, Facebook, Inc.
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 |
13 | @implementation AppDelegate
14 |
15 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
16 | {
17 | NSURL *jsCodeLocation;
18 |
19 | #ifdef DEBUG
20 | jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
21 | #else
22 | jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
23 | #endif
24 |
25 | RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
26 | moduleName:@"planned_project"
27 | initialProperties:nil
28 | launchOptions:launchOptions];
29 | rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];
30 |
31 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
32 | UIViewController *rootViewController = [UIViewController new];
33 | rootViewController.view = rootView;
34 | self.window.rootViewController = rootViewController;
35 | [self.window makeKeyAndVisible];
36 | return YES;
37 | }
38 |
39 | @end
40 |
--------------------------------------------------------------------------------
/planned_project/ios/planned_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 | }
--------------------------------------------------------------------------------
/planned_project/ios/planned_project/Images.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/planned_project/ios/planned_project/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | planned_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 | NSLocationWhenInUseUsageDescription
28 |
29 | UILaunchStoryboardName
30 | LaunchScreen
31 | UIRequiredDeviceCapabilities
32 |
33 | armv7
34 |
35 | UISupportedInterfaceOrientations
36 |
37 | UIInterfaceOrientationPortrait
38 | UIInterfaceOrientationLandscapeLeft
39 | UIInterfaceOrientationLandscapeRight
40 |
41 | UIViewControllerBasedStatusBarAppearance
42 |
43 | NSLocationWhenInUseUsageDescription
44 |
45 | NSAppTransportSecurity
46 |
47 |
48 | NSAllowsArbitraryLoads
49 |
50 | NSExceptionDomains
51 |
52 | localhost
53 |
54 | NSExceptionAllowsInsecureHTTPLoads
55 |
56 |
57 |
58 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/planned_project/ios/planned_project/main.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015-present, Facebook, Inc.
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 |
--------------------------------------------------------------------------------
/planned_project/ios/planned_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 |
--------------------------------------------------------------------------------
/planned_project/ios/planned_projectTests/planned_projectTests.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015-present, Facebook, Inc.
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 planned_projectTests : XCTestCase
18 |
19 | @end
20 |
21 | @implementation planned_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 |
--------------------------------------------------------------------------------
/planned_project/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "planned_project",
3 | "version": "0.0.1",
4 | "private": true,
5 | "scripts": {
6 | "start": "node node_modules/react-native/local-cli/cli.js start",
7 | "test": "jest"
8 | },
9 | "dependencies": {
10 | "react": "16.6.3",
11 | "react-native": "0.57.8",
12 | "react-native-gesture-handler": "^1.0.12",
13 | "react-native-paper": "^2.4.0",
14 | "react-native-pose": "^0.9.0",
15 | "react-native-shadow": "^1.2.2",
16 | "react-native-svg": "^9.0.5",
17 | "react-native-vector-icons": "^6.1.0",
18 | "react-navigation": "^3.0.9",
19 | "react-navigation-material-bottom-tabs": "^1.0.0"
20 | },
21 | "devDependencies": {
22 | "babel-jest": "23.6.0",
23 | "jest": "23.6.0",
24 | "metro-react-native-babel-preset": "0.51.1",
25 | "react-test-renderer": "16.6.3"
26 | },
27 | "jest": {
28 | "preset": "react-native"
29 | }
30 | }
31 |
--------------------------------------------------------------------------------