Commit fc2ef83c by zhanghaozhe

优惠券

parent ed40ea49
...@@ -23,12 +23,12 @@ class UseCoupon extends PureComponent { ...@@ -23,12 +23,12 @@ class UseCoupon extends PureComponent {
} }
componentDidMount() { componentDidMount() {
const {history, location} = this.props const {history, location} = this.props
if (!this.state.courseId) {
location.state && location.state.from ? history.replace(location.state.from) : history.goBack()
}
const {state} = this.props.location const {state} = this.props.location
if (state && state.from) { if (state && state.from) {
if (state.from === '/my') { if (state.from === '/my') {
this.getMyCoupons(); this.getMyCoupons();
...@@ -36,6 +36,9 @@ class UseCoupon extends PureComponent { ...@@ -36,6 +36,9 @@ class UseCoupon extends PureComponent {
showUseButton: true showUseButton: true
}) })
} else { } else {
if (!this.state.courseId) {
location.state && location.state.from ? history.replace(location.state.from) : history.goBack()
}
this.getAllCoupons(); this.getAllCoupons();
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment