Yingchuan

first

... ... @@ -4,50 +4,102 @@
* @flow
*/
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View
} from 'react-native';
import React, { Component } from "react";
import { AppRegistry, StyleSheet, Text, View, Image } from "react-native";
import { StackNavigator, TabNavigator } from "react-navigation";
export default class ProtectGod extends Component {
render() {
return (
<View style={styles.container}>
<Text style={styles.welcome}>
Welcome to React Native!
</Text>
<Text style={styles.instructions}>
To get started, edit index.android.js
</Text>
<Text style={styles.instructions}>
Double tap R on your keyboard to reload,{'\n'}
Shake or press menu button for dev menu
</Text>
</View>
);
}
}
import Home from "./src/pages/Home/index";
import InsuranceCircle from "./src/pages/InsuranceCircle/index";
import InsuranceChurch from "./src/pages/InsuranceChurch/index";
import Mine from "./src/pages/Mine/index";
import Login from "./src/pages/Login";
import AllProduct from "./src/pages/Home/allProduct";
import CommonWebView from "./src/Components/CommonWebView";
import Details from "./src/pages/InsuranceCircle/details";
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
// 底部导航栏配置,但也只是作为一个页面,加载到StackNavigator成为第一个页面
const MainTabBar = TabNavigator({
Home: {
screen: Home,
navigationOptions: {
title: "首页",
tabBarIcon: ({ focused }) =>
focused ? (
<Image source={require("./src/assets/tabbar/ic_home_s.png")} />
) : (
<Image source={require("./src/assets/tabbar/ic_home_n.png")} />
)
}
},
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 10,
InsuranceCircle: {
screen: InsuranceCircle,
navigationOptions: {
title: "保圈",
tabBarIcon: ({ focused }) =>
focused ? (
<Image source={require("./src/assets/tabbar/ic_circle_s.png")} />
) : (
<Image source={require("./src/assets/tabbar/ic_circle_n.png")} />
)
}
},
instructions: {
textAlign: 'center',
color: '#333333',
marginBottom: 5,
InsuranceChurch: {
screen: InsuranceChurch,
navigationOptions: {
title: "保堂",
tabBarIcon: ({ focused }) =>
focused ? (
<Image source={require("./src/assets/tabbar/ic_umbrella_s.png")} />
) : (
<Image source={require("./src/assets/tabbar/ic_umbrella_n.png")} />
)
}
},
Mine: {
screen: Mine,
navigationOptions: {
title: "我的",
tabBarIcon: ({ focused }) =>
focused ? (
<Image source={require("./src/assets/tabbar/ic_mine_s.png")} />
) : (
<Image source={require("./src/assets/tabbar/ic_mine_n.png")} />
)
}
}
},{
swipeEnabled: true,
tabBarOptions: {
activeTintColor: "#1B9341"
}
});
AppRegistry.registerComponent('ProtectGod', () => ProtectGod);
const ProtectGod = StackNavigator(
{
MainTabBar: { screen: MainTabBar },
Home: { screen: Home },
InsuranceCircle: { screen: InsuranceCircle },
InsuranceChurch: { screen: InsuranceChurch },
Mine: { screen: Mine },
Login: { screen: Login },
AllProduct: {
screen: AllProduct,
navigationOptions: { headerTitle: "全部产品" }
},
CommonWebView: { screen: CommonWebView },
Details: { screen: Details }
},{
navigationOptions: {
// headerTintColor: "blue",
headerStyle: {
backgroundColor: "white"
}
}
}
);
const styles = StyleSheet.create(
);
AppRegistry.registerComponent("ProtectGod", () => ProtectGod);
... ...