Commit db5de29f by FE

Merge branch 'issue-20190920' into pre

parents b97d503b a0e250db
...@@ -3,7 +3,12 @@ import './index.scss' ...@@ -3,7 +3,12 @@ import './index.scss'
const VList = (props) => { const VList = (props) => {
return ( return (
<li className='v-list-item' onClick={() => props.toDetail(props.id)}> <li
className='v-list-item'
onClick={() => {
typeof props.toDetail === 'function' && props.toDetail(props.id)
}}
>
<div className="content"> <div className="content">
<div className="cover"> <div className="cover">
{props.status} {props.status}
......
...@@ -721,3 +721,19 @@ ...@@ -721,3 +721,19 @@
color: #fff; color: #fff;
} }
.course-button__buy--done {
position: absolute;
top: 0;
right: 0;
bottom: 0;
width: 61px;
height: 18px;
margin: auto 0;
border-radius: 9px;
font-size: 12px;
color: $white;
text-align: center;
line-height: 18px;
background-color: $bg_active;
}
...@@ -339,6 +339,7 @@ class BargainMiddlePage extends Component { ...@@ -339,6 +339,7 @@ class BargainMiddlePage extends Component {
} }
render() { render() {
// console.log(this.state.data);
let thirdRow, btn let thirdRow, btn
// is_artifact 0-再邀请多少人可以使用 1-可以使用未领取 2-已领取 3-已使用 // is_artifact 0-再邀请多少人可以使用 1-可以使用未领取 2-已领取 3-已使用
if (this.state.bargainData.is_artifact === 0) { if (this.state.bargainData.is_artifact === 0) {
...@@ -353,19 +354,38 @@ class BargainMiddlePage extends Component { ...@@ -353,19 +354,38 @@ class BargainMiddlePage extends Component {
btn = <button className={'artifact-btn'} onClick={this.useArtifact}>立即使用</button> btn = <button className={'artifact-btn'} onClick={this.useArtifact}>立即使用</button>
} }
const { data: { is_originator = 0, assist_status = 0, bargain_status = 0 } } = this.state;
let bargainBtn let bargainBtn = '';
if (this.state.isOriginator !== 1 && this.state.data.assist_status === 0 && this.state.data.bargain_status === 0) { // assist_status 助力状态 0-未助力,1-已助力一次 2-已助力两次,不能再助力
// is_originator 是否发起人 0-否 1-是
// bargain_status 砍价状态 0-砍价中,1砍价结束,待支付,2砍价过期(没有砍价记录没有砍价信息),3已购买
if(is_originator) {
if(bargain_status === 0) {
bargainBtn = <button className='active-btn' onClick={this.shareFriendBargain}>邀请好友砍价</button>
}
}else {
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>
} else if (this.state.isOriginator !== 1 && this.state.data.assist_status === 1) { }else if (assist_status === 1 && bargain_status === 0) {
bargainBtn = <button className='active-btn' onClick={this.friendBargainSecond}>再砍一刀</button> bargainBtn = <button className='active-btn' onClick={this.friendBargainSecond}>再砍一刀</button>
} else if (this.state.isOriginator !== 1 && this.state.data.assist_status === 2) { }else if (assist_status === 2 && bargain_status === 0) {
bargainBtn = <button className={'invalid-btn'}>已帮好友助力</button> bargainBtn = <button className={'invalid-btn'}>已帮好友助力</button>
} else if (this.state.data.bargain_status === 1 || this.state.data.bargain_status === 2) { }else if (bargain_status !== 0) {
bargainBtn = <button className={'invalid-btn'}>砍价结束</button> bargainBtn = <button className={'invalid-btn'}>砍价结束</button>
} else if (this.state.isOriginator === 1 && this.state.data.bargain_status === 0) {
bargainBtn = <button className='active-btn' onClick={this.shareFriendBargain}>邀请好友砍价</button>
} }
}
// if (this.state.isOriginator !== 1 && this.state.data.assist_status === 0 && this.state.data.bargain_status === 0) {
// bargainBtn = <button className='active-btn' onClick={this.friendBargainFirst}>帮好友砍一刀</button>
// } else if (this.state.isOriginator !== 1 && this.state.data.assist_status === 1) {
// bargainBtn = <button className='active-btn' onClick={this.friendBargainSecond}>再砍一刀1</button>
// } else if (this.state.isOriginator !== 1 && this.state.data.assist_status === 2) {
// bargainBtn = <button className={'invalid-btn'}>已帮好友助力</button>
// } else if (this.state.data.bargain_status === 1 || this.state.data.bargain_status === 2) {
// bargainBtn = <button className={'invalid-btn'}>砍价结束</button>
// } else if (this.state.isOriginator === 1 && this.state.data.bargain_status === 0) {
// bargainBtn = <button className='active-btn' onClick={this.shareFriendBargain}>邀请好友砍价</button>
// }
return ( return (
<div className={'bargain-middle-page'}> <div className={'bargain-middle-page'}>
<HeaderBar title='砍价详情' arrow={true} cart={true} toHref={'/'}></HeaderBar> <HeaderBar title='砍价详情' arrow={true} cart={true} toHref={'/'}></HeaderBar>
...@@ -571,24 +591,30 @@ class BargainMiddlePage extends Component { ...@@ -571,24 +591,30 @@ class BargainMiddlePage extends Component {
} }
} }
// 课程信息 -- 右侧
function CourseDes(props) { function CourseDes(props) {
const data = props.data && props.data.course const { data: { bargain_status = 0, course = {}, is_originator = 0 }, toCart } = props;
return ( return (
<div className={'des'}> <div className={'des'}>
<div className="course-title text-overflow-2"> <div className="course-title text-overflow-2">
{data.course_title} {course.course_title}
</div> </div>
<div className="price-bar"> <div className="price-bar">
<span className={'discount-price'}>{data.course_price}</span> <span className={'discount-price'}>{course.course_price}</span>
{/* is_originator 是否发起人 0-否 1-是 */}
{ {
props.isOriginator === 1 && (is_originator === 1 && bargain_status !== 3) &&
<button className={'purchase-btn'} <button className={'purchase-btn'} onClick={toCart}>
onClick={props.toCart}>¥{data.pay_price}去支付 ¥{course.pay_price}去支付
</button> </button>
} }
{
(is_originator === 1 && bargain_status === 3) &&
<span className="course-button__buy--done">已购买</span>
}
</div> </div>
</div> </div>
) );
} }
function CourseBottom(props) { function CourseBottom(props) {
......
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