MessageDetail.js
2.36 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
'use strict';
import React from 'react';
import ReactNative from 'react-native';
const {
Component,
} = React;
const {
View,
Text,
StyleSheet,
} = ReactNative;
export default class MessageDetail extends Component {
static propTypes = {
title: React.PropTypes.string,
time: React.PropTypes.string,
content: React.PropTypes.string,
};
constructor(props) {
super(props);
}
renderName() {
return (
<Text style={{color: '#444444', fontSize: 13, marginLeft: 15, marginBottom: 6,}}>尊敬的用户:</Text>
);
}
render() {
return (
<View style={styles.container}>
<View style={styles.message}>
<View style={styles.row_top}>
<Text style={styles.title}>{this.props.title}</Text>
</View>
<View style={styles.line}/>
{this.props.hasHead ? this.renderName() : null}
<Text style={styles.subtitle}>{this.props.content}</Text>
<Text style={styles.company}>Yoho!buy有货</Text>
<Text style={styles.time}>{this.props.time}</Text>
</View>
</View>
);
}
}
const styles = StyleSheet.create({
container:{
flex: 1,
},
message: {
backgroundColor: 'white',
},
title: {
flex: 1,
color: '#444444',
fontSize: 20,
marginLeft: 10,
marginRight: 18,
},
row_top: {
flexDirection: 'row',
height: 50,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: 'white',
},
subtitle: {
fontSize: 13,
marginLeft: 15,
color: '#444444',
marginRight: 18,
},
column: {
flexDirection: 'column',
height: 100,
backgroundColor: 'white',
},
line: {
height: 1,
backgroundColor: '#B0B0B0',
marginLeft: 15,
marginBottom: 15,
},
company: {
fontSize: 12,
alignSelf: 'flex-end',
marginTop: 15,
marginRight: 15,
color: '#B0B0B0',
},
time: {
fontSize: 12,
alignSelf: 'flex-end',
marginTop: 2,
marginRight: 15,
marginBottom: 15,
color: '#B0B0B0',
},
});