1) 修复优惠券列表初始化页面请求两次
This commit is contained in:
parent
1ce706af15
commit
b63367e30a
|
@ -15,11 +15,7 @@ export default class tabbar extends React.Component {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
if (!this.props.first) {
|
this.tabChange(0);
|
||||||
this.tabChange(0);
|
|
||||||
} else {
|
|
||||||
this.setState({ activeIndex: 0 });
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tabChange(index) {
|
tabChange(index) {
|
||||||
|
@ -37,7 +33,7 @@ export default class tabbar extends React.Component {
|
||||||
arr[i] = temp;
|
arr[i] = temp;
|
||||||
}
|
}
|
||||||
this.setState({ tabList: arr });
|
this.setState({ tabList: arr });
|
||||||
if (this.state.tabList.length > 1) {
|
if (this.state.tabList.length > 1 && this.props.first !== true) {
|
||||||
this.props.tabChange(index);
|
this.props.tabChange(index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue