Authored by 陈林

增加新品到着的key。review by 孙凯。

@@ -41,10 +41,10 @@ export default class NewArrivalCell extends Component { @@ -41,10 +41,10 @@ export default class NewArrivalCell extends Component {
41 this.props.jumpWithLinkUrl && this.props.jumpWithLinkUrl(url); 41 this.props.jumpWithLinkUrl && this.props.jumpWithLinkUrl(url);
42 } 42 }
43 43
44 - renderJumpRow = (rowData) => { 44 + renderJumpRow = (rowData,index) => {
45 let url = YH_Image.getSlicedUrl(rowData.get('image'), 225, 225, 2); 45 let url = YH_Image.getSlicedUrl(rowData.get('image'), 225, 225, 2);
46 return ( 46 return (
47 - <TouchableOpacity activeOpacity={1} onPress={_ => this.jumpWithLinkUrl(rowData.get('link_url'))}> 47 + <TouchableOpacity key={'renderJumpRowkey_'+index} activeOpacity={1} onPress={_ => this.jumpWithLinkUrl(rowData.get('link_url'))}>
48 <YH_Image resizeMode="stretch" style={styles.jumpImage} url={url} /> 48 <YH_Image resizeMode="stretch" style={styles.jumpImage} url={url} />
49 </TouchableOpacity>); 49 </TouchableOpacity>);
50 } 50 }
@@ -77,6 +77,7 @@ export default class NewArrivalCell extends Component { @@ -77,6 +77,7 @@ export default class NewArrivalCell extends Component {
77 if (recommend_type == 'hotShop') { 77 if (recommend_type == 'hotShop') {
78 return ( 78 return (
79 <ShopCell 79 <ShopCell
  80 + key={'ShopCellkey_'+index}
80 style={[styles.listContainer, customStyle]} 81 style={[styles.listContainer, customStyle]}
81 data={data} 82 data={data}
82 rowID={index} 83 rowID={index}
@@ -87,6 +88,7 @@ export default class NewArrivalCell extends Component { @@ -87,6 +88,7 @@ export default class NewArrivalCell extends Component {
87 if (recommend_type == 'fashionArticle') { 88 if (recommend_type == 'fashionArticle') {
88 return ( 89 return (
89 <ArticleCell 90 <ArticleCell
  91 + key={'ArticleCellkey_'+index}
90 rowID={index} 92 rowID={index}
91 style={[styles.listContainer, customStyle]} 93 style={[styles.listContainer, customStyle]}
92 data={data} 94 data={data}
@@ -100,8 +102,9 @@ export default class NewArrivalCell extends Component { @@ -100,8 +102,9 @@ export default class NewArrivalCell extends Component {
100 } = this.props; 102 } = this.props;
101 103
102 if (parseInt(rowData.get('rowType')) === 1) { 104 if (parseInt(rowData.get('rowType')) === 1) {
103 - return this.renderJumpRow(rowData) 105 + return this.renderJumpRow(rowData,index)
104 } else { 106 } else {
  107 + console.log("index = " + index)
105 return ( 108 return (
106 <ProductListCell 109 <ProductListCell
107 style={[styles.listContainer, customStyle]} 110 style={[styles.listContainer, customStyle]}
@@ -49,6 +49,7 @@ export default class NewArrivalHeader extends Component { @@ -49,6 +49,7 @@ export default class NewArrivalHeader extends Component {
49 if (!item) { return null; } 49 if (!item) { return null; }
50 return ( 50 return (
51 <FocusCell 51 <FocusCell
  52 + key={'key_'+i}
52 data={item.get('data')} 53 data={item.get('data')}
53 imageWidth={item.get('image_width')} 54 imageWidth={item.get('image_width')}
54 imageHeight={item.get('image_height')} 55 imageHeight={item.get('image_height')}
@@ -63,6 +64,7 @@ export default class NewArrivalHeader extends Component { @@ -63,6 +64,7 @@ export default class NewArrivalHeader extends Component {
63 if (!divideImage) { return null; } 64 if (!divideImage) { return null; }
64 return ( 65 return (
65 <Image 66 <Image
  67 + key={'key1_'+i}
66 source={{uri: divideImage}} 68 source={{uri: divideImage}}
67 style={{width: width,height: 10}} 69 style={{width: width,height: 10}}
68 resizeMode={'cover'} 70 resizeMode={'cover'}
@@ -73,6 +75,7 @@ export default class NewArrivalHeader extends Component { @@ -73,6 +75,7 @@ export default class NewArrivalHeader extends Component {
73 if (!item) { return null; } 75 if (!item) { return null; }
74 return ( 76 return (
75 <RecommendCell 77 <RecommendCell
  78 + key={'key22_'+i}
76 data={item.get('list')} 79 data={item.get('list')}
77 onPressShop={this.props.onPressShop} 80 onPressShop={this.props.onPressShop}
78 goToRecommendForYou={this.props.goToRecommendForYou} 81 goToRecommendForYou={this.props.goToRecommendForYou}
@@ -83,6 +86,7 @@ export default class NewArrivalHeader extends Component { @@ -83,6 +86,7 @@ export default class NewArrivalHeader extends Component {
83 if (!item) { return null; } 86 if (!item) { return null; }
84 return ( 87 return (
85 <JointCell 88 <JointCell
  89 + key={'key23_'+i}
86 data={item.get('data')} 90 data={item.get('data')}
87 contentCode={contentCode} 91 contentCode={contentCode}
88 isExtends={item.get('is_extend')} 92 isExtends={item.get('is_extend')}