...
|
...
|
@@ -20,12 +20,12 @@ export default class MessageCell extends Component { |
|
|
renderUnreaderMsg(rowData) {
|
|
|
let msgNumber = rowData.get('unReadCount', 0);
|
|
|
if (msgNumber <= 0) {
|
|
|
return null;
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
return (
|
|
|
<View style={styles.unreadMsgContainerStyle}>
|
|
|
<Text style={styles.unreadMsgStyle}>
|
|
|
<View style={styles.unreadMsgContainer}>
|
|
|
<Text style={styles.unreadMsg}>
|
|
|
{msgNumber}
|
|
|
</Text>
|
|
|
</View>
|
...
|
...
|
@@ -40,25 +40,25 @@ export default class MessageCell extends Component { |
|
|
this.props.onPressListItem && this.props.onPressListItem(data);
|
|
|
}}
|
|
|
>
|
|
|
<View style={styles.rowContainer}>
|
|
|
<View style={styles.iconContainerStyle}>
|
|
|
<Image style={styles.iconStyle}/>
|
|
|
{this.renderUnreaderMsg(data)}
|
|
|
<View style={styles.rowContainer}>
|
|
|
<View style={styles.iconContainer}>
|
|
|
<Image style={styles.iconStyle}/>
|
|
|
{this.renderUnreaderMsg(data)}
|
|
|
</View>
|
|
|
<View style={styles.cellContent}>
|
|
|
<View style={styles.titleContainer}>
|
|
|
<Text style={styles.titleStyle}>
|
|
|
{data.get('inboxCatName')}
|
|
|
</Text>
|
|
|
<Text style={styles.timeStyle}>
|
|
|
{data.get('createTime')}
|
|
|
</Text>
|
|
|
</View>
|
|
|
<Text style={styles.subTitle}>
|
|
|
{data.get('content')}
|
|
|
</Text>
|
|
|
</View>
|
|
|
</View>
|
|
|
<View style={styles.cellContentStyle}>
|
|
|
<View style={styles.titleContainerStyle}>
|
|
|
<Text style={styles.titleStyle}>
|
|
|
{data.get('inboxCatName')}
|
|
|
</Text>
|
|
|
<Text style={styles.timeStyle}>
|
|
|
{data.get('createTime')}
|
|
|
</Text>
|
|
|
</View>
|
|
|
<Text style={styles.subTitleStyle}>
|
|
|
{data.get('content')}
|
|
|
</Text>
|
|
|
</View>
|
|
|
</View>
|
|
|
</TouchableOpacity>
|
|
|
);
|
|
|
}
|
...
|
...
|
@@ -77,60 +77,60 @@ let styles = StyleSheet.create({ |
|
|
height:70,
|
|
|
alignItems:'center',
|
|
|
},
|
|
|
iconContainerStyle:{
|
|
|
iconContainer: {
|
|
|
flexDirection:'row',
|
|
|
marginLeft: 15,
|
|
|
marginRight:15,
|
|
|
backgroundColor:'transparent',
|
|
|
width:50,
|
|
|
height:50,
|
|
|
marginRight: 15,
|
|
|
backgroundColor: 'transparent',
|
|
|
width: 50,
|
|
|
height: 50,
|
|
|
},
|
|
|
iconStyle:{
|
|
|
backgroundColor:'yellow',
|
|
|
width:50,
|
|
|
height:50,
|
|
|
resizeMode:'center',
|
|
|
iconStyle: {
|
|
|
backgroundColor: 'yellow',
|
|
|
width: 50,
|
|
|
height: 50,
|
|
|
resizeMode: 'center',
|
|
|
},
|
|
|
unreadMsgContainerStyle:{
|
|
|
height:18,
|
|
|
marginTop:-5,
|
|
|
marginLeft:-12,
|
|
|
backgroundColor:'#d0021b',
|
|
|
justifyContent:'center',
|
|
|
borderRadius:10,
|
|
|
minWidth:18,
|
|
|
unreadMsgContainer: {
|
|
|
height: 18,
|
|
|
marginTop: -5,
|
|
|
marginLeft: -12,
|
|
|
backgroundColor: '#d0021b',
|
|
|
justifyContent: 'center',
|
|
|
borderRadius: 10,
|
|
|
minWidth: 18,
|
|
|
},
|
|
|
unreadMsgStyle:{
|
|
|
textAlign:'center',
|
|
|
justifyContent:'center',
|
|
|
fontSize:10,
|
|
|
color:'white',
|
|
|
backgroundColor:'transparent',
|
|
|
padding:5,
|
|
|
unreadMsg: {
|
|
|
textAlign: 'center',
|
|
|
justifyContent: 'center',
|
|
|
fontSize: 10,
|
|
|
color: 'white',
|
|
|
backgroundColor: 'transparent',
|
|
|
padding: 5,
|
|
|
},
|
|
|
cellContentStyle:{
|
|
|
flexDirection:'column',
|
|
|
marginRight:15,
|
|
|
width:width-45-50
|
|
|
cellContent: {
|
|
|
flexDirection: 'column',
|
|
|
marginRight: 15,
|
|
|
width: width-45-50
|
|
|
},
|
|
|
titleContainerStyle:{
|
|
|
flexDirection:'row',
|
|
|
alignItems:'center',
|
|
|
marginBottom:8,
|
|
|
titleContainer: {
|
|
|
flexDirection: 'row',
|
|
|
alignItems: 'center',
|
|
|
marginBottom: 8,
|
|
|
},
|
|
|
titleStyle:{
|
|
|
fontSize:15,
|
|
|
fontWeight:'bold',
|
|
|
color:'#444444',
|
|
|
backgroundColor:'transparent'
|
|
|
titleStyle: {
|
|
|
fontSize: 15,
|
|
|
fontWeight: 'bold',
|
|
|
color: '#444444',
|
|
|
backgroundColor: 'transparent'
|
|
|
},
|
|
|
timeStyle:{
|
|
|
fontSize:11,
|
|
|
color:'#b0b0b0',
|
|
|
timeStyle: {
|
|
|
fontSize: 11,
|
|
|
color: '#b0b0b0',
|
|
|
},
|
|
|
subTitleStyle:{
|
|
|
fontSize:12,
|
|
|
color:'#b0b0b0',
|
|
|
backgroundColor:'transparent'
|
|
|
subTitle: {
|
|
|
fontSize: 12,
|
|
|
color: '#b0b0b0',
|
|
|
backgroundColor: 'transparent'
|
|
|
}
|
|
|
}); |
...
|
...
|
|