Authored by chenl

Merge branch 'local' into 5.4

@@ -74,13 +74,18 @@ export default class CategoryBList extends Component { @@ -74,13 +74,18 @@ export default class CategoryBList extends Component {
74 74
75 switch (rowID) { 75 switch (rowID) {
76 case 'bannerInfo': 76 case 'bannerInfo':
77 - let imageUrl = getSlicedUrl(rowData.get("src"), 400, 125, 2);  
78 - return(  
79 - <TouchableOpacity activeOpacity={0.8} onPress={() => {  
80 - this.props.onPressBannerResourceItem && this.props.onPressBannerResourceItem(rowData.toJS())}}>  
81 - <Image style={styles.banner} source={{uri: imageUrl}}/>  
82 - </TouchableOpacity>  
83 - ); 77 + let data = rowData.get(0).get("data").get(0);
  78 + if(data){
  79 + let imageSrc = getSlicedUrl(data.get("src"), 400, 125, 2);
  80 + let url = data.get("url");
  81 + return(
  82 + <TouchableOpacity activeOpacity={0.8} onPress={() => {
  83 + this.props.onPressBannerResourceItem && this.props.onPressBannerResourceItem(url)}}>
  84 + <Image style={styles.banner} source={{uri: imageSrc}}/>
  85 + </TouchableOpacity>
  86 + );
  87 + }
  88 +
84 case 'sortInfo': 89 case 'sortInfo':
85 let hotTitle = "热门" + this.props.currentCateValue; 90 let hotTitle = "热门" + this.props.currentCateValue;
86 return ( 91 return (
@@ -51,24 +51,15 @@ export default class HotCategoryList extends Component{ @@ -51,24 +51,15 @@ export default class HotCategoryList extends Component{
51 51
52 renderRow(rowData, sectionID, rowID, highlightRow){ 52 renderRow(rowData, sectionID, rowID, highlightRow){
53 53
54 - // console.log("chenlin", "rowData数据:" + JSON.stringify(rowData));  
55 -  
56 -  
57 if (!rowData || rowData.length == 0) { 54 if (!rowData || rowData.length == 0) {
58 return null; 55 return null;
59 } 56 }
60 57
61 - let imageUrl = getSlicedUrl(rowData.get("default_images"), 106, 106, 2); 58 + let imageUrl = getSlicedUrl(rowData.get("default_images"), 82, 110, 2);
62 let categoryName = rowData.get("category_name"); 59 let categoryName = rowData.get("category_name");
63 60
64 //数据类型,纯文字型和图片型,列表中会出现纯文本的情况,比如MORE 61 //数据类型,纯文字型和图片型,列表中会出现纯文本的情况,比如MORE
65 let dataType = rowData.get("data_type"); 62 let dataType = rowData.get("data_type");
66 - // console.log("chenlin", "rowData数据:" + JSON.stringify(rowData));  
67 - // console.log("chenlin", "dataType数据:" + dataType);  
68 -  
69 - // return(  
70 - // <Text style={styles.rowText} numberOfLines={1}>{categoryName}</Text>  
71 - // );  
72 63
73 if(dataType && dataType == 'text') 64 if(dataType && dataType == 'text')
74 return ( 65 return (
@@ -95,15 +86,10 @@ export default class HotCategoryList extends Component{ @@ -95,15 +86,10 @@ export default class HotCategoryList extends Component{
95 render(){ 86 render(){
96 let {data} = this.props; 87 let {data} = this.props;
97 88
98 - console.log("chenlin", "data数据长度:" + data.length);  
99 -  
100 - // console.log("chenlin", "data数据:" + JSON.stringify(data));  
101 -  
102 -  
103 return( 89 return(
104 <View style={styles.container}> 90 <View style={styles.container}>
105 <ListView 91 <ListView
106 - pageSize={9} 92 + pageSize={3}
107 contentContainerStyle={styles.contentContainer} 93 contentContainerStyle={styles.contentContainer}
108 dataSource={this.dataSource.cloneWithRows(data)} 94 dataSource={this.dataSource.cloneWithRows(data)}
109 enableEmptySections={true} 95 enableEmptySections={true}
@@ -170,17 +156,19 @@ let styles = StyleSheet.create({ @@ -170,17 +156,19 @@ let styles = StyleSheet.create({
170 height: 70 * DEVICE_WIDTH_RATIO, 156 height: 70 * DEVICE_WIDTH_RATIO,
171 paddingLeft: 8.5 * DEVICE_WIDTH_RATIO, 157 paddingLeft: 8.5 * DEVICE_WIDTH_RATIO,
172 paddingRight: 8.5 * DEVICE_WIDTH_RATIO, 158 paddingRight: 8.5 * DEVICE_WIDTH_RATIO,
  159 + justifyContent: 'center',
  160 + alignItems: 'center',
173 }, 161 },
174 162
175 rowThumbnail:{ 163 rowThumbnail:{
176 - width: 53 * DEVICE_WIDTH_RATIO,  
177 - height: 53 * DEVICE_WIDTH_RATIO, 164 + width: 41 * DEVICE_WIDTH_RATIO,
  165 + height: 55 * DEVICE_WIDTH_RATIO,
178 }, 166 },
179 167
180 rowText:{ 168 rowText:{
181 width: 53 * DEVICE_WIDTH_RATIO, 169 width: 53 * DEVICE_WIDTH_RATIO,
182 - height: 17 * DEVICE_WIDTH_RATIO,  
183 - fontSize: 10 * DEVICE_WIDTH_RATIO, 170 + height: 15 * DEVICE_WIDTH_RATIO,
  171 + fontSize: 9 * DEVICE_WIDTH_RATIO,
184 color: '#B0B0B0', 172 color: '#B0B0B0',
185 textAlign: 'center', 173 textAlign: 'center',
186 }, 174 },
@@ -95,13 +95,13 @@ class CategoryBContainer extends Component { @@ -95,13 +95,13 @@ class CategoryBContainer extends Component {
95 this.props.actions.getCategoryBSubCategoryDetail(categoryId, categoryValue); 95 this.props.actions.getCategoryBSubCategoryDetail(categoryId, categoryValue);
96 } 96 }
97 97
98 - _onPressBannerResourceItem(value){  
99 - // console.log("chenlin", "调用点击事件:_onPressBannerResourceItem,参数为:" + value); 98 + _onPressBannerResourceItem(url){
  99 + if(url){
  100 + ReactNative.NativeModules.YH_CommonHelper.jumpWithUrl(url);
  101 + }
100 } 102 }
101 103
102 _onPressHotCategoryItem(value, index) { 104 _onPressHotCategoryItem(value, index) {
103 - console.log("chenlin", "调用点击事件:_onPressHotCategoryItem,参数为:" + JSON.stringify(value) + "index: " + index);  
104 -  
105 let currentChannelId = this.props.categoryB.currentChannelId; 105 let currentChannelId = this.props.categoryB.currentChannelId;
106 this.props.actions.jumpToCategory(value, index, currentChannelId); 106 this.props.actions.jumpToCategory(value, index, currentChannelId);
107 } 107 }