Authored by chenl

Merge branch 'local' into 5.4

... ... @@ -74,13 +74,18 @@ export default class CategoryBList extends Component {
switch (rowID) {
case 'bannerInfo':
let imageUrl = getSlicedUrl(rowData.get("src"), 400, 125, 2);
return(
<TouchableOpacity activeOpacity={0.8} onPress={() => {
this.props.onPressBannerResourceItem && this.props.onPressBannerResourceItem(rowData.toJS())}}>
<Image style={styles.banner} source={{uri: imageUrl}}/>
</TouchableOpacity>
);
let data = rowData.get(0).get("data").get(0);
if(data){
let imageSrc = getSlicedUrl(data.get("src"), 400, 125, 2);
let url = data.get("url");
return(
<TouchableOpacity activeOpacity={0.8} onPress={() => {
this.props.onPressBannerResourceItem && this.props.onPressBannerResourceItem(url)}}>
<Image style={styles.banner} source={{uri: imageSrc}}/>
</TouchableOpacity>
);
}
case 'sortInfo':
let hotTitle = "热门" + this.props.currentCateValue;
return (
... ...
... ... @@ -51,24 +51,15 @@ export default class HotCategoryList extends Component{
renderRow(rowData, sectionID, rowID, highlightRow){
// console.log("chenlin", "rowData数据:" + JSON.stringify(rowData));
if (!rowData || rowData.length == 0) {
return null;
}
let imageUrl = getSlicedUrl(rowData.get("default_images"), 106, 106, 2);
let imageUrl = getSlicedUrl(rowData.get("default_images"), 82, 110, 2);
let categoryName = rowData.get("category_name");
//数据类型,纯文字型和图片型,列表中会出现纯文本的情况,比如MORE
let dataType = rowData.get("data_type");
// console.log("chenlin", "rowData数据:" + JSON.stringify(rowData));
// console.log("chenlin", "dataType数据:" + dataType);
// return(
// <Text style={styles.rowText} numberOfLines={1}>{categoryName}</Text>
// );
if(dataType && dataType == 'text')
return (
... ... @@ -95,15 +86,10 @@ export default class HotCategoryList extends Component{
render(){
let {data} = this.props;
console.log("chenlin", "data数据长度:" + data.length);
// console.log("chenlin", "data数据:" + JSON.stringify(data));
return(
<View style={styles.container}>
<ListView
pageSize={9}
pageSize={3}
contentContainerStyle={styles.contentContainer}
dataSource={this.dataSource.cloneWithRows(data)}
enableEmptySections={true}
... ... @@ -170,17 +156,19 @@ let styles = StyleSheet.create({
height: 70 * DEVICE_WIDTH_RATIO,
paddingLeft: 8.5 * DEVICE_WIDTH_RATIO,
paddingRight: 8.5 * DEVICE_WIDTH_RATIO,
justifyContent: 'center',
alignItems: 'center',
},
rowThumbnail:{
width: 53 * DEVICE_WIDTH_RATIO,
height: 53 * DEVICE_WIDTH_RATIO,
width: 41 * DEVICE_WIDTH_RATIO,
height: 55 * DEVICE_WIDTH_RATIO,
},
rowText:{
width: 53 * DEVICE_WIDTH_RATIO,
height: 17 * DEVICE_WIDTH_RATIO,
fontSize: 10 * DEVICE_WIDTH_RATIO,
height: 15 * DEVICE_WIDTH_RATIO,
fontSize: 9 * DEVICE_WIDTH_RATIO,
color: '#B0B0B0',
textAlign: 'center',
},
... ...
... ... @@ -95,13 +95,13 @@ class CategoryBContainer extends Component {
this.props.actions.getCategoryBSubCategoryDetail(categoryId, categoryValue);
}
_onPressBannerResourceItem(value){
// console.log("chenlin", "调用点击事件:_onPressBannerResourceItem,参数为:" + value);
_onPressBannerResourceItem(url){
if(url){
ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(url);
}
}
_onPressHotCategoryItem(value, index) {
console.log("chenlin", "调用点击事件:_onPressHotCategoryItem,参数为:" + JSON.stringify(value) + "index: " + index);
let currentChannelId = this.props.categoryB.currentChannelId;
this.props.actions.jumpToCategory(value, index, currentChannelId);
}
... ...