...
|
...
|
@@ -37,7 +37,8 @@ export default class Index extends Component { |
|
|
],
|
|
|
page: {},
|
|
|
productList: {},
|
|
|
stopLoading: {}
|
|
|
stopLoading: {},
|
|
|
floors: []
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
@@ -51,8 +52,27 @@ export default class Index extends Component { |
|
|
onPullDownRefresh() {
|
|
|
let filterMenu = this.props.filterMenu;
|
|
|
this.getProductData(filterMenu).then(isFinish => {
|
|
|
this.getResource().then(() => {
|
|
|
Taro.stopPullDownRefresh();
|
|
|
}).catch(error => {
|
|
|
Taro.stopPullDownRefresh();
|
|
|
})
|
|
|
}).catch(error => {
|
|
|
Taro.stopPullDownRefresh();
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
async getResource() {
|
|
|
const pk = await getPrivateKey();
|
|
|
Taro.setStorage({ key: 'verifyKey', data: pk });
|
|
|
return commonModel.resource(contentCode.index).then(res => {
|
|
|
if (res && res.code === 200) {
|
|
|
this.setState({
|
|
|
floors: res.data
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
onReachBottom() {
|
...
|
...
|
@@ -87,6 +107,7 @@ export default class Index extends Component { |
|
|
|
|
|
this.setState(obj, () => {
|
|
|
this.getProductData();
|
|
|
this.getResource();
|
|
|
});
|
|
|
}
|
|
|
|
...
|
...
|
@@ -185,7 +206,7 @@ export default class Index extends Component { |
|
|
}
|
|
|
|
|
|
render() {
|
|
|
let {tabs, productList} = this.state;
|
|
|
let {tabs, productList, isRefresh, floors} = this.state;
|
|
|
let {filterMenu} = this.props;
|
|
|
let list = productList[filterMenu.indexType] || [];
|
|
|
|
...
|
...
|
@@ -203,7 +224,7 @@ export default class Index extends Component { |
|
|
onScrollToLower={this.onScrollToLower}>
|
|
|
|
|
|
|
|
|
<Resources code={contentCode.index}></Resources>
|
|
|
<Resources isRefresh={isRefresh} floors={floors}></Resources>
|
|
|
<FilterMenu filterMenu={filterMenu} tabs={tabs} tabClass="border" fromPage="index"></FilterMenu>
|
|
|
{
|
|
|
list &&
|
...
|
...
|
|