Commit c6f49544 by FE

other kanjia course to detail in bargian middlle page

parent c4a7ed38
......@@ -10,8 +10,11 @@ import { differenceInSeconds, differenceInMinutes, differenceInHours, difference
import Overlay from '../detail/overlay'
import { compose } from "redux"
import { connect } from "react-redux";
import {getCourses} from './../detail/actions';
@connect(state => ({
user: state.user
}))
class BargainMiddlePage extends Component {
timer
......@@ -267,6 +270,14 @@ class BargainMiddlePage extends Component {
})
}
toCourseDetail = (id) => {
const { dispatch, history } = this.props;
dispatch(getCourses(id, () => {
history.push(`/detail?id=${id}`);
return false;
}));
}
render() {
let thirdRow, btn
// is_artifact 0-再邀请多少人可以使用 1-可以使用未领取 2-已领取 3-已使用
......@@ -410,9 +421,12 @@ class BargainMiddlePage extends Component {
id={item.course_id}
img={item.image_name}
title={item.course_title}
bottom={<CourseBottom
toDetail={this.toCourseDetail}
bottom={
<CourseBottom
item={item}
toCart={this.toCart}
toDetail={this.toCourseDetail}
/>
}
/>
......@@ -516,7 +530,8 @@ function CourseDes(props) {
function CourseBottom(props) {
let Buttons
if (props.item.bargain_status === 2) {
Buttons = <Link to={`/detail?id=${props.item.course_id}`} className={'bargain'}>我要砍价</Link>
// Buttons = <Link to={`/detail?id=${props.item.course_id}`} className={'bargain'}>我要砍价</Link>
Buttons = <a href="javascript:;" onClick={() => props.toDetail(props.item.course_id)} className={'bargain'}>我要砍价</a>
} else if (props.item.bargain_status === 3) {
Buttons = <Link to={`/play?id=${props.item.course_id}`} className={'bargain'}>去学习</Link>
} else {
......@@ -531,7 +546,7 @@ function CourseBottom(props) {
}
{
props.item.bargain_status === 0 &&
<Link to={`/detail?id=${props.item.course_id}`} className={'bargain-btn'}>继续砍价</Link>
<a href="javascript:;" onClick={() => props.toDetail(props.item.course_id)} className={'bargain-btn'}>我要砍价</a>
}
......@@ -655,10 +670,4 @@ function BargainSuccess(props) {
}
export default compose(
connect(
state => ({user: state.user}),
null
),
withRouter
)(BargainMiddlePage)
export default withRouter(BargainMiddlePage);
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