Commit a2291208 by xuzhenghua

pull

parent 1b83d1ca
...@@ -284,6 +284,7 @@ class BargainMiddlePage extends Component { ...@@ -284,6 +284,7 @@ class BargainMiddlePage extends Component {
} }
this.getBargainInfo() this.getBargainInfo()
this.getBargainRankList(getParam('id'), 1)
} else if (res.data.code == 4030 || res.data.code == 4040) { } else if (res.data.code == 4030 || res.data.code == 4040) {
...@@ -376,6 +377,9 @@ class BargainMiddlePage extends Component { ...@@ -376,6 +377,9 @@ class BargainMiddlePage extends Component {
if(bargain_status === 0) { if(bargain_status === 0) {
bargainBtn = <button className='active-btn' onClick={this.shareFriendBargain}>邀请好友砍价</button> bargainBtn = <button className='active-btn' onClick={this.shareFriendBargain}>邀请好友砍价</button>
} }
else {
bargainBtn = <button className={'invalid-btn'}>砍价结束</button>
}
}else { }else {
if(assist_status === 0 && bargain_status === 0) { if(assist_status === 0 && bargain_status === 0) {
bargainBtn = <button className='active-btn' onClick={this.friendBargainFirst}>帮好友砍一刀</button> bargainBtn = <button className='active-btn' onClick={this.friendBargainFirst}>帮好友砍一刀</button>
...@@ -422,30 +426,35 @@ class BargainMiddlePage extends Component { ...@@ -422,30 +426,35 @@ class BargainMiddlePage extends Component {
/> />
</ul> </ul>
<div className="bargain-detail"> <div className="bargain-detail">
<div className="top"> {
(this.state.data.bargain_status == 0 || this.state.data.bargain_status == 1) &&
<div> <div>
已砍<span className={'reduced-price'}>{this.state.bargainData.bargain_price}</span> <div className="top">
</div> <div>
{ 已砍<span className={'reduced-price'}>{this.state.bargainData.bargain_price}</span>
this.state.data.bargain_status === 0 && </div>
<div> {
this.state.data.bargain_status === 0 &&
<div>
<span <span
className={'time hour'}>{String(this.state.hour).padStart(2, 0)}</span> :&nbsp; className={'time hour'}>{String(this.state.hour).padStart(2, 0)}</span> :&nbsp;
<span <span
className={'time min'}>{String(this.state.min).padStart(2, 0)}</span> :&nbsp; className={'time min'}>{String(this.state.min).padStart(2, 0)}</span> :&nbsp;
<span className={'time sec'}>{String(this.state.sec).padStart(2, 0)}</span> <span className={'time sec'}>{String(this.state.sec).padStart(2, 0)}</span>
<span className={'inactive'}> 后砍价结束</span> <span className={'inactive'}> 后砍价结束</span>
</div> </div>
} }
{ {
this.state.data.bargain_status === 1 && this.state.isOriginator === 1 && this.state.data.bargain_status === 1 && this.state.isOriginator === 1 &&
<span className={'inactive'}>砍价结束</span> <span className={'inactive'}>砍价结束</span>
} }
</div> </div>
<div className="middle"> <div className="middle">
<span style={{width: this.state.width}}></span> <span style={{width: this.state.width}}></span>
</div> </div>
</div>
}
{ {
this.state.isOriginator === 1 && this.state.data.bargain_status === 0 && this.state.isOriginator === 1 && this.state.data.bargain_status === 0 &&
<div> <div>
...@@ -541,7 +550,7 @@ class BargainMiddlePage extends Component { ...@@ -541,7 +550,7 @@ class BargainMiddlePage extends Component {
<Overlay> <Overlay>
<div className="bargain-popup__content"> <div className="bargain-popup__content">
{/*砍价成功去分享*/} {/*砍价成功去分享*/}
{ {
...@@ -561,7 +570,7 @@ class BargainMiddlePage extends Component { ...@@ -561,7 +570,7 @@ class BargainMiddlePage extends Component {
} */} } */}
{ {
this.state.status === 1 && this.state.status === 1 &&
<FollowBarcode <FollowBarcode
userInfo={this.props.user.data} userInfo={this.props.user.data}
money={this.state.amount} money={this.state.amount}
firendBaigainPrice={this.state.firendBaigainPrice} firendBaigainPrice={this.state.firendBaigainPrice}
...@@ -625,13 +634,13 @@ function CourseDes(props) { ...@@ -625,13 +634,13 @@ function CourseDes(props) {
<span className={'discount-price'}>{course.course_price}</span> <span className={'discount-price'}>{course.course_price}</span>
{/* is_originator 是否发起人 0-否 1-是 */} {/* is_originator 是否发起人 0-否 1-是 */}
{ {
(is_originator === 1 && bargain_status !== 3) && (is_originator == 1 && bargain_status == 0 || bargain_status == 1) &&
<button className={'purchase-btn'} onClick={toCart}> <button className={'purchase-btn'} onClick={toCart}>
¥{course.pay_price}去支付 ¥{course.pay_price}去支付
</button> </button>
} }
{ {
(is_originator === 1 && bargain_status === 3) && (is_originator == 1 && bargain_status == 3) &&
<span className="course-button__buy--done">已购买</span> <span className="course-button__buy--done">已购买</span>
} }
</div> </div>
...@@ -640,7 +649,7 @@ function CourseDes(props) { ...@@ -640,7 +649,7 @@ 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 { user: { data = {} } } = props;
...@@ -653,19 +662,19 @@ function CourseBottom(props) { ...@@ -653,19 +662,19 @@ function CourseBottom(props) {
<div className=""> <div className="">
<a onClick={() => props.toDetail(props.item.course_id)} className={'bargain bargian-study'}>我要砍价</a> <a onClick={() => props.toDetail(props.item.course_id)} className={'bargain bargian-study'}>我要砍价</a>
</div> </div>
) )
} else if (bargain_status === 3) { } else if (bargain_status === 3) {
if(course_id === 139) { if(course_id === 139) {
Buttons = ( Buttons = (
<a <a
onClick={() => props.toDetail(props.item.course_id)} onClick={() => props.toDetail(props.item.course_id)}
className={'bargain bargian-study'} className={'bargain bargian-study'}
>我要砍价</a> >我要砍价</a>
); );
}else { }else {
Buttons = ( Buttons = (
<Link <Link
to={`/play/video?id=${props.item.v_course_id}`} to={`/play/video?id=${props.item.v_course_id}`}
className={classnames('bargain', 'button--study')} className={classnames('bargain', 'button--study')}
>去学习</Link> >去学习</Link>
...@@ -685,7 +694,7 @@ function CourseBottom(props) { ...@@ -685,7 +694,7 @@ function CourseBottom(props) {
bargain_status === 0 && 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'}
> >
...@@ -694,16 +703,16 @@ function CourseBottom(props) { ...@@ -694,16 +703,16 @@ function CourseBottom(props) {
</div> </div>
) )
} }
}else { }else {
Buttons = ( Buttons = (
<a <a
onClick={() => props.toDetail(props.item.course_id)} onClick={() => props.toDetail(props.item.course_id)}
className={'bargain bargian-study'} className={'bargain bargian-study'}
>我要砍价</a> >我要砍价</a>
); );
} }
return ( return (
<div className="course-bottom"> <div className="course-bottom">
<div className={'course-price'}> <div className={'course-price'}>
...@@ -725,9 +734,9 @@ function PublicNumber(props) { ...@@ -725,9 +734,9 @@ function PublicNumber(props) {
<p className='status-title ff4'>谢谢你帮我砍了{props.money}元!</p> <p className='status-title ff4'>谢谢你帮我砍了{props.money}元!</p>
} }
<p className='status-dec'>关注公众号,可以再砍一刀哦~</p> <p className='status-dec'>关注公众号,可以再砍一刀哦~</p>
<img <img
className='public-number-img' className='public-number-img'
src="https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/tinypng-common/right_weixin.png" src="https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/tinypng-common/right_weixin.png"
alt="" alt=""
/> />
</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