DeliverGoodsCell.js 2.11 KB
'use strict';

import React, {Component} from 'react';
import CheckBox from 'react-native-checkbox';
import CONFIG from '../../constants/config';

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

export default class DeliverGoodsCell extends Component {

    constructor(props) {
        super (props);
    }

	render() {
		let num = 2;
		let tags = [1,1];

		return (
            <View style={{width: width,height: headerH + cellH * num,backgroundColor: 'white',}}>
				<View style={styles.header}>
					<Text style={styles.title} numberOfLines={1}>单号:175321</Text>
				</View>
				{tags.map((value, i) => {
                        return (
							<View style={styles.cell}>
								<Text style={styles.cellText1} numberOfLines={1}>SKU:2564123</Text>
								<Text style={styles.cellText2} numberOfLines={1}>商品条码:KT-2017156  红色/L</Text>
								<Text style={styles.cellText3} numberOfLines={1}>当前需发数:5</Text>
							</View>
                        );
                    })}
            </View>
		);
	}
}

let {width, height} = Dimensions.get('window');
let headerH = 30;
let cellH = 40;

const styles = StyleSheet.create({
    container: {

    },
	header: {
		width: width,
		height: headerH,
		backgroundColor: 'gray',
		alignItems: 'center',
		justifyContent: 'center',
	},
	title: {
		fontSize:15,
        alignItems: 'center',
		textAlign: 'left',
		marginLeft: 10,
		width: width-20,
	},
	cell: {
        width: width,
        height: 40,
        backgroundColor: 'white',
        flexDirection: 'row',
        alignItems: 'center',
		borderBottomWidth: 1,
		borderBottomColor: 'black',
    },
	cellText1: {
        fontSize:12,
        marginLeft: 10,
        width:  Math.ceil((width-20)/3)-30,
    	textAlign: 'left',
        color: 'black',
    },
    cellText2: {
        fontSize:12,
        width: Math.ceil((width-20)/3)+60,
    	textAlign: 'center',
        color: 'black',
    },
    cellText3: {
        fontSize:12,
        width: Math.ceil((width-20)/3)-30,
    	textAlign: 'right',
        color: 'black',
    },
});