...
|
...
|
@@ -51,11 +51,20 @@ export default class HotCategoryList extends Component{ |
|
|
return null;
|
|
|
}
|
|
|
|
|
|
let imageUrl = SlicedImage.getSlicedUrl(rowData.get("default_images"), 98, 128, 2);
|
|
|
let imageUrl = rowData.get("default_images");
|
|
|
let hasImage;
|
|
|
if(imageUrl){
|
|
|
imageUrl = SlicedImage.getSlicedUrl(rowData.get("default_images"), 98, 128, 2);
|
|
|
hasImage = true;
|
|
|
}
|
|
|
else
|
|
|
hasImage = false;
|
|
|
|
|
|
return (
|
|
|
<TouchableOpacity onPress={() => this.props.onPressHotCategoryItem && this.props.onPressHotCategoryItem(rowData.toJS(),rowID)}>
|
|
|
<View style={styles.rowContainer}>
|
|
|
<Image style={styles.rowThumbnail} key={imageUrl} source={{uri: imageUrl}}/>
|
|
|
{hasImage ? <Image style={styles.rowThumbnail} key={imageUrl} source={{uri:imageUrl}}/>
|
|
|
: <View style={styles.rowDefaultImageContainer}><Image style={styles.rowDefaultImage} source={require('../../images/yoho_icon.png')}/></View>}
|
|
|
<View style={styles.rowTextContainer}><Text style={styles.rowText} numberOfLines={2}>{rowData.get("category_name")}</Text></View>
|
|
|
</View>
|
|
|
</TouchableOpacity>
|
...
|
...
|
@@ -158,6 +167,18 @@ let styles = StyleSheet.create({ |
|
|
height: 65 * DEVICE_WIDTH_RATIO,
|
|
|
},
|
|
|
|
|
|
rowDefaultImageContainer:{
|
|
|
width: 48 * DEVICE_WIDTH_RATIO,
|
|
|
height: 65 * DEVICE_WIDTH_RATIO,
|
|
|
justifyContent: 'center',
|
|
|
alignItems: 'center',
|
|
|
},
|
|
|
|
|
|
rowDefaultImage:{
|
|
|
width: 48 * DEVICE_WIDTH_RATIO,
|
|
|
height: 28 * DEVICE_WIDTH_RATIO,
|
|
|
},
|
|
|
|
|
|
rowTextContainer:{
|
|
|
width: 53 * DEVICE_WIDTH_RATIO,
|
|
|
height: 28 * DEVICE_WIDTH_RATIO,
|
...
|
...
|
|