罗广聪

jj

Showing 41 changed files with 76 additions and 49 deletions
This diff could not be displayed because it is too large.
... ... @@ -19,4 +19,4 @@
"jest": {
"preset": "react-native"
}
}
\ No newline at end of file
}
... ...
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
}
});
... ...
import React, { Component } from "react";
import { AppRegistry, StyleSheet, Text, View } from "react-native";
// import Swiper from "react-native-swiper";
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}>
<Text style={styles.welcome}>首页</Text>
{/* <Swiper style={styles.wrapper} showsButtons={true}>
<View style={styles.slide1}>
<Text style={styles.text}>Hello Swiper</Text>
</View>
<View style={styles.slide2}>
<Text style={styles.text}>Beautiful</Text>
</View>
<View style={styles.slide3}>
<Text style={styles.text}>And simple</Text>
</View>
</Swiper> */}
<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>
);
}
}
// this.props.navigator.push()
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: "center",
paddingTop: 64,
justifyContent: "flex-start",
alignItems: "center",
backgroundColor: "#F5FCFF"
backgroundColor: "#EFEFEF"
},
welcome: {
fontSize: 20,
textAlign: "center",
margin: 10
MidContainer: {
height: 45,
width: 375,
backgroundColor: '#fff',
alignItems: "center",
flexDirection: 'row',
paddingLeft: 13
},
// wrapper: {
// },
// slide1: {
// flex: 1,
// justifyContent: 'center',
// alignItems: 'center',
// backgroundColor: '#9DD6EB',
// },
// slide2: {
// flex: 1,
// justifyContent: 'center',
// alignItems: 'center',
// backgroundColor: '#97CAE5',
// },
// slide3: {
// flex: 1,
// justifyContent: 'center',
// alignItems: 'center',
// backgroundColor: '#92BBD9',
// },
MidText: {
fontSize: 15,
paddingLeft: 9,
// fontFamily: PingFang-SC-Medium,
color: '#202020'
}
});
... ...
... ... @@ -5,7 +5,8 @@ import {
Text,
View,
TabBarIOS,
NavigatorIOS
NavigatorIOS,
Dimensions
} from "react-native";
import Home from "./Home/index";
... ... @@ -13,6 +14,9 @@ import InsuranceCircle from "./InsuranceCircle/index";
import InsuranceChurch from "./InsuranceChurch/index";
import Mine from "./Mine/index";
var scale = Dimensions.get('window').scale;
export default class Main extends Component {
constructor(props) {
super(props);
... ... @@ -20,7 +24,7 @@ export default class Main extends Component {
selectedItem: "home"
}
}
render() {
return (
<TabBarIOS tintColor="#08CC6A" barTintColor="white">
... ... @@ -37,10 +41,9 @@ export default class Main extends Component {
style={{ flex: 1 }}
initialRoute={{
component: Home,
title: "首页"
title: "保护神"
}}
/>
{/* <Home /> */}
</TabBarIOS.Item>
<TabBarIOS.Item
title="保圈"
... ... @@ -55,8 +58,7 @@ export default class Main extends Component {
style={{ flex: 1 }}
initialRoute={{
component: InsuranceCircle,
title: "保圈",
rightButtonTitle: 'Add',
title: "保护神",
}}
/>
</TabBarIOS.Item>
... ... @@ -73,7 +75,7 @@ export default class Main extends Component {
style={{ flex: 1 }}
initialRoute={{
component: InsuranceChurch,
title: "保"
title: "保护神"
}}
/>
</TabBarIOS.Item>
... ... @@ -90,7 +92,7 @@ export default class Main extends Component {
style={{ flex: 1 }}
initialRoute={{
component: Mine,
title: "我的"
title: "保护神"
}}
/>
</TabBarIOS.Item>
... ...