ListHeader.js
1.92 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
import React, { Component } from 'react';
import {
StyleSheet,
Text,
View,
Image,
Dimensions,
} from 'react-native';
export default class ListHeader extends Component {
constructor(props) {
super(props);
}
render(){
let title=this.props.data.get('order_title','');
let orderStatus=this.props.data.get('status_str','');
let shouldShowIcon=this.props.data.get('order_type') == 7;
let src=require('../../image/huanhuo_ic.png');
return(
<View style={styles.container}>
<View style={styles.orderContainer}>
<View style={styles.codeStyle}>
<Text style={styles.title}>
{title}
</Text>
{shouldShowIcon?<Image style={styles.imageStyle} source={src}/>:null}
</View>
<Text style={styles.status}>
{orderStatus}
</Text>
</View>
</View>
);
}
}
let {w,h} = Dimensions.get('window');
const styles = StyleSheet.create({
container: {
flexDirection: 'column',
borderColor: '#e5e5e5',
borderBottomWidth: 1,
borderTopWidth:1,
},
orderContainer: {
width: w,
height: 56,
backgroundColor: 'white',
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'space-between'
},
codeStyle: {
flexDirection: 'row',
alignItems: 'center',
marginLeft: 15,
},
title: {
fontSize: 16,
fontFamily: 'STHeitiSC-Light',
color: '#444444',
},
status: {
fontSize: 16,
fontFamily: 'STHeitiSC-Light',
color: '#444444',
marginRight: 15,
},
imageStyle: {
backgroundColor: 'transparent',
alignItems: 'center',
marginLeft: 10,
},
});