罗广聪

jj

Showing 41 changed files with 74 additions and 47 deletions
This diff could not be displayed because it is too large.
  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 +});
1 import React, { Component } from "react"; 1 import React, { Component } from "react";
2 -import { AppRegistry, StyleSheet, Text, View } from "react-native"; 2 +import { AppRegistry, StyleSheet, Text, View, Image, TouchableOpacity } from "react-native";
3 -// import Swiper from "react-native-swiper"; 3 +import Carousel from "../../Components/Carousel";
4 4
5 export default class Main extends Component { 5 export default class Main extends Component {
  6 +
  7 + componentDidMount() {
  8 + console.log('thisprops',this.props);
  9 + }
  10 +
6 render() { 11 render() {
7 return ( 12 return (
8 <View style={styles.container}> 13 <View style={styles.container}>
9 - <Text style={styles.welcome}>首页</Text> 14 + <Carousel />
10 - {/* <Swiper style={styles.wrapper} showsButtons={true}> 15 + {/* <Text style={styles.welcome}>首页</Text> */}
11 - <View style={styles.slide1}> 16 + <TouchableOpacity onPress={() => {this.props.navigator.push()}} style={styles.MidContainer}>
12 - <Text style={styles.text}>Hello Swiper</Text> 17 + <Image source={require('../../assets/首页的副本/pic.png')} style={{width:72, height:18}} />
13 - </View> 18 + <Text style={styles.MidText}>平安保险2017</Text>
14 - <View style={styles.slide2}> 19 + </TouchableOpacity>
15 - <Text style={styles.text}>Beautiful</Text>  
16 - </View>  
17 - <View style={styles.slide3}>  
18 - <Text style={styles.text}>And simple</Text>  
19 - </View>  
20 - </Swiper> */}  
21 </View> 20 </View>
22 ); 21 );
23 } 22 }
24 } 23 }
25 24
  25 +
  26 +// this.props.navigator.push()
  27 +
26 const styles = StyleSheet.create({ 28 const styles = StyleSheet.create({
27 container: { 29 container: {
28 flex: 1, 30 flex: 1,
29 - justifyContent: "center", 31 + paddingTop: 64,
  32 + justifyContent: "flex-start",
30 alignItems: "center", 33 alignItems: "center",
31 - backgroundColor: "#F5FCFF" 34 + backgroundColor: "#EFEFEF"
32 }, 35 },
33 - welcome: { 36 + MidContainer: {
34 - fontSize: 20, 37 + height: 45,
35 - textAlign: "center", 38 + width: 375,
36 - margin: 10 39 + backgroundColor: '#fff',
  40 + alignItems: "center",
  41 + flexDirection: 'row',
  42 + paddingLeft: 13
37 }, 43 },
38 - // wrapper: { 44 + MidText: {
39 - // }, 45 + fontSize: 15,
40 - // slide1: { 46 + paddingLeft: 9,
41 - // flex: 1, 47 + // fontFamily: PingFang-SC-Medium,
42 - // justifyContent: 'center', 48 + color: '#202020'
43 - // alignItems: 'center', 49 + }
44 - // backgroundColor: '#9DD6EB',  
45 - // },  
46 - // slide2: {  
47 - // flex: 1,  
48 - // justifyContent: 'center',  
49 - // alignItems: 'center',  
50 - // backgroundColor: '#97CAE5',  
51 - // },  
52 - // slide3: {  
53 - // flex: 1,  
54 - // justifyContent: 'center',  
55 - // alignItems: 'center',  
56 - // backgroundColor: '#92BBD9',  
57 - // },  
58 }); 50 });
@@ -5,7 +5,8 @@ import { @@ -5,7 +5,8 @@ import {
5 Text, 5 Text,
6 View, 6 View,
7 TabBarIOS, 7 TabBarIOS,
8 - NavigatorIOS 8 + NavigatorIOS,
  9 + Dimensions
9 } from "react-native"; 10 } from "react-native";
10 11
11 import Home from "./Home/index"; 12 import Home from "./Home/index";
@@ -13,6 +14,9 @@ import InsuranceCircle from "./InsuranceCircle/index"; @@ -13,6 +14,9 @@ import InsuranceCircle from "./InsuranceCircle/index";
13 import InsuranceChurch from "./InsuranceChurch/index"; 14 import InsuranceChurch from "./InsuranceChurch/index";
14 import Mine from "./Mine/index"; 15 import Mine from "./Mine/index";
15 16
  17 +
  18 +var scale = Dimensions.get('window').scale;
  19 +
16 export default class Main extends Component { 20 export default class Main extends Component {
17 constructor(props) { 21 constructor(props) {
18 super(props); 22 super(props);
@@ -37,10 +41,9 @@ export default class Main extends Component { @@ -37,10 +41,9 @@ export default class Main extends Component {
37 style={{ flex: 1 }} 41 style={{ flex: 1 }}
38 initialRoute={{ 42 initialRoute={{
39 component: Home, 43 component: Home,
40 - title: "首页" 44 + title: "保护神"
41 }} 45 }}
42 /> 46 />
43 - {/* <Home /> */}  
44 </TabBarIOS.Item> 47 </TabBarIOS.Item>
45 <TabBarIOS.Item 48 <TabBarIOS.Item
46 title="保圈" 49 title="保圈"
@@ -55,8 +58,7 @@ export default class Main extends Component { @@ -55,8 +58,7 @@ export default class Main extends Component {
55 style={{ flex: 1 }} 58 style={{ flex: 1 }}
56 initialRoute={{ 59 initialRoute={{
57 component: InsuranceCircle, 60 component: InsuranceCircle,
58 - title: "保圈", 61 + title: "保护神",
59 - rightButtonTitle: 'Add',  
60 }} 62 }}
61 /> 63 />
62 </TabBarIOS.Item> 64 </TabBarIOS.Item>
@@ -73,7 +75,7 @@ export default class Main extends Component { @@ -73,7 +75,7 @@ export default class Main extends Component {
73 style={{ flex: 1 }} 75 style={{ flex: 1 }}
74 initialRoute={{ 76 initialRoute={{
75 component: InsuranceChurch, 77 component: InsuranceChurch,
76 - title: "保" 78 + title: "保护神"
77 }} 79 }}
78 /> 80 />
79 </TabBarIOS.Item> 81 </TabBarIOS.Item>
@@ -90,7 +92,7 @@ export default class Main extends Component { @@ -90,7 +92,7 @@ export default class Main extends Component {
90 style={{ flex: 1 }} 92 style={{ flex: 1 }}
91 initialRoute={{ 93 initialRoute={{
92 component: Mine, 94 component: Mine,
93 - title: "我的" 95 + title: "保护神"
94 }} 96 }}
95 /> 97 />
96 </TabBarIOS.Item> 98 </TabBarIOS.Item>