AboutUs.js 4.66 KB
/**
 * Created by jone on 2017/4/10.
 */
import React,
{
    Component
} from "react";
import ReactNative from 'react-native';
import {
    View,
    Text,
    TouchableWithoutFeedback,
    StyleSheet,
    TouchableOpacity,
    ScrollView,
    Image,
    Dimensions,
} from "react-native";


export default class SettingMessage extends Component {
    constructor(props) {
        super(props);
    }

    render() {
        let {data} = this.props;
        let hasNew = data.versionInfo.hasNew;
        return (
            <View style={styles.container}>
                <Image
                    style={styles.logoViewStyle}
                    source={require("../images/about_icon_launcher.png")}
                />
                <Text style={[styles.textViewStyle,styles.marginStyle]}>版本 {data.versionInfo.version}</Text>
                {this._renderUpdate(hasNew)}
                <TouchableOpacity
                    activeOpacity={0.5}
                    onPress={
                            () =>  this.props.pressItem && this.props.pressItem(1)
                        }
                >
                <View style={styles.textBorderStyle}>
                    <Text style={styles.textViewStyle}>关于YOHO!BUY有货</Text>
                </View>
                </TouchableOpacity>
                <TouchableOpacity
                    activeOpacity={0.5}
                    onPress={
                            () =>  this.props.pressItem && this.props.pressItem(2)
                        }
                >
                <View style={styles.textBorderStyle}>
                    <Text style={styles.textViewStyle}>关于新力传媒</Text>
                </View>
                </TouchableOpacity>
                <TouchableOpacity
                    activeOpacity={0.5}
                    onPress={
                            () =>  this.props.pressItem && this.props.pressItem(4)
                        }
                >
                <View style={styles.textBorderStyle}>
                    <Text style={styles.textViewStyle}>给我评价</Text>
                </View>
                </TouchableOpacity>
                <View style={styles.bottomViewStyle}>
                    <TouchableOpacity
                        activeOpacity={0.5}
                        onPress={
                            () =>  this.props.pressItem && this.props.pressItem(3)
                        }
                    >
                   <View style={styles.privacyViewStyle}>
                       <Text>隐私条款</Text>
                   </View>
                    </TouchableOpacity>
                    <Image
                        style={styles.bottomAboutStyle}
                        source={require("../images/mine_about_company.png")}
                    />
                </View>

            </View>
        );
    }
    _renderUpdate(hasNew){
            return (
                hasNew?
                <TouchableOpacity
                    activeOpacity={0.5}
                    onPress={
                            () =>  this.props.pressItem && this.props.pressItem(5)
                        }
                >
                    <View style={styles.updateViewStyle}>
                        <Text style={styles.textViewStyle}>版本更新</Text>
                        <Image
                            style={{margin:4}}
                            source={ require('../images/mine_setting_app_new.png')}
                        />
                    </View>
                </TouchableOpacity>:null
            );
    }

};
let {width, height} = Dimensions.get('window');
let styles = StyleSheet.create({
    container: {
        alignItems: 'center',
        backgroundColor: '#ffffffff',
        flex: 1
    },
    logoViewStyle: {
        width: 80,
        height: 80,
        marginTop: 50
    },
    bottomViewStyle: {
        alignItems: 'center',
        position: 'absolute',
        width:width,
        bottom: 20,
    },
    bottomAboutStyle: {
        width: 125,
        height: 30,
        marginTop:10

    },
    privacyViewStyle:{
        borderBottomColor:'black',
        borderBottomWidth:1
    },
    textViewStyle:{
        fontSize:14
    },
    textBorderStyle:{
        borderColor:'black',
        borderWidth:1,
        borderRadius:3,
        width:150,
        height:45,
        alignItems:'center',
        justifyContent:'center',
        marginTop:15
    },
    updateViewStyle:{
        borderColor:'black',
        borderWidth:1,
        borderRadius:3,
        width:150,
        height:45,
        alignItems:'center',
        justifyContent:'center',
        marginTop:15,
        flexDirection:'row'
    },
    marginStyle:{
        marginTop:10
    }


});