...
|
...
|
@@ -17,6 +17,8 @@ import GlobalHomeSwiper from './GlobalHomeSwiper'; |
|
|
import RecommendContentTwo from './RecommendContentTwo';
|
|
|
import RecommendContentFive from './RecommendContentFive';
|
|
|
import RecommendContentOne from './RecommendContentOne';
|
|
|
import SmallPic from './SmallPic';
|
|
|
import {getSlicedUrl} from '../../../classify/utils/Utils';
|
|
|
|
|
|
export default class Home extends Component {
|
|
|
|
...
|
...
|
@@ -54,7 +56,7 @@ export default class Home extends Component { |
|
|
}
|
|
|
|
|
|
_renderRow(rowData: object, sectionID: number, rowID: number) {
|
|
|
console.log(rowData.toJS());
|
|
|
// console.log(rowData.toJS());
|
|
|
if (rowData.get('template_name') == 'focus') {
|
|
|
return (
|
|
|
<GlobalHomeSwiper resource={rowData}/>
|
...
|
...
|
@@ -78,16 +80,29 @@ export default class Home extends Component { |
|
|
/>
|
|
|
);
|
|
|
}else if (rowData.get('template_name') == 'divideImage') {
|
|
|
let data = rowData.get('data').toJS();
|
|
|
let divideImage = getSlicedUrl(data[0].src, width, 20, 2);
|
|
|
if (!divideImage) {return null;}
|
|
|
return (
|
|
|
<Text>divideImage</Text>
|
|
|
<Image
|
|
|
source={{uri: divideImage}}
|
|
|
style={{width: width,height: 20}}
|
|
|
resizeMode={'cover'}
|
|
|
></Image>
|
|
|
);
|
|
|
}else if (rowData.get('template_name') == 'small_pic') {
|
|
|
return (
|
|
|
<Text>small_pic</Text>
|
|
|
<SmallPic
|
|
|
resource={rowData}
|
|
|
// onPressRecommendItem={this.props.onPressRecommendItem}
|
|
|
/>
|
|
|
);
|
|
|
}else if (rowData.get('template_name') == 'paramsGroup') {
|
|
|
let data = rowData.get('data');
|
|
|
return (
|
|
|
<Text>paramsGroup</Text>
|
|
|
<View style={styles.title}>
|
|
|
<Text style={styles.text}>{data.get('title')}</Text>
|
|
|
</View>
|
|
|
);
|
|
|
}
|
|
|
return null;
|
...
|
...
|
@@ -140,4 +155,17 @@ let styles = StyleSheet.create({ |
|
|
contentContainer: {
|
|
|
|
|
|
},
|
|
|
title: {
|
|
|
alignItems: 'center',
|
|
|
justifyContent: 'center',
|
|
|
height: 39,
|
|
|
width:width,
|
|
|
backgroundColor: 'white',
|
|
|
},
|
|
|
text: {
|
|
|
textAlign: 'center',
|
|
|
fontSize: 16,
|
|
|
fontWeight: 'bold',
|
|
|
color: '#444',
|
|
|
},
|
|
|
}); |
...
|
...
|
|