Authored by 陈林

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

... ... @@ -41,10 +41,10 @@ export default class NewArrivalCell extends Component {
this.props.jumpWithLinkUrl && this.props.jumpWithLinkUrl(url);
}
renderJumpRow = (rowData) => {
renderJumpRow = (rowData,index) => {
let url = YH_Image.getSlicedUrl(rowData.get('image'), 225, 225, 2);
return (
<TouchableOpacity activeOpacity={1} onPress={_ => this.jumpWithLinkUrl(rowData.get('link_url'))}>
<TouchableOpacity key={'renderJumpRowkey_'+index} activeOpacity={1} onPress={_ => this.jumpWithLinkUrl(rowData.get('link_url'))}>
<YH_Image resizeMode="stretch" style={styles.jumpImage} url={url} />
</TouchableOpacity>);
}
... ... @@ -77,6 +77,7 @@ export default class NewArrivalCell extends Component {
if (recommend_type == 'hotShop') {
return (
<ShopCell
key={'ShopCellkey_'+index}
style={[styles.listContainer, customStyle]}
data={data}
rowID={index}
... ... @@ -87,6 +88,7 @@ export default class NewArrivalCell extends Component {
if (recommend_type == 'fashionArticle') {
return (
<ArticleCell
key={'ArticleCellkey_'+index}
rowID={index}
style={[styles.listContainer, customStyle]}
data={data}
... ... @@ -100,8 +102,9 @@ export default class NewArrivalCell extends Component {
} = this.props;
if (parseInt(rowData.get('rowType')) === 1) {
return this.renderJumpRow(rowData)
return this.renderJumpRow(rowData,index)
} else {
console.log("index = " + index)
return (
<ProductListCell
style={[styles.listContainer, customStyle]}
... ...
... ... @@ -49,6 +49,7 @@ export default class NewArrivalHeader extends Component {
if (!item) { return null; }
return (
<FocusCell
key={'key_'+i}
data={item.get('data')}
imageWidth={item.get('image_width')}
imageHeight={item.get('image_height')}
... ... @@ -63,6 +64,7 @@ export default class NewArrivalHeader extends Component {
if (!divideImage) { return null; }
return (
<Image
key={'key1_'+i}
source={{uri: divideImage}}
style={{width: width,height: 10}}
resizeMode={'cover'}
... ... @@ -73,6 +75,7 @@ export default class NewArrivalHeader extends Component {
if (!item) { return null; }
return (
<RecommendCell
key={'key22_'+i}
data={item.get('list')}
onPressShop={this.props.onPressShop}
goToRecommendForYou={this.props.goToRecommendForYou}
... ... @@ -83,6 +86,7 @@ export default class NewArrivalHeader extends Component {
if (!item) { return null; }
return (
<JointCell
key={'key23_'+i}
data={item.get('data')}
contentCode={contentCode}
isExtends={item.get('is_extend')}
... ...