...
|
...
|
@@ -62,12 +62,8 @@ export default class Recommend extends React.Component { |
|
|
let moduleOrder = resource.get('module_order') + 1;
|
|
|
let moduleType = resource.get('module_type');
|
|
|
let showTitle = false;
|
|
|
let bottomStyle ={};
|
|
|
if (rowID < list.length - 4) {
|
|
|
rowContainerHeight += 1;
|
|
|
}else {
|
|
|
bottomStyle ={borderBottomWidth: 0}
|
|
|
}
|
|
|
rowContainerHeight += 1;
|
|
|
|
|
|
if (rowData.get('text') && rowData.get('text') != '') {
|
|
|
rowContainerHeight += 20;
|
|
|
showTitle = true;
|
...
|
...
|
@@ -76,7 +72,7 @@ export default class Recommend extends React.Component { |
|
|
<TouchableOpacity yh_exposureData={yh_exposureData} activeOpacity={1.0} onPress={() => {
|
|
|
this.props.onPressProduct && this.props.onPressProduct(rowData.get('linkType'), rowData.get('resource'),moduleOrder,moduleType,rowID+1);
|
|
|
}}>
|
|
|
<View style={[styles.rowContainer, bottomStyle,{height: rowContainerHeight}]}>
|
|
|
<View style={[styles.rowContainer,{height: rowContainerHeight}]}>
|
|
|
<YH_Image url={rowData.get('pic')} style={styles.thumbnail}/>
|
|
|
|
|
|
{showTitle?
|
...
|
...
|
@@ -85,6 +81,7 @@ export default class Recommend extends React.Component { |
|
|
</View>
|
|
|
:null
|
|
|
}
|
|
|
<View style={{width: width,height: 1,backgroundColor: '#e5e5e5',}}/>
|
|
|
</View>
|
|
|
</TouchableOpacity>
|
|
|
|
...
|
...
|
@@ -105,7 +102,7 @@ export default class Recommend extends React.Component { |
|
|
}
|
|
|
list.map((item, i) => {
|
|
|
if (item.get('text') && item.get('text') != '') {
|
|
|
rowHeightArray[Math.floor(i/list.length)] = itemWidth + 21;
|
|
|
rowHeightArray[Math.floor(i/list.length)] = itemWidth + 20;
|
|
|
}
|
|
|
});
|
|
|
|
...
|
...
|
@@ -114,8 +111,6 @@ export default class Recommend extends React.Component { |
|
|
for (var i = 0; i < rowHeightArray.length; i++) {
|
|
|
backgroundHeight += rowHeightArray[i];
|
|
|
}
|
|
|
backgroundHeight -= 1;
|
|
|
|
|
|
if (isModuleMargin == '1') {
|
|
|
backgroundHeight += 10;
|
|
|
}
|
...
|
...
|
@@ -137,27 +132,30 @@ export default class Recommend extends React.Component { |
|
|
};
|
|
|
|
|
|
let {width, height} = Dimensions.get('window');
|
|
|
let itemWidth = width/4;
|
|
|
let itemWidth = (width - 4)/4;
|
|
|
const styles = StyleSheet.create({
|
|
|
contentContainer: {
|
|
|
width: width + 1,
|
|
|
flexDirection: 'row',
|
|
|
flexWrap: 'wrap',
|
|
|
backgroundColor: 'white',
|
|
|
backgroundColor: '#f5f7f6',
|
|
|
alignItems:'flex-start',
|
|
|
},
|
|
|
header: {
|
|
|
|
|
|
},
|
|
|
rowContainer: {
|
|
|
width: itemWidth,
|
|
|
width: itemWidth + 1,
|
|
|
height: itemWidth + 20,
|
|
|
backgroundColor: 'white',
|
|
|
backgroundColor: '#f5f7f6',
|
|
|
borderRightWidth: 1,
|
|
|
borderColor: '#e5e5e5',
|
|
|
|
|
|
|
|
|
},
|
|
|
thumbnail: {
|
|
|
width: itemWidth,
|
|
|
height: itemWidth,
|
|
|
height: itemWidth - 1,
|
|
|
backgroundColor: '#f5f7f6',
|
|
|
resizeMode: 'contain',
|
|
|
},
|
...
|
...
|
@@ -170,6 +168,7 @@ const styles = StyleSheet.create({ |
|
|
textAlign: 'center',
|
|
|
color: 'gray',
|
|
|
fontSize: 9,
|
|
|
backgroundColor: '#f5f7f6',
|
|
|
},
|
|
|
text: {
|
|
|
textAlign: 'center',
|
...
|
...
|
|