|
@@ -27,6 +27,7 @@ export default class Home extends Component { |
|
@@ -27,6 +27,7 @@ export default class Home extends Component { |
27
|
this._renderRow = this._renderRow.bind(this);
|
27
|
this._renderRow = this._renderRow.bind(this);
|
28
|
this._renderSectionHeader = this._renderSectionHeader.bind(this);
|
28
|
this._renderSectionHeader = this._renderSectionHeader.bind(this);
|
29
|
this._floorCellRender = this._floorCellRender.bind(this);
|
29
|
this._floorCellRender = this._floorCellRender.bind(this);
|
|
|
30
|
+ this._clickCategorySelector = this._clickCategorySelector.bind(this);
|
30
|
|
31
|
|
31
|
this.dataSource = new ListView.DataSource({
|
32
|
this.dataSource = new ListView.DataSource({
|
32
|
rowHasChanged: (r1, r2) => !Immutable.is(r1, r2),
|
33
|
rowHasChanged: (r1, r2) => !Immutable.is(r1, r2),
|
|
@@ -44,6 +45,7 @@ export default class Home extends Component { |
|
@@ -44,6 +45,7 @@ export default class Home extends Component { |
44
|
<CategorySelector
|
45
|
<CategorySelector
|
45
|
data={categoryList}
|
46
|
data={categoryList}
|
46
|
selectedCategoryIndex={selectedCategoryIndex}
|
47
|
selectedCategoryIndex={selectedCategoryIndex}
|
|
|
48
|
+ changeCategorySelectorTitle={this._clickCategorySelector}
|
47
|
onPressCategory={(rowData, rowID) => {
|
49
|
onPressCategory={(rowData, rowID) => {
|
48
|
this.props.onPressCategory && this.props.onPressCategory(rowData, rowID);
|
50
|
this.props.onPressCategory && this.props.onPressCategory(rowData, rowID);
|
49
|
}}
|
51
|
}}
|
|
@@ -55,6 +57,16 @@ export default class Home extends Component { |
|
@@ -55,6 +57,16 @@ export default class Home extends Component { |
55
|
}
|
57
|
}
|
56
|
}
|
58
|
}
|
57
|
|
59
|
|
|
|
60
|
+ _clickCategorySelector(rowData) {
|
|
|
61
|
+ let params = {
|
|
|
62
|
+ animated: true,
|
|
|
63
|
+ sectionIndex: 1,
|
|
|
64
|
+ itemIndex: 0,
|
|
|
65
|
+ viewOffset: 44
|
|
|
66
|
+ }
|
|
|
67
|
+ this.sectionList.scrollToLocation(params);
|
|
|
68
|
+ }
|
|
|
69
|
+
|
58
|
_renderRow(item) {
|
70
|
_renderRow(item) {
|
59
|
let rowID = item.index;
|
71
|
let rowID = item.index;
|
60
|
let rowData = item.item;
|
72
|
let rowData = item.item;
|
|
@@ -174,9 +186,7 @@ export default class Home extends Component { |
|
@@ -174,9 +186,7 @@ export default class Home extends Component { |
174
|
isShowGuide={this.props.isShowGuide}
|
186
|
isShowGuide={this.props.isShowGuide}
|
175
|
hiddenGuideDialog={this.props.hiddenGuideDialog}/>
|
187
|
hiddenGuideDialog={this.props.hiddenGuideDialog}/>
|
176
|
<SectionList
|
188
|
<SectionList
|
177
|
- ref={(c) => {
|
|
|
178
|
- this.listView = c;
|
|
|
179
|
- }}
|
189
|
+ ref={(ref) => this.sectionList = ref}
|
180
|
sections={dataSource}
|
190
|
sections={dataSource}
|
181
|
renderSectionHeader={this._renderSectionHeader}
|
191
|
renderSectionHeader={this._renderSectionHeader}
|
182
|
yh_viewVisible={true}
|
192
|
yh_viewVisible={true}
|