|
@@ -37,7 +37,8 @@ export default class SearchList extends Component { |
|
@@ -37,7 +37,8 @@ export default class SearchList extends Component { |
37
|
pageTitle: '',
|
37
|
pageTitle: '',
|
38
|
page: {},
|
38
|
page: {},
|
39
|
productList: {},
|
39
|
productList: {},
|
40
|
- stopLoading: {}
|
40
|
+ stopLoading: {},
|
|
|
41
|
+ destroy: false
|
41
|
};
|
42
|
};
|
42
|
}
|
43
|
}
|
43
|
|
44
|
|
|
@@ -96,18 +97,23 @@ export default class SearchList extends Component { |
|
@@ -96,18 +97,23 @@ export default class SearchList extends Component { |
96
|
});
|
97
|
});
|
97
|
}
|
98
|
}
|
98
|
|
99
|
|
99
|
- componentWillReceiveProps(nextProps) {
|
|
|
100
|
- let curType = nextProps.filterMenu.curType;
|
|
|
101
|
- let { productList } = this.state;
|
|
|
102
|
- console.log(productList);
|
|
|
103
|
- console.log(curType);
|
|
|
104
|
- console.log(productList["p_asc"]);
|
|
|
105
|
- this.getProductData(nextProps.filterMenu);
|
100
|
+ componentWillReceiveProps(nextProps, oldProps) {
|
|
|
101
|
+ let { destroy } = this.state;
|
|
|
102
|
+ if (!destroy) {
|
|
|
103
|
+ this.getProductData();
|
|
|
104
|
+ }
|
|
|
105
|
+ }
|
|
|
106
|
+
|
|
|
107
|
+ componentDidShow() {
|
|
|
108
|
+ this.getProductData();
|
106
|
}
|
109
|
}
|
107
|
|
110
|
|
108
|
componentWillUnmount() {
|
111
|
componentWillUnmount() {
|
109
|
let { clearFilter } = this.props;
|
112
|
let { clearFilter } = this.props;
|
110
|
clearFilter();
|
113
|
clearFilter();
|
|
|
114
|
+ this.setState({
|
|
|
115
|
+ destroy: true
|
|
|
116
|
+ })
|
111
|
}
|
117
|
}
|
112
|
|
118
|
|
113
|
onScroll(e) {
|
119
|
onScroll(e) {
|