index.js 1.48 KB
import React, { Component } from "react";
import { AppRegistry, StyleSheet, Text, View, Image, TouchableOpacity } from "react-native";
import Carousel from "../../Components/Carousel";
import NewsList from "./NewList";

export default class Main extends Component {

  componentDidMount() {
    console.log('thisprops',this.props);
  }

  render() {
    return (
      <View style={styles.container}>
        <Carousel />
        <TouchableOpacity 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 style={styles.minText}>保险头条</Text>
        </View>
        <NewsList /> 
      </View>
    );
  }
}

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",
  }
});