Commit 6fb71fb8 by FE

togroup not go back after alipay

parent c6ee5a03
...@@ -10,9 +10,10 @@ class HeaderBar extends Component { ...@@ -10,9 +10,10 @@ class HeaderBar extends Component {
window.history.go(-1); window.history.go(-1);
} }
toHref = () => { toLink = () => {
const { href } = this.props; const { toHref } = this.props;
location.replace(href) console.log(toHref);
location.replace(toHref)
} }
goShop = () => { goShop = () => {
...@@ -20,15 +21,20 @@ class HeaderBar extends Component { ...@@ -20,15 +21,20 @@ class HeaderBar extends Component {
} }
render() { render() {
const { toHref } = this.props
return ( return (
<div className="detail-header" style={{...this.props.style}}> <div className="detail-header" style={{...this.props.style}}>
{ {
!this.props.href && this.props.arrow && !toHref && this.props.arrow &&
<i className='iconfont iconiconfront-68' onClick={this.goBack}></i> <i className='iconfont iconiconfront-68' onClick={this.goBack}></i>
} }
{ {
this.props.href && toHref && typeof toHref === 'function' &&
<i className='iconfont iconiconfront-68' onClick={this.toHref}></i> <i className='iconfont iconiconfront-68' onClick={toHref}>1</i>
}
{
toHref && typeof toHref === 'string' &&
<i className='iconfont iconiconfront-68' onClick={this.toLink}></i>
} }
<span className='herder'>{this.props.title}</span> <span className='herder'>{this.props.title}</span>
{ {
......
...@@ -125,7 +125,7 @@ class ToGroup extends Component { ...@@ -125,7 +125,7 @@ class ToGroup extends Component {
toCourseDetail = (id) => { toCourseDetail = (id) => {
const { dispatch, history } = this.props; const { dispatch, history } = this.props;
dispatch(getCourses(id, () => { dispatch(getCourses(id, () => {
history.push(`/detail?id=${id}`); history.push(`/detail?id=${id}`, {href: '/classify'});
return false; return false;
})); }));
} }
...@@ -150,7 +150,7 @@ class ToGroup extends Component { ...@@ -150,7 +150,7 @@ class ToGroup extends Component {
) )
return ( return (
<div className='to-group-box'> <div className='to-group-box'>
<HeaderBar title='拼团' arrow={true} cart={false}></HeaderBar> <HeaderBar title='拼团' cart={false} toHref={() => this.toCourseDetail(course_id)}></HeaderBar>
{ {
!is_success && !is_success &&
<VList <VList
......
...@@ -184,7 +184,7 @@ class Detail extends Component { ...@@ -184,7 +184,7 @@ class Detail extends Component {
const href = this.props.location && this.props.location.state? this.props.location.state.href : undefined; const href = this.props.location && this.props.location.state? this.props.location.state.href : undefined;
return ( return (
<div className='detail-box'> <div className='detail-box'>
<HeaderBar title='课程详情' arrow={true} cart={true} href={href}></HeaderBar> <HeaderBar title='课程详情' arrow={true} cart={true} toHref={href}></HeaderBar>
<CallApp className='toapp'></CallApp> <CallApp className='toapp'></CallApp>
{/*弹幕*/} {/*弹幕*/}
<Carouselw></Carouselw> <Carouselw></Carouselw>
......
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