Commit a9721374 by FE

bargain list btn

parent ef9571c2
...@@ -516,6 +516,7 @@ class BargainMiddlePage extends Component { ...@@ -516,6 +516,7 @@ class BargainMiddlePage extends Component {
toDetail={this.toCourseDetail} toDetail={this.toCourseDetail}
bottom={ bottom={
<CourseBottom <CourseBottom
user={this.props.user}
item={item} item={item}
toCartBottom={this.toCartBottom.bind(this, item.course_id)} toCartBottom={this.toCartBottom.bind(this, item.course_id)}
toDetail={this.toCourseDetail} toDetail={this.toCourseDetail}
...@@ -640,19 +641,20 @@ function CourseDes(props) { ...@@ -640,19 +641,20 @@ function CourseDes(props) {
function CourseBottom(props) { function CourseBottom(props) {
// bargain_status 砍价状态 0-砍价中,1砍价结束,待支付,2砍价过期(没有砍价记录没有砍价信息),3已购买 // bargain_status 砍价状态 0-砍价中,1砍价结束,待支付,2砍价过期(没有砍价记录没有砍价信息),3已购买
const { course_id = '', bargain_status = '', price1 = '', pay_price = '' } = props.item || {}; const {course_id = '', bargain_status = '', price1 = '', pay_price = '' } = props.item || {};
const { user: { data = {} } } = props;
const price = bargain_status === 2? price1 : pay_price; const price = bargain_status === 2? price1 : pay_price;
let Buttons let Buttons
// if (props.item.bargain_status === 2) { if(data.uid) {
// // Buttons = <Link to={`/detail?id=${props.item.course_id}`} className={'bargain'}>我要砍价</Link> if (props.item.bargain_status === 2) {
// Buttons = ( // Buttons = <Link to={`/detail?id=${props.item.course_id}`} className={'bargain'}>我要砍价</Link>
// <div className=""> Buttons = (
// <a onClick={() => props.toDetail(props.item.course_id)} className={'bargain bargian-study'}>我要砍价</a> <div className="">
// </div> <a onClick={() => props.toDetail(props.item.course_id)} className={'bargain bargian-study'}>我要砍价</a>
</div>
// )
// } else )
if (bargain_status === 3) { } else if (bargain_status === 3) {
if(course_id === 139) { if(course_id === 139) {
Buttons = ( Buttons = (
<a <a
...@@ -679,10 +681,9 @@ function CourseBottom(props) { ...@@ -679,10 +681,9 @@ function CourseBottom(props) {
<button className='invalid'>砍价结束</button> <button className='invalid'>砍价结束</button>
} }
{ {
(bargain_status === 0 || bargain_status === 2) && bargain_status === 0 &&
<a onClick={() => props.toDetail(props.item.course_id)} className={'bargain-btn'}>我要砍价</a> <a onClick={() => props.toDetail(props.item.course_id)} className={'bargain-btn'}>继续砍价</a>
} }
<button <button
onClick={() => props.toCartBottom(props.item.course_id)} onClick={() => props.toCartBottom(props.item.course_id)}
className={'purchase-btn'} className={'purchase-btn'}
...@@ -692,6 +693,16 @@ function CourseBottom(props) { ...@@ -692,6 +693,16 @@ function CourseBottom(props) {
</div> </div>
) )
} }
}else {
Buttons = (
<a
onClick={() => props.toDetail(props.item.course_id)}
className={'bargain bargian-study'}
>我要砍价</a>
);
}
return ( return (
<div className="course-bottom"> <div className="course-bottom">
<div className={'course-price'}> <div className={'course-price'}>
......
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