Authored by hongyong.zhao

修复分页问题 — reviewed by yjc

... ... @@ -44,6 +44,10 @@ class RecommendContainer extends Component {
this.onPressCategory = this.onPressCategory.bind(this);
this.onPressProduct = this.onPressProduct.bind(this);
this.onEndReached = this.onEndReached.bind(this);
this.state = {
categoryData:null
}
}
componentDidMount() {
... ... @@ -68,7 +72,11 @@ class RecommendContainer extends Component {
productPool,
skns,
} = this.props.app;
this.props.actions.setAppSelectedCategory(productPool, skns, data.get('sort_id'), data.get('sort_name'), index);
this.setState({
categoryData:data
})
}
onPressProduct(product) {
... ... @@ -97,8 +105,16 @@ class RecommendContainer extends Component {
onEndReached() {
let {
productPool,
skns,
} = this.props.app;
this.props.actions.getProductList(productPool);
let data = this.state.categoryData;
if (data) {
this.props.actions.getProductList(productPool, skns,data.get('sort_id'));
} else {
this.props.actions.getProductList(productPool);
}
}
render() {
... ...