Authored by chenl

修复了android remove tag。 review by yuliang.

@@ -12,6 +12,8 @@ const { @@ -12,6 +12,8 @@ const {
12 TouchableOpacity, 12 TouchableOpacity,
13 StyleSheet, 13 StyleSheet,
14 Dimensions, 14 Dimensions,
  15 + Platform,
  16 +
15 } = ReactNative; 17 } = ReactNative;
16 18
17 export default class Banner extends React.Component { 19 export default class Banner extends React.Component {
@@ -57,6 +59,26 @@ export default class Banner extends React.Component { @@ -57,6 +59,26 @@ export default class Banner extends React.Component {
57 let height = this.props.height; 59 let height = this.props.height;
58 let data = this.props.data.toArray(); 60 let data = this.props.data.toArray();
59 61
  62 +
  63 +
  64 + if (data.length == 1) {
  65 +
  66 + return (
  67 + <TouchableOpacity
  68 + activeOpacity={1}
  69 + style={{width: width, height: height}}
  70 + onPress={() => {
  71 + this.props.onPress && this.props.onPress(data[0].get('url'), 0);
  72 + }}
  73 + >
  74 + <SlicedImage
  75 + source={{uri: data[0].get('src').replace('{width}', width).replace('{height}', height).replace('{mode}',2)}}
  76 + style={{ width: width, height: height}}
  77 + />
  78 + </TouchableOpacity>
  79 + );
  80 + }
  81 +
60 return ( 82 return (
61 <Swiper 83 <Swiper
62 style={styles.banner} 84 style={styles.banner}
@@ -66,7 +88,7 @@ export default class Banner extends React.Component { @@ -66,7 +88,7 @@ export default class Banner extends React.Component {
66 autoplayTimeout={this.props.duration} 88 autoplayTimeout={this.props.duration}
67 paginationStyle={{bottom: 8}} 89 paginationStyle={{bottom: 8}}
68 dot={this.dot} 90 dot={this.dot}
69 - activeDot={this.activeDot} 91 + activeDot={(Platform.OS === 'ios')?this.activeDot:null}
70 height={height} 92 height={height}
71 > 93 >
72 {data.map((item, i) => { 94 {data.map((item, i) => {
@@ -329,6 +329,12 @@ export default class NewArrival extends Component { @@ -329,6 +329,12 @@ export default class NewArrival extends Component {
329 recommend = [topPart.get('brandList')]; 329 recommend = [topPart.get('brandList')];
330 } 330 }
331 let featured = topPart.get('featuredList')&&topPart.get('featuredList').size?[topPart.get('featuredList')]:[]; 331 let featured = topPart.get('featuredList')&&topPart.get('featuredList').size?[topPart.get('featuredList')]:[];
  332 +
  333 + let removeTag = true;
  334 + if(Platform.OS !== 'ios' && featured.length > 0 && featured[0] && featured[0].size > 2){
  335 + removeTag = false;
  336 + }
  337 +
332 let dataSource = { 338 let dataSource = {
333 banner, 339 banner,
334 recommend, 340 recommend,
@@ -349,6 +355,8 @@ export default class NewArrival extends Component { @@ -349,6 +355,8 @@ export default class NewArrival extends Component {
349 renderRow={this._renderRow} 355 renderRow={this._renderRow}
350 enableEmptySections={true} 356 enableEmptySections={true}
351 renderSectionHeader={this._renderSectionHeader} 357 renderSectionHeader={this._renderSectionHeader}
  358 + removeClippedSubviews={removeTag}
  359 +
352 renderFooter={()=>{ 360 renderFooter={()=>{
353 if (endReached) { 361 if (endReached) {
354 return <View style={styles.placeholder} />; 362 return <View style={styles.placeholder} />;