Authored by 于良

bug fix: http://jira.yoho.cn:8888/browse/YH-2680 , 代码优化 ,review by 盖剑秋

@@ -221,23 +221,20 @@ export default class Home extends React.Component { @@ -221,23 +221,20 @@ export default class Home extends React.Component {
221 onPressLike={this.props.onPressLike} 221 onPressLike={this.props.onPressLike}
222 /> 222 />
223 ); 223 );
  224 + default:
  225 + return null;
224 } 226 }
225 } 227 }
226 228
227 _renderSectionHeader(sectionData, sectionID) { 229 _renderSectionHeader(sectionData, sectionID) {
228 switch (sectionID) { 230 switch (sectionID) {
229 - case 'progressing':  
230 - case 'banner':  
231 - case 'notice':  
232 - case 'section':  
233 - return null;  
234 -  
235 case 'recommendation': 231 case 'recommendation':
236 return ( 232 return (
237 <View style={styles.sectionHeader}> 233 <View style={styles.sectionHeader}>
238 <Image style={styles.sectionHeaderImg} source={require('../../images/home/hot.png')}/> 234 <Image style={styles.sectionHeaderImg} source={require('../../images/home/hot.png')}/>
239 <Text style={styles.sectionHeaderText}>热门推荐</Text> 235 <Text style={styles.sectionHeaderText}>热门推荐</Text>
240 - <View style={styles.sectionHeaderLine}/> 236 + <View style={styles.sectionHeaderTopLine}/>
  237 + <View style={styles.sectionHeaderBottomLine}/>
241 </View> 238 </View>
242 ); 239 );
243 240
@@ -323,8 +320,8 @@ let styles = StyleSheet.create({ @@ -323,8 +320,8 @@ let styles = StyleSheet.create({
323 height: 32, 320 height: 32,
324 alignItems: 'center', 321 alignItems: 'center',
325 backgroundColor: 'white', 322 backgroundColor: 'white',
326 - borderTopWidth: 0.5,  
327 - borderTopColor: '#e0e0e0', 323 + // borderTopWidth: 0.5, // borderTopWidth 在iPhone 6P上显示有bug
  324 + // borderTopColor: '#e0e0e0',
328 }, 325 },
329 sectionHeaderImg: { 326 sectionHeaderImg: {
330 width: 9, 327 width: 9,
@@ -335,7 +332,15 @@ let styles = StyleSheet.create({ @@ -335,7 +332,15 @@ let styles = StyleSheet.create({
335 fontSize: 12, 332 fontSize: 12,
336 marginLeft: 5, 333 marginLeft: 5,
337 }, 334 },
338 - sectionHeaderLine: { 335 + sectionHeaderTopLine: {
  336 + position: 'absolute',
  337 + left: 0,
  338 + top: 0,
  339 + width: width,
  340 + height: 0.5,
  341 + backgroundColor: '#e0e0e0',
  342 + },
  343 + sectionHeaderBottomLine: {
339 position: 'absolute', 344 position: 'absolute',
340 left: 17, 345 left: 17,
341 bottom: 0, 346 bottom: 0,
@@ -211,6 +211,8 @@ export default class Section extends React.Component { @@ -211,6 +211,8 @@ export default class Section extends React.Component {
211 /> 211 />
212 </ScrollableTabView> 212 </ScrollableTabView>
213 ); 213 );
  214 + default:
  215 + return null;
214 } 216 }
215 } 217 }
216 218