ExpressCell.js 2.64 KB
'use strict';

import React, {Component} from 'react';
import Immutable, {Map} from 'immutable';

import ReactNative, {
    View,
    Text,
    Image,
    ListView,
    StyleSheet,
    Dimensions,
    TouchableOpacity,
    InteractionManager,
    Platform
} from 'react-native';

export default class ExpressCell extends Component {

    constructor(props) {
        super(props);
    }

    render() {
        return (
            <TouchableOpacity style={styles.container} onPress={
                () => {
                    this.props.onPressExpress && this.props.onPressExpress();
                }
            }>
                <View style={styles.leftPart}>
                    <Image style={{
                        width: 22,
                        height: 22
                    }} source={require('../../image/icon_wuliu.png')}/>
                </View>
                <View style={styles.rightPart}>
                    <View style={styles.topPart}>
                        <Text style={styles.codeText}>物流信息</Text>
                    </View>
                    {
                        this.props.data.map((item, index) => {
                            return <Text key={index} style={styles.otherText}>{item}</Text>
                        })
                    }
                </View>
                <Image style={{
                    width: 15,
                    height: 15
                }} source={require('../../image/shared_next_icon.png')}/>
            </TouchableOpacity>
        );
    }
}

let {width, height} = Dimensions.get('window');

let styles = StyleSheet.create({
    container: {
        width: width,
        flexDirection: 'row',
        backgroundColor: 'white',
        borderColor: '#f0f0f0',
        alignItems: 'center',
        borderBottomWidth: 10
    },

    topPart: {
        width: width - 45,
        height: 20,
        flexDirection: 'row',
        alignItems: 'center',
        marginTop: 13,
        marginBottom: 2
    },

    codeText: {
        fontSize: 14,
        marginBottom: 0,
        color: '#444444',
        fontFamily: 'STHeitiSC-Light',
    },

    copyButton: {
        marginLeft: 10,
        width: 44,
        height: 18,
        borderColor: '#444444',
        borderWidth: 1,
        justifyContent: 'center',
        alignItems: 'center'
    },

    leftPart: {
        width: 45,
        justifyContent: 'center',
        alignItems: 'center'
    },

    rightPart: {
        width: width - 45 - 30,
        flexDirection: 'column',
        paddingBottom: 10
    },

    otherText: {
        fontSize: 12,
        marginBottom: 3,
        color: '#b0b0b0',
        fontFamily: 'STHeitiSC-Light',
    }
});