|
@@ -90,18 +90,14 @@ export default class Brand extends Component { |
|
@@ -90,18 +90,14 @@ export default class Brand extends Component { |
90
|
}
|
90
|
}
|
91
|
|
91
|
|
92
|
renderRow(rowData, sectionID, rowID, highlightRow) {
|
92
|
renderRow(rowData, sectionID, rowID, highlightRow) {
|
93
|
- if (this.props.brandFliter == 0) {
|
|
|
94
|
- let title = sectionID == '0-9' ? '0' : sectionID;
|
|
|
95
|
- return (
|
|
|
96
|
- <View onLayout={this.onLayout.bind(this, sectionID)}>
|
|
|
97
|
- <BLKBrandCell title={title} rowData={rowData} onPressBrandItem={this.props.onPressBrandItem}/>
|
|
|
98
|
- </View>
|
|
|
99
|
- );
|
|
|
100
|
- } else {
|
|
|
101
|
- return (
|
|
|
102
|
- <NewHotBannerListCell rowData={rowData} onPressBrandItem={this.props.onPressBrandItem}/>
|
|
|
103
|
- );
|
|
|
104
|
- }
|
93
|
+ let title = sectionID == '0-9' ? '0' : sectionID;
|
|
|
94
|
+ // console.log(sectionID);
|
|
|
95
|
+ // console.log(rowData);
|
|
|
96
|
+ return (
|
|
|
97
|
+ <View onLayout={this.onLayout.bind(this, sectionID)}>
|
|
|
98
|
+ <BLKBrandCell title={title} rowData={rowData} onPressBrandItem={this.props.onPressBrandItem}/>
|
|
|
99
|
+ </View>
|
|
|
100
|
+ );
|
105
|
}
|
101
|
}
|
106
|
|
102
|
|
107
|
render() {
|
103
|
render() {
|
|
@@ -136,37 +132,21 @@ export default class Brand extends Component { |
|
@@ -136,37 +132,21 @@ export default class Brand extends Component { |
136
|
}
|
132
|
}
|
137
|
|
133
|
|
138
|
let list;
|
134
|
let list;
|
139
|
- let listDataSource;
|
|
|
140
|
let contentContainerStyle;
|
135
|
let contentContainerStyle;
|
141
|
- let renderSectionHeader = null;
|
|
|
142
|
- let showIndexForListView = false;
|
|
|
143
|
let showsVerticalScrollIndicator = false;
|
136
|
let showsVerticalScrollIndicator = false;
|
144
|
|
137
|
|
145
|
- if (brandFliter == 0) {
|
|
|
146
|
- list = data ? data.get('all_list') : null;
|
|
|
147
|
- let newList = {};
|
|
|
148
|
- list && list.map((value, key) => {
|
|
|
149
|
- newList[key] = [value.toArray()];
|
|
|
150
|
- });
|
|
|
151
|
- listDataSource = newList ? this.dataSource.cloneWithRowsAndSections(newList) : null;
|
|
|
152
|
-
|
|
|
153
|
- contentContainerStyle = styles.contentContainerOne;
|
|
|
154
|
- renderSectionHeader = this.renderSectionHeader;
|
|
|
155
|
-
|
|
|
156
|
- showIndexForListView = true;
|
|
|
157
|
- this.sectionData = newList;
|
|
|
158
|
- this.sectionDataKey = data.get('all_list_key').toJS();
|
|
|
159
|
- } else if (brandFliter == 1) {
|
|
|
160
|
- list = data ? data.get('new_list') : null;
|
|
|
161
|
- listDataSource = list ? this.dataSource.cloneWithRows(list.toArray()) : null;
|
|
|
162
|
- contentContainerStyle = styles.contentContainerTwo;
|
|
|
163
|
- showsVerticalScrollIndicator = true;
|
|
|
164
|
- } else if (brandFliter == 2) {
|
|
|
165
|
- list = data ? data.get('hot_list') : null;
|
|
|
166
|
- listDataSource = list ? this.dataSource.cloneWithRows(list.toArray()) : null;
|
|
|
167
|
- contentContainerStyle = styles.contentContainerTwo;
|
|
|
168
|
- showsVerticalScrollIndicator = true;
|
|
|
169
|
- }
|
138
|
+ list = data ? data.get('all_list') : null;
|
|
|
139
|
+ let newList = {};
|
|
|
140
|
+ list && list.map((value, key) => {
|
|
|
141
|
+ newList[key] = [value.toArray()];
|
|
|
142
|
+ });
|
|
|
143
|
+ // console.log(newList);
|
|
|
144
|
+ // console.log('aaaaa');
|
|
|
145
|
+ // console.log(data?data.toJS():'null');
|
|
|
146
|
+ contentContainerStyle = styles.contentContainerOne;
|
|
|
147
|
+
|
|
|
148
|
+ this.sectionData = newList;
|
|
|
149
|
+ this.sectionDataKey = data.get('all_list_key').toJS();
|
170
|
|
150
|
|
171
|
if (!list) {
|
151
|
if (!list) {
|
172
|
return null;
|
152
|
return null;
|
|
@@ -180,26 +160,16 @@ export default class Brand extends Component { |
|
@@ -180,26 +160,16 @@ export default class Brand extends Component { |
180
|
ref={(ref)=>this.listView=ref}
|
160
|
ref={(ref)=>this.listView=ref}
|
181
|
initialListSize={1000}
|
161
|
initialListSize={1000}
|
182
|
contentContainerStyle={contentContainerStyle}
|
162
|
contentContainerStyle={contentContainerStyle}
|
183
|
- enableEmptySections={true}
|
|
|
184
|
- dataSource={listDataSource}
|
163
|
+ enableEmptySections={false}
|
|
|
164
|
+ dataSource={this.dataSource.cloneWithRowsAndSections(newList)}
|
185
|
renderRow={this.renderRow}
|
165
|
renderRow={this.renderRow}
|
186
|
showsVerticalScrollIndicator={showsVerticalScrollIndicator}
|
166
|
showsVerticalScrollIndicator={showsVerticalScrollIndicator}
|
187
|
renderHeader={this.renderHeader}
|
167
|
renderHeader={this.renderHeader}
|
188
|
/>
|
168
|
/>
|
189
|
-
|
|
|
190
|
- {showIndexForListView ? <IndexListView dataSource={list.keySeq().toArray()} onLetterPress={this.scrollToSection}/> : null}
|
|
|
191
|
-
|
169
|
+ <IndexListView dataSource={list.keySeq().toArray()} onLetterPress={this.scrollToSection}/>
|
192
|
<LoadingIndicator
|
170
|
<LoadingIndicator
|
193
|
isVisible={isFetching}
|
171
|
isVisible={isFetching}
|
194
|
/>
|
172
|
/>
|
195
|
-
|
|
|
196
|
- {showSearch ? <BrandSearch
|
|
|
197
|
- data={search}
|
|
|
198
|
- onTextChange={this.props.onTextChange}
|
|
|
199
|
- onClickCancel={this.props.onClickCancel}
|
|
|
200
|
- onPressClearHistory={this.props.onPressClearHistory}
|
|
|
201
|
- onPressBrandSearchItem={this.props.onPressBrandSearchItem}
|
|
|
202
|
- onPressSearchHistoryItem={this.props.onPressSearchHistoryItem} /> : null}
|
|
|
203
|
</View>
|
173
|
</View>
|
204
|
);
|
174
|
);
|
205
|
}
|
175
|
}
|