MyOrderListCell.js
3.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
'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 MyOrderListCell 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,
},
});