DeliverGoodsCell.js
2.67 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
'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 {resource} = this.props;
let id = resource?resource.id:0;
let tags = resource?resource.value:[];
let num = tags.length;
return (
<View style={{width: width,height: headerH + cellH * num,backgroundColor: 'white',}}>
<View style={styles.header}>
<Text style={styles.title} numberOfLines={1}>单号:{id}</Text>
</View>
{tags.map((value, i) => {
let sku = value.productSku;
let skuFactoryCode = value.skuFactoryCode?value.skuFactoryCode:0;//商品条码
let factoryGoodsName = value.factoryGoodsName?value.factoryGoodsName:0;//厂家颜色
let sizeName = value.sizeName?value.sizeName:0;//尺码名
let lastNum = value.num?value.num:0;
return (
<View style={styles.cell} key={'j_'+i}>
<Text style={styles.cellText1} numberOfLines={1}>SKU:{sku}</Text>
<Text style={styles.cellText2} numberOfLines={1}>商品条码:{skuFactoryCode} {factoryGoodsName}/{sizeName}</Text>
<Text style={styles.cellText3} numberOfLines={1}>当前需发数:{lastNum}</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',
},
});