Commit 6fb71fb8 by FE

togroup not go back after alipay

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