四张图的情况,有title展示,没有不展示,review by redding
Showing
1 changed file
with
6 additions
and
5 deletions
@@ -36,18 +36,19 @@ export default class Recommend extends React.Component { | @@ -36,18 +36,19 @@ export default class Recommend extends React.Component { | ||
36 | } | 36 | } |
37 | 37 | ||
38 | renderRow(rowData, sectionID, rowID, highlightRow) { | 38 | renderRow(rowData, sectionID, rowID, highlightRow) { |
39 | - let rowContainerHeight = itemWidth + 20; | 39 | + let rowContainerHeight = itemWidth; |
40 | let {resource} = this.props; | 40 | let {resource} = this.props; |
41 | let list = resource.get('module_data').get('data').toArray(); | 41 | let list = resource.get('module_data').get('data').toArray(); |
42 | - | 42 | + let showTitle = false; |
43 | let bottomStyle ={}; | 43 | let bottomStyle ={}; |
44 | if (rowID < list.length - 4) { | 44 | if (rowID < list.length - 4) { |
45 | rowContainerHeight += 1; | 45 | rowContainerHeight += 1; |
46 | }else { | 46 | }else { |
47 | bottomStyle ={borderBottomWidth: 0} | 47 | bottomStyle ={borderBottomWidth: 0} |
48 | } | 48 | } |
49 | - if (rowData.get('linkType') == 1 && !rowData.get('showProductInfo')) { | ||
50 | - rowContainerHeight -= 20; | 49 | + if (rowData.get('text') && rowData.get('text') != '') { |
50 | + rowContainerHeight += 20; | ||
51 | + showTitle = true; | ||
51 | } | 52 | } |
52 | return ( | 53 | return ( |
53 | <TouchableOpacity activeOpacity={0.5} onPress={() => { | 54 | <TouchableOpacity activeOpacity={0.5} onPress={() => { |
@@ -59,7 +60,7 @@ export default class Recommend extends React.Component { | @@ -59,7 +60,7 @@ export default class Recommend extends React.Component { | ||
59 | style={styles.thumbnail} | 60 | style={styles.thumbnail} |
60 | > | 61 | > |
61 | </Image> | 62 | </Image> |
62 | - {rowData.get('linkType') == 1 && rowData.get('showProductInfo')? | 63 | + {showTitle? |
63 | <View style={styles.itemTitle}> | 64 | <View style={styles.itemTitle}> |
64 | <Text style={styles.itemText} numberOfLines={1}>{rowData.get('text')}</Text> | 65 | <Text style={styles.itemText} numberOfLines={1}>{rowData.get('text')}</Text> |
65 | </View> | 66 | </View> |
-
Please register or login to post a comment