Commit 6a604060 by FE

modify tip not login when get into kanjia course detial

parent f7077b39
......@@ -27,7 +27,7 @@ class Bargain extends Component {
}
componentDidMount() {
this.getBargainInfo()
// this.getBargainInfo()
}
// 获取助理好友
......@@ -119,7 +119,8 @@ class Bargain extends Component {
}
// 继续砍价
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`)
}
......@@ -170,18 +171,19 @@ class Bargain extends Component {
}
render() {
const { list, outList, barInfo } = this.props;
return (
<div className={'bargain-func'}>
{/*bargain_status 砍价状态 0-砍价中,1砍价结束,待支付,2砍价过期(没有砍价记录没有砍价信息),3已购买*/}
{
this.state.info.bargain_status === 2 &&
<BargainIntro limitPeople={this.state.limitPeople} iWantBargain={this.iWantBargain}/>
barInfo.bargain_status === 2 &&
<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
info={this.state.info}
outList={this.state.outList}
info={barInfo}
outList={outList}
getMore={this.getMore}
toArtifact={this.toArtifact}
useArtifact={this.useArtifact}
......@@ -222,8 +224,13 @@ class Bargain extends Component {
{/*更多好友砍价*/}
<Ranking list={this.state.list} icon={this.state.kanjiaIcon} limitPeople={this.state.limitPeople}
isShowMore={this.state.isShowMore} boxHide={this.boxHide}></Ranking>
<Ranking
list={list}
icon={this.state.kanjiaIcon}
limitPeople={barInfo.limitPeople}
isShowMore={this.state.isShowMore}
boxHide={this.boxHide}
/>
</div>
)
......
......@@ -29,6 +29,8 @@ class Detail extends Component {
barInfo: '',
share: false,
countdown: '00:00:00',
outList: [],
list: [],
}
}
......@@ -156,6 +158,29 @@ class Detail extends Component {
if (res.data.code === 200) {
this.setState({
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 {
Toast.info(res.data.msg, 2)
......@@ -180,7 +205,7 @@ class Detail extends Component {
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;
return (
<div className='detail-box'>
......@@ -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 &&
<Bargain/>
courseInfo.is_baoming === 0 && (!courseInfo.is_aist) && this.state.barInfo &&
<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