...
|
...
|
@@ -50,12 +50,14 @@ export default class Brand extends Component { |
|
|
|
|
|
scrollToSection(index,sectionID){
|
|
|
let item = this.sectionDataKey[sectionID];
|
|
|
console.log('........');
|
|
|
console.log(item);
|
|
|
if (item) {
|
|
|
if (!item.y) {
|
|
|
this.needScrollSection = sectionID;
|
|
|
item.count = ScrollCount(sectionID,this.sectionData);
|
|
|
this.props.setInitialListSize && this.props.setInitialListSize(item.count);
|
|
|
item.y = ScrollY(sectionID,this.sectionData);
|
|
|
this.props.setBrandData && this.props.setBrandData(this.sectionDataKey, this.props.selectedChannelId);
|
|
|
this.listView && this.listView.scrollTo({x: 0, y: item.y, animated: false});
|
|
|
} else {
|
|
|
this.listView && this.listView.scrollTo({x: 0, y: item.y, animated: false});
|
|
|
}
|
...
|
...
|
@@ -67,9 +69,6 @@ export default class Brand extends Component { |
|
|
if (this.sectionDataKey && this.sectionDataKey[sectionID].y != y) {
|
|
|
this.sectionDataKey[sectionID].y = y;
|
|
|
this.props.setBrandData && this.props.setBrandData(this.sectionDataKey, this.props.selectedChannelId);
|
|
|
if (this.needScrollSection == sectionID) {
|
|
|
this.listView && this.listView.scrollTo({x: 0, y, animated: false});
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
@@ -96,7 +95,13 @@ export default class Brand extends Component { |
|
|
if (this.props.brandFliter == 0) {
|
|
|
let title = sectionID == '0-9' ? '0' : sectionID;
|
|
|
return (
|
|
|
<BLKBrandCell title={title} rowData={rowData} onPressBrandItem={this.props.onPressBrandItem}/>
|
|
|
|
|
|
|
|
|
<View onLayout={this.onLayout.bind(this, sectionID)}>
|
|
|
<BLKBrandCell title={title} rowData={rowData} onPressBrandItem={this.props.onPressBrandItem}/>
|
|
|
</View>
|
|
|
|
|
|
|
|
|
);
|
|
|
} else {
|
|
|
return (
|
...
|
...
|
@@ -179,7 +184,7 @@ export default class Brand extends Component { |
|
|
|
|
|
<ListView
|
|
|
ref={(ref)=>this.listView=ref}
|
|
|
initialListSize={initialListSize}
|
|
|
initialListSize={1000}
|
|
|
contentContainerStyle={contentContainerStyle}
|
|
|
enableEmptySections={true}
|
|
|
dataSource={listDataSource}
|
...
|
...
|
|