罗广聪

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

@@ -17,11 +17,12 @@ import AllProduct from "./src/pages/Home/allProduct"; @@ -17,11 +17,12 @@ import AllProduct from "./src/pages/Home/allProduct";
17 import CommonWebView from "./src/Components/CommonWebView"; 17 import CommonWebView from "./src/Components/CommonWebView";
18 import Details from "./src/pages/InsuranceCircle/details"; 18 import Details from "./src/pages/InsuranceCircle/details";
19 19
  20 +// 底部导航栏配置,但也只是作为一个页面,加载到StackNavigator成为第一个页面
20 const MainTabBar = TabNavigator({ 21 const MainTabBar = TabNavigator({
21 Home: { 22 Home: {
22 screen: Home, 23 screen: Home,
23 navigationOptions: { 24 navigationOptions: {
24 - // title: "首页", 25 + title: "首页",
25 tabBarIcon: ({ focused }) => 26 tabBarIcon: ({ focused }) =>
26 focused ? ( 27 focused ? (
27 <Image source={require("./src/assets/tabbar/ic_home_s.png")} /> 28 <Image source={require("./src/assets/tabbar/ic_home_s.png")} />
@@ -33,7 +34,7 @@ const MainTabBar = TabNavigator({ @@ -33,7 +34,7 @@ const MainTabBar = TabNavigator({
33 InsuranceCircle: { 34 InsuranceCircle: {
34 screen: InsuranceCircle, 35 screen: InsuranceCircle,
35 navigationOptions: { 36 navigationOptions: {
36 - // title: "首页", 37 + title: "保圈",
37 tabBarIcon: ({ focused }) => 38 tabBarIcon: ({ focused }) =>
38 focused ? ( 39 focused ? (
39 <Image source={require("./src/assets/tabbar/ic_circle_s.png")} /> 40 <Image source={require("./src/assets/tabbar/ic_circle_s.png")} />
@@ -45,7 +46,7 @@ const MainTabBar = TabNavigator({ @@ -45,7 +46,7 @@ const MainTabBar = TabNavigator({
45 InsuranceChurch: { 46 InsuranceChurch: {
46 screen: InsuranceChurch, 47 screen: InsuranceChurch,
47 navigationOptions: { 48 navigationOptions: {
48 - // title: "首页", 49 + title: "保堂",
49 tabBarIcon: ({ focused }) => 50 tabBarIcon: ({ focused }) =>
50 focused ? ( 51 focused ? (
51 <Image source={require("./src/assets/tabbar/ic_umbrella_s.png")} /> 52 <Image source={require("./src/assets/tabbar/ic_umbrella_s.png")} />
@@ -57,7 +58,7 @@ const MainTabBar = TabNavigator({ @@ -57,7 +58,7 @@ const MainTabBar = TabNavigator({
57 Mine: { 58 Mine: {
58 screen: Mine, 59 screen: Mine,
59 navigationOptions: { 60 navigationOptions: {
60 - // title: "首页", 61 + title: "我的",
61 tabBarIcon: ({ focused }) => 62 tabBarIcon: ({ focused }) =>
62 focused ? ( 63 focused ? (
63 <Image source={require("./src/assets/tabbar/ic_mine_s.png")} /> 64 <Image source={require("./src/assets/tabbar/ic_mine_s.png")} />
@@ -73,31 +74,8 @@ const MainTabBar = TabNavigator({ @@ -73,31 +74,8 @@ const MainTabBar = TabNavigator({
73 } 74 }
74 }); 75 });
75 76
76 -// class Main extends Component {  
77 -// constructor(props) {  
78 -// super(props);  
79 -// this.state = {  
80 -// isLoading: false,  
81 -// isLogin: true  
82 -// };  
83 -// }  
84 -// render() {  
85 -// const { isLogin } = this.state;  
86 -  
87 -// return isLogin ? (  
88 -// <MainTabBar />  
89 -// ) : (  
90 -// <Login  
91 -// loginSuccess={this.props.loginSuccess}  
92 -// onLogin={this.props.onLogin}  
93 -// />  
94 -// );  
95 -// }  
96 -// }  
97 -  
98 const ProtectGod = StackNavigator( 77 const ProtectGod = StackNavigator(
99 { 78 {
100 - // Main: { screen: Main },  
101 MainTabBar: { screen: MainTabBar }, 79 MainTabBar: { screen: MainTabBar },
102 Home: { screen: Home }, 80 Home: { screen: Home },
103 InsuranceCircle: { screen: InsuranceCircle }, 81 InsuranceCircle: { screen: InsuranceCircle },
@@ -111,26 +89,10 @@ const ProtectGod = StackNavigator( @@ -111,26 +89,10 @@ const ProtectGod = StackNavigator(
111 CommonWebView: { screen: CommonWebView }, 89 CommonWebView: { screen: CommonWebView },
112 Details: { screen: Details } 90 Details: { screen: Details }
113 }, 91 },
114 - {  
115 - navigationOptions: {  
116 - // 顶部标题颜色  
117 - // headerTintColor: 'red',  
118 - // 顶部背景颜色  
119 - // headerStyle: {backgroundColor: "white"},  
120 - // headerTitleStyle: {alignSelf: 'center'},  
121 - }  
122 - }  
123 ); 92 );
124 93
125 const styles = StyleSheet.create( 94 const styles = StyleSheet.create(
126 - { 95 +
127 - // container: {  
128 - // flex: 1,  
129 - // justifyContent: "center",  
130 - // alignItems: "center",  
131 - // backgroundColor: "#F5FCFF"  
132 - // }  
133 - }  
134 ); 96 );
135 97
136 AppRegistry.registerComponent("ProtectGod", () => ProtectGod); 98 AppRegistry.registerComponent("ProtectGod", () => ProtectGod);
1 -import React, { Component } from "react";  
2 -import { AppRegistry, StyleSheet, Text, View, Image, Dimensions } from "react-native";  
3 -  
4 -var width = Dimensions.get('window').width;  
5 -var height = width*(140/375);  
6 -// var height = Dimensions.get('window').height;  
7 -var scale = Dimensions.get('window').scale;  
8 -  
9 -export default class Carousel extends Component {  
10 - render() {  
11 - console.log(width,height,scale);  
12 - return (  
13 - <Image  
14 - source={require("../assets/WechatIMG10.png")}  
15 - style={{ width:width, height:140}}  
16 - />  
17 - );  
18 - }  
19 -}  
20 -  
21 -const styles = StyleSheet.create({  
22 - container: {  
23 - flex: 1,  
24 - justifyContent: "center",  
25 - alignItems: "center",  
26 - backgroundColor: "#F5FCFF"  
27 - },  
28 - welcome: {  
29 - fontSize: 20,  
30 - textAlign: "center",  
31 - margin: 10  
32 - }  
33 -});  
@@ -14,9 +14,9 @@ import Swiper from "react-native-swiper"; @@ -14,9 +14,9 @@ import Swiper from "react-native-swiper";
14 import CommonWebView from "../../Components/CommonWebView"; 14 import CommonWebView from "../../Components/CommonWebView";
15 15
16 export default class Home extends Component { 16 export default class Home extends Component {
17 - static navigationOptions = { 17 + // static navigationOptions = {
18 - title: "首页" 18 + // title: "首页"
19 - }; 19 + // };
20 constructor(props) { 20 constructor(props) {
21 super(props); 21 super(props);
22 this._renderMap = this._renderMap.bind(this); 22 this._renderMap = this._renderMap.bind(this);
@@ -12,9 +12,9 @@ import { StackNavigator, TabNavigator } from 'react-navigation'; @@ -12,9 +12,9 @@ import { StackNavigator, TabNavigator } from 'react-navigation';
12 import CommonWebView from "../../Components/CommonWebView"; 12 import CommonWebView from "../../Components/CommonWebView";
13 13
14 export default class InsuranceChurch extends Component { 14 export default class InsuranceChurch extends Component {
15 - static navigationOptions = { 15 + // static navigationOptions = {
16 - title: '保堂', 16 + // title: '保堂',
17 - }; 17 + // };
18 constructor(props) { 18 constructor(props) {
19 super(props); 19 super(props);
20 // this._renderMap = this._renderMap.bind(this); 20 // this._renderMap = this._renderMap.bind(this);
@@ -13,9 +13,9 @@ import CommonWebView from "../../Components/CommonWebView"; @@ -13,9 +13,9 @@ import CommonWebView from "../../Components/CommonWebView";
13 import Details from "./details"; 13 import Details from "./details";
14 14
15 export default class InsuranceCircle extends Component { 15 export default class InsuranceCircle extends Component {
16 - static navigationOptions = { 16 + // static navigationOptions = {
17 - title: '保圈', 17 + // title: '保圈',
18 - }; 18 + // };
19 constructor(props) { 19 constructor(props) {
20 super(props); 20 super(props);
21 this.state = { 21 this.state = {
@@ -11,9 +11,9 @@ import { @@ -11,9 +11,9 @@ import {
11 import { StackNavigator, TabNavigator } from 'react-navigation'; 11 import { StackNavigator, TabNavigator } from 'react-navigation';
12 12
13 export default class Mine extends Component { 13 export default class Mine extends Component {
14 - static navigationOptions = { 14 + // static navigationOptions = {
15 - title: '我的', 15 + // title: '我的',
16 - }; 16 + // };
17 constructor(props) { 17 constructor(props) {
18 super(props); 18 super(props);
19 this.state = { 19 this.state = {