├── .babelrc ├── .buckconfig ├── .flowconfig ├── .gitattributes ├── .gitignore ├── .watchmanconfig ├── App ├── Components │ ├── Constant │ │ ├── BackPressComponent.js │ │ ├── Device.js │ │ └── FilterTagDataBase.js │ ├── ItemCell │ │ └── index.js │ ├── Navigator │ │ ├── SDNavigationBar.js │ │ └── index.js │ ├── TabBar │ │ └── index.js │ └── View │ │ ├── StarView.js │ │ └── TagView.js ├── Mobx │ └── Home │ │ └── index.js ├── Network │ └── index.js ├── Styles │ └── index.js ├── Views │ ├── About │ │ └── index.js │ ├── Home │ │ ├── Banner.js │ │ ├── HomeNavigator.js │ │ ├── NewProduct.js │ │ ├── NewProductCell.js │ │ ├── PickerView.js │ │ ├── Recommend.js │ │ ├── Subjects.js │ │ ├── index.js │ │ └── testView.js │ ├── Index │ │ └── index.js │ ├── Me │ │ └── index.js │ ├── Product │ │ ├── IndividualChoice.js │ │ ├── ProductListCell.js │ │ └── index.js │ └── ProductDetails │ │ └── index.js └── assets │ ├── wave.png │ ├── wave3x.png │ ├── wave@2x.png │ ├── arrows.png │ ├── arrows@2x.png │ ├── arrows@3x.png │ ├── attention.png │ ├── attention@2x.png │ ├── attention@3x.png │ ├── back.png │ ├── back@2x.png │ ├── back@3x.png │ ├── collect.png │ ├── collect@2x.png │ ├── collect@3x.png │ ├── credit _information.png │ ├── credit _information@2x.png │ ├── credit _information@3x.png │ ├── gift.png │ ├── gift@2x.png │ ├── gift@3x.png │ ├── grayStar.png │ ├── grayStar@2x.png │ ├── grayStar@3x.png │ ├── halfStar.png │ ├── halfStar@2x.png │ ├── halfStar@3x.png │ ├── help.png │ ├── help@2x.png │ ├── help@3x.png │ ├── home.png │ ├── home@2x.png │ ├── home@3x.png │ ├── homeBbs.png │ ├── homeBbs@2x.png │ ├── homeBbs@3x.png │ ├── homeNewProductTime.png │ ├── homeNewProductTime@2x.png │ ├── homeNewProductTime@3x.png │ ├── homeRemind.png │ ├── homeRemind@2x.png │ ├── homeRemind@3x.png │ ├── homeSearch.png │ ├── homeSearch@2x.png │ ├── homeSearch@3x.png │ ├── homeSelect.png │ ├── homeSelect@2x.png │ ├── homeSelect@3x.png │ ├── homeTotal.png │ ├── homeTotal@2x.png │ ├── homeTotal@3x.png │ ├── home_guide.png │ ├── home_guide@2x.png │ ├── home_guide@3x.png │ ├── home_new_product_time.png │ ├── home_new_product_time@2x.png │ ├── home_new_product_time@3x.png │ ├── identity.png │ ├── identity@2x.png │ ├── identity@3x.png │ ├── me.png │ ├── me@2x.png │ ├── me@3x.png │ ├── me_select.png │ ├── me_select@2x.png │ ├── me_select@3x.png │ ├── navigationImage.png │ ├── navigationImage@2x.png │ ├── navigationImage@3x.png │ ├── process.png │ ├── process@2x.png │ ├── process@3x.png │ ├── productBackImage.png │ ├── productBackImage@2x.png │ ├── productBackImage@3x.png │ ├── product_jian.png │ ├── product_jian@2x.png │ ├── product_jian@3x.png │ ├── product_selectButton_banckground.png │ ├── product_selectButton_banckground@2x.png │ ├── product_selectButton_banckground@3x.png │ ├── product_title_round.png │ ├── product_title_round@2x.png │ ├── product_title_round@3x.png │ ├── product_top1.png │ ├── product_top1@2x.png │ ├── product_top1@3x.png │ ├── product_top2.png │ ├── product_top2@2x.png │ ├── product_top2@3x.png │ ├── product_top3.png │ ├── product_top3@2x.png │ ├── product_top3@3x.png │ ├── product_top4.png │ ├── product_top4@2x.png │ ├── product_top4@3x.png │ ├── product_top5.png │ ├── product_top5@2x.png │ ├── product_top5@3x.png │ ├── rate.png │ ├── rate@2x.png │ ├── rate@3x.png │ ├── setting.png │ ├── setting@2x.png │ ├── setting@3x.png │ ├── star.png │ ├── star@2x.png │ ├── star@3x.png │ ├── sudai.png │ ├── sudai@2x.png │ ├── sudai@3x.png │ ├── supermarket.png │ ├── supermarket@2x.png │ ├── supermarket@3x.png │ ├── supermarketSelect.png │ ├── supermarketSelect@2x.png │ └── supermarketSelect@3x.png ├── LICENSE ├── README.md ├── __tests__ ├── index.android.js └── index.ios.js ├── android ├── app │ ├── BUCK │ ├── build.gradle │ ├── proguard-rules.pro │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ └── com │ │ │ └── sudaizhijia │ │ │ ├── MainActivity.java │ │ │ └── MainApplication.java │ │ └── res │ │ ├── mipmap-hdpi │ │ └── ic_launcher.png │ │ ├── mipmap-mdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ └── ic_launcher.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 ├── index.android.js ├── index.ios.js ├── ios ├── sudaizhijia-tvOS │ └── Info.plist ├── sudaizhijia-tvOSTests │ └── Info.plist ├── sudaizhijia.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ │ └── xcschemes │ │ ├── sudaizhijia-tvOS.xcscheme │ │ └── sudaizhijia.xcscheme ├── sudaizhijia │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Base.lproj │ │ └── LaunchScreen.xib │ ├── Images.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Info.plist │ └── main.m └── sudaizhijiaTests │ ├── Info.plist │ └── sudaizhijiaTests.m ├── package.json └── yarn.lock /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["react-native"], 3 | "plugins": ["transform-decorators-legacy"] 4 | } 5 | 6 | -------------------------------------------------------------------------------- /.buckconfig: -------------------------------------------------------------------------------- 1 | 2 | [android] 3 | target = Google Inc.:Google APIs:23 4 | 5 | [maven_repositories] 6 | central = https://repo1.maven.org/maven2 7 | -------------------------------------------------------------------------------- /.flowconfig: -------------------------------------------------------------------------------- 1 | [ignore] 2 | ; We fork some components by platform 3 | .*/*[.]android.js 4 | 5 | ; Ignore "BUCK" generated dirs 6 | /\.buckd/ 7 | 8 | ; Ignore unexpected extra "@providesModule" 9 | .*/node_modules/.*/node_modules/fbjs/.* 10 | 11 | ; Ignore duplicate module providers 12 | ; For RN Apps installed via npm, "Libraries" folder is inside 13 | ; "node_modules/react-native" but in the source repo it is in the root 14 | .*/Libraries/react-native/React.js 15 | .*/Libraries/react-native/ReactNative.js 16 | 17 | [include] 18 | 19 | [libs] 20 | node_modules/react-native/Libraries/react-native/react-native-interface.js 21 | node_modules/react-native/flow 22 | flow/ 23 | 24 | [options] 25 | emoji=true 26 | 27 | module.system=haste 28 | 29 | experimental.strict_type_args=true 30 | 31 | munge_underscores=true 32 | 33 | module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub' 34 | 35 | suppress_type=$FlowIssue 36 | suppress_type=$FlowFixMe 37 | suppress_type=$FixMe 38 | 39 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(4[0-5]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) 40 | suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(4[0-5]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+ 41 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy 42 | suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError 43 | 44 | unsafe.enable_getters_and_setters=true 45 | 46 | [version] 47 | ^0.45.0 48 | -------------------------------------------------------------------------------- /.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://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md 50 | 51 | fastlane/report.xml 52 | fastlane/Preview.html 53 | fastlane/screenshots 54 | -------------------------------------------------------------------------------- /.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /App/Components/Constant/BackPressComponent.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | import React, {Component, PropTypes} from "react"; 5 | import {BackHandler} from "react-native"; 6 | 7 | export default class BackPressComponent{ 8 | constructor(props){ 9 | this.props=props; 10 | } 11 | componentDidMount(){ 12 | if(this.props.backPress){ 13 | 14 | BackHandler.addEventListener('hardwareBackPress',this.props.backPress); 15 | 16 | } 17 | 18 | } 19 | componentWillUnmount(){ 20 | if(this.props.backPress){ 21 | 22 | BackHandler.removeEventListener('hardwareBackPress',this.props.backPress); 23 | } 24 | 25 | } 26 | } -------------------------------------------------------------------------------- /App/Components/Constant/Device.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by zhanming on 2017/6/26. 3 | */ 4 | 5 | 6 | import { 7 | Dimensions, 8 | } from 'react-native'; 9 | 10 | const {width ,height} = Dimensions.get('window'); 11 | 12 | export { width as ScreenWidth,height as ScreenHeight}; 13 | 14 | 15 | -------------------------------------------------------------------------------- /App/Components/Constant/FilterTagDataBase.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | import React, { 4 | Component 5 | } from 'react' 6 | 7 | import { 8 | Dimensions, 9 | AsyncStorage, 10 | } from 'react-native'; 11 | 12 | 13 | const FILTERTAG_KEY='FilterTag' 14 | 15 | 16 | 17 | export default class FilterTagDataBase{ 18 | 19 | static GetFilterTagArray(){ 20 | 21 | return new Promise((resolve,reject)=>{ 22 | AsyncStorage.getItem(FILTERTAG_KEY,(error,result)=>{ 23 | if (!error) { 24 | try { 25 | resolve(JSON.parse(result)); 26 | } catch (e) { 27 | reject(error); 28 | } 29 | }else { 30 | reject(error); 31 | } 32 | }); 33 | }); 34 | 35 | } 36 | 37 | static saveFilterTagArray(value){ 38 | 39 | 40 | 41 | AsyncStorage.setItem(FILTERTAG_KEY,JSON.stringify(value),(error,result)=>{ 42 | 43 | 44 | }); 45 | 46 | } 47 | 48 | } -------------------------------------------------------------------------------- /App/Components/ItemCell/index.js: -------------------------------------------------------------------------------- 1 | import React, { 2 | Component, 3 | PropTypes 4 | } from 'react' 5 | 6 | import { 7 | View, 8 | Text, 9 | Image, 10 | TouchableHighlight, 11 | StyleSheet, 12 | PixelRatio 13 | } from 'react-native' 14 | 15 | export default class ItemCell extends Component { 16 | _renderDisclosureIndicator() { 17 | if (this.props.showDisclosureIndicator) { 18 | return ( 19 | 20 | ) 21 | } 22 | } 23 | 24 | _renderSubText() { 25 | if(this.props.subText) { 26 | return ( 27 | {this.props.subText} 28 | ) 29 | } 30 | } 31 | 32 | _renderIcon() { 33 | if (this.props.icon) { 34 | return ( 35 | 36 | 37 | 41 | 42 | 43 | ) 44 | } 45 | return 46 | } 47 | 48 | render() { 49 | let touchableProps = { 50 | accessible: this.props.accessible, 51 | delayLongPress: this.props.delayLongPress, 52 | delayPressIn: this.props.delayPressIn, 53 | delayPressOut: this.props.delayPressOut, 54 | onLongPress: this.props.onLongPress, 55 | onPress: this.props.onPress, 56 | onPressIn: this.props.onPressIn, 57 | onPressOut: this.props.onPressOut, 58 | } 59 | return ( 60 | 63 | 64 | 65 | {this._renderIcon() } 66 | 67 | 68 | 69 | 70 | {this.props.children} 71 | 72 | {this._renderSubText()} 73 | {this._renderDisclosureIndicator() } 74 | 75 | 76 | 77 | 78 | ) 79 | } 80 | } 81 | 82 | ItemCell.propTypes = { 83 | ...TouchableHighlight.propTypes, 84 | children: PropTypes.string.isRequired, 85 | showDisclosureIndicator: PropTypes.bool, 86 | showBottomBorder: PropTypes.bool, 87 | icon: PropTypes.oneOfType([ 88 | PropTypes.number, 89 | PropTypes.shape({ 90 | uri: PropTypes.string, 91 | }), 92 | ]), 93 | iconStyle: PropTypes.object, 94 | containerStyle: PropTypes.object 95 | } 96 | 97 | const styles = StyleSheet.create({ 98 | container: { 99 | flexGrow: 1, 100 | flexDirection: 'row', 101 | }, 102 | viewContainer: { 103 | flexGrow: 1, 104 | flexDirection: 'row', 105 | backgroundColor: 'white', 106 | alignItems: 'center', 107 | }, 108 | leftContainer: { 109 | marginTop: 5, 110 | marginBottom: 5, 111 | }, 112 | flex: { 113 | flexGrow: 1 114 | }, 115 | bottomBorder: { // eslint-disable-line 116 | borderBottomWidth: 1 / PixelRatio.get(), 117 | borderBottomColor: '#C8C7CC', 118 | borderStyle: 'solid', 119 | }, 120 | paddingView: { 121 | width: 15, 122 | backgroundColor: 'white', 123 | }, 124 | textContainer: { 125 | flexGrow: 1, 126 | flexDirection: 'row', 127 | marginTop: 10, 128 | marginBottom: 10, 129 | alignItems: 'center', 130 | }, 131 | text: { 132 | flexGrow: 1, 133 | fontSize: 16, 134 | alignSelf: 'center', 135 | }, 136 | subText: { 137 | marginRight: 5, 138 | fontSize: 14, 139 | color: '#8e8e93' 140 | }, 141 | chevron: { 142 | width: 23, 143 | height: 23, 144 | marginRight: 5 145 | }, 146 | iconContainer: { 147 | alignItems: 'center', 148 | width: 30, 149 | height: 30, 150 | justifyContent: 'center', 151 | marginRight: 10, 152 | marginLeft: 10 153 | }, 154 | icon: { 155 | width: 24, 156 | height: 24 157 | } 158 | }) -------------------------------------------------------------------------------- /App/Components/Navigator/SDNavigationBar.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by zhanming on 2017/6/19. 3 | */ 4 | 5 | 6 | import React, {Component,PropTypes} from 'react'; 7 | 8 | import { 9 | AppRegistry, 10 | StyleSheet, 11 | Text, 12 | View, 13 | Image, 14 | Platform, 15 | ViewPropTypes, 16 | StatusBar, 17 | TouchableOpacity, 18 | 19 | } from 'react-native'; 20 | import * as Device from '../../Components/Constant/Device'; 21 | 22 | const NAV_BAR_HEIGHT_IOS = 44; 23 | 24 | const NAV_BAR_HEIGHT_ANDROID = 50; 25 | 26 | const STATUS_BAR_HEIGHT = 20; 27 | 28 | 29 | export default class SDNavigationBar extends Component{ 30 | 31 | 32 | static propTypes ={ 33 | 34 | //标题 35 | title:PropTypes.string.isRequired, 36 | 37 | titleStyle:ViewPropTypes.style, 38 | 39 | leftButton:PropTypes.element, 40 | 41 | rightButton:PropTypes.element, 42 | 43 | isTop: PropTypes.bool, 44 | } 45 | 46 | static defaultProps ={ 47 | isTop:false, 48 | } 49 | 50 | constructor(props) { 51 | super(props); 52 | // 初始状态 53 | this.state = {}; 54 | } 55 | 56 | render(){ 57 | 58 | 59 | return( 60 | 61 | 62 | 64 | 67 | 68 | 69 | 70 | 71 | 72 | { 73 | this.props.navigator.pop(); 74 | 75 | }} > 76 | 77 | {this._leftBtnView()} 78 | 79 | 80 | 81 | 86 | {this.props.title} 87 | 88 | 89 | 90 | 91 | {this._rightBtnView()} 92 | 93 | 94 | 95 | 96 | 97 | ) 98 | 99 | } 100 | 101 | _leftBtnView(){ 102 | 103 | if (this.props.isTop) { 104 | return 105 | } else { 106 | return this.props.leftButton ? {this.props.leftButton} :; 107 | 108 | } 109 | 110 | } 111 | _rightBtnView(){ 112 | 113 | return this.props.leftButton ? {this.props.rightButton}:; 114 | } 115 | 116 | } 117 | 118 | const styles = StyleSheet.create({ 119 | 120 | 121 | statusBarStyle: { 122 | height: Platform.OS === 'ios' ? STATUS_BAR_HEIGHT : 0, 123 | width: Device.ScreenWidth, 124 | 125 | }, 126 | navBarStyle: { 127 | flexDirection:'row', 128 | // justifyContent:'space-between', 129 | alignItems:'center', 130 | height: Platform.OS === 'ios'?NAV_BAR_HEIGHT_IOS:NAV_BAR_HEIGHT_ANDROID, 131 | width:Device.ScreenWidth, 132 | }, 133 | 134 | navBarBackImageStyle:{ 135 | 136 | height:Platform.OS === 'ios'?NAV_BAR_HEIGHT_IOS:NAV_BAR_HEIGHT_ANDROID, 137 | width:Device.ScreenWidth, 138 | position:'absolute', left:0, 139 | top:0, 140 | }, 141 | buttonStyle:{ 142 | flex:1, 143 | backgroundColor:'rgba(255, 255, 255,0)', 144 | flexDirection:'row', 145 | alignItems:'center', 146 | justifyContent:'center', 147 | }, 148 | titleStyle:{ 149 | color:'white', 150 | backgroundColor:'rgba(255, 255, 255,0)', 151 | fontSize:16, 152 | textAlign:'center', 153 | 154 | 155 | } 156 | }) 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | -------------------------------------------------------------------------------- /App/Components/Navigator/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by zhanming on 2017/6/27. 3 | */ 4 | import React, { 5 | Component 6 | } from 'react' 7 | 8 | import { 9 | StyleSheet, 10 | Text, 11 | Image, 12 | View, 13 | 14 | } from 'react-native' 15 | 16 | import SDNavigator from '../TabBar'; 17 | import {Navigator} from 'react-native-deprecated-custom-components'; 18 | 19 | export default class TabBar extends Component { 20 | constructor(props) { 21 | super(props) 22 | } 23 | 24 | render(){ 25 | return( 26 | { 29 | let Component = route.component; 30 | return 31 | 32 | }}> 33 | ) 34 | } 35 | 36 | } -------------------------------------------------------------------------------- /App/Components/TabBar/index.js: -------------------------------------------------------------------------------- 1 | import React, { 2 | Component 3 | } from 'react' 4 | 5 | import { 6 | StyleSheet, 7 | Text, 8 | Image, 9 | View, 10 | 11 | } from 'react-native' 12 | 13 | import TabNavigator from 'react-native-tab-navigator'; 14 | import {Navigator} from 'react-native-deprecated-custom-components'; 15 | import Home from '../../Views/Home'; 16 | 17 | import Product from '../../Views/Product'; 18 | 19 | import Me from '../../Views/Me'; 20 | 21 | 22 | export default class TabBar extends Component { 23 | constructor(props) { 24 | super(props) 25 | this.state = { 26 | selectedTab: 'home' 27 | } 28 | } 29 | 30 | render() { 31 | return ( 32 | 33 | 34 | 35 | 36 | } 41 | renderSelectedIcon={() => } 42 | onPress={() => this.setState({ selectedTab: 'home' })}> 43 | 44 | 45 | 46 | 47 | } 52 | renderSelectedIcon={() => } 53 | onPress={() => this.setState({ selectedTab: 'product' })}> 54 | 55 | 56 | 57 | 58 | } 63 | renderSelectedIcon={() => } 64 | onPress={() => this.setState({ selectedTab: 'me' })}> 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | ) 74 | } 75 | } 76 | 77 | const styles = StyleSheet.create({ 78 | 79 | container: { 80 | 81 | flex:1, 82 | }, 83 | imageSize:{ 84 | height:22, 85 | width:22, 86 | 87 | } 88 | }) -------------------------------------------------------------------------------- /App/Components/View/StarView.js: -------------------------------------------------------------------------------- 1 | 2 | import React, { Component,PropTypes } from 'react'; 3 | import { 4 | StyleSheet, 5 | View, 6 | TouchableOpacity, 7 | Image, 8 | Text, 9 | ScrollView, 10 | } from 'react-native'; 11 | 12 | const count = 5.0; 13 | 14 | let StarWidth = 0; 15 | 16 | 17 | const starType={ 18 | greyStar:'greyStar', 19 | yellowStar:'yellowStar', 20 | } 21 | 22 | 23 | export default class StarView extends Component{ 24 | 25 | 26 | static propTypes ={ 27 | 28 | StarWidth:PropTypes.number.isRequired, 29 | 30 | StarHeight:PropTypes.number.isRequired, 31 | 32 | StarNum:PropTypes.number.isRequired, 33 | 34 | } 35 | 36 | 37 | constructor(props){ 38 | super(props); 39 | 40 | } 41 | 42 | // componentWillReceiveProps(){ 43 | // 44 | // this.StarNum = this.props.StarNum; 45 | // } 46 | 47 | 48 | 49 | render(){ 50 | 51 | return( 52 | 54 | 56 | 57 | {this._getStarView(starType.greyStar)} 58 | 59 | 60 | 61 | 63 | 64 | {this._getStarView(starType.yellowStar)} 65 | 66 | 67 | 68 | ) 69 | } 70 | 71 | _getStarView(type){ 72 | 73 | 74 | let starViews = []; 75 | 76 | for(let i = 0; i 80 | 83 | 84 | ) 85 | 86 | } 87 | 88 | return starViews; 89 | 90 | } 91 | } 92 | 93 | const styles = StyleSheet.create({ 94 | 95 | starFatherViewStyle:{ 96 | 97 | 98 | 99 | }, 100 | 101 | starViewStyle: { 102 | 103 | top: 0, 104 | left: 0, 105 | position: 'absolute', 106 | flexDirection: 'row', 107 | alignItems: 'center', 108 | justifyContent: 'space-between', 109 | overflow:'hidden', 110 | }, 111 | greyStarViewStyle:{ 112 | 113 | flexDirection:'row', 114 | alignItems:'center', 115 | justifyContent:'space-between', 116 | 117 | }, 118 | starSingleViewStyle:{ 119 | 120 | 121 | flexDirection: 'row', 122 | alignItems: 'center', 123 | justifyContent: 'center', 124 | 125 | }, 126 | starSingleImageStyle:{ 127 | 128 | } 129 | 130 | 131 | 132 | 133 | 134 | 135 | }) -------------------------------------------------------------------------------- /App/Components/View/TagView.js: -------------------------------------------------------------------------------- 1 | 2 | import React, { Component,PropTypes } from 'react'; 3 | import { 4 | StyleSheet, 5 | View, 6 | TouchableOpacity, 7 | Image, 8 | Text, 9 | ScrollView, 10 | } from 'react-native'; 11 | 12 | const count = 5.0; 13 | 14 | let StarWidth = 0; 15 | 16 | 17 | const starType={ 18 | greyStar:'greyStar', 19 | yellowStar:'yellowStar', 20 | } 21 | 22 | 23 | export default class TagView extends Component{ 24 | 25 | 26 | static propTypes ={ 27 | 28 | tagName:PropTypes.array.isRequired, 29 | 30 | 31 | } 32 | 33 | 34 | constructor(props){ 35 | super(props); 36 | 37 | } 38 | 39 | // componentWillReceiveProps(){ 40 | // 41 | // this.StarNum = this.props.StarNum; 42 | // } 43 | 44 | 45 | 46 | render(){ 47 | 48 | return( 49 | 50 | {this._tagViews(this.props.tagName)} 51 | 52 | 53 | ) 54 | } 55 | 56 | _tagViews(tagItem){ 57 | 58 | let tagViewList = []; 59 | let width = 50; 60 | let height = 20; 61 | for(let i = 0;i 68 | 69 | {tagModel.name} 70 | 71 | ) 72 | 73 | 74 | } 75 | 76 | return tagViewList; 77 | 78 | 79 | 80 | } 81 | } 82 | 83 | const styles = StyleSheet.create({ 84 | 85 | 86 | tagFatherViewStyle:{ 87 | flexDirection:'row', 88 | alignItems:'center', 89 | }, 90 | tagViewStyle:{ 91 | borderWidth:1, 92 | width:50, 93 | height:15, 94 | borderRadius:10, 95 | flexDirection:'row', 96 | alignItems:'center', 97 | justifyContent:'center', 98 | marginRight:4, 99 | }, 100 | 101 | 102 | 103 | 104 | 105 | 106 | })/** 107 | * Created by zhanming on 2017/7/9. 108 | */ 109 | -------------------------------------------------------------------------------- /App/Mobx/Home/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by zhanming on 2017/6/26. 3 | */ 4 | 5 | import {observable, computed, action} from 'mobx'; 6 | import * as Device from '../../Components/Constant/Device'; 7 | const instructionWith = Device.ScreenWidth*0.2; 8 | 9 | //待办事项行数据 10 | export default class HomeState { 11 | 12 | @observable 13 | bannerList = []; 14 | @action 15 | setBannerList(data) { 16 | this.bannerList = data; 17 | } 18 | @observable 19 | RecommendList = []; 20 | 21 | @action 22 | setRecommendList(array) { 23 | this.RecommendList = array; 24 | } 25 | 26 | @observable 27 | SubjectList = []; 28 | 29 | @action 30 | setSubjectList(array) { 31 | this.SubjectList = array; 32 | } 33 | 34 | @computed get subjectProgressWith() { 35 | return Device.ScreenWidth/( this.SubjectList.length * ( ( Device.ScreenWidth - 40)/2.0 ) )*instructionWith; 36 | } 37 | 38 | @observable 39 | NewProductList = [1,2,3,4,5,6,7,8,9]; 40 | 41 | @action 42 | setNewProductList(array) { 43 | this.NewProductList = array; 44 | } 45 | 46 | 47 | 48 | } -------------------------------------------------------------------------------- /App/Network/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by zhanming on 2017/6/23. 3 | */ 4 | 5 | 6 | const SDServerHttp = 'https://api.sudaizhijia.com/'; 7 | 8 | const method={ 9 | 10 | GET:'GET', 11 | POST:'POST', 12 | } 13 | 14 | export default class SDHttpRequest { 15 | 16 | /** 17 | * GET请求 18 | * @param url 19 | * @param param 20 | */ 21 | static GET(url, param) { 22 | 23 | return SDHttpRequest.Request(method.GET,SDServerHttp+url,param); 24 | } 25 | /** 26 | * POST请求 27 | * @param url 28 | * @param param 29 | */ 30 | static POST(url, param) { 31 | 32 | return SDHttpRequest.Request(method.POST,SDServerHttp+url,param); 33 | } 34 | static Request(type,url,param){ 35 | 36 | if(type == 'GET' && param != null){ 37 | 38 | url = url+'?'; 39 | 40 | for(let key in param) { 41 | url = url+key+'='+param[key]; 42 | if(Object.keys(param).length >1){ 43 | url = url +'&'; 44 | } 45 | } 46 | 47 | } 48 | 49 | return new Promise((resolve,reject) => { 50 | 51 | fetch(url, { 52 | method: type, 53 | headers: { 54 | 'Accept': 'application/json', 55 | 'Content-Type': 'application/json', 56 | 'Content-Encoding':'gzip', 57 | }, 58 | body: type == 'GET'?null:JSON.stringify(param) 59 | }).then(data => data.json() 60 | 61 | ).then(json => { 62 | 63 | let code = json.code; 64 | 65 | let errorCode = json.error_code; 66 | 67 | //服务器在code为200 1600为没有数据所以也为成功 68 | 69 | if(code == 200 & (errorCode == 0 || errorCode == 1600)){ 70 | 71 | resolve(json.data); 72 | } 73 | else { 74 | reject(json.error_message); 75 | } 76 | 77 | }).catch(error=>{ 78 | 79 | reject('网络信号差,请稍后再试') 80 | }) 81 | 82 | } 83 | ) 84 | } 85 | 86 | 87 | } 88 | 89 | 90 | -------------------------------------------------------------------------------- /App/Styles/index.js: -------------------------------------------------------------------------------- 1 | let itemCell = { 2 | backgroundColor: 'white', 3 | margin: 10, 4 | marginBottom: 0, 5 | borderRadius: 2, 6 | shadowColor: '#000000', 7 | shadowOpacity: 0.1, 8 | shadowRadius: 0, 9 | shadowOffset: { 10 | height: 2, 11 | width: 1 12 | } 13 | } 14 | 15 | export default { 16 | androidSpinnerColor: '#009688', 17 | containerBg: { 18 | backgroundColor: '#efeff4' 19 | }, 20 | containerShadow: { 21 | borderColor: '#e1e1e1', 22 | borderLeftWidth: 1 23 | }, 24 | itemCell: itemCell, 25 | card: { 26 | tweetContainer: { 27 | ...itemCell, 28 | backgroundColor: 'white' 29 | }, 30 | topContainer: { 31 | flexDirection: 'row', 32 | padding: 10, 33 | borderColor: '#e1e1e1', 34 | borderBottomWidth: 1 35 | }, 36 | avatar: { 37 | backgroundColor: 'gray', 38 | width: 35, 39 | height: 35, 40 | borderRadius: 4, 41 | marginRight: 6 42 | }, 43 | time: { 44 | fontSize: 13, 45 | color: '#8999a5', 46 | marginTop: 2 47 | }, 48 | name: { 49 | color: '#ff9630', 50 | fontWeight: '600', 51 | fontSize: 14 52 | }, 53 | middleContainer: { 54 | padding: 10, 55 | borderColor: '#e1e1e1', 56 | borderBottomWidth: 1 57 | }, 58 | msgImage: { 59 | marginTop: 10, 60 | height: 200, 61 | backgroundColor: '#e1e1e1' 62 | }, 63 | bottomContainer: { 64 | flexDirection: 'row', 65 | height: 40, 66 | backgroundColor: '#fafafa' 67 | }, 68 | bottomTool: { 69 | flexGrow: 1, 70 | justifyContent: 'center', 71 | alignItems: 'center' 72 | }, 73 | bottomToolText: { 74 | color: '#6D6D78', 75 | fontWeight: '500', 76 | alignItems: 'center' 77 | } 78 | } 79 | } -------------------------------------------------------------------------------- /App/Views/About/index.js: -------------------------------------------------------------------------------- 1 | import React, { 2 | Component 3 | } from 'react' 4 | 5 | import { 6 | StyleSheet, 7 | View, 8 | Text, 9 | Image 10 | } from 'react-native' 11 | 12 | import styleUtils from '../../Styles' 13 | import NavbarComp from '../../Components/NavBar' 14 | 15 | export default class AboutView extends Component{ 16 | constructor(props) { 17 | super(props) 18 | this.state = {} 19 | } 20 | 21 | render() { 22 | return ( 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | HiApp 31 | 32 | 33 | GitHub: BelinChung 34 | Email: BelinChung@gmail.com 35 | Twitter: @BelinChung 36 | 37 | 38 | Copyright © 2016 BelinChung. 39 | 40 | 41 | 42 | ) 43 | } 44 | } 45 | 46 | const styles = StyleSheet.create({ 47 | container: { 48 | flexGrow: 1 49 | }, 50 | textContainer: { 51 | ...styleUtils.containerBg, 52 | flexGrow: 1, 53 | alignItems: 'center', 54 | paddingTop: 35 55 | }, 56 | logoView: { 57 | width: 90, 58 | height: 90, 59 | borderColor: '#dfdfdf', 60 | backgroundColor: 'white', 61 | borderRadius: 5, 62 | borderWidth: 1, 63 | justifyContent: 'center' 64 | }, 65 | logo: { 66 | width: 75, 67 | height: 75, 68 | alignSelf: 'center' 69 | }, 70 | appNameView: { 71 | marginTop: 15, 72 | }, 73 | appNameText: { 74 | fontSize: 20, 75 | color: '#666' 76 | }, 77 | infoView: { 78 | marginTop: 30 79 | }, 80 | infoText: { 81 | marginTop: 10, 82 | color: '#666' 83 | }, 84 | copyrightView: { 85 | position: 'absolute', 86 | bottom: 25, 87 | left: 0, 88 | right: 0 89 | }, 90 | copyrightText: { 91 | color: '#666', 92 | alignSelf: 'center' 93 | } 94 | }) -------------------------------------------------------------------------------- /App/Views/Home/Banner.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by zhanming on 2017/6/26. 3 | */ 4 | 5 | import React, { Component,PropTypes } from 'react'; 6 | import { 7 | StyleSheet, 8 | View, 9 | TouchableOpacity, 10 | Image, 11 | Text, 12 | } from 'react-native'; 13 | 14 | import {observer} from 'mobx-react/native'; 15 | import Swiper from 'react-native-swiper'; 16 | import * as Device from '../../Components/Constant/Device'; 17 | 18 | import TestView from './testView'; 19 | 20 | const bannerH = Device.ScreenWidth*(136.0/375.0); 21 | @observer 22 | export default class Banner extends Component{ 23 | 24 | 25 | constructor(props){ 26 | super(props); 27 | } 28 | render(){ 29 | 30 | return( 31 | 32 | 33 | 34 | {this._getItem()} 35 | 36 | 37 | 38 | 39 | ) 40 | } 41 | _getItem() { 42 | 43 | 44 | if(this.props.homeState.bannerList.length != 0){ 45 | 46 | var views=[]; 47 | 48 | let key = 0; 49 | 50 | views.push( 51 | 53 | { 54 | this.props.homeState.bannerList.map((item)=>{ 55 | 56 | return( 57 | 58 | { 59 | this.props.navigator.push({ 60 | component:TestView, 61 | params:{ 62 | ...this.props 63 | } 64 | }) 65 | }}> 66 | 68 | 69 | 70 | 71 | ) 72 | }) 73 | 74 | 75 | } 76 | 77 | 78 | 79 | ) 80 | 81 | return views; 82 | } 83 | 84 | 85 | 86 | } 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | } 96 | const styles = StyleSheet.create({ 97 | 98 | bottomView:{ 99 | height:10, 100 | width:Device.ScreenWidth, 101 | backgroundColor:'#F7F7F7', 102 | position:'absolute', 103 | left:0, 104 | bottom:0, 105 | } 106 | 107 | }) -------------------------------------------------------------------------------- /App/Views/Home/HomeNavigator.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | import React, {Component,PropTypes} from 'react'; 4 | 5 | import { 6 | StyleSheet, 7 | Text, 8 | View, 9 | Image, 10 | Platform, 11 | ViewPropTypes, 12 | StatusBar, 13 | TouchableOpacity, 14 | 15 | } from 'react-native'; 16 | 17 | 18 | 19 | import * as Device from '../../Components/Constant/Device'; 20 | 21 | const NAV_BAR_HEIGHT_IOS = 44; 22 | 23 | const NAV_BAR_HEIGHT_ANDROID = 50; 24 | 25 | const STATUS_BAR_HEIGHT = 20; 26 | 27 | 28 | export default class SDNavigationBar extends Component{ 29 | 30 | 31 | static propTypes ={ 32 | 33 | //标题 34 | title:PropTypes.string, 35 | 36 | titleStyle:ViewPropTypes.style, 37 | 38 | leftButton:PropTypes.element, 39 | 40 | rightButton:PropTypes.element, 41 | } 42 | 43 | constructor(props) { 44 | super(props); 45 | // 初始状态 46 | this.state = {}; 47 | } 48 | 49 | render(){ 50 | 51 | return( 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 想借多少钱 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | ) 76 | 77 | } 78 | 79 | } 80 | 81 | const styles = StyleSheet.create({ 82 | 83 | navStyle:{ 84 | 85 | flexDirection:'row', 86 | justifyContent:'center', 87 | alignItems:'center', 88 | height: Platform.OS === 'ios'?NAV_BAR_HEIGHT_IOS:NAV_BAR_HEIGHT_ANDROID, 89 | width:Device.ScreenWidth, 90 | }, 91 | statusImageStyle:{ 92 | 93 | flex:1, 94 | position:'absolute', 95 | left:0, 96 | top:0, 97 | overflow:'hidden', 98 | }, 99 | navImageStyle:{ 100 | height:Platform.OS === 'ios'?NAV_BAR_HEIGHT_IOS:NAV_BAR_HEIGHT_ANDROID, 101 | width:Device.ScreenWidth, 102 | 103 | position:'absolute', 104 | left:0, 105 | top:0, 106 | }, 107 | searchStyle:{ 108 | width:Device.ScreenWidth*0.7, 109 | height:29, 110 | borderRadius:29, 111 | backgroundColor:'white', 112 | flexDirection:'row', 113 | justifyContent:'center', 114 | alignItems:'center', 115 | } 116 | 117 | 118 | 119 | 120 | }) 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | -------------------------------------------------------------------------------- /App/Views/Home/NewProduct.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | import React, { Component,ViewPropTypes } from 'react'; 4 | import { 5 | AppRegistry, 6 | StyleSheet, 7 | Text, 8 | View, 9 | Image, 10 | ListView, 11 | ScrollView, 12 | DeviceEventEmitter, 13 | 14 | } from 'react-native'; 15 | 16 | import NewProductCell from './NewProductCell'; 17 | import * as Device from '../../Components/Constant/Device'; 18 | 19 | export default class NewProduct extends Component{ 20 | 21 | // 构造 22 | constructor(props) { 23 | super(props); 24 | 25 | this.state = { 26 | 27 | dataSource:new ListView.DataSource({rowHasChanged:(r1,r2)=>{return r1 !== r2}}), 28 | } 29 | 30 | } 31 | 32 | componentDidMount(){ 33 | 34 | DeviceEventEmitter.addListener('NewProduct',(data)=>{ 35 | 36 | this.setState({ 37 | dataSource: this.state.dataSource.cloneWithRows(data), 38 | }) 39 | 40 | }); 41 | }; 42 | 43 | render(){ 44 | return ( 45 | 46 | 47 | 48 | 49 | 50 | 新品入住 51 | 52 | 53 | 54 | { 57 | return this._renderRowGG(productModel) 58 | }} 59 | > 60 | 61 | 62 | ) 63 | } 64 | 65 | _renderRowGG(productModel){ 66 | 67 | 68 | 69 | return 70 | } 71 | } 72 | 73 | const styles = StyleSheet.create({ 74 | 75 | productItemStyle: { 76 | height: 100, 77 | width: 375, 78 | backgroundColor: 'red', 79 | 80 | }, 81 | topTextStyle: { 82 | color:'#4f4f4f', 83 | fontSize:15, 84 | marginLeft:20, 85 | marginTop:10, 86 | }, 87 | topLineStyle: { 88 | height: 1, 89 | width: Device.ScreenWidth-20, 90 | backgroundColor: '#D7D7D7', 91 | marginLeft:20, 92 | marginTop:10, 93 | }, 94 | topBlockStyle:{ 95 | height: 10, 96 | width: Device.ScreenWidth, 97 | backgroundColor: '#F7F7F7', 98 | 99 | } 100 | 101 | }) 102 | -------------------------------------------------------------------------------- /App/Views/Home/NewProductCell.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by zhanming on 2017/6/28. 3 | */ 4 | import React, { Component } from 'react'; 5 | import { 6 | StyleSheet, 7 | Text, 8 | View, 9 | Image, 10 | ListView, 11 | ScrollView, 12 | DeviceEventEmitter, 13 | 14 | } from 'react-native'; 15 | import * as Device from '../../Components/Constant/Device'; 16 | import TagView from '../../Components/View/TagView'; 17 | 18 | export default class NewProductCell extends Component{ 19 | 20 | // 构造 21 | constructor(props) { 22 | super(props); 23 | 24 | } 25 | render(){ 26 | 27 | return( 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | {this.props.productModel.update_date} 37 | 38 | 39 | {this.props.productModel.platform_product_name} 40 | {this.props.productModel.product_conduct} 41 | 42 | 43 | 44 | 45 | 46 | {this.props.productModel.product_introduct} 47 | 48 | 49 | 50 | 51 | ) 52 | } 53 | 54 | } 55 | 56 | const styles = StyleSheet.create({ 57 | 58 | productItemStyle: { 59 | height: 75, 60 | width: Device.ScreenWidth, 61 | backgroundColor: 'white', 62 | flexDirection: 'row', 63 | alignItems: 'center', 64 | }, 65 | topLeftViewStyle: { 66 | height: 50, 67 | width: 50, 68 | marginLeft: 10, 69 | }, 70 | rightViewStyle: { 71 | 72 | marginTop: 5, 73 | height: 60, 74 | flexDirection: 'column', 75 | 76 | justifyContent: 'space-between', 77 | 78 | marginLeft: 13, 79 | 80 | }, 81 | rightTopStyle: { 82 | 83 | flexDirection: 'row', 84 | justifyContent: 'flex-start', 85 | } 86 | 87 | 88 | }) 89 | -------------------------------------------------------------------------------- /App/Views/Home/PickerView.js: -------------------------------------------------------------------------------- 1 | import React, { Component ,PropTypes} from 'react'; 2 | import { 3 | StyleSheet, 4 | View, 5 | Image, 6 | Text, 7 | TouchableHighlight, 8 | Animated, 9 | Easing, 10 | Dimensions, 11 | Platform, 12 | TouchableOpacity, 13 | findNodeHandle, 14 | InteractionManager, 15 | } from 'react-native'; 16 | import { BlurView } from 'react-native-blur'; 17 | import Picker from 'react-native-picker'; 18 | 19 | 20 | 21 | const {width, height} = Dimensions.get('window'); 22 | const navigatorH = 64; // navigator height 23 | const [aWidth, aHeight] = [width, 214]; 24 | const [left, top] = [0, 0]; 25 | 26 | export default class PickerView extends Component { 27 | 28 | 29 | static propTypes = { 30 | 31 | pickViewArray:PropTypes.array.isRequired, 32 | } 33 | 34 | constructor(props) { 35 | super(props); 36 | this.state = { 37 | offset: new Animated.Value(0), 38 | opacity: new Animated.Value(0), 39 | hide: true, 40 | viewRef: null, 41 | }; 42 | this.options = this.props.pickViewArray; 43 | this.callback = function () {};//回调方法 44 | this.parent ={}; 45 | } 46 | 47 | componentWillUnMount(){ 48 | this.timer && clearTimeout(this.timer); 49 | } 50 | 51 | componentDidUpdate(){ 52 | 53 | // console.log('findNodeHandle'); 54 | // 55 | // InteractionManager.runAfterInteractions(() => { 56 | // setTimeout(() => { 57 | // this.setState({ viewRef: findNodeHandle(this.backgroundImage) }); 58 | // }, 500); 59 | // }); 60 | 61 | 62 | } 63 | 64 | render() { 65 | if(this.state.hide){ 66 | return () 67 | } else { 68 | return ( 69 | 70 | 71 | 72 | {this._backView()} 73 | 74 | 75 | 76 | 83 | 84 | {this._pickerShow()} 85 | 86 | {/**/} 87 | {/*取消*/} 88 | {/*确定*/} 89 | {/**/} 90 | {/* this.setState({choice: choice})}>*/} 96 | {/*{this.options.map((aOption) => )}*/} 97 | {/**/} 98 | 99 | 100 | 101 | 102 | ); 103 | } 104 | } 105 | 106 | _pickerShow(){ 107 | 108 | Picker.init({ 109 | pickerData: this.props.pickViewArray, 110 | selectedValue: [this.props.pickViewArray[0]], 111 | pickerConfirmBtnText:'选择', 112 | pickerTitleText:'金额', 113 | pickerCancelBtnText:'取消', 114 | pickerConfirmBtnColor:[255,255,255,1], 115 | pickerCancelBtnColor:[255,255,255,1], 116 | pickerTitleColor:[255,255,255,1], 117 | pickerToolBarBg:[0,180,255,1], 118 | 119 | pickerBg:[255,255,255,1], 120 | 121 | pickerFontColor:[77,77,77,1], 122 | 123 | 124 | onPickerConfirm: data => { 125 | 126 | this.out() 127 | }, 128 | onPickerCancel: data => { 129 | this.out() 130 | }, 131 | onPickerSelect: data => { 132 | console.log(data); 133 | } 134 | }); 135 | 136 | Picker.show(); 137 | } 138 | 139 | 140 | 141 | 142 | //显示动画 143 | startAnimation() { 144 | 145 | this.setState({ 146 | hide:false, 147 | }) 148 | 149 | Animated.parallel([ 150 | Animated.timing( 151 | this.state.opacity, 152 | { 153 | easing: Easing.linear, 154 | duration: 500, 155 | toValue: 1, 156 | } 157 | ), 158 | Animated.timing( 159 | this.state.offset, 160 | { 161 | easing: Easing.linear, 162 | duration: 500, 163 | toValue: 0, 164 | } 165 | ) 166 | ]).start(); 167 | } 168 | 169 | 170 | _backView() { 171 | 172 | if (Platform.OS === 'ios') { 173 | return ( 174 | 175 | 178 | ) 179 | 180 | } else { 181 | 182 | return ( 183 | 184 | 185 | 186 | ) 187 | } 188 | } 189 | 190 | //隐藏动画 191 | out(){ 192 | Animated.parallel([ 193 | Animated.timing( 194 | this.state.opacity, 195 | { 196 | easing: Easing.linear, 197 | duration: 500, 198 | toValue: 0, 199 | } 200 | ), 201 | Animated.timing( 202 | this.state.offset, 203 | { 204 | easing: Easing.linear, 205 | duration: 500, 206 | toValue: 0, 207 | } 208 | ) 209 | ]).start(); 210 | 211 | this.timer = setTimeout( 212 | () => this.setState({hide: true}), 213 | 500 214 | ); 215 | } 216 | 217 | //取消 218 | cancel(event) { 219 | if(!this.state.hide){ 220 | this.out(); 221 | } 222 | } 223 | 224 | //选择 225 | ok() { 226 | if(!this.state.hide){ 227 | this.out(); 228 | this.callback.apply(this.parent,[this.state.choice]); 229 | } 230 | } 231 | 232 | show(obj:Object,callback:Object) { 233 | this.parent = obj; 234 | this.callback = callback; 235 | if(this.state.hide){ 236 | this.setState({ hide: false}, this.in); 237 | } 238 | } 239 | } 240 | 241 | const styles = StyleSheet.create({ 242 | container: { 243 | position:"absolute", 244 | width:width, 245 | height:height, 246 | left:left, 247 | top:top, 248 | }, 249 | mask: { 250 | justifyContent:"center", 251 | position:"absolute", 252 | width:width, 253 | height:height, 254 | left:left, 255 | top:top, 256 | }, 257 | tip: { 258 | width:aWidth, 259 | height:aHeight, 260 | // left:middleLeft, 261 | backgroundColor:"#fff", 262 | alignItems:"center", 263 | justifyContent:"space-between", 264 | }, 265 | tipTitleView: { 266 | height:53, 267 | width:aWidth, 268 | flexDirection:'row', 269 | alignItems:'center', 270 | justifyContent:'space-between', 271 | borderBottomWidth:0.5, 272 | borderColor:"#f0f0f0", 273 | 274 | }, 275 | cancelText:{ 276 | color:"#e6454a", 277 | fontSize:16, 278 | paddingLeft:30, 279 | }, 280 | okText:{ 281 | color:"#e6454a", 282 | fontSize:16, 283 | paddingRight:27, 284 | fontWeight:'bold', 285 | }, 286 | picker:{ 287 | justifyContent:'center', 288 | height: 216,//Picker 默认高度 289 | width:aWidth, 290 | }, 291 | itemPicker:{ 292 | color:'black', 293 | fontSize:15, 294 | textAlign: 'center', 295 | 296 | }, 297 | backViewStyle:{ 298 | position: 'absolute', 299 | left: 0, 300 | right:0, 301 | top: 0, 302 | bottom:0, 303 | } 304 | }); 305 | -------------------------------------------------------------------------------- /App/Views/Home/Recommend.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by zhanming on 2017/6/26. 3 | */ 4 | //推荐产品 recommend products 5 | 6 | import React, { Component,PropTypes } from 'react'; 7 | import { 8 | StyleSheet, 9 | View, 10 | Image, 11 | Text, 12 | DeviceEventEmitter, 13 | TouchableOpacity, 14 | } from 'react-native'; 15 | 16 | import {observer} from 'mobx-react/native'; 17 | import * as Device from '../../Components/Constant/Device'; 18 | 19 | import HomeState from '../../Mobx/Home'; 20 | 21 | import ProductDetails from '../ProductDetails/index'; 22 | 23 | @observer 24 | 25 | 26 | export default class Recommend extends Component { 27 | 28 | static PropTypes ={ 29 | RecommendAllArray:PropTypes.array, 30 | homeState:PropTypes.instanceOf(HomeState), 31 | } 32 | 33 | static defaultProps = { 34 | RecommendAllArray:[], 35 | } 36 | 37 | constructor(props) { 38 | super(props); 39 | 40 | 41 | 42 | this.state ={ 43 | defualtNum:8, 44 | count:0, 45 | } 46 | } 47 | 48 | componentDidMount(){ 49 | DeviceEventEmitter.addListener('zhanming',this.nextStep.bind(this)); 50 | }; 51 | 52 | render() { 53 | 54 | return ( 55 | 56 | 57 | 58 | 59 | 推荐产品 60 | 61 | 62 | 63 | 66 | 下一批> 67 | 68 | 76 | 77 | 78 | 79 | 80 | {this._getItem()} 81 | 82 | 83 | 84 | 85 | ) 86 | 87 | } 88 | 89 | nextStep(){ 90 | 91 | let count = this.state.count; 92 | 93 | if (count > 3) { 94 | count = 0; 95 | } 96 | 97 | this.props.homeState.setRecommendList(this.props.RecommendAllArray.slice(count * this.state.defualtNum, count * this.state.defualtNum + 8)); 98 | 99 | this.setState({ 100 | count: ++count, 101 | }) 102 | } 103 | 104 | _getItem() { 105 | 106 | var views = []; 107 | 108 | for (let i = 0; i < this.props.homeState.RecommendList.length; i++) { 109 | 110 | let itemModel = this.props.homeState.RecommendList[i]; 111 | 112 | console.log(itemModel); 113 | 114 | views.push( 115 | { 116 | 117 | //push to ProductDetails / 跳转到ProductDetails 118 | this.props.navigator.push({ 119 | component:ProductDetails, 120 | params:{ 121 | ...this.props, 122 | productID:itemModel.platform_product_id, 123 | 124 | } 125 | }) 126 | }}> 127 | 128 | 130 | 131 | 132 | 133 | {itemModel.platform_product_name} 139 | 140 | {itemModel.loan_min}-{itemModel.loan_max} 144 | 145 | 成功率 146 | 147 | {itemModel.success_rate} 148 | 149 | 150 | 151 | 152 | 153 | 154 | ) 155 | } 156 | 157 | return views; 158 | } 159 | 160 | } 161 | 162 | const styles = StyleSheet.create({ 163 | 164 | topStyle:{ 165 | height:40, 166 | width: Device.ScreenWidth, 167 | flexDirection:'row', 168 | alignItems:'center', 169 | }, 170 | recommendStyle:{ 171 | flexDirection:'row', 172 | flexWrap:'wrap', 173 | justifyContent:'space-between', 174 | backgroundColor:'white', 175 | }, 176 | recommendCellStyle:{ 177 | height: 70, 178 | width: Device.ScreenWidth / 2.0, 179 | backgroundColor: 'white', 180 | flexDirection:'row', 181 | alignItems:'center', 182 | }, 183 | cellImageStyle:{ 184 | height:40, 185 | width:40, 186 | marginLeft:26, 187 | backgroundColor:'white', 188 | marginRight:10, 189 | }, 190 | //cell Lift View / cell 右边的View 191 | cellLeftViewStyle:{ 192 | 193 | flexDirection:'column', 194 | justifyContent:'space-between', 195 | height:48, 196 | 197 | }, 198 | 199 | cellLeftTopStyle:{ 200 | flexDirection: 'row', 201 | alignItems: 'center', 202 | }, 203 | cellLeftBottomStyle:{ 204 | flexDirection: 'row', 205 | alignItems: 'center', 206 | }, 207 | bottomViewStyle:{ 208 | height: 10, 209 | width: Device.ScreenWidth, 210 | backgroundColor: '#F7F7F7', 211 | } 212 | 213 | 214 | 215 | 216 | }) -------------------------------------------------------------------------------- /App/Views/Home/Subjects.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by zhanming on 2017/6/27. 3 | */ 4 | import React, { Component,PropTypes } from 'react'; 5 | import { 6 | StyleSheet, 7 | View, 8 | TouchableOpacity, 9 | Image, 10 | Text, 11 | ScrollView, 12 | DeviceEventEmitter, 13 | } from 'react-native'; 14 | 15 | import {observer} from 'mobx-react/native'; 16 | import * as Device from '../../Components/Constant/Device'; 17 | @observer 18 | 19 | 20 | 21 | 22 | export default class Subjects extends Component{ 23 | 24 | constructor(props){ 25 | super(props); 26 | 27 | this.instructionWith = Device.ScreenWidth*0.2; 28 | 29 | this.instructionProgress = this.instructionWith*0.2; 30 | this.state = { 31 | Left:0, 32 | } 33 | } 34 | 35 | render(){ 36 | 37 | return( 38 | 39 | { 40 | 41 | this.setState({ 42 | 43 | Left:e.nativeEvent.contentOffset.x/(((((Device.ScreenWidth-40)/ 2.0)*this.props.homeState.SubjectList.length)+ ((this.props.homeState.SubjectList.length-1)*10)) - (Device.ScreenWidth-30)) *(this.instructionWith- 2 - this.instructionProgress), 44 | 45 | }) 46 | 47 | } } scrollEventThrottle={1}> 48 | {this.getImageItem()} 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | ) 60 | } 61 | 62 | getImageItem(){ 63 | 64 | 65 | let ImageItems= []; 66 | 67 | for(let i = 0;i 74 | 75 | 76 | 77 | 78 | 79 | ) 80 | } 81 | return ImageItems; 82 | 83 | } 84 | } 85 | 86 | const styles = StyleSheet.create({ 87 | 88 | scrollViewStyle:{ 89 | width:Device.ScreenWidth-30, 90 | marginLeft:15, 91 | }, 92 | scrollCellStyle:{ 93 | height: 70, 94 | width: (Device.ScreenWidth - 40) / 2.0, 95 | 96 | }, 97 | bottomView:{ 98 | height:40, 99 | width:Device.ScreenWidth, 100 | flexDirection:'row', 101 | justifyContent:'center', 102 | alignItems:'center', 103 | }, 104 | bottomInstructionStyle:{ 105 | height:6, 106 | borderColor:'#f5f5f5', 107 | borderWidth:1, 108 | overflow:'hidden', 109 | // backgroundColor:'red', 110 | } 111 | 112 | 113 | }) -------------------------------------------------------------------------------- /App/Views/Home/index.js: -------------------------------------------------------------------------------- 1 | 2 | import React, { 3 | Component 4 | } from 'react'; 5 | 6 | import { 7 | TouchableOpacity, 8 | StyleSheet, 9 | Text, 10 | Image, 11 | View, 12 | ScrollView, 13 | DeviceEventEmitter, 14 | RefreshControl, 15 | } from 'react-native'; 16 | 17 | import Swiper from 'react-native-swiper'; 18 | import HomeState from '../../Mobx/Home'; 19 | import {observer} from 'mobx-react/native'; 20 | import Banner from './Banner'; 21 | import Recommend from './Recommend'; 22 | import Subjects from './Subjects'; 23 | import NewProduct from './NewProduct'; 24 | import SDHttpRequest from '../../Network'; 25 | import Toast, {DURATION} from 'react-native-easy-toast'; 26 | import * as Device from '../../Components/Constant/Device'; 27 | import PickerView from './PickerView'; 28 | import FilterTagDataBase from '../../Components/Constant/FilterTagDataBase' 29 | 30 | import HomeNavigator from './HomeNavigator'; 31 | 32 | @observer 33 | export default class Home extends Component{ 34 | 35 | 36 | homeState = new HomeState(); 37 | constructor(props) { 38 | super(props) 39 | 40 | this.state = { 41 | 42 | RecommendAllArray:[], 43 | 44 | NewProductArray:[], 45 | } 46 | 47 | } 48 | 49 | componentDidMount(){ 50 | 51 | 52 | 53 | // navigator.geolocation.getCurrentPosition( 54 | // (position) => { 55 | // var initialPosition = JSON.stringify(position); 56 | // 57 | // console.log('position'); 58 | // 59 | // console.log(position); 60 | // }, 61 | // (error) => alert(JSON.stringify(error)), 62 | // {enableHighAccuracy: true, timeout: 20000, maximumAge: 1000} 63 | // ); 64 | 65 | 66 | SDHttpRequest.GET('v2/banners').then((data) => { 67 | this.homeState.setBannerList(data); 68 | 69 | },(error =>{ 70 | this.infoSHow.show(error); 71 | })).catch(error =>{ 72 | this.infoSHow.show(error); 73 | }) 74 | 75 | SDHttpRequest.GET('v1/product/recommends').then((data) => { 76 | 77 | this.setState({ 78 | RecommendAllArray:data.list, 79 | 80 | }); 81 | 82 | DeviceEventEmitter.emit('zhanming'); 83 | },(error =>{ 84 | this.infoSHow.show(error); 85 | })).catch(error =>{ 86 | this.infoSHow.show(error); 87 | }) 88 | 89 | 90 | 91 | 92 | SDHttpRequest.GET('v1/banners/subjects').then((data) => { 93 | 94 | this.homeState.setSubjectList(data); 95 | 96 | },(error =>{ 97 | this.infoSHow.show(error); 98 | })).catch(error =>{ 99 | this.infoSHow.show(error); 100 | }) 101 | 102 | SDHttpRequest.GET('v1/product/online').then((data) => { 103 | 104 | 105 | // 106 | // this.setState({ 107 | // NewProductArray:data, 108 | // }) 109 | DeviceEventEmitter.emit('NewProduct',data); 110 | 111 | },(error =>{ 112 | this.infoSHow.show(error); 113 | })).catch(error =>{ 114 | this.infoSHow.show(error); 115 | }); 116 | 117 | 118 | SDHttpRequest.GET('v1/product/searchtag').then((data) => { 119 | 120 | FilterTagDataBase.saveFilterTagArray(data); 121 | 122 | }); 123 | 124 | 125 | 126 | // Promise.all(SDHttpRequest.GET('v2/banners'),SDHttpRequest.GET('v1/product/recommends')).then((array)=>{ 127 | // console.log(array); 128 | // }) 129 | 130 | } 131 | 132 | componentWillUpdate(){ 133 | } 134 | render(){ 135 | 136 | return( 137 | 138 | 139 | 140 | 141 | 142 | 149 | }> 150 | {/*首页轮播*/} 151 | 155 | 156 | 157 | 158 | {this._guideView()} 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | this.infoSHow = toast)}/> 170 | 171 | 172 | {this.PickerView = e}} pickViewArray={['金额不限','500元','1000元','1500元','2000元','3000元','4000元','5000元','6000元','7000元','9000元','10000元','150000元','20000元','30000元','50000元','10万元','20万元']} /> 173 | 174 | 175 | ) 176 | } 177 | 178 | _guideView(){ 179 | 180 | return 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | } 190 | 191 | //点击Nav上借钱 192 | showPickerView(){ 193 | 194 | this.PickerView.startAnimation(); 195 | 196 | } 197 | 198 | 199 | 200 | } 201 | 202 | const styles = StyleSheet.create({ 203 | 204 | guideViewStyle:{ 205 | 206 | width:Device.ScreenWidth, 207 | height:100, 208 | flexDirection:'row', 209 | 210 | }, 211 | guideCellStyle:{ 212 | flex:1, 213 | flexDirection:'row', 214 | justifyContent:'center', 215 | alignItems:'center', 216 | }, 217 | guideImageStyle:{ 218 | width:90, 219 | height:90, 220 | }, 221 | homeGuideImageStyle:{ 222 | width:Device.ScreenWidth, 223 | height:60.0/375*Device.ScreenWidth, 224 | 225 | 226 | } 227 | 228 | 229 | }) 230 | 231 | -------------------------------------------------------------------------------- /App/Views/Home/testView.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by zhanming on 2017/6/27. 3 | */ 4 | import React, { Component,PropTypes } from 'react'; 5 | import { 6 | StyleSheet, 7 | View, 8 | TouchableOpacity, 9 | Image, 10 | Text, 11 | ScrollView, 12 | } from 'react-native'; 13 | 14 | export default class TestView extends Component{ 15 | 16 | constructor(props){ 17 | super(props); 18 | this.state = { 19 | bottomLeft:0, 20 | } 21 | } 22 | 23 | render(){ 24 | 25 | return( 26 | 27 | { 29 | this.props.navigator.pop(); 30 | } 31 | 32 | } > 33 | 返回 34 | 35 | 36 | 37 | ) 38 | } 39 | } -------------------------------------------------------------------------------- /App/Views/Index/index.js: -------------------------------------------------------------------------------- 1 | import React, { 2 | Component 3 | } from 'react' 4 | 5 | import { 6 | StyleSheet, 7 | View 8 | } from 'react-native' 9 | 10 | import TabBarComp from '../../Components/TabBar' 11 | import NavbarComp from '../../Components/NavBar' 12 | 13 | export default class IndexView extends Component{ 14 | constructor(props) { 15 | super(props) 16 | this.state = {} 17 | } 18 | 19 | render() { 20 | return ( 21 | 22 | 23 | 24 | 25 | ) 26 | } 27 | } 28 | 29 | const styles = StyleSheet.create({ 30 | container: { 31 | flexGrow: 1 32 | } 33 | }) 34 | -------------------------------------------------------------------------------- /App/Views/Me/index.js: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Created by zhanming on 2017/6/27. 4 | */ 5 | import React, { Component,PropTypes } from 'react'; 6 | import { 7 | StyleSheet, 8 | View, 9 | TouchableOpacity, 10 | Image, 11 | Text, 12 | ScrollView, 13 | } from 'react-native'; 14 | import * as Device from '../../Components/Constant/Device'; 15 | 16 | const meDataSource = [{name:'要好友得现金',source:require('../../assets/gift.png')},{name:'信用资料',source:require('../../assets/credit _information.png')},{name:'设置用户名&身份',source:require('../../assets/identity.png')},{name:'我的收藏',source:require('../../assets/collect.png')},{name:'关注速贷之家',source:require('../../assets/attention.png')},{name:'帮助中心&反馈',source:require('../../assets/help.png')},{name:'设置',source:require('../../assets/setting.png')}]; 17 | 18 | export default class Me extends Component{ 19 | 20 | constructor(props){ 21 | super(props); 22 | this.state = { 23 | bottomLeft:0, 24 | } 25 | } 26 | 27 | componentWillUpdate(){ 28 | 29 | console.log('componentWillUpdate-me'); 30 | 31 | } 32 | 33 | render(){ 34 | 35 | return( 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 速贷哥 47 | 48 | 49 | 50 | 积分商城 51 | 500 52 | 53 | 54 | 55 | 我的现金 56 | 500 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | {this._getCellsView()} 65 | 66 | 67 | 68 | ) 69 | } 70 | 71 | _titleLayout(event) { 72 | 73 | this.titleWitdh=event.nativeEvent.layout.width; 74 | 75 | this.refs.title.setNativeProps({ 76 | style:{ 77 | 78 | width:this.titleWitdh, 79 | backgroundColor:'yellow', 80 | height:1, 81 | } 82 | }); 83 | 84 | } 85 | 86 | 87 | 88 | 89 | _getCellsView(){ 90 | 91 | let cellArray = []; 92 | 93 | cellArray.push( 94 | 95 | meDataSource.map((item =>{ 96 | 97 | return( 98 | 99 | 100 | 101 | 102 | {item.name} 103 | 104 | 105 | 106 | 107 | ) 108 | 109 | 110 | 111 | })) 112 | ) 113 | 114 | 115 | 116 | return cellArray; 117 | 118 | 119 | 120 | 121 | } 122 | 123 | } 124 | 125 | const styles = StyleSheet.create({ 126 | 127 | topBackgroundImageStyle: { 128 | 129 | width: Device.ScreenWidth, 130 | height: 270, 131 | position: 'absolute', 132 | top: 0, 133 | left: 0, 134 | }, 135 | 136 | topViewStyle: { 137 | 138 | width: Device.ScreenWidth, 139 | height: 270, 140 | flexDirection:'column', 141 | alignItems:"center", 142 | justifyContent:'flex-start', 143 | 144 | }, 145 | 146 | iconStyle: { 147 | 148 | width: 68, 149 | height: 68, 150 | flexDirection:'column', 151 | alignItems:"center", 152 | justifyContent:'center', 153 | marginTop:30, 154 | borderWidth:3, 155 | borderColor:'#50D7FF', 156 | borderRadius:34, 157 | 158 | }, 159 | iconImageStyle: { 160 | 161 | width: 60, 162 | height: 60, 163 | }, 164 | 165 | nameStyle:{ 166 | 167 | color:'white', 168 | backgroundColor:'rgba(255,255,255,0)', 169 | fontSize:12, 170 | marginTop:20, 171 | }, 172 | 173 | cellStyle:{ 174 | 175 | flexDirection:'row', 176 | alignItems:"center", 177 | justifyContent:'flex-start', 178 | width:Device.ScreenWidth, 179 | height:45, 180 | backgroundColor:'white', 181 | }, 182 | 183 | cellImageStyle:{ 184 | 185 | width:22, 186 | height:22, 187 | marginLeft:29, 188 | }, 189 | cellTextStyle:{ 190 | 191 | marginLeft:10, 192 | fontSize:15, 193 | color:'#4D4D4D', 194 | }, 195 | cellLineStyle:{ 196 | backgroundColor:'#F5F5F5', 197 | height:1, 198 | width:Device.ScreenWidth, 199 | position:'absolute', 200 | left:0, 201 | bottom:0, 202 | }, 203 | 204 | propertyViewStyle:{ 205 | 206 | marginTop:20, 207 | 208 | flexDirection:'row', 209 | alignItems:"center", 210 | justifyContent:'space-between', 211 | width:Device.ScreenWidth*0.5, 212 | }, 213 | 214 | pointsViewStyle:{ 215 | 216 | flexDirection:'column', 217 | alignItems:"center", 218 | justifyContent:'flex-start', 219 | 220 | }, 221 | 222 | pointsTitleStyle:{ 223 | 224 | backgroundColor:'rgba(255,255,255,0)', 225 | color:'white', 226 | fontSize:11, 227 | marginTop:10, 228 | }, 229 | pointsNumStyle:{ 230 | 231 | backgroundColor:'rgba(255,255,255,0)', 232 | color:'yellow', 233 | fontSize:19, 234 | fontWeight:'600', 235 | }, 236 | 237 | pointsLineStyle:{ 238 | backgroundColor:'yellow', 239 | height:1, 240 | width:200, 241 | 242 | }, 243 | 244 | waveImageStyle:{ 245 | 246 | width:Device.ScreenWidth, 247 | height:40, 248 | position:'absolute', 249 | bottom:0, 250 | left:0, 251 | }, 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | }) -------------------------------------------------------------------------------- /App/Views/Product/IndividualChoice.js: -------------------------------------------------------------------------------- 1 | 2 | //个性选择 3 | 4 | import React, { Component ,PropTypes} from 'react'; 5 | import { 6 | StyleSheet, 7 | View, 8 | Image, 9 | Platform, 10 | Dimensions, 11 | Text, 12 | Animated, 13 | Easing, 14 | TouchableOpacity, 15 | ScrollView, 16 | } from 'react-native'; 17 | import { BlurView} from 'react-native-blur'; 18 | import FilterTagDataBase from '../../Components/Constant/FilterTagDataBase'; 19 | 20 | 21 | 22 | const {width, height} = Dimensions.get('window'); 23 | 24 | const [left, top] = [0, Platform.OS === 'ios'?(64+45):(50+45)]; 25 | 26 | 27 | const [cellWidth,cellHeight] = [72,23]; 28 | 29 | const marginRight = ((width-30)- cellWidth*4)/3.0; 30 | 31 | const identityArray = [{value:'上班族',id:2},{value:'学生党',id:1},{value:'生意人',id:3},{value:'自由职业',id:4}]; 32 | 33 | export default class IndividualChoice extends Component { 34 | 35 | // 36 | // static propTypes = { 37 | // 38 | // pickViewArray:PropTypes.array.isRequired, 39 | // } 40 | 41 | constructor(props) { 42 | super(props); 43 | this.state = { 44 | offset: new Animated.Value(0), 45 | opacity: new Animated.Value(0), 46 | hide: true, 47 | filterArray: [], 48 | Height:0, 49 | }; 50 | 51 | 52 | console.log(width); 53 | 54 | this.callback = function () {};//回调方法 55 | FilterTagDataBase.GetFilterTagArray().then((date)=>{ 56 | 57 | this.filterArray = date; 58 | console.log(date); 59 | 60 | }); 61 | } 62 | 63 | componentWillUnMount(){ 64 | this.timer && clearTimeout(this.timer); 65 | } 66 | 67 | // componentDidMount() { 68 | // // this.in() 69 | // } 70 | 71 | render() { 72 | if(this.state.hide){ 73 | return () 74 | } else { 75 | return ( 76 | 77 | 78 | 79 | {this._backView()} 80 | 81 | 82 | 83 | this.layout(e)} style={[styles.tip , {transform: [{ 84 | translateY: this.state.offset.interpolate({ 85 | inputRange: [0, 1], 86 | outputRange: [-height,0] 87 | }), 88 | }] 89 | }] 90 | }> 91 | 92 | 93 | 94 | 95 | {this._filterView('我是',identityArray)} 96 | 97 | {this._filterView('我需要',this.filterArray.loan_need_lists)} 98 | 99 | {this._filterView('我有',this.filterArray.loan_has_lists)} 100 | 101 | 102 | { 104 | this.out() 105 | }} 106 | > 107 | 重置 108 | 109 | 110 | { 112 | this.out() 113 | }} 114 | > 115 | 确定 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | ); 127 | } 128 | } 129 | 130 | componentDidMount() { 131 | } 132 | 133 | layout(e){ 134 | this.setState({ 135 | 136 | Height:e.layout.height, 137 | }) 138 | } 139 | 140 | 141 | _backView(){ 142 | 143 | if (Platform.OS === 'ios') { 144 | return ( 145 | 146 | 150 | 151 | { 152 | 153 | this.out() 154 | }} > 155 | 156 | 157 | ) 158 | 159 | } else { 160 | 161 | return ( 162 | 163 | 164 | { 165 | 166 | this.out() 167 | }} > 168 | 169 | 170 | ) 171 | } 172 | } 173 | 174 | //显示动画 175 | startAnimation() { 176 | 177 | this.setState({ 178 | hide:false, 179 | }) 180 | 181 | Animated.parallel([ 182 | Animated.timing( 183 | this.state.opacity, 184 | { 185 | easing: Easing.linear, 186 | duration: 500, 187 | toValue: 1, 188 | } 189 | ), 190 | Animated.timing( 191 | this.state.offset, 192 | { 193 | easing: Easing.linear, 194 | duration: 500, 195 | toValue: 1, 196 | } 197 | ) 198 | ]).start(); 199 | } 200 | 201 | //隐藏动画 202 | out(){ 203 | Animated.parallel([ 204 | Animated.timing( 205 | this.state.opacity, 206 | { 207 | easing: Easing.linear, 208 | duration: 500, 209 | toValue: 0, 210 | } 211 | ), 212 | Animated.timing( 213 | this.state.offset, 214 | { 215 | easing: Easing.linear, 216 | duration: 500, 217 | toValue: 0, 218 | } 219 | ) 220 | ]).start(); 221 | 222 | this.timer = setTimeout( 223 | () => this.setState({hide: true}), 224 | 500 225 | ); 226 | } 227 | 228 | // 229 | _filterView(title,array){ 230 | 231 | let fiterBtnArray = []; 232 | 233 | fiterBtnArray.push( 234 | 235 | {title} 236 | 237 | 238 | ); 239 | 240 | let i = -1; 241 | fiterBtnArray.push( 242 | 243 | 244 | { 245 | 246 | 247 | array.map((item=>{ 248 | return ( {item.value}) 249 | })) 250 | } 251 | 252 | 253 | 254 | 255 | 256 | ); 257 | 258 | return fiterBtnArray; 259 | } 260 | 261 | } 262 | 263 | const styles = StyleSheet.create({ 264 | container: { 265 | position:"absolute", 266 | width:width, 267 | height:height, 268 | left:left, 269 | top:top, 270 | overflow:'hidden', 271 | }, 272 | mask: { 273 | justifyContent:"center", 274 | position:"absolute", 275 | width:width, 276 | height:height, 277 | left:left, 278 | top:0, 279 | }, 280 | tip: { 281 | width:width, 282 | backgroundColor:'white', 283 | }, 284 | 285 | filterViewStyle:{ 286 | flexDirection:'row', 287 | alignItems:"center", 288 | flexWrap:'wrap', 289 | }, 290 | filterCellTitleStyle:{ 291 | 292 | color:'#4d4d4d', 293 | fontSize:16, 294 | marginTop:15, 295 | marginLeft:15, 296 | 297 | }, 298 | filterCellLineStyle:{ 299 | marginTop:15, 300 | width:width, 301 | height:1, 302 | backgroundColor:'#F0F0F0', 303 | }, 304 | filterCellStyle:{ 305 | 306 | height:cellHeight, 307 | width:cellWidth, 308 | backgroundColor:'#FFFFFF', 309 | color:'#62B3D3', 310 | borderWidth:1, 311 | borderColor:'#99E2FE', 312 | lineHeight:cellHeight-2, 313 | textAlign:'center', 314 | fontSize:13, 315 | borderRadius:cellHeight/2.0, 316 | marginTop:15, 317 | 318 | }, 319 | 320 | filterBottomStyle:{ 321 | 322 | flexDirection:'row', 323 | alignItems:"center", 324 | justifyContent:'space-between', 325 | width:width-100, 326 | marginLeft:50, 327 | marginBottom:20, 328 | 329 | 330 | }, 331 | 332 | filterButtonStyle:{ 333 | width:116, 334 | height:36, 335 | borderRadius:5, 336 | flexDirection:'row', 337 | alignItems:"center", 338 | justifyContent:'center', 339 | 340 | }, 341 | backViewStyle:{ 342 | position: 'absolute', 343 | left: 0, 344 | right: 0, 345 | top: 0, 346 | bottom: 0, 347 | } 348 | 349 | 350 | 351 | }); 352 | -------------------------------------------------------------------------------- /App/Views/Product/ProductListCell.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by zhanming on 2017/7/5. 3 | */ 4 | 5 | 6 | import React, { Component,PropTypes } from 'react'; 7 | import { 8 | StyleSheet, 9 | View, 10 | TouchableOpacity, 11 | Image, 12 | Text, 13 | } from 'react-native'; 14 | 15 | import {observer} from 'mobx-react/native'; 16 | 17 | import TagView from '../../Components/View/TagView' 18 | 19 | import StarView from '../../Components/View/StarView'; 20 | 21 | import * as Device from '../../Components/Constant/Device'; 22 | 23 | const labelSource = [require('../../assets/product_top1.png'),require('../../assets/product_top2.png'),require('../../assets/product_top3.png'),require('../../assets/product_top4.png'),require('../../assets/product_top5.png'),require('../../assets/product_jian.png')] 24 | 25 | 26 | export default class ProductListCell extends Component{ 27 | 28 | static propTypes ={ 29 | 30 | onSelect:PropTypes.func, 31 | } 32 | 33 | 34 | constructor(props) { 35 | super(props) 36 | 37 | 38 | console.log(this.props.productModel); 39 | } 40 | 41 | render(){ 42 | 43 | return ({this.props.onSelect(this.props.productModel.platform_product_id)}}> 45 | 46 | 47 | 48 | 50 | 51 | 52 | {this._labelView()} 53 | 54 | 55 | 56 | 57 | 58 | 60 | 61 | 62 | 63 | 64 | {this.props.productModel.platform_product_name} 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | {this.props.productModel.success_count}人已申请 79 | 80 | 81 | 82 | 83 | {this.props.productModel.product_introduct} 84 | 85 | 86 | 87 | ) 88 | } 89 | 90 | _labelView(){ 91 | 92 | 93 | if(this.props.rowID<20){ 94 | 95 | return() 96 | 97 | } 98 | 99 | 100 | } 101 | 102 | } 103 | 104 | const styles = StyleSheet.create({ 105 | 106 | backImageStyle: { 107 | position:'absolute', 108 | top:10, 109 | width:Device.ScreenWidth-20, 110 | left:10, 111 | height:90 112 | }, 113 | cellStyle: { 114 | height:100, 115 | width:Device.ScreenWidth, 116 | 117 | backgroundColor:'#F5F5F5', 118 | }, 119 | topViewStyle: { 120 | height: 65, 121 | marginLeft: 10, 122 | marginRight: 10, 123 | marginTop: 14, 124 | // backgroundColor: 'red', 125 | flexDirection:'row', 126 | alignItems:'center', 127 | }, 128 | topLeftViewStyle:{ 129 | height:50, 130 | width:50, 131 | marginLeft:10, 132 | }, 133 | topRightViewStyle:{ 134 | 135 | marginTop:5, 136 | height:55, 137 | flexDirection:'column', 138 | 139 | justifyContent:'space-between', 140 | 141 | marginLeft:13, 142 | 143 | }, 144 | tagFatherViewStyle:{ 145 | flexDirection:'row', 146 | alignItems:'center', 147 | }, 148 | tagViewStyle:{ 149 | borderWidth:1, 150 | width:50, 151 | height:15, 152 | borderRadius:10, 153 | flexDirection:'row', 154 | alignItems:'center', 155 | justifyContent:'center', 156 | marginRight:4, 157 | }, 158 | 159 | labelStyle:{ 160 | position:'absolute', 161 | top:10, 162 | right:10, 163 | height:36, 164 | width:43, 165 | }, 166 | successCountStyle:{ 167 | 168 | position:'absolute', 169 | top:23, 170 | right:10, 171 | fontSize:10, 172 | color:'#4d4d4d', 173 | backgroundColor:'rgba(255,255,255,0)', 174 | 175 | }, 176 | lineStyle:{ 177 | 178 | width:Device.ScreenWidth - 40, 179 | marginLeft:20, 180 | height:1, 181 | marginTop:4, 182 | backgroundColor:'#f5f5f5', 183 | }, 184 | productIntroductStyle:{ 185 | 186 | marginLeft:25, 187 | marginTop:2, 188 | fontSize:10, 189 | color:'#4d4d4d', 190 | backgroundColor:'rgba(255,255,255,0)', 191 | 192 | } 193 | 194 | }) 195 | 196 | -------------------------------------------------------------------------------- /App/Views/Product/index.js: -------------------------------------------------------------------------------- 1 | 2 | import React, { Component,PropTypes } from 'react'; 3 | import { 4 | StyleSheet, 5 | View, 6 | TouchableOpacity, 7 | Image, 8 | Text, 9 | ListView, 10 | RefreshControl, 11 | PanResponder, 12 | Animated, 13 | } from 'react-native'; 14 | 15 | import {observer} from 'mobx-react/native'; 16 | import * as Device from '../../Components/Constant/Device'; 17 | import SDNavigationBar from '../../Components/Navigator/SDNavigationBar'; 18 | import SDHttpRequest from '../../Network'; 19 | import Toast, {DURATION} from 'react-native-easy-toast'; 20 | import ProductListCell from './ProductListCell'; 21 | 22 | // import { BlurView } from 'react-native-blur'; 23 | import ProductDetails from '../ProductDetails'; 24 | 25 | import IndividualChoice from './IndividualChoice'; 26 | 27 | import PickerView from '../Home/PickerView'; 28 | 29 | @observer 30 | export default class Product extends Component{ 31 | 32 | constructor(props){ 33 | super(props); 34 | //产品类型 35 | this.productType = 1; 36 | //身份 37 | this.indent = 0; 38 | // 借款金额 39 | this.loanMoney = 1000; 40 | //页码 41 | this.pageSize = 1; 42 | 43 | this.pageCount = 0; 44 | //每页显示条数 45 | this.pageNum = 10; 46 | //我需要 47 | this.loanNeed =[]; 48 | //我有 49 | this.loanHas = []; 50 | //地域id 51 | this.areaId = 0; 52 | 53 | this.productList = []; 54 | 55 | this.state = { 56 | 57 | dataSource:new ListView.DataSource({rowHasChanged:(r1,r2)=>{return r1 !== r2}}), 58 | isLoaded:false, 59 | isLoadAll:false, 60 | isRefreshing:true, 61 | trans: new Animated.ValueXY(), 62 | bottom:80, 63 | right:30, 64 | }; 65 | 66 | } 67 | 68 | componentDidMount(){ 69 | 70 | this._loadData(); 71 | 72 | } 73 | 74 | render(){ 75 | 76 | return( 77 | 78 | {this.backgroundImage = view}} > 79 | 80 | 81 | 82 | 83 | {this._selectView()} 84 | 85 | 86 | 87 | 88 | 89 | 101 | } 102 | dataSource={this.state.dataSource} 103 | renderFooter={this._renderFooter.bind(this)} 104 | onEndReached={this._loadMoreDate.bind(this)} 105 | onEndReachedThreshold={100} 106 | renderRow={(rowData,sectionID,rowID,)=>{return }} 108 | 109 | > 110 | 111 | 112 | {this.IndividualChoice = name}}/> 113 | {this.moneyChoice = name}} pickViewArray={['金额不限','500元','1000元','1500元','2000元','3000元','4000元','5000元','6000元','7000元','9000元','10000元','150000元','20000元','30000元','50000元','10万元','20万元']} /> 114 | this.infoSHow = toast)}/> 115 | 116 | 117 | 118 | ) 119 | } 120 | 121 | _selectView(){ 122 | 123 | return( 124 | 125 | 126 | 127 | { 129 | 130 | this.moneyChoice.startAnimation(); 131 | }} 132 | > 133 | 金额不限 134 | 136 | 137 | 138 | 139 | { 140 | 141 | 142 | 143 | this.IndividualChoice.startAnimation(); 144 | 145 | }} > 146 | 个性选择 147 | 149 | 150 | 151 | 152 | 153 | ) 154 | } 155 | 156 | 157 | _loadData() { 158 | 159 | this.productList = []; 160 | 161 | this.pageSize = 1; 162 | 163 | this.pageCount = 0; 164 | 165 | SDHttpRequest.GET('v1/product/lists', { 166 | productType: this.productType, 167 | indent: this.indent, 168 | loanMoney: this.loanMoney, 169 | pageSize: this.pageSize, 170 | pageNum: this.pageNum, 171 | loanNeed: this.loanNeed, 172 | loanHas: this.loanHas, 173 | areaId: this.areaId 174 | }).then((data) => { 175 | 176 | this.productList = data.list; 177 | 178 | this.pageCount = data.pageCount; 179 | 180 | this.setState({ 181 | dataSource: this.state.dataSource.cloneWithRows(this.productList), 182 | isLoaded: true, 183 | isRefreshing:false, 184 | }) 185 | 186 | }, (error => { 187 | this.infoSHow.show(error); 188 | })).catch(error => { 189 | this.infoSHow.show(error); 190 | }) 191 | 192 | } 193 | _loadMoreDate(){ 194 | 195 | if(this.pageCount == this.pageSize){ 196 | 197 | this.setState({ 198 | isLoadAll:true, 199 | }) 200 | 201 | return; 202 | } 203 | this.pageSize++; 204 | 205 | SDHttpRequest.GET('v1/product/lists',{productType:this.productType,indent:this.indent,loanMoney:this.loanMoney,pageSize:this.pageSize,pageNum:this.pageNum,loanNeed:this.loanNeed,loanHas:this.loanHas,areaId:this.areaId}).then((data) => { 206 | 207 | this.productList = this.productList.concat(data.list); 208 | this.pageCount = data.pageCount; 209 | this.setState({ 210 | dataSource: this.state.dataSource.cloneWithRows(this.productList), 211 | isLoaded:true, 212 | }) 213 | 214 | },(error =>{ 215 | this.infoSHow.show(error); 216 | })).catch(error =>{ 217 | this.infoSHow.show(error); 218 | }) 219 | 220 | } 221 | 222 | _renderFooter(){ 223 | 224 | 225 | if(this.state.isLoaded && !this.state.isLoadAll){//加载完毕 226 | 227 | return ( 228 | 229 | 230 | 正在加载... 231 | 232 | ); 233 | }else if(this.state.isLoaded && this.state.isLoadAll){ 234 | 235 | return ( 236 | 237 | 加载完毕 238 | 239 | ) 240 | }else { 241 | return () 242 | } 243 | } 244 | 245 | _pushDetail(productID) { 246 | 247 | this.props.navigator.push({ 248 | component: ProductDetails, 249 | params: { 250 | ...this.props, 251 | productID: productID, 252 | } 253 | }) 254 | } 255 | } 256 | 257 | const styles = StyleSheet.create({ 258 | 259 | bottomView:{ 260 | height:10, 261 | width:Device.ScreenWidth, 262 | backgroundColor:'#F7F7F7', 263 | position:'absolute', 264 | left:0, 265 | bottom:0, 266 | }, 267 | selectViewStyle:{ 268 | 269 | flexDirection:'row', 270 | alignItems:'stretch', 271 | // justifyContent:'center', 272 | width:Device.ScreenWidth, 273 | height:45, 274 | borderBottomColor:'#EAEAEA', 275 | borderBottomWidth:1, 276 | 277 | }, 278 | 279 | selectIemViewStyle:{ 280 | 281 | backgroundColor:'white', 282 | flexDirection:'row', 283 | alignItems:'center', 284 | justifyContent:'center', 285 | flex:1, 286 | }, 287 | centerLineStyle:{ 288 | width:0.5, 289 | height:40, 290 | backgroundColor:'#EAEAEA', 291 | position:'absolute', 292 | left:Device.ScreenWidth/2.0, 293 | top:2.5, 294 | } 295 | 296 | 297 | 298 | }) 299 | -------------------------------------------------------------------------------- /App/Views/ProductDetails/index.js: -------------------------------------------------------------------------------- 1 | 2 | import React, { Component,PropTypes } from 'react'; 3 | import { 4 | StyleSheet, 5 | View, 6 | ScrollView, 7 | TouchableOpacity, 8 | Image, 9 | Text, 10 | ListView, 11 | RefreshControl, 12 | PanResponder, 13 | } from 'react-native'; 14 | 15 | import {observer} from 'mobx-react/native'; 16 | import * as Device from '../../Components/Constant/Device'; 17 | import SDNavigationBar from '../../Components/Navigator/SDNavigationBar'; 18 | import SDHttpRequest from '../../Network'; 19 | import TagView from '../../Components/View/TagView'; 20 | import BackPressComponent from '../../Components/Constant/BackPressComponent'; 21 | 22 | // import ScrollableTabView, {DefaultTabBar,ScrollableTabBar} from 'react-native-scrollable-tab-view'; 23 | 24 | @observer 25 | export default class ProductDetail extends Component{ 26 | 27 | 28 | static propTypes={ 29 | 30 | productID:PropTypes.number, 31 | } 32 | 33 | constructor(props) { 34 | super(props); 35 | 36 | this.state = { 37 | 38 | calculatorData:null, 39 | productDetail:null, 40 | applyCondition:null, 41 | 42 | }; 43 | 44 | this.backPress = new BackPressComponent({backPress:(e)=>{return this.onBackPress(e)}}); 45 | 46 | 47 | 48 | 49 | // this._panResponder = PanResponder.create({ 50 | // 51 | // 52 | // onStartShouldSetPanResponder: () => { 53 | // 54 | // return this.state.ranResponder; 55 | // 56 | // }, //响应手势 57 | // 58 | // onPanResponderGrant: () => { 59 | // this._top= this.state.top; 60 | // 61 | // 62 | // }, 63 | // onPanResponderMove: (evt, gs) => { 64 | // 65 | // 66 | // if(this.state.top<1 && gs.dy<0){ 67 | // 68 | // 69 | // this.setState({ 70 | // scrollY:-gs.dy, 71 | // }) 72 | // 73 | // 74 | // this.AScrollView.scrollTo({x:0, y:this.state.scrollY , animated: false}) 75 | // return; 76 | // } 77 | // 78 | // 79 | // console.log(gs.dy); 80 | // 81 | // this.setState({ 82 | // top: this._top + gs.dy, 83 | // }) 84 | // 85 | // // if(this.state.top<=0){ 86 | // // 87 | // // this.setState({ 88 | // // top:0, 89 | // // // ranResponder:false, 90 | // // // scrollEnabled:true, 91 | // // }) 92 | // // } 93 | // 94 | // // if(this.state.top<=0){ 95 | // // 96 | // // this.setState({ 97 | // // top:0, 98 | // // ranResponder:false, 99 | // // scrollEnabled:true, 100 | // // 101 | // // }) 102 | // // } 103 | // // if(this.state.top>200){ 104 | // // 105 | // // this.setState({ 106 | // // top:200, 107 | // // ranResponder:false, 108 | // // }) 109 | // // } 110 | // }, 111 | // onPanResponderRelease: (evt, gs) => {//手松开,回到原始位置 112 | // 113 | // 114 | // console.log(gs.dy); 115 | // 116 | // if(this.state.top<1 && gs.dy<0){ 117 | // 118 | // return; 119 | // } 120 | // 121 | // 122 | // 123 | // this.setState({ 124 | // top: this._top + gs.dy, 125 | // }) 126 | // // 127 | // 128 | // 129 | // // if(this.state.top<=0){ 130 | // // 131 | // // this.setState({ 132 | // // top:0, 133 | // // // ranResponder:false, 134 | // // // scrollEnabled:true, 135 | // // }) 136 | // // } 137 | // // if(this.state.top>200){ 138 | // // 139 | // // this.setState({ 140 | // // top:200, 141 | // // ranResponder:false, 142 | // // }) 143 | // // } 144 | // } 145 | // }) 146 | } 147 | 148 | 149 | componentDidMount(){ 150 | 151 | this.backPress.componentDidMount(); 152 | 153 | 154 | // SDHttpRequest.GET('v2/product/calculator',{productId:this.props.productID}).then((data) => { 155 | // 156 | // console.log(data); 157 | // 158 | // this.setState({ 159 | // 160 | // calculatorData:data, 161 | // }) 162 | // 163 | // },(error =>{ 164 | // this.infoSHow.show(error); 165 | // })).catch(error =>{ 166 | // this.infoSHow.show(error); 167 | // }); 168 | // 169 | // SDHttpRequest.GET('v2/product/detail',{productId:this.props.productID}).then((data) => { 170 | // 171 | // console.log(data); 172 | // 173 | // this.setState({ 174 | // 175 | // productDetail:data, 176 | // }) 177 | // 178 | // },(error =>{ 179 | // this.infoSHow.show(error); 180 | // })).catch(error =>{ 181 | // this.infoSHow.show(error); 182 | // }) 183 | 184 | 185 | Promise.all([SDHttpRequest.GET('v2/product/calculator',{productId:this.props.productID}),SDHttpRequest.GET('v2/product/detail',{productId:this.props.productID}),SDHttpRequest.GET('v2/product/particular',{productId:this.props.productID})]).then( (datas) => { 186 | 187 | this.setState({ 188 | 189 | calculatorData:datas[0], 190 | productDetail:datas[1], 191 | applyCondition:datas[2], 192 | }); 193 | 194 | console.log(datas[2]); 195 | 196 | 197 | }).catch(function(reason){ 198 | // ... 199 | }); 200 | 201 | } 202 | 203 | onBackPress(e){ 204 | 205 | console.log('3'); 206 | 207 | this.props.navigator.pop(); 208 | return true; 209 | 210 | } 211 | 212 | componentWillUpdate(){ 213 | 214 | } 215 | render(){ 216 | 217 | return( 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | {this._calculatorView()} 226 | {this._productInfoView()} 227 | {this._bannerImageView()} 228 | {this._applyConditionView()} 229 | {this._applyProcess()} 230 | {this._loanDetailView()} 231 | {this._newGuideView()} 232 | {this._productIntroductView()} 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | ) 243 | } 244 | 245 | //借款利率计算View / Loan Interest Rate View 246 | _calculatorView() { 247 | 248 | if (this.state.calculatorData == null) { 249 | return 250 | } else { 251 | 252 | return ( 253 | 254 | 255 | 256 | {this.state.calculatorData.interest_alg} 257 | {this.state.calculatorData.method} 258 | 平均额度 259 | 260 | 261 | 262 | {this.state.calculatorData.interest_rate}% 264 | 请选择金额/期限 265 | {this.state.calculatorData.avg_quota} 267 | 268 | 269 | 270 | 275 | 277 | {this.state.calculatorData.loan_min}~{this.state.calculatorData.loan_max} 279 | 280 | 285 | 287 | {this.state.calculatorData.period_min}~{this.state.calculatorData.period_max} 289 | 290 | 291 | 292 | 293 | 294 | 295 | ) 296 | } 297 | 298 | } 299 | 300 | _cellTitleView(title){ 301 | return( 302 | 303 | 304 | {title} 305 | 306 | ) 307 | } 308 | 309 | _productInfoView() { 310 | 311 | if (this.state.productDetail == null) { 312 | return 313 | } else { 314 | 315 | return ( 316 | 317 | 318 | 319 | 320 | 321 | {this.state.productDetail.platform_product_name} 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 产品人气: 332 | 334 | {this.state.productDetail.success_num} 335 | {this.state.productDetail.success_count}人申请 336 | 337 | 338 | 339 | 放款速度: 340 | 342 | {this.state.productDetail.fast_num} 343 | 平均{this.state.productDetail.fast_time} 344 | 345 | 346 | 下款概率: 347 | 349 | {this.state.productDetail.pass_num} 350 | 通过率{this.state.productDetail.pass_rate} 351 | 352 | 353 | 354 | ) 355 | } 356 | 357 | } 358 | //广告图片的View / Advertising Picture View 359 | _bannerImageView() { 360 | 361 | if ((this.state.productDetail == null) || (this.state.productDetail.banner_img.length == 0)) { 362 | return 363 | } else { 364 | 365 | return ( 366 | 367 | 368 | 369 | 370 | 371 | ) 372 | } 373 | } 374 | 375 | //申请条件 / Apply Condition 376 | _applyConditionView(){ 377 | 378 | if (this.state.applyCondition == null) { 379 | return 380 | } else { 381 | 382 | return ( 383 | 384 | 385 | {this._cellTitleView('申请条件&要点')} 386 | 387 | {this.state.applyCondition.apply_condition.replace(/
/g,'\n')}
388 | 389 |
390 | ) 391 | } 392 | } 393 | 394 | //申请流程 / Apply Process 395 | 396 | _applyProcess(){ 397 | if (this.state.applyCondition == null) { 398 | return 399 | } else { 400 | 401 | return ( 402 | 403 | 404 | {this._cellTitleView('流程&材料')} 405 | 406 | 407 | { 408 | this._applyProcessCell( this.state.applyCondition.process) 409 | } 410 | 411 | 412 | ) 413 | } 414 | 415 | } 416 | 417 | // 418 | _applyProcessCell(array){ 419 | 420 | let cells = []; 421 | 422 | for(let i = 0 ;i 428 | 429 | 430 | { 431 | i== (this.state.applyCondition.process.length-1)?: 433 | 434 | } 435 | 436 | 437 | 438 | 439 | {item.name} 440 | 441 | 442 | 443 | ) 444 | } 445 | 446 | return cells; 447 | } 448 | 449 | 450 | // 借款详情 / Loan Detail 451 | _loanDetailView(){ 452 | 453 | if (this.state.applyCondition == null) { 454 | return 455 | } else { 456 | 457 | return ( 458 | 459 | 460 | {this._cellTitleView('借款审核细节')} 461 | {this._loanDetailArray(this.state.applyCondition.loan_detail)} 462 | 463 | ) 464 | } 465 | 466 | } 467 | 468 | _loanDetailArray(detailModelArray 469 | ){ 470 | 471 | let detailArray = []; 472 | 473 | for(let i = 0;i 480 | {detailModel.title}: 481 | {detailModel.content.replace(/
/g,'\n')}
482 |
483 | ) 484 | } 485 | return detailArray; 486 | } 487 | // 新手指导 / New guidance 488 | _newGuideView(){ 489 | 490 | if (this.state.applyCondition == null) { 491 | return 492 | } else { 493 | 494 | return ( 495 | 496 | 497 | 498 | {this._cellTitleView('新手指导')} 499 | 500 | {this.state.applyCondition.guide.replace(/
/g,'\n')}
501 | 502 |
503 | ) 504 | } 505 | } 506 | // 产品介绍 / Product Introduct 507 | _productIntroductView(){ 508 | 509 | if (this.state.applyCondition == null) { 510 | return 511 | } else { 512 | 513 | return ( 514 | 515 | 516 | {this._cellTitleView('产品优势')} 517 | {this.state.applyCondition.product_introduct} 518 | 519 | 520 | ) 521 | } 522 | } 523 | 524 | componentWillMount() { 525 | this.backPress.componentWillUnmount(); 526 | } 527 | 528 | 529 | 530 | 531 | 532 | 533 | // _scrollViewTop(){ 534 | // 535 | // this.AScrollView.scrollTo(0,0,false); 536 | // } 537 | 538 | 539 | 540 | 541 | // _loadMoreDate(){ 542 | // 543 | // if(this.pageCount == this.pageSize){ 544 | // 545 | // this.setState({ 546 | // isLoadAll:true, 547 | // }) 548 | // 549 | // return; 550 | // } 551 | // this.pageSize++; 552 | // 553 | // SDHttpRequest.GET('v1/product/lists',{productType:this.productType,indent:this.indent,loanMoney:this.loanMoney,pageSize:this.pageSize,pageNum:this.pageNum,loanNeed:this.loanNeed,loanHas:this.loanHas,areaId:this.areaId}).then((data) => { 554 | // 555 | // this.productList = this.productList.concat(data.list); 556 | // this.pageCount = data.pageCount; 557 | // this.setState({ 558 | // dataSource: this.state.dataSource.cloneWithRows(this.productList), 559 | // isLoaded:true, 560 | // }) 561 | // 562 | // },(error =>{ 563 | // this.infoSHow.show(error); 564 | // })).catch(error =>{ 565 | // this.infoSHow.show(error); 566 | // }) 567 | // 568 | // } 569 | 570 | 571 | } 572 | 573 | const styles = StyleSheet.create({ 574 | 575 | topBackgroundImageStyle:{ 576 | 577 | width:Device.ScreenWidth, 578 | height:150, 579 | position:'absolute', 580 | top:0, 581 | left:0, 582 | }, 583 | calculatorViewStyle:{ 584 | 585 | flexDirection:'row', 586 | alignItems:'center', 587 | justifyContent:'space-between', 588 | 589 | width:Device.ScreenWidth - 40, 590 | marginLeft:20, 591 | }, 592 | 593 | calculatorTitleStyle:{ 594 | backgroundColor:'rgba(255, 255, 255,0)', 595 | color:'white', 596 | fontSize:13, 597 | 598 | }, 599 | 600 | calculatorSelectStyle:{ 601 | 602 | width:(Device.ScreenWidth - 40)/2.0-1, 603 | height:45, 604 | }, 605 | 606 | productInfoStyle:{ 607 | 608 | 609 | width:Device.ScreenWidth - 30, 610 | backgroundColor:'rgba(255, 255, 255,1)', 611 | 612 | marginTop:23, 613 | marginLeft:15, 614 | }, 615 | 616 | productImageStyle:{ 617 | width:45, 618 | height:45, 619 | position:'absolute', 620 | left:10, 621 | top:-15, 622 | backgroundColor:'rgba(255, 255, 255,0)', 623 | }, 624 | gradualView:{ 625 | flexDirection:'column', 626 | alignItems:'flex-start', 627 | justifyContent:'space-between', 628 | marginLeft:12, 629 | marginTop:10, 630 | height:65, 631 | marginBottom:10, 632 | 633 | }, 634 | gradualCellView:{ 635 | flexDirection:'row', 636 | alignItems:'center', 637 | justifyContent:'flex-start', 638 | }, 639 | degreeText:{ 640 | 641 | position:'absolute', 642 | fontStyle:'italic', 643 | left:143, 644 | fontSize:11, 645 | color:'#999999', 646 | backgroundColor:'rgba(255,255,255,0)' 647 | 648 | }, 649 | gradualCellInfo:{ 650 | position:'absolute', 651 | left:182, 652 | fontSize:10, 653 | color:'#999999', 654 | }, 655 | //广告图片的Style / Advertising picture Style 656 | bannerImageStyle:{ 657 | // flexDirection:'row', 658 | // alignItems:'center', 659 | // justifyContent:'center', 660 | marginLeft:15, 661 | marginTop:10, 662 | backgroundColor:'rgba(255, 255, 255,1)', 663 | width:Device.ScreenWidth - 30, 664 | }, 665 | applyConditionStyle:{ 666 | 667 | 668 | }, 669 | cellTitleView:{ 670 | flexDirection:'row', 671 | alignItems:'center', 672 | justifyContent:'flex-start', 673 | marginTop:10, 674 | }, 675 | cellTitleImageView:{ 676 | 677 | width:9, 678 | height:9, 679 | marginLeft:5, 680 | }, 681 | cellTitleTextView:{ 682 | 683 | color:'#303030', 684 | fontSize:14, 685 | marginLeft:5, 686 | }, 687 | 688 | cellTextStyle:{ 689 | color:'#4c4c4c', 690 | fontSize:13, 691 | 692 | } 693 | 694 | 695 | 696 | 697 | 698 | 699 | 700 | 701 | }) 702 | 703 | -------------------------------------------------------------------------------- /App/assets/ wave.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/ wave.png -------------------------------------------------------------------------------- /App/assets/ wave3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/ wave3x.png -------------------------------------------------------------------------------- /App/assets/ wave@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/ wave@2x.png -------------------------------------------------------------------------------- /App/assets/arrows.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/arrows.png -------------------------------------------------------------------------------- /App/assets/arrows@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/arrows@2x.png -------------------------------------------------------------------------------- /App/assets/arrows@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/arrows@3x.png -------------------------------------------------------------------------------- /App/assets/attention.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/attention.png -------------------------------------------------------------------------------- /App/assets/attention@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/attention@2x.png -------------------------------------------------------------------------------- /App/assets/attention@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/attention@3x.png -------------------------------------------------------------------------------- /App/assets/back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/back.png -------------------------------------------------------------------------------- /App/assets/back@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/back@2x.png -------------------------------------------------------------------------------- /App/assets/back@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/back@3x.png -------------------------------------------------------------------------------- /App/assets/collect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/collect.png -------------------------------------------------------------------------------- /App/assets/collect@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/collect@2x.png -------------------------------------------------------------------------------- /App/assets/collect@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/collect@3x.png -------------------------------------------------------------------------------- /App/assets/credit _information.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/credit _information.png -------------------------------------------------------------------------------- /App/assets/credit _information@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/credit _information@2x.png -------------------------------------------------------------------------------- /App/assets/credit _information@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/credit _information@3x.png -------------------------------------------------------------------------------- /App/assets/gift.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/gift.png -------------------------------------------------------------------------------- /App/assets/gift@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/gift@2x.png -------------------------------------------------------------------------------- /App/assets/gift@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/gift@3x.png -------------------------------------------------------------------------------- /App/assets/grayStar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/grayStar.png -------------------------------------------------------------------------------- /App/assets/grayStar@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/grayStar@2x.png -------------------------------------------------------------------------------- /App/assets/grayStar@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/grayStar@3x.png -------------------------------------------------------------------------------- /App/assets/halfStar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/halfStar.png -------------------------------------------------------------------------------- /App/assets/halfStar@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/halfStar@2x.png -------------------------------------------------------------------------------- /App/assets/halfStar@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/halfStar@3x.png -------------------------------------------------------------------------------- /App/assets/help.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/help.png -------------------------------------------------------------------------------- /App/assets/help@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/help@2x.png -------------------------------------------------------------------------------- /App/assets/help@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/help@3x.png -------------------------------------------------------------------------------- /App/assets/home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/home.png -------------------------------------------------------------------------------- /App/assets/home@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/home@2x.png -------------------------------------------------------------------------------- /App/assets/home@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/home@3x.png -------------------------------------------------------------------------------- /App/assets/homeBbs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/homeBbs.png -------------------------------------------------------------------------------- /App/assets/homeBbs@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/homeBbs@2x.png -------------------------------------------------------------------------------- /App/assets/homeBbs@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/homeBbs@3x.png -------------------------------------------------------------------------------- /App/assets/homeNewProductTime.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/homeNewProductTime.png -------------------------------------------------------------------------------- /App/assets/homeNewProductTime@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/homeNewProductTime@2x.png -------------------------------------------------------------------------------- /App/assets/homeNewProductTime@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/homeNewProductTime@3x.png -------------------------------------------------------------------------------- /App/assets/homeRemind.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/homeRemind.png -------------------------------------------------------------------------------- /App/assets/homeRemind@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/homeRemind@2x.png -------------------------------------------------------------------------------- /App/assets/homeRemind@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/homeRemind@3x.png -------------------------------------------------------------------------------- /App/assets/homeSearch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/homeSearch.png -------------------------------------------------------------------------------- /App/assets/homeSearch@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/homeSearch@2x.png -------------------------------------------------------------------------------- /App/assets/homeSearch@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/homeSearch@3x.png -------------------------------------------------------------------------------- /App/assets/homeSelect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/homeSelect.png -------------------------------------------------------------------------------- /App/assets/homeSelect@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/homeSelect@2x.png -------------------------------------------------------------------------------- /App/assets/homeSelect@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/homeSelect@3x.png -------------------------------------------------------------------------------- /App/assets/homeTotal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/homeTotal.png -------------------------------------------------------------------------------- /App/assets/homeTotal@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/homeTotal@2x.png -------------------------------------------------------------------------------- /App/assets/homeTotal@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/homeTotal@3x.png -------------------------------------------------------------------------------- /App/assets/home_guide.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/home_guide.png -------------------------------------------------------------------------------- /App/assets/home_guide@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/home_guide@2x.png -------------------------------------------------------------------------------- /App/assets/home_guide@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/home_guide@3x.png -------------------------------------------------------------------------------- /App/assets/home_new_product_time.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/home_new_product_time.png -------------------------------------------------------------------------------- /App/assets/home_new_product_time@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/home_new_product_time@2x.png -------------------------------------------------------------------------------- /App/assets/home_new_product_time@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/home_new_product_time@3x.png -------------------------------------------------------------------------------- /App/assets/identity.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/identity.png -------------------------------------------------------------------------------- /App/assets/identity@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/identity@2x.png -------------------------------------------------------------------------------- /App/assets/identity@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/identity@3x.png -------------------------------------------------------------------------------- /App/assets/me.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/me.png -------------------------------------------------------------------------------- /App/assets/me@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/me@2x.png -------------------------------------------------------------------------------- /App/assets/me@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/me@3x.png -------------------------------------------------------------------------------- /App/assets/me_select.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/me_select.png -------------------------------------------------------------------------------- /App/assets/me_select@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/me_select@2x.png -------------------------------------------------------------------------------- /App/assets/me_select@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/me_select@3x.png -------------------------------------------------------------------------------- /App/assets/navigationImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/navigationImage.png -------------------------------------------------------------------------------- /App/assets/navigationImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/navigationImage@2x.png -------------------------------------------------------------------------------- /App/assets/navigationImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/navigationImage@3x.png -------------------------------------------------------------------------------- /App/assets/process.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/process.png -------------------------------------------------------------------------------- /App/assets/process@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/process@2x.png -------------------------------------------------------------------------------- /App/assets/process@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/process@3x.png -------------------------------------------------------------------------------- /App/assets/productBackImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/productBackImage.png -------------------------------------------------------------------------------- /App/assets/productBackImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/productBackImage@2x.png -------------------------------------------------------------------------------- /App/assets/productBackImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/productBackImage@3x.png -------------------------------------------------------------------------------- /App/assets/product_jian.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/product_jian.png -------------------------------------------------------------------------------- /App/assets/product_jian@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/product_jian@2x.png -------------------------------------------------------------------------------- /App/assets/product_jian@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/product_jian@3x.png -------------------------------------------------------------------------------- /App/assets/product_selectButton_banckground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/product_selectButton_banckground.png -------------------------------------------------------------------------------- /App/assets/product_selectButton_banckground@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/product_selectButton_banckground@2x.png -------------------------------------------------------------------------------- /App/assets/product_selectButton_banckground@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/product_selectButton_banckground@3x.png -------------------------------------------------------------------------------- /App/assets/product_title_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/product_title_round.png -------------------------------------------------------------------------------- /App/assets/product_title_round@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/product_title_round@2x.png -------------------------------------------------------------------------------- /App/assets/product_title_round@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/product_title_round@3x.png -------------------------------------------------------------------------------- /App/assets/product_top1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/product_top1.png -------------------------------------------------------------------------------- /App/assets/product_top1@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/product_top1@2x.png -------------------------------------------------------------------------------- /App/assets/product_top1@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/product_top1@3x.png -------------------------------------------------------------------------------- /App/assets/product_top2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/product_top2.png -------------------------------------------------------------------------------- /App/assets/product_top2@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/product_top2@2x.png -------------------------------------------------------------------------------- /App/assets/product_top2@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/product_top2@3x.png -------------------------------------------------------------------------------- /App/assets/product_top3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/product_top3.png -------------------------------------------------------------------------------- /App/assets/product_top3@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/product_top3@2x.png -------------------------------------------------------------------------------- /App/assets/product_top3@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/product_top3@3x.png -------------------------------------------------------------------------------- /App/assets/product_top4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/product_top4.png -------------------------------------------------------------------------------- /App/assets/product_top4@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/product_top4@2x.png -------------------------------------------------------------------------------- /App/assets/product_top4@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/product_top4@3x.png -------------------------------------------------------------------------------- /App/assets/product_top5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/product_top5.png -------------------------------------------------------------------------------- /App/assets/product_top5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/product_top5@2x.png -------------------------------------------------------------------------------- /App/assets/product_top5@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/product_top5@3x.png -------------------------------------------------------------------------------- /App/assets/rate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/rate.png -------------------------------------------------------------------------------- /App/assets/rate@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/rate@2x.png -------------------------------------------------------------------------------- /App/assets/rate@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/rate@3x.png -------------------------------------------------------------------------------- /App/assets/setting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/setting.png -------------------------------------------------------------------------------- /App/assets/setting@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/setting@2x.png -------------------------------------------------------------------------------- /App/assets/setting@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/setting@3x.png -------------------------------------------------------------------------------- /App/assets/star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/star.png -------------------------------------------------------------------------------- /App/assets/star@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/star@2x.png -------------------------------------------------------------------------------- /App/assets/star@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/star@3x.png -------------------------------------------------------------------------------- /App/assets/sudai.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/sudai.png -------------------------------------------------------------------------------- /App/assets/sudai@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/sudai@2x.png -------------------------------------------------------------------------------- /App/assets/sudai@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/sudai@3x.png -------------------------------------------------------------------------------- /App/assets/supermarket.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/supermarket.png -------------------------------------------------------------------------------- /App/assets/supermarket@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/supermarket@2x.png -------------------------------------------------------------------------------- /App/assets/supermarket@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/supermarket@3x.png -------------------------------------------------------------------------------- /App/assets/supermarketSelect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/supermarketSelect.png -------------------------------------------------------------------------------- /App/assets/supermarketSelect@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/supermarketSelect@2x.png -------------------------------------------------------------------------------- /App/assets/supermarketSelect@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/App/assets/supermarketSelect@3x.png -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 zhanming0601 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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # **react-native-app** 2 | 3 | 4 | ## Introduce 5 | 6 | 7 | [App](https://github.com/zhanming0601/react-native-app) written in react-native. 8 | Completed the basic function of the original project,use the MobX in the project. 9 | [MobX](https://mobxjs.github.io/mobx/) : Simple, scalable state management (easier than Redux) 10 | MobX library is a state of precise management tool, it is very easy for me to learn and accept. 11 | 12 | 13 | ## Requirements 14 | 15 | [React Native](http://facebook.github.io/react-native/docs/getting-started.html) 0.44.0 16 |  (follow iOS and Android guides) 17 | 18 | 19 | ## Dependencies 20 | 21 | 1. [mobx](https://github.com/mobxjs/mobx) 22 | 2. [mobx-react](https://github.com/mobxjs/mobx-react) 23 | 3. [react-native-swiper](https://github.com/leecade/react-native-swiper) 24 | 4. [react-native-easy-toast](https://github.com/crazycodeboy/react-native-easy-toast) 25 | 5. [react-native-scrollable-tab-view](https://github.com/skv-headless/react-native-scrollable-tab-view) 26 | 6. [react-native-tab-navigator](https://github.com/happypancake/react-native-tab-navigator) 27 | 7. [react-native-picker](https://github.com/beefe/react-native-picker) 28 | 8. [react-native-blur](https://github.com/react-native-community/react-native-blur) 29 | 30 | ## Install 31 | 32 | 33 | 1.**Clone the repo** 34 | 35 | ``` 36 | $ git clone https://github.com/zhanming0601/react-native-app.git 37 | $ cd react-native-app 38 | ``` 39 | 2.**Install dependencies** 40 | 41 | ``` 42 | $ npm install 43 | $ brew install watchman 44 | ``` 45 | 3.**Start Packager** 46 | 47 | ``` 48 | $ npm start 49 | ``` 50 | 4.**Running on iOS:** 51 | 52 | ``` 53 | $ react-native run-ios 54 | ``` 55 | 5.**Running on Android:** 56 | 57 | ``` 58 | $ react-native run-android 59 | ``` 60 | 61 | 62 | ## Other Features 63 | 64 | 65 | 66 | ## License 67 | 68 | The MIT License 69 | 70 | ## Questions? 71 | 72 | Feel free to contact me by 18611205315@163.com or [issues](https://github.com/zhanming0601/react-native-app/issues) me -------------------------------------------------------------------------------- /__tests__/index.android.js: -------------------------------------------------------------------------------- 1 | import 'react-native'; 2 | import React from 'react'; 3 | import Index from '../index.android.js'; 4 | 5 | // Note: test renderer must be required after react-native. 6 | import renderer from 'react-test-renderer'; 7 | 8 | it('renders correctly', () => { 9 | const tree = renderer.create( 10 | 11 | ); 12 | }); 13 | -------------------------------------------------------------------------------- /__tests__/index.ios.js: -------------------------------------------------------------------------------- 1 | import 'react-native'; 2 | import React from 'react'; 3 | import Index from '../index.ios.js'; 4 | 5 | // Note: test renderer must be required after react-native. 6 | import renderer from 'react-test-renderer'; 7 | 8 | it('renders correctly', () => { 9 | const tree = renderer.create( 10 | 11 | ); 12 | }); 13 | -------------------------------------------------------------------------------- /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.sudaizhijia", 49 | ) 50 | 51 | android_resource( 52 | name = "res", 53 | package = "com.sudaizhijia", 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 | -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "com.android.application" 2 | 3 | import com.android.build.OutputFile 4 | 5 | /** 6 | * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets 7 | * and bundleReleaseJsAndAssets). 8 | * These basically call `react-native bundle` with the correct arguments during the Android build 9 | * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the 10 | * bundle directly from the development server. Below you can see all the possible configurations 11 | * and their defaults. If you decide to add a configuration block, make sure to add it before the 12 | * `apply from: "../../node_modules/react-native/react.gradle"` line. 13 | * 14 | * project.ext.react = [ 15 | * // the name of the generated asset file containing your JS bundle 16 | * bundleAssetName: "index.android.bundle", 17 | * 18 | * // the entry file for bundle generation 19 | * entryFile: "index.android.js", 20 | * 21 | * // whether to bundle JS and assets in debug mode 22 | * bundleInDebug: false, 23 | * 24 | * // whether to bundle JS and assets in release mode 25 | * bundleInRelease: true, 26 | * 27 | * // whether to bundle JS and assets in another build variant (if configured). 28 | * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants 29 | * // The configuration property can be in the following formats 30 | * // 'bundleIn${productFlavor}${buildType}' 31 | * // 'bundleIn${buildType}' 32 | * // bundleInFreeDebug: true, 33 | * // bundleInPaidRelease: true, 34 | * // bundleInBeta: true, 35 | * 36 | * // whether to disable dev mode in custom build variants (by default only disabled in release) 37 | * // for example: to disable dev mode in the staging build type (if configured) 38 | * devDisabledInStaging: true, 39 | * // The configuration property can be in the following formats 40 | * // 'devDisabledIn${productFlavor}${buildType}' 41 | * // 'devDisabledIn${buildType}' 42 | * 43 | * // the root of your project, i.e. where "package.json" lives 44 | * root: "../../", 45 | * 46 | * // where to put the JS bundle asset in debug mode 47 | * jsBundleDirDebug: "$buildDir/intermediates/assets/debug", 48 | * 49 | * // where to put the JS bundle asset in release mode 50 | * jsBundleDirRelease: "$buildDir/intermediates/assets/release", 51 | * 52 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 53 | * // require('./image.png')), in debug mode 54 | * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug", 55 | * 56 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 57 | * // require('./image.png')), in release mode 58 | * resourcesDirRelease: "$buildDir/intermediates/res/merged/release", 59 | * 60 | * // by default the gradle tasks are skipped if none of the JS files or assets change; this means 61 | * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to 62 | * // date; if you have any other folders that you want to ignore for performance reasons (gradle 63 | * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/ 64 | * // for example, you might want to remove it from here. 65 | * inputExcludes: ["android/**", "ios/**"], 66 | * 67 | * // override which node gets called and with what additional arguments 68 | * nodeExecutableAndArgs: ["node"], 69 | * 70 | * // supply additional arguments to the packager 71 | * extraPackagerArgs: [] 72 | * ] 73 | */ 74 | 75 | apply from: "../../node_modules/react-native/react.gradle" 76 | 77 | /** 78 | * Set this to true to create two separate APKs instead of one: 79 | * - An APK that only works on ARM devices 80 | * - An APK that only works on x86 devices 81 | * The advantage is the size of the APK is reduced by about 4MB. 82 | * Upload all the APKs to the Play Store and people will download 83 | * the correct one based on the CPU architecture of their device. 84 | */ 85 | def enableSeparateBuildPerCPUArchitecture = false 86 | 87 | /** 88 | * Run Proguard to shrink the Java bytecode in release builds. 89 | */ 90 | def enableProguardInReleaseBuilds = false 91 | 92 | android { 93 | compileSdkVersion 23 94 | buildToolsVersion '25.0.0' 95 | 96 | defaultConfig { 97 | applicationId "com.sudaizhijia" 98 | minSdkVersion 16 99 | targetSdkVersion 22 100 | renderscriptTargetApi 23 101 | renderscriptSupportModeEnabled true 102 | versionCode 1 103 | versionName "1.0" 104 | ndk { 105 | abiFilters "armeabi-v7a", "x86" 106 | } 107 | } 108 | splits { 109 | abi { 110 | reset() 111 | enable enableSeparateBuildPerCPUArchitecture 112 | universalApk false // If true, also generate a universal APK 113 | include "armeabi-v7a", "x86" 114 | } 115 | } 116 | buildTypes { 117 | release { 118 | minifyEnabled enableProguardInReleaseBuilds 119 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" 120 | } 121 | } 122 | // applicationVariants are e.g. debug, release 123 | applicationVariants.all { variant -> 124 | variant.outputs.each { output -> 125 | // For each separate APK per architecture, set a unique version code as described here: 126 | // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits 127 | def versionCodes = ["armeabi-v7a":1, "x86":2] 128 | def abi = output.getFilter(OutputFile.ABI) 129 | if (abi != null) { // null for the universal-debug, universal-release variants 130 | output.versionCodeOverride = 131 | versionCodes.get(abi) * 1048576 + defaultConfig.versionCode 132 | } 133 | } 134 | } 135 | } 136 | 137 | dependencies { 138 | compile project(':react-native-picker') 139 | compile project(':react-native-linear-gradient') 140 | compile project(':react-native-blur') 141 | compile fileTree(dir: "libs", include: ["*.jar"]) 142 | compile "com.android.support:appcompat-v7:23.0.1" 143 | compile "com.facebook.react:react-native:+" // From node_modules 144 | } 145 | 146 | // Run this once to be able to run the application with BUCK 147 | // puts all compile dependencies into folder libs for BUCK to use 148 | task copyDownloadableDepsToLibs(type: Copy) { 149 | from configurations.compile 150 | into 'libs' 151 | } 152 | -------------------------------------------------------------------------------- /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 | 19 | # Disabling obfuscation is useful if you collect stack traces from production crashes 20 | # (unless you are using a system that supports de-obfuscate the stack traces). 21 | -dontobfuscate 22 | 23 | # React Native 24 | 25 | # Keep our interfaces so they can be used by other ProGuard rules. 26 | # See http://sourceforge.net/p/proguard/bugs/466/ 27 | -keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip 28 | -keep,allowobfuscation @interface com.facebook.proguard.annotations.KeepGettersAndSetters 29 | -keep,allowobfuscation @interface com.facebook.common.internal.DoNotStrip 30 | 31 | # Do not strip any method/class that is annotated with @DoNotStrip 32 | -keep @com.facebook.proguard.annotations.DoNotStrip class * 33 | -keep @com.facebook.common.internal.DoNotStrip class * 34 | -keepclassmembers class * { 35 | @com.facebook.proguard.annotations.DoNotStrip *; 36 | @com.facebook.common.internal.DoNotStrip *; 37 | } 38 | 39 | -keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * { 40 | void set*(***); 41 | *** get*(); 42 | } 43 | 44 | -keep class * extends com.facebook.react.bridge.JavaScriptModule { *; } 45 | -keep class * extends com.facebook.react.bridge.NativeModule { *; } 46 | -keepclassmembers,includedescriptorclasses class * { native ; } 47 | -keepclassmembers class * { @com.facebook.react.uimanager.UIProp ; } 48 | -keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactProp ; } 49 | -keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactPropGroup ; } 50 | 51 | -dontwarn com.facebook.react.** 52 | 53 | # TextLayoutBuilder uses a non-public Android constructor within StaticLayout. 54 | # See libs/proxy/src/main/java/com/facebook/fbui/textlayoutbuilder/proxy for details. 55 | -dontwarn android.text.StaticLayout 56 | 57 | # okhttp 58 | 59 | -keepattributes Signature 60 | -keepattributes *Annotation* 61 | -keep class okhttp3.** { *; } 62 | -keep interface okhttp3.** { *; } 63 | -dontwarn okhttp3.** 64 | 65 | # okio 66 | 67 | -keep class sun.misc.Unsafe { *; } 68 | -dontwarn java.nio.file.* 69 | -dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement 70 | -dontwarn okio.** 71 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 12 | 13 | 19 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/sudaizhijia/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.sudaizhijia; 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 "sudaizhijia"; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/sudaizhijia/MainApplication.java: -------------------------------------------------------------------------------- 1 | package com.sudaizhijia; 2 | 3 | import android.app.Application; 4 | 5 | import com.facebook.react.ReactApplication; 6 | import com.beefe.picker.PickerViewPackage; 7 | import com.BV.LinearGradient.LinearGradientPackage; 8 | import com.cmcewen.blurview.BlurViewPackage; 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 PickerViewPackage(), 30 | new LinearGradientPackage(), 31 | new BlurViewPackage() 32 | ); 33 | } 34 | }; 35 | 36 | @Override 37 | public ReactNativeHost getReactNativeHost() { 38 | return mReactNativeHost; 39 | } 40 | 41 | @Override 42 | public void onCreate() { 43 | super.onCreate(); 44 | SoLoader.init(this, /* native exopackage */ false); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | sudaizhijia 3 | 4 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | jcenter() 6 | } 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:2.3.3' 9 | 10 | 11 | // NOTE: Do not place your application dependencies here; they belong 12 | // in the individual module build.gradle files 13 | } 14 | } 15 | 16 | allprojects { 17 | repositories { 18 | mavenLocal() 19 | jcenter() 20 | maven { 21 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 22 | url "$rootDir/../node_modules/react-native/android" 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | 20 | android.useDeprecatedNdk=true 21 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhanming0601/react-native-app/c8a1a977bc871529efd6a6ebe4c8f4b1fa09db11/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Jun 28 23:55:27 CST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip 7 | -------------------------------------------------------------------------------- /android/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # For Cygwin, ensure paths are in UNIX format before anything is touched. 46 | if $cygwin ; then 47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 48 | fi 49 | 50 | # Attempt to set APP_HOME 51 | # Resolve links: $0 may be a link 52 | PRG="$0" 53 | # Need this for relative symlinks. 54 | while [ -h "$PRG" ] ; do 55 | ls=`ls -ld "$PRG"` 56 | link=`expr "$ls" : '.*-> \(.*\)$'` 57 | if expr "$link" : '/.*' > /dev/null; then 58 | PRG="$link" 59 | else 60 | PRG=`dirname "$PRG"`"/$link" 61 | fi 62 | done 63 | SAVED="`pwd`" 64 | cd "`dirname \"$PRG\"`/" >&- 65 | APP_HOME="`pwd -P`" 66 | cd "$SAVED" >&- 67 | 68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 69 | 70 | # Determine the Java command to use to start the JVM. 71 | if [ -n "$JAVA_HOME" ] ; then 72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 73 | # IBM's JDK on AIX uses strange locations for the executables 74 | JAVACMD="$JAVA_HOME/jre/sh/java" 75 | else 76 | JAVACMD="$JAVA_HOME/bin/java" 77 | fi 78 | if [ ! -x "$JAVACMD" ] ; then 79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 80 | 81 | Please set the JAVA_HOME variable in your environment to match the 82 | location of your Java installation." 83 | fi 84 | else 85 | JAVACMD="java" 86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 87 | 88 | Please set the JAVA_HOME variable in your environment to match the 89 | location of your Java installation." 90 | fi 91 | 92 | # Increase the maximum file descriptors if we can. 93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 94 | MAX_FD_LIMIT=`ulimit -H -n` 95 | if [ $? -eq 0 ] ; then 96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 97 | MAX_FD="$MAX_FD_LIMIT" 98 | fi 99 | ulimit -n $MAX_FD 100 | if [ $? -ne 0 ] ; then 101 | warn "Could not set maximum file descriptor limit: $MAX_FD" 102 | fi 103 | else 104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 105 | fi 106 | fi 107 | 108 | # For Darwin, add options to specify how the application appears in the dock 109 | if $darwin; then 110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 111 | fi 112 | 113 | # For Cygwin, switch paths to Windows format before running java 114 | if $cygwin ; then 115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 158 | function splitJvmOpts() { 159 | JVM_OPTS=("$@") 160 | } 161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 163 | 164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 165 | -------------------------------------------------------------------------------- /android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /android/keystores/BUCK: -------------------------------------------------------------------------------- 1 | keystore( 2 | name = "debug", 3 | properties = "debug.keystore.properties", 4 | store = "debug.keystore", 5 | visibility = [ 6 | "PUBLIC", 7 | ], 8 | ) 9 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'sudaizhijia' 2 | include ':react-native-picker' 3 | project(':react-native-picker').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-picker/android') 4 | include ':react-native-linear-gradient' 5 | project(':react-native-linear-gradient').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-linear-gradient/android') 6 | include ':react-native-blur' 7 | project(':react-native-blur').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-blur/android') 8 | 9 | include ':app' 10 | -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sudaizhijia", 3 | "displayName": "sudaizhijia" 4 | } -------------------------------------------------------------------------------- /index.android.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Sample React Native App 3 | * https://github.com/facebook/react-native 4 | * @flow 5 | */ 6 | 7 | import React, { Component } from 'react'; 8 | import { 9 | AppRegistry, 10 | StyleSheet, 11 | Text, 12 | View 13 | } from 'react-native'; 14 | 15 | import SDNavigtor from './App/Components/Navigator'; 16 | 17 | AppRegistry.registerComponent('sudaizhijia', () => SDNavigtor); 18 | 19 | -------------------------------------------------------------------------------- /index.ios.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Sample React Native App 3 | * https://github.com/facebook/react-native 4 | * @flow 5 | */ 6 | 7 | import React, { Component } from 'react'; 8 | import { 9 | AppRegistry, 10 | StyleSheet, 11 | Text, 12 | View 13 | } from 'react-native'; 14 | 15 | 16 | import SDNavigtor from './App/Components/Navigator'; 17 | 18 | AppRegistry.registerComponent('sudaizhijia', () => SDNavigtor); 19 | -------------------------------------------------------------------------------- /ios/sudaizhijia-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 | -------------------------------------------------------------------------------- /ios/sudaizhijia-tvOSTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /ios/sudaizhijia.xcodeproj/xcshareddata/xcschemes/sudaizhijia-tvOS.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 43 | 49 | 50 | 51 | 52 | 53 | 58 | 59 | 61 | 67 | 68 | 69 | 70 | 71 | 77 | 78 | 79 | 80 | 81 | 82 | 92 | 94 | 100 | 101 | 102 | 103 | 104 | 105 | 111 | 113 | 119 | 120 | 121 | 122 | 124 | 125 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /ios/sudaizhijia.xcodeproj/xcshareddata/xcschemes/sudaizhijia.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 43 | 49 | 50 | 51 | 52 | 53 | 58 | 59 | 61 | 67 | 68 | 69 | 70 | 71 | 77 | 78 | 79 | 80 | 81 | 82 | 92 | 94 | 100 | 101 | 102 | 103 | 104 | 105 | 111 | 113 | 119 | 120 | 121 | 122 | 124 | 125 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /ios/sudaizhijia/AppDelegate.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @interface AppDelegate : UIResponder 13 | 14 | @property (nonatomic, strong) UIWindow *window; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /ios/sudaizhijia/AppDelegate.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import "AppDelegate.h" 11 | 12 | #import 13 | #import 14 | 15 | @implementation AppDelegate 16 | 17 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 18 | { 19 | NSURL *jsCodeLocation; 20 | 21 | jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil]; 22 | 23 | // jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"bundle/index.ios" withExtension:@"jsbundle"]; 24 | 25 | RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation 26 | moduleName:@"sudaizhijia" 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 | -------------------------------------------------------------------------------- /ios/sudaizhijia/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 21 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /ios/sudaizhijia/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | } 43 | ], 44 | "info" : { 45 | "version" : 1, 46 | "author" : "xcode" 47 | } 48 | } -------------------------------------------------------------------------------- /ios/sudaizhijia/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | sudaizhijia 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 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 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UIViewControllerBasedStatusBarAppearance 40 | 41 | NSLocationWhenInUseUsageDescription 42 | 43 | NSAppTransportSecurity 44 | 45 | NSAllowsArbitraryLoads 46 | 47 | 48 | NSLocationWhenInUseUsageDescription 49 | 是否允许访问您的位置? 50 | 51 | 52 | -------------------------------------------------------------------------------- /ios/sudaizhijia/main.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import "AppDelegate.h" 13 | 14 | int main(int argc, char * argv[]) { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /ios/sudaizhijiaTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /ios/sudaizhijiaTests/sudaizhijiaTests.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | #import 12 | 13 | #import 14 | #import 15 | 16 | #define TIMEOUT_SECONDS 600 17 | #define TEXT_TO_LOOK_FOR @"Welcome to React Native!" 18 | 19 | @interface sudaizhijiaTests : XCTestCase 20 | 21 | @end 22 | 23 | @implementation sudaizhijiaTests 24 | 25 | - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test 26 | { 27 | if (test(view)) { 28 | return YES; 29 | } 30 | for (UIView *subview in [view subviews]) { 31 | if ([self findSubviewInView:subview matching:test]) { 32 | return YES; 33 | } 34 | } 35 | return NO; 36 | } 37 | 38 | - (void)testRendersWelcomeScreen 39 | { 40 | UIViewController *vc = [[[RCTSharedApplication() delegate] window] rootViewController]; 41 | NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS]; 42 | BOOL foundElement = NO; 43 | 44 | __block NSString *redboxError = nil; 45 | RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) { 46 | if (level >= RCTLogLevelError) { 47 | redboxError = message; 48 | } 49 | }); 50 | 51 | while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) { 52 | [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 53 | [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 54 | 55 | foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) { 56 | if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) { 57 | return YES; 58 | } 59 | return NO; 60 | }]; 61 | } 62 | 63 | RCTSetLogFunction(RCTDefaultLogFunction); 64 | 65 | XCTAssertNil(redboxError, @"RedBox error: %@", redboxError); 66 | XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS); 67 | } 68 | 69 | 70 | @end 71 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sudaizhijia", 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 | "mobx": "^3.1.16", 11 | "mobx-react": "^4.2.1", 12 | "react": "16.0.0-alpha.6", 13 | "react-native": "0.44.0", 14 | "react-native-blur": "^3.1.2", 15 | "react-native-deprecated-custom-components": "^0.1.0", 16 | "react-native-easy-toast": "^1.0.6", 17 | "react-native-linear-gradient": "^2.0.0", 18 | "react-native-picker": "^4.0.19", 19 | "react-native-scrollable-tab-view": "^0.6.7", 20 | "react-native-swiper": "^1.5.4", 21 | "react-native-tab-navigator": "^0.3.3" 22 | }, 23 | "devDependencies": { 24 | "babel-jest": "20.0.0", 25 | "babel-plugin-transform-decorators-legacy": "^1.3.4", 26 | "babel-preset-react-native": "1.9.1", 27 | "babel-preset-react-native-stage-0": "^1.0.1", 28 | "jest": "20.0.0", 29 | "react-test-renderer": "16.0.0-alpha.6" 30 | }, 31 | "jest": { 32 | "preset": "react-native" 33 | } 34 | } 35 | --------------------------------------------------------------------------------