罗广聪

精简代码 目前除了登录一切OK

... ... @@ -17,11 +17,12 @@ import AllProduct from "./src/pages/Home/allProduct";
import CommonWebView from "./src/Components/CommonWebView";
import Details from "./src/pages/InsuranceCircle/details";
// 底部导航栏配置,但也只是作为一个页面,加载到StackNavigator成为第一个页面
const MainTabBar = TabNavigator({
Home: {
screen: Home,
navigationOptions: {
// title: "首页",
title: "首页",
tabBarIcon: ({ focused }) =>
focused ? (
<Image source={require("./src/assets/tabbar/ic_home_s.png")} />
... ... @@ -33,7 +34,7 @@ const MainTabBar = TabNavigator({
InsuranceCircle: {
screen: InsuranceCircle,
navigationOptions: {
// title: "首页",
title: "保圈",
tabBarIcon: ({ focused }) =>
focused ? (
<Image source={require("./src/assets/tabbar/ic_circle_s.png")} />
... ... @@ -45,7 +46,7 @@ const MainTabBar = TabNavigator({
InsuranceChurch: {
screen: InsuranceChurch,
navigationOptions: {
// title: "首页",
title: "保堂",
tabBarIcon: ({ focused }) =>
focused ? (
<Image source={require("./src/assets/tabbar/ic_umbrella_s.png")} />
... ... @@ -57,7 +58,7 @@ const MainTabBar = TabNavigator({
Mine: {
screen: Mine,
navigationOptions: {
// title: "首页",
title: "我的",
tabBarIcon: ({ focused }) =>
focused ? (
<Image source={require("./src/assets/tabbar/ic_mine_s.png")} />
... ... @@ -73,31 +74,8 @@ const MainTabBar = TabNavigator({
}
});
// class Main extends Component {
// constructor(props) {
// super(props);
// this.state = {
// isLoading: false,
// isLogin: true
// };
// }
// render() {
// const { isLogin } = this.state;
// return isLogin ? (
// <MainTabBar />
// ) : (
// <Login
// loginSuccess={this.props.loginSuccess}
// onLogin={this.props.onLogin}
// />
// );
// }
// }
const ProtectGod = StackNavigator(
{
// Main: { screen: Main },
MainTabBar: { screen: MainTabBar },
Home: { screen: Home },
InsuranceCircle: { screen: InsuranceCircle },
... ... @@ -111,26 +89,10 @@ const ProtectGod = StackNavigator(
CommonWebView: { screen: CommonWebView },
Details: { screen: Details }
},
{
navigationOptions: {
// 顶部标题颜色
// headerTintColor: 'red',
// 顶部背景颜色
// headerStyle: {backgroundColor: "white"},
// headerTitleStyle: {alignSelf: 'center'},
}
}
);
const styles = StyleSheet.create(
{
// container: {
// flex: 1,
// justifyContent: "center",
// alignItems: "center",
// backgroundColor: "#F5FCFF"
// }
}
);
AppRegistry.registerComponent("ProtectGod", () => ProtectGod);
... ...
import React, { Component } from "react";
import { AppRegistry, StyleSheet, Text, View, Image, Dimensions } from "react-native";
var width = Dimensions.get('window').width;
var height = width*(140/375);
// var height = Dimensions.get('window').height;
var scale = Dimensions.get('window').scale;
export default class Carousel extends Component {
render() {
console.log(width,height,scale);
return (
<Image
source={require("../assets/WechatIMG10.png")}
style={{ width:width, height:140}}
/>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: "center",
alignItems: "center",
backgroundColor: "#F5FCFF"
},
welcome: {
fontSize: 20,
textAlign: "center",
margin: 10
}
});
... ... @@ -14,9 +14,9 @@ import Swiper from "react-native-swiper";
import CommonWebView from "../../Components/CommonWebView";
export default class Home extends Component {
static navigationOptions = {
title: "首页"
};
// static navigationOptions = {
// title: "首页"
// };
constructor(props) {
super(props);
this._renderMap = this._renderMap.bind(this);
... ...
... ... @@ -12,9 +12,9 @@ import { StackNavigator, TabNavigator } from 'react-navigation';
import CommonWebView from "../../Components/CommonWebView";
export default class InsuranceChurch extends Component {
static navigationOptions = {
title: '保堂',
};
// static navigationOptions = {
// title: '保堂',
// };
constructor(props) {
super(props);
// this._renderMap = this._renderMap.bind(this);
... ...
... ... @@ -13,9 +13,9 @@ import CommonWebView from "../../Components/CommonWebView";
import Details from "./details";
export default class InsuranceCircle extends Component {
static navigationOptions = {
title: '保圈',
};
// static navigationOptions = {
// title: '保圈',
// };
constructor(props) {
super(props);
this.state = {
... ...
... ... @@ -11,9 +11,9 @@ import {
import { StackNavigator, TabNavigator } from 'react-navigation';
export default class Mine extends Component {
static navigationOptions = {
title: '我的',
};
// static navigationOptions = {
// title: '我的',
// };
constructor(props) {
super(props);
this.state = {
... ...