|
@@ -3,13 +3,18 @@ import { View, Button } from '@tarojs/components'; |
|
@@ -3,13 +3,18 @@ import { View, Button } from '@tarojs/components'; |
3
|
import { SearchBar, FilterMenu, ProductList, PageTitle } from '../../components';
|
3
|
import { SearchBar, FilterMenu, ProductList, PageTitle } from '../../components';
|
4
|
import { common as commonModel } from '../../models';
|
4
|
import { common as commonModel } from '../../models';
|
5
|
import { connect } from '@tarojs/redux';
|
5
|
import { connect } from '@tarojs/redux';
|
6
|
-
|
6
|
+import { bindActionCreators } from 'redux';
|
|
|
7
|
+import { clearFilter } from '../../actions/filterData';
|
7
|
import './index.scss';
|
8
|
import './index.scss';
|
8
|
|
9
|
|
9
|
@connect(({ filterMenu, filterData }) => ({
|
10
|
@connect(({ filterMenu, filterData }) => ({
|
10
|
filterMenu,
|
11
|
filterMenu,
|
11
|
filterData
|
12
|
filterData
|
12
|
-}))
|
13
|
+}), (dispatch) => {
|
|
|
14
|
+ return bindActionCreators({
|
|
|
15
|
+ clearFilter
|
|
|
16
|
+ }, dispatch);
|
|
|
17
|
+})
|
13
|
|
18
|
|
14
|
export default class SearchList extends Component {
|
19
|
export default class SearchList extends Component {
|
15
|
constructor(props) {
|
20
|
constructor(props) {
|
|
@@ -67,7 +72,6 @@ export default class SearchList extends Component { |
|
@@ -67,7 +72,6 @@ export default class SearchList extends Component { |
67
|
}
|
72
|
}
|
68
|
}
|
73
|
}
|
69
|
|
74
|
|
70
|
- params.gender = ''
|
|
|
71
|
|
75
|
|
72
|
// 初始化数据
|
76
|
// 初始化数据
|
73
|
tabs.map(item => {
|
77
|
tabs.map(item => {
|
|
@@ -101,6 +105,11 @@ export default class SearchList extends Component { |
|
@@ -101,6 +105,11 @@ export default class SearchList extends Component { |
101
|
this.getProductData(nextProps.filterMenu);
|
105
|
this.getProductData(nextProps.filterMenu);
|
102
|
}
|
106
|
}
|
103
|
|
107
|
|
|
|
108
|
+ componentWillUnmount() {
|
|
|
109
|
+ let { clearFilter } = this.props;
|
|
|
110
|
+ clearFilter();
|
|
|
111
|
+ }
|
|
|
112
|
+
|
104
|
onScroll(e) {
|
113
|
onScroll(e) {
|
105
|
if (e.detail.scrollTop > 72 && !this.state.isFixed) {
|
114
|
if (e.detail.scrollTop > 72 && !this.state.isFixed) {
|
106
|
this.setState({
|
115
|
this.setState({
|
|
@@ -193,8 +202,6 @@ export default class SearchList extends Component { |
|
@@ -193,8 +202,6 @@ export default class SearchList extends Component { |
193
|
|
202
|
|
194
|
if (order) {
|
203
|
if (order) {
|
195
|
params.order = order;
|
204
|
params.order = order;
|
196
|
- } else {
|
|
|
197
|
- // params.type = order ? '' : type;
|
|
|
198
|
}
|
205
|
}
|
199
|
|
206
|
|
200
|
// 系列,品牌,品类
|
207
|
// 系列,品牌,品类
|
|
@@ -307,7 +314,7 @@ export default class SearchList extends Component { |
|
@@ -307,7 +314,7 @@ export default class SearchList extends Component { |
307
|
<PageTitle pageTitle={pageTitle} selfClass="pd"></PageTitle>
|
314
|
<PageTitle pageTitle={pageTitle} selfClass="pd"></PageTitle>
|
308
|
}
|
315
|
}
|
309
|
<View className={ this.state.fixed ? 'fixed' : '' }>
|
316
|
<View className={ this.state.fixed ? 'fixed' : '' }>
|
310
|
- <FilterMenu filterMenu={filterMenu} tabs={ this.state.tabs } fromPage="search" hasFilter = { this.state.hasFilter } > </FilterMenu>
|
317
|
+ <FilterMenu filterMenu={ filterMenu } tabs = { this.state.tabs } fromPage = "search" hasFilter = { this.state.hasFilter } screen={this.$router.params} > </FilterMenu>
|
311
|
< /View>
|
318
|
< /View>
|
312
|
<ProductList list={productList[type]}></ProductList>
|
319
|
<ProductList list={productList[type]}></ProductList>
|
313
|
</ScrollView>
|
320
|
</ScrollView>
|