|
|
/**
|
|
|
* Created by zzz on 2019/5/21.
|
|
|
*/
|
|
|
'use strict';
|
|
|
|
|
|
import React, {Component} from 'react';
|
|
|
import {Dimensions, Image, ListView, StyleSheet, Text, TouchableOpacity, View, NativeModules} from 'react-native';
|
|
|
import {Immutable} from "immutable";
|
|
|
import YH_Image from '../../../common/components/YH_Image';
|
|
|
import SlicedImage from '../../../common/components/SlicedImage'
|
|
|
|
|
|
export default class ContentNotifyListCell extends Component {
|
|
|
constructor(props) {
|
|
|
super(props);
|
|
|
}
|
|
|
|
|
|
render() {
|
|
|
let imageUri = 'http://img10.static.yhbimg.com/couponImg/2017/02/23/16/0199db13b531e2ae5b4c69fa34c198c902.png?imageView/{mode}/w/{width}/h/{height}';
|
|
|
imageUri = SlicedImage.getSlicedUrl(imageUri, 50, 50, 2);
|
|
|
|
|
|
let {itemData} = this.props;
|
|
|
|
|
|
return (
|
|
|
<View style= {styles.cellContainer}>
|
|
|
|
|
|
<View style={styles.headContainer}>
|
|
|
<Text style={styles.headTextStyle}>
|
|
|
今天 12:03
|
|
|
</Text>
|
|
|
<View style={[styles.headSeparator]}/>
|
|
|
</View>
|
|
|
|
|
|
<View style={styles.editContainer}>
|
|
|
<TouchableOpacity
|
|
|
activeOpacity={1}
|
|
|
onLongPress={() =>{
|
|
|
this.props.onLongPressListItem && this.props.onLongPressListItem(itemData);
|
|
|
}}
|
|
|
onPress={() =>{
|
|
|
this.props.onPressListItem && this.props.onPressListItem(itemData);
|
|
|
}}
|
|
|
>
|
|
|
<View style={styles.contentContainer}>
|
|
|
<View style={styles.descStyle}>
|
|
|
<Image
|
|
|
style={styles.iconStyle}
|
|
|
source={{uri: imageUri}}
|
|
|
resizeMode="contain"
|
|
|
/>
|
|
|
<View style={styles.textContainer}>
|
|
|
<Text
|
|
|
style={styles.detail}
|
|
|
numberOfLines={2}
|
|
|
>
|
|
|
恭喜您!您发布的内容为优质内容,获得有货社区重点推荐
|
|
|
</Text>
|
|
|
</View>
|
|
|
</View>
|
|
|
</View>
|
|
|
</TouchableOpacity>
|
|
|
|
|
|
<TouchableOpacity
|
|
|
activeOpacity={1}
|
|
|
onPress={() => {
|
|
|
this.props.onPressListItem && this.props.onPressListItem(itemData)
|
|
|
}
|
|
|
}
|
|
|
>
|
|
|
<View style={styles.footContainer}>
|
|
|
<View style={styles.footSeparator} />
|
|
|
<View style={styles.footextContainer}>
|
|
|
<Text style={styles.footextStyle}>
|
|
|
查看原文
|
|
|
</Text>
|
|
|
</View>
|
|
|
</View>
|
|
|
</TouchableOpacity>
|
|
|
|
|
|
</View>
|
|
|
|
|
|
</View>
|
|
|
);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
let { width, height } = Dimensions.get('window');
|
|
|
const DEVICE_HEIGHT_RATIO = height / 667;
|
|
|
|
|
|
let styles = StyleSheet.create({
|
|
|
cellContainer: {
|
|
|
backgroundColor: 'transparent',
|
|
|
flexDirection: 'column',
|
|
|
justifyContent: 'flex-start',
|
|
|
},
|
|
|
headContainer: {
|
|
|
flexDirection: 'column',
|
|
|
width,
|
|
|
height: 40,
|
|
|
backgroundColor: '#f2f2f2',
|
|
|
},
|
|
|
headTextStyle: {
|
|
|
fontSize: 13,
|
|
|
backgroundColor: 'transparent',
|
|
|
color: '#b0b0b0',
|
|
|
textAlign: 'center',
|
|
|
marginTop: 13
|
|
|
},
|
|
|
headSeparator: {
|
|
|
marginTop: 10.5,
|
|
|
backgroundColor: '#e0e0e0',
|
|
|
width,
|
|
|
height: 0.5,
|
|
|
},
|
|
|
|
|
|
editContainer: {
|
|
|
backgroundColor: 'white',
|
|
|
width
|
|
|
},
|
|
|
contentContainer: {
|
|
|
flex: 1,
|
|
|
minHeight: 71,
|
|
|
flexDirection: 'column',
|
|
|
backgroundColor: 'white',
|
|
|
justifyContent: 'center'
|
|
|
},
|
|
|
descStyle:{
|
|
|
flexDirection: 'row',
|
|
|
backgroundColor: 'white',
|
|
|
alignItems: 'center',
|
|
|
},
|
|
|
iconStyle: {
|
|
|
marginLeft: 15,
|
|
|
width: 50,
|
|
|
height: 50
|
|
|
},
|
|
|
textContainer: {
|
|
|
flex: 1,
|
|
|
flexDirection: 'column',
|
|
|
justifyContent: 'space-between',
|
|
|
alignItems: 'flex-start',
|
|
|
},
|
|
|
titleStyle: {
|
|
|
marginLeft: 10,
|
|
|
fontSize: 13,
|
|
|
fontWeight: 'bold',
|
|
|
color: '#444444',
|
|
|
marginRight: 15,
|
|
|
backgroundColor: 'transparent'
|
|
|
},
|
|
|
detail:{
|
|
|
marginLeft: 10,
|
|
|
fontSize: 13,
|
|
|
fontWeight: 'bold',
|
|
|
color: '#444444',
|
|
|
maxWidth: width-15-50-10-22,
|
|
|
lineHeight: 18,
|
|
|
backgroundColor: 'transparent'
|
|
|
},
|
|
|
|
|
|
footContainer: {
|
|
|
flexDirection: 'column',
|
|
|
height: 44,
|
|
|
backgroundColor: 'white',
|
|
|
width
|
|
|
},
|
|
|
footSeparator: {
|
|
|
marginLeft: 15,
|
|
|
height: 0.5,
|
|
|
width: width-15,
|
|
|
backgroundColor: '#e0e0e0'
|
|
|
},
|
|
|
footextContainer: {
|
|
|
flexDirection: 'row',
|
|
|
justifyContent: 'space-between',
|
|
|
height: 43,
|
|
|
width,
|
|
|
backgroundColor: 'white',
|
|
|
alignItems: 'center'
|
|
|
},
|
|
|
footextStyle: {
|
|
|
marginLeft: 15,
|
|
|
color: '#444444',
|
|
|
backgroundColor: 'transparent',
|
|
|
textAlign: 'left',
|
|
|
fontSize: 14,
|
|
|
fontWeight: 'bold'
|
|
|
},
|
|
|
}); |
...
|
...
|
|