Authored by 张丽霞

为您推荐UI,review by redding

... ... @@ -50,16 +50,9 @@ export default class RecommendForYou extends Component {
/>
)
}
_renderSeperator(){
_renderSeperator(sectionID, rowID){
return (
<View style={styles.seperatorView}>
</View>
);
}
_renderHeader(){
return (
<View style={styles.seperatorView}>
<View style={styles.seperatorView} key={`${sectionID}-${rowID}`}>
</View>
);
}
... ... @@ -67,8 +60,8 @@ export default class RecommendForYou extends Component {
render() {
let {resource} = this.props;
let dataSource = {
hotBrandList: resource.get('hotBrandList').toArray(),
browseBrandList: resource.get('browseBrandList').toArray(),
hotBrandList: resource.get('hotBrandList').toArray(),
newBrandList: resource.get('newBrandList').toArray(),
};
return (
... ... @@ -78,7 +71,6 @@ export default class RecommendForYou extends Component {
dataSource={this.dataSource.cloneWithRows(dataSource)}
renderRow={this._renderRow}
renderSeparator={this._renderSeperator}
renderHeader={this._renderHeader}
enableEmptySections={true}
/>
... ... @@ -91,7 +83,8 @@ let {width, height} = Dimensions.get('window');
let styles = StyleSheet.create({
container: {
flex: 1,
width: width,
height: height - 64,
backgroundColor: '#f0f0f0',
},
contentContainer: {
... ...
... ... @@ -24,12 +24,13 @@ export default class RecommendForYouCell extends Component {
let {title, dataSource} = this.props;
let hideNewNum = false;
let footerHeight = 46;
let selfShowHeight = selfHeaderViewHeight + selfFooterViewHeight + TitleNumbCellHeight * Math.ceil(dataSource.length / 3);
if (title == '新入驻品牌') {
hideNewNum = true;
footerHeight = 30;
}
return (
<View style={styles.container}>
<View style={[styles.container,{height: selfShowHeight}]}>
<View style={styles.header}>
<Text style={styles.headerText}>{title}</Text>
</View>
... ... @@ -37,7 +38,7 @@ export default class RecommendForYouCell extends Component {
{dataSource.map((item, i) => {
return(
<RecForYouIconTitleNumbCell
key={i}
key={"TitleNumbCell" +i}
dataSource = {item}
hideNewNum={hideNewNum}
onPressShop={this.props.onPressShop}
... ... @@ -54,6 +55,9 @@ export default class RecommendForYouCell extends Component {
}
let {width, height} = Dimensions.get('window');
let TitleNumbCellHeight = Math.ceil((Dimensions.get('window').width - 40) / 3) + 26;
let selfHeaderViewHeight = 30;
let selfFooterViewHeight = 30;
let styles = StyleSheet.create({
container: {
... ... @@ -63,7 +67,7 @@ let styles = StyleSheet.create({
header: {
backgroundColor: 'white',
width: width,
height: 40,
height: selfHeaderViewHeight,
alignItems: 'center',
flexDirection: 'row',
},
... ... @@ -73,6 +77,7 @@ let styles = StyleSheet.create({
width: width,
textAlign: 'center',
backgroundColor: 'white',
marginTop: 12,
},
contentContainer: {
backgroundColor: 'white',
... ... @@ -82,7 +87,7 @@ let styles = StyleSheet.create({
},
footer: {
height: 16,
height: selfFooterViewHeight,
backgroundColor: 'white',
},
cellContainer: {
... ...