|
@@ -24,12 +24,13 @@ export default class RecommendForYouCell extends Component { |
|
@@ -24,12 +24,13 @@ export default class RecommendForYouCell extends Component { |
24
|
let {title, dataSource} = this.props;
|
24
|
let {title, dataSource} = this.props;
|
25
|
let hideNewNum = false;
|
25
|
let hideNewNum = false;
|
26
|
let footerHeight = 46;
|
26
|
let footerHeight = 46;
|
|
|
27
|
+ let selfShowHeight = selfHeaderViewHeight + selfFooterViewHeight + TitleNumbCellHeight * Math.ceil(dataSource.length / 3);
|
27
|
if (title == '新入驻品牌') {
|
28
|
if (title == '新入驻品牌') {
|
28
|
hideNewNum = true;
|
29
|
hideNewNum = true;
|
29
|
footerHeight = 30;
|
30
|
footerHeight = 30;
|
30
|
}
|
31
|
}
|
31
|
return (
|
32
|
return (
|
32
|
- <View style={styles.container}>
|
33
|
+ <View style={[styles.container,{height: selfShowHeight}]}>
|
33
|
<View style={styles.header}>
|
34
|
<View style={styles.header}>
|
34
|
<Text style={styles.headerText}>{title}</Text>
|
35
|
<Text style={styles.headerText}>{title}</Text>
|
35
|
</View>
|
36
|
</View>
|
|
@@ -37,7 +38,7 @@ export default class RecommendForYouCell extends Component { |
|
@@ -37,7 +38,7 @@ export default class RecommendForYouCell extends Component { |
37
|
{dataSource.map((item, i) => {
|
38
|
{dataSource.map((item, i) => {
|
38
|
return(
|
39
|
return(
|
39
|
<RecForYouIconTitleNumbCell
|
40
|
<RecForYouIconTitleNumbCell
|
40
|
- key={i}
|
41
|
+ key={"TitleNumbCell" +i}
|
41
|
dataSource = {item}
|
42
|
dataSource = {item}
|
42
|
hideNewNum={hideNewNum}
|
43
|
hideNewNum={hideNewNum}
|
43
|
onPressShop={this.props.onPressShop}
|
44
|
onPressShop={this.props.onPressShop}
|
|
@@ -54,6 +55,9 @@ export default class RecommendForYouCell extends Component { |
|
@@ -54,6 +55,9 @@ export default class RecommendForYouCell extends Component { |
54
|
}
|
55
|
}
|
55
|
|
56
|
|
56
|
let {width, height} = Dimensions.get('window');
|
57
|
let {width, height} = Dimensions.get('window');
|
|
|
58
|
+let TitleNumbCellHeight = Math.ceil((Dimensions.get('window').width - 40) / 3) + 26;
|
|
|
59
|
+let selfHeaderViewHeight = 30;
|
|
|
60
|
+let selfFooterViewHeight = 30;
|
57
|
|
61
|
|
58
|
let styles = StyleSheet.create({
|
62
|
let styles = StyleSheet.create({
|
59
|
container: {
|
63
|
container: {
|
|
@@ -63,7 +67,7 @@ let styles = StyleSheet.create({ |
|
@@ -63,7 +67,7 @@ let styles = StyleSheet.create({ |
63
|
header: {
|
67
|
header: {
|
64
|
backgroundColor: 'white',
|
68
|
backgroundColor: 'white',
|
65
|
width: width,
|
69
|
width: width,
|
66
|
- height: 40,
|
70
|
+ height: selfHeaderViewHeight,
|
67
|
alignItems: 'center',
|
71
|
alignItems: 'center',
|
68
|
flexDirection: 'row',
|
72
|
flexDirection: 'row',
|
69
|
},
|
73
|
},
|
|
@@ -73,6 +77,7 @@ let styles = StyleSheet.create({ |
|
@@ -73,6 +77,7 @@ let styles = StyleSheet.create({ |
73
|
width: width,
|
77
|
width: width,
|
74
|
textAlign: 'center',
|
78
|
textAlign: 'center',
|
75
|
backgroundColor: 'white',
|
79
|
backgroundColor: 'white',
|
|
|
80
|
+ marginTop: 12,
|
76
|
},
|
81
|
},
|
77
|
contentContainer: {
|
82
|
contentContainer: {
|
78
|
backgroundColor: 'white',
|
83
|
backgroundColor: 'white',
|
|
@@ -82,7 +87,7 @@ let styles = StyleSheet.create({ |
|
@@ -82,7 +87,7 @@ let styles = StyleSheet.create({ |
82
|
|
87
|
|
83
|
},
|
88
|
},
|
84
|
footer: {
|
89
|
footer: {
|
85
|
- height: 16,
|
90
|
+ height: selfFooterViewHeight,
|
86
|
backgroundColor: 'white',
|
91
|
backgroundColor: 'white',
|
87
|
},
|
92
|
},
|
88
|
cellContainer: {
|
93
|
cellContainer: {
|