DeliverGoodsCell.js
2.11 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
'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',
},
});