Commit 6a604060 by FE

modify tip not login when get into kanjia course detial

parent f7077b39
...@@ -27,7 +27,7 @@ class Bargain extends Component { ...@@ -27,7 +27,7 @@ class Bargain extends Component {
} }
componentDidMount() { componentDidMount() {
this.getBargainInfo() // this.getBargainInfo()
} }
// 获取助理好友 // 获取助理好友
...@@ -119,7 +119,8 @@ class Bargain extends Component { ...@@ -119,7 +119,8 @@ class Bargain extends Component {
} }
// 继续砍价 // 继续砍价
continueBargain = () => { continueBargain = () => {
const code = this.state.bargainCode const { barInfo = {} } = this.props;
const code = barInfo.bargain_code;
this.props.history.push(`/bargain-middle-page?id=${getParam('id')}&bargaincode=${code}&is_originator=1`) this.props.history.push(`/bargain-middle-page?id=${getParam('id')}&bargaincode=${code}&is_originator=1`)
} }
...@@ -170,18 +171,19 @@ class Bargain extends Component { ...@@ -170,18 +171,19 @@ class Bargain extends Component {
} }
render() { render() {
const { list, outList, barInfo } = this.props;
return ( return (
<div className={'bargain-func'}> <div className={'bargain-func'}>
{/*bargain_status 砍价状态 0-砍价中,1砍价结束,待支付,2砍价过期(没有砍价记录没有砍价信息),3已购买*/} {/*bargain_status 砍价状态 0-砍价中,1砍价结束,待支付,2砍价过期(没有砍价记录没有砍价信息),3已购买*/}
{ {
this.state.info.bargain_status === 2 && barInfo.bargain_status === 2 &&
<BargainIntro limitPeople={this.state.limitPeople} iWantBargain={this.iWantBargain}/> <BargainIntro limitPeople={barInfo.limitPeople} iWantBargain={this.iWantBargain}/>
} }
{ {
(this.state.info.bargain_status === 0 || this.state.info.bargain_status === 1) && (barInfo.bargain_status === 0 || barInfo.bargain_status === 1) &&
<BargainStatus <BargainStatus
info={this.state.info} info={barInfo}
outList={this.state.outList} outList={outList}
getMore={this.getMore} getMore={this.getMore}
toArtifact={this.toArtifact} toArtifact={this.toArtifact}
useArtifact={this.useArtifact} useArtifact={this.useArtifact}
...@@ -222,8 +224,13 @@ class Bargain extends Component { ...@@ -222,8 +224,13 @@ class Bargain extends Component {
{/*更多好友砍价*/} {/*更多好友砍价*/}
<Ranking list={this.state.list} icon={this.state.kanjiaIcon} limitPeople={this.state.limitPeople} <Ranking
isShowMore={this.state.isShowMore} boxHide={this.boxHide}></Ranking> list={list}
icon={this.state.kanjiaIcon}
limitPeople={barInfo.limitPeople}
isShowMore={this.state.isShowMore}
boxHide={this.boxHide}
/>
</div> </div>
) )
......
...@@ -29,6 +29,8 @@ class Detail extends Component { ...@@ -29,6 +29,8 @@ class Detail extends Component {
barInfo: '', barInfo: '',
share: false, share: false,
countdown: '00:00:00', countdown: '00:00:00',
outList: [],
list: [],
} }
} }
...@@ -156,6 +158,29 @@ class Detail extends Component { ...@@ -156,6 +158,29 @@ class Detail extends Component {
if (res.data.code === 200) { if (res.data.code === 200) {
this.setState({ this.setState({
barInfo: res.data.data barInfo: res.data.data
});
if (res.data.data.bargain_status === 0) {
this.getBargainRankList(getParam('id'), 0)
}
}else if(res.data.code === 4030) {
} else {
Toast.info(res.data.msg, 2)
}
})
}
// 获取助理好友
getBargainRankList = (id, type) => {
let data = {
courseId: id,
type: type
}
http.post(`${API.home}/m/bargain/rankList`, data).then((res) => {
if (res.data.code === 200) {
this.setState({
list: res.data.data.list,
outList: res.data.data.list[0]
}) })
} else { } else {
Toast.info(res.data.msg, 2) Toast.info(res.data.msg, 2)
...@@ -180,7 +205,7 @@ class Detail extends Component { ...@@ -180,7 +205,7 @@ class Detail extends Component {
number = courseInfo.pdd_group_info.groupon_member.number; number = courseInfo.pdd_group_info.groupon_member.number;
} }
} }
const {share, countdown} = this.state; const {share, countdown, list, outList} = this.state;
const href = this.props.location && this.props.location.state? this.props.location.state.href : undefined; const href = this.props.location && this.props.location.state? this.props.location.state.href : undefined;
return ( return (
<div className='detail-box'> <div className='detail-box'>
...@@ -267,8 +292,12 @@ class Detail extends Component { ...@@ -267,8 +292,12 @@ class Detail extends Component {
{/*砍价*/} {/*砍价*/}
{ {
courseInfo.is_baoming === 0 && (!courseInfo.is_aist) && this.props.courseInfo.course_info && this.props.courseInfo.course_info.is_bargain && courseInfo.is_baoming === 0 && (!courseInfo.is_aist) && this.state.barInfo &&
<Bargain/> <Bargain
list={list}
outList={outList}
barInfo={this.state.barInfo}
/>
} }
{/*课程介绍、大纲*/} {/*课程介绍、大纲*/}
......
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