Authored by 孙凯

添加 下拉刷新 review by zhanglixia

... ... @@ -32,17 +32,22 @@ export default class OutletPageListView extends Component {
});
this.renderSectionHeader = this.renderSectionHeader.bind(this);
this.renderRow = this.renderRow.bind(this);
this._onRefresh = this._onRefresh.bind(this);
}
componentDidMount() {
let {
resource,
} = this.props;
this.props.getOutletHomeResource && this.props.getOutletHomeResource(resource.get('content_code'));
this._onRefresh && this._onRefresh();
}
_onRefresh() {
let {
resource,
} = this.props;
this.props.getOutletHomeResource && this.props.getOutletHomeResource(resource.get('content_code'));
}
renderSectionHeader(sectionData, sectionID) {
if (sectionID == 'categoryNavigationList') {
return (
... ... @@ -56,7 +61,7 @@ export default class OutletPageListView extends Component {
}
renderRow(rowData, sectionID, rowID, highlightRow) {
console.log(rowData.toJS());
// console.log(rowData.toJS());
if (sectionID == 'outletHomeReource') {
if (rowData.get('template_name') == 'NL2R') {
return(<OutletThreeImage resource={rowData} onPressProduct={this.props.onPressProduct}/>);
... ... @@ -112,10 +117,6 @@ export default class OutletPageListView extends Component {
categoryNavigationList: categoryNavigationList?categoryNavigationList.toArray():[],
};
return (
<View style={styles.container}>
<ListView
... ... @@ -125,6 +126,11 @@ export default class OutletPageListView extends Component {
dataSource={this.dataSource.cloneWithRowsAndSections(dataSource)}
renderRow={this.renderRow}
renderSectionHeader={this.renderSectionHeader}
enablePullToRefresh={true}
isOnPullToRefresh={isFetching}
onRefreshData={() => {
this._onRefresh && this._onRefresh();
}}
/>
<LoadingIndicator
isVisible={isFetching}
... ...