MyOrderDetailPayListCell.js 3.21 KB
'use strict';
import React from 'react';
import ReactNative, {
    View,
    Text,
    Image,
    StyleSheet,
    Dimensions,
    TouchableOpacity,
} from 'react-native';

import Immutable, {Map} from 'immutable';

export default class MyOrderDetailPayListCell extends React.Component {
    constructor(props) {
        super(props);
    }

    render() {
        let{cardNo, cardBank} = this.props.data;

        let goodsName = "Adidas Originals KS full size";
        let goodsSkn = "FULXN 2526542";
        let orderTime = "2015.12.13";
        let orderMoney = "¥ 455";
        let isOrderPaying = false;
        let orderStateText = "还款中1/3";

        let colorStyle = isOrderPaying ? {color: '#444444'} : {color: '#b0b0b0'};


        return(
            <TouchableOpacity activeOpacity={1} onPress={() => this.props.onPressOrder && this.props.onPressOrder()}>
                <View style={styles.container} >
                    <Image style={styles.goodsImage} source={require("../../image/bank/bank-ABC.png")} />
                    <Text style={styles.goodsName} numberOfLines={1}>{goodsName}</Text>
                    <Text style={styles.goodsSkn} numberOfLines={1}>{goodsSkn}</Text>
                    <Text style={styles.orderTime} numberOfLines={1}>{orderTime}</Text>
                    <Text style={styles.orderMoney} numberOfLines={1}>{orderMoney}</Text>
                    <Text style={[styles.orderStateText, colorStyle]} numberOfLines={1}>{orderStateText}</Text>
                </View>
            </TouchableOpacity>
        );
    }



};




let {width, height} = Dimensions.get('window');
const DEVICE_WIDTH_RATIO = width / 320;

let styles = StyleSheet.create({
    container: {
        flex: 1,
        width: width,
        height: 80 * DEVICE_WIDTH_RATIO,
        borderBottomColor: '#e0e0e0',
        borderBottomWidth: 0.5,
        // alignItems: 'center',
        // justifyContent: 'center',
        // paddingTop: 10 * DEVICE_WIDTH_RATIO,
        // paddingLeft: 15 * DEVICE_WIDTH_RATIO,
        // paddingRight: 15 * DEVICE_WIDTH_RATIO,

    },
    goodsImage:{
        position: 'absolute',
        top: 10 * DEVICE_WIDTH_RATIO,
        left: 15 * DEVICE_WIDTH_RATIO,
        width: 45 * DEVICE_WIDTH_RATIO,
        height: 60 * DEVICE_WIDTH_RATIO,
    },

    goodsName:{
        position: 'absolute',
        top: 15 * DEVICE_WIDTH_RATIO,
        left: 70 * DEVICE_WIDTH_RATIO,
        color: "#444444",
        fontSize: 12 * DEVICE_WIDTH_RATIO,
    },

    goodsSkn:{
        position: 'absolute',
        top: 30 * DEVICE_WIDTH_RATIO,
        left: 70 * DEVICE_WIDTH_RATIO,
        color: "#444444",
        fontSize: 12 * DEVICE_WIDTH_RATIO,
    },

    orderTime:{
        position: 'absolute',
        top: 50 * DEVICE_WIDTH_RATIO,
        left: 70 * DEVICE_WIDTH_RATIO,
        color: "#b0b0b0",
        fontSize: 12 * DEVICE_WIDTH_RATIO,
    },

    orderMoney:{
        position: 'absolute',
        top: 15 * DEVICE_WIDTH_RATIO,
        right: 15 * DEVICE_WIDTH_RATIO,
        color: "#444444",
        fontSize: 14 * DEVICE_WIDTH_RATIO,
    },

    orderStateText:{
        position: 'absolute',
        top: 45 * DEVICE_WIDTH_RATIO,
        right: 15 * DEVICE_WIDTH_RATIO,
        fontSize: 12 * DEVICE_WIDTH_RATIO,
    },

});