myMessageDetail.js
2.68 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
/**
* Created by tdzl2003 on 12/18/16.
*/
import React, {Component, PropTypes} from "react";
import {
Dimensions,
Image,
ScrollView,
StyleSheet,
Text,
TouchableOpacity,
View,
Platform,
FlatList,
BackHandler,
ActivityIndicator,
StatusBar
} from "react-native";
import Toast from 'react-native-root-toast';
import {zoomW, zoomH, width} from '../../utils/getSize';
import {timeChange} from '../../utils/utils';
const noResult = require('../../img/noResult.png');
const submitLog = require('../../img/submitLog.png');
import AppService from '../../service/AppService';
import moment from "moment";
function isIphoneX() {
let dimen = Dimensions.get('window');
return (
Platform.OS === 'ios' &&
!Platform.isPad &&
!Platform.isTVOS &&
(dimen.height === 812 || dimen.width === 812)
);
}
export default class myMessageDetail extends Component {
static navigationOptions = ({navigation}) => ({
headerTitle:'我的消息',
headerLeft:(
<TouchableOpacity style={styles.backWrap} onPress={() => navigation.goBack()}>
<Image source={require('../../img/back_gray.png')} resizeMode="contain" />
</TouchableOpacity>
),
headerRight:(
<View></View>
)
});
constructor(props){
super(props);
this.state = {
item:{}
};
}
/*页面初始化*/
componentWillMount(){
this.setState({
item:this.props.navigation.state.params.item
})
};
componentWillUnmount(){
}
componentDidMount(){
}
render(){
return(
<View style={styles.bg}>
<StatusBar barStyle={'default'}/>
<Text style={{marginTop:30,fontSize:20,fontWeight:'900'}}>{this.state.item.title}</Text>
<Text numberOfLines={0} style={{marginTop:30,fontSize:17,lineHeight:30,color:'rgba(0,0,0,.5)'}}>{this.state.item.content}</Text>
<View style={{width:width,marginTop:30,alignItems: 'flex-end',paddingRight:15}}>
<Text style={{color:'rgba(0,0,0,.5)',fontSize:18}}>{moment(Number(this.state.item.creationTime)).format('YYYY-MM-DD HH:ss')}</Text>
</View>
</View>
)
}
}
const styles = StyleSheet.create({
backWrap: {
justifyContent: 'center',
paddingLeft: 18.5/zoomW,
paddingRight: 18.5/zoomW,
height: 44/zoomH,
},
back: {
width: 8.5/zoomW,
height: 15/zoomH,
},
bg:{
flex:1,
backgroundColor:'#fff',
alignItems: 'center',
paddingLeft: 15,
paddingRight: 15
},
});