Commit 53062673 by zhanghaozhe

coupon-bug

parent ffaaaa03
......@@ -8,7 +8,7 @@ import './coupons.scss'
class coupons extends Component {
render() {
const {match} = this.props;
const {match, location} = this.props;
return (
<div className={'coupons-box'}>
<HeaderBar title='优惠券' arrow={true}/>
......@@ -32,7 +32,7 @@ class coupons extends Component {
<div className="coupons-container">
<Switch>
<Redirect exact from='/coupons' to={{
pathname: 'coupons/my-coupon', state: {
pathname: 'coupons/my-coupon', search: location.search, state: {
from: this.props.location.state && this.props.location.state.from
}
}}/>
......
......@@ -7,7 +7,7 @@ import { http, getParam } from '@/utils'
import { WithFullSize } from '@/HOCs'
import { Toast } from 'antd-mobile'
import { isEmpty } from 'lodash'
import {connect} from 'react-redux';
import { connect } from 'react-redux';
@connect()
class UseCoupon extends PureComponent {
......@@ -48,7 +48,7 @@ class UseCoupon extends PureComponent {
}
exchange = () => {
const { location: { state = {}} } = this.props;
const {location: {state = {}}} = this.props;
if (this.state.redeemCode !== '') {
http.post(`${API.home}/m/coupon/exchange`, {
code: this.state.redeemCode
......@@ -86,7 +86,7 @@ class UseCoupon extends PureComponent {
if (state.from === '/my') {
this.getMyCoupons()
}
if(state.from === '/order') {
if (state.from === '/order') {
this.getAllCoupons()
}
} else {
......
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