index.js
1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import React, { Component } from "react";
import { AppRegistry, StyleSheet, Text, View, Image, TouchableOpacity } from "react-native";
import Carousel from "../../Components/Carousel";
export default class Main extends Component {
componentDidMount() {
console.log('thisprops',this.props);
}
render() {
return (
<View style={styles.container}>
<Carousel />
{/* <Text style={styles.welcome}>首页</Text> */}
<TouchableOpacity onPress={() => {this.props.navigator.push()}} style={styles.midContainer}>
<Image source={require('../../assets/首页的副本/pic.png')} style={{width:72, height:18}} />
<Text style={styles.midText}>平安保险2017版</Text>
</TouchableOpacity>
<View style={styles.textContainer}>
<Text>保险头条</Text>
</View>
</View>
);
}
}
// this.props.navigator.push()
const styles = StyleSheet.create({
container: {
flex: 1,
paddingTop: 64,
justifyContent: "flex-start",
alignItems: "stretch",
backgroundColor: "#EFEFEF"
},
midContainer: {
height: 45,
// width: 200,
// alignSelf: 'center',
backgroundColor: '#fff',
alignItems: "center",
flexDirection: 'row',
paddingLeft: 13
},
midText: {
fontSize: 15,
paddingLeft: 9,
// fontFamily: PingFang-SC-Medium,
color: '#202020'
},
textContainer: {
backgroundColor: '#fff',
marginTop: 10,
height: 45,
justifyContent: "center",
paddingLeft: 13,
fontSize: 15,
color: "#202020",
}
});