Commit 0f7d7f1b by zhanghaozhe

coupon-bug

parent 53062673
import React, {Component} from 'react' import React, { Component } from 'react'
import {NavLink, Route, Switch, Redirect} from "react-router-dom" import { NavLink, Route, Switch, Redirect } from "react-router-dom"
import myCoupons from "./myCoupons" import myCoupons from "./myCoupons"
import myPatch from './myPatch' import myPatch from './myPatch'
import {HeaderBar} from "@/common"; import { HeaderBar } from "@/common";
import './coupons.scss' import './coupons.scss'
...@@ -15,13 +15,21 @@ class coupons extends Component { ...@@ -15,13 +15,21 @@ class coupons extends Component {
<section id='coupons'> <section id='coupons'>
<div className='tab'> <div className='tab'>
<div> <div>
<NavLink to={{pathname: `${match.url}/my-coupon`, state: {...this.props.location.state}}} <NavLink to={{
pathname: `${match.url}/my-coupon`,
search: location.search,
state: {...this.props.location.state}
}}
replace replace
activeClassName='tab-active' activeClassName='tab-active'
>我的优惠券</NavLink> >我的优惠券</NavLink>
</div> </div>
<div> <div>
<NavLink to={{pathname: `${match.url}/my-patch`, state: {...this.props.location.state}}} <NavLink to={{
pathname: `${match.url}/my-patch`,
search: location.search,
state: {...this.props.location.state}
}}
replace replace
activeClassName='tab-active' activeClassName='tab-active'
>碎片合成</NavLink> >碎片合成</NavLink>
...@@ -36,7 +44,7 @@ class coupons extends Component { ...@@ -36,7 +44,7 @@ class coupons extends Component {
from: this.props.location.state && this.props.location.state.from from: this.props.location.state && this.props.location.state.from
} }
}}/> }}/>
<Route path={`${this.props.match.path}/my-coupon`} component={myCoupons}/> <Route path={`${this.props.match.path}/my-coupon`} component={myCoupons}/>
<Route path={`${this.props.match.path}/my-patch`} component={myPatch}/> <Route path={`${this.props.match.path}/my-patch`} component={myPatch}/>
</Switch> </Switch>
</div> </div>
......
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