Authored by chenl

修复了品类页在android 7 点击无效的问题。review by liben。

... ... @@ -52,30 +52,14 @@ export default class HotCategoryList extends Component{
}
let imageUrl = SlicedImage.getSlicedUrl(rowData.get("default_images"), 98, 128, 2);
// let categoryName = rowData.get("category_name");
//数据类型,纯文字型和图片型,列表中会出现纯文本的情况,比如MORE
let dataType = rowData.get("data_type");
if(dataType && dataType == 'text')
return (
<TouchableOpacity activeOpacity={1} onPress={() => this.props.onPressHotCategoryItem && this.props.onPressHotCategoryItem(rowData.toJS(),rowID)}>
<View style={styles.rowContainer}>
<Text style={styles.rowText} numberOfLines={1}>{rowData.get("show_category_name")}</Text>
</View>
</TouchableOpacity>
);
else{
return (
<TouchableOpacity activeOpacity={1} onPress={() => this.props.onPressHotCategoryItem && this.props.onPressHotCategoryItem(rowData.toJS(),rowID)}>
<View style={styles.rowContainer}>
<Image style={styles.rowThumbnail} source={{uri: imageUrl}}/>
<View style={styles.rowTextContainer}><Text style={styles.rowText} numberOfLines={2}>{rowData.get("category_name")}</Text></View>
</View>
</TouchableOpacity>
);
}
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}}/>
<View style={styles.rowTextContainer}><Text style={styles.rowText} numberOfLines={2}>{rowData.get("category_name")}</Text></View>
</View>
</TouchableOpacity>
);
}
... ...