Authored by QC-L

更新消息列表展示,修复数据无限刷新的 bug review by 黄敬囿

@@ -19,11 +19,10 @@ @@ -19,11 +19,10 @@
19 } 19 }
20 20
21 .no-data .no-data-btn { 21 .no-data .no-data-btn {
22 - margin-top: 20rpx; 22 + margin-top: 100rpx;
23 line-height: 88rpx; 23 line-height: 88rpx;
24 color: #fff; 24 color: #fff;
25 text-align: center; 25 text-align: center;
26 - background-color: #000;  
27 - border-radius: 20rpx;  
28 - width: 300rpx; 26 + background-color: #002B47;
  27 + width: 600rpx;
29 } 28 }
@@ -103,6 +103,5 @@ @@ -103,6 +103,5 @@
103 color: #999; 103 color: #999;
104 font-size: 30rpx; 104 font-size: 30rpx;
105 letter-spacing: 0.8px; 105 letter-spacing: 0.8px;
106 - margin-top: 300rpx;  
107 - height: 80%; 106 + margin-top: 200rpx;
108 } 107 }
@@ -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) {