...
|
...
|
@@ -90,18 +90,14 @@ export default class Brand extends Component { |
|
|
}
|
|
|
|
|
|
renderRow(rowData, sectionID, rowID, highlightRow) {
|
|
|
if (this.props.brandFliter == 0) {
|
|
|
let title = sectionID == '0-9' ? '0' : sectionID;
|
|
|
return (
|
|
|
<View onLayout={this.onLayout.bind(this, sectionID)}>
|
|
|
<BLKBrandCell title={title} rowData={rowData} onPressBrandItem={this.props.onPressBrandItem}/>
|
|
|
</View>
|
|
|
);
|
|
|
} else {
|
|
|
return (
|
|
|
<NewHotBannerListCell rowData={rowData} onPressBrandItem={this.props.onPressBrandItem}/>
|
|
|
);
|
|
|
}
|
|
|
let title = sectionID == '0-9' ? '0' : sectionID;
|
|
|
// console.log(sectionID);
|
|
|
// console.log(rowData);
|
|
|
return (
|
|
|
<View onLayout={this.onLayout.bind(this, sectionID)}>
|
|
|
<BLKBrandCell title={title} rowData={rowData} onPressBrandItem={this.props.onPressBrandItem}/>
|
|
|
</View>
|
|
|
);
|
|
|
}
|
|
|
|
|
|
render() {
|
...
|
...
|
@@ -136,37 +132,21 @@ export default class Brand extends Component { |
|
|
}
|
|
|
|
|
|
let list;
|
|
|
let listDataSource;
|
|
|
let contentContainerStyle;
|
|
|
let renderSectionHeader = null;
|
|
|
let showIndexForListView = false;
|
|
|
let showsVerticalScrollIndicator = false;
|
|
|
|
|
|
if (brandFliter == 0) {
|
|
|
list = data ? data.get('all_list') : null;
|
|
|
let newList = {};
|
|
|
list && list.map((value, key) => {
|
|
|
newList[key] = [value.toArray()];
|
|
|
});
|
|
|
listDataSource = newList ? this.dataSource.cloneWithRowsAndSections(newList) : null;
|
|
|
|
|
|
contentContainerStyle = styles.contentContainerOne;
|
|
|
renderSectionHeader = this.renderSectionHeader;
|
|
|
|
|
|
showIndexForListView = true;
|
|
|
this.sectionData = newList;
|
|
|
this.sectionDataKey = data.get('all_list_key').toJS();
|
|
|
} else if (brandFliter == 1) {
|
|
|
list = data ? data.get('new_list') : null;
|
|
|
listDataSource = list ? this.dataSource.cloneWithRows(list.toArray()) : null;
|
|
|
contentContainerStyle = styles.contentContainerTwo;
|
|
|
showsVerticalScrollIndicator = true;
|
|
|
} else if (brandFliter == 2) {
|
|
|
list = data ? data.get('hot_list') : null;
|
|
|
listDataSource = list ? this.dataSource.cloneWithRows(list.toArray()) : null;
|
|
|
contentContainerStyle = styles.contentContainerTwo;
|
|
|
showsVerticalScrollIndicator = true;
|
|
|
}
|
|
|
list = data ? data.get('all_list') : null;
|
|
|
let newList = {};
|
|
|
list && list.map((value, key) => {
|
|
|
newList[key] = [value.toArray()];
|
|
|
});
|
|
|
// console.log(newList);
|
|
|
// console.log('aaaaa');
|
|
|
// console.log(data?data.toJS():'null');
|
|
|
contentContainerStyle = styles.contentContainerOne;
|
|
|
|
|
|
this.sectionData = newList;
|
|
|
this.sectionDataKey = data.get('all_list_key').toJS();
|
|
|
|
|
|
if (!list) {
|
|
|
return null;
|
...
|
...
|
@@ -180,26 +160,16 @@ export default class Brand extends Component { |
|
|
ref={(ref)=>this.listView=ref}
|
|
|
initialListSize={1000}
|
|
|
contentContainerStyle={contentContainerStyle}
|
|
|
enableEmptySections={true}
|
|
|
dataSource={listDataSource}
|
|
|
enableEmptySections={false}
|
|
|
dataSource={this.dataSource.cloneWithRowsAndSections(newList)}
|
|
|
renderRow={this.renderRow}
|
|
|
showsVerticalScrollIndicator={showsVerticalScrollIndicator}
|
|
|
renderHeader={this.renderHeader}
|
|
|
/>
|
|
|
|
|
|
{showIndexForListView ? <IndexListView dataSource={list.keySeq().toArray()} onLetterPress={this.scrollToSection}/> : null}
|
|
|
|
|
|
<IndexListView dataSource={list.keySeq().toArray()} onLetterPress={this.scrollToSection}/>
|
|
|
<LoadingIndicator
|
|
|
isVisible={isFetching}
|
|
|
/>
|
|
|
|
|
|
{showSearch ? <BrandSearch
|
|
|
data={search}
|
|
|
onTextChange={this.props.onTextChange}
|
|
|
onClickCancel={this.props.onClickCancel}
|
|
|
onPressClearHistory={this.props.onPressClearHistory}
|
|
|
onPressBrandSearchItem={this.props.onPressBrandSearchItem}
|
|
|
onPressSearchHistoryItem={this.props.onPressSearchHistoryItem} /> : null}
|
|
|
</View>
|
|
|
);
|
|
|
}
|
...
|
...
|
|