Commit 70426bdf by FE

bargainMiddlePage modify

parent caa42759
...@@ -9,7 +9,10 @@ const VList = (props) => { ...@@ -9,7 +9,10 @@ const VList = (props) => {
<div className="cover"> <div className="cover">
{props.status} {props.status}
{/* <Link to={`/detail?id=${props.id}`}> */} {/* <Link to={`/detail?id=${props.id}`}> */}
<img src={props.img} alt="" onClick={() => props.toDetail(props.id)} /> {props.toDetail
?(<img src={props.img} alt="" onClick={() => props.toDetail(props.id)} />)
:(<img src={props.img} alt="" />)
}
{/* </Link> */} {/* </Link> */}
</div> </div>
{props.info} {props.info}
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
flex: 0 0 auto; flex: 0 0 auto;
margin-right: 16px; margin-right: 16px;
position: relative; position: relative;
width: 150px;
img { img {
width: 150px; width: 150px;
height: 108px; height: 108px;
......
...@@ -22,6 +22,7 @@ class BargainMiddlePage extends Component { ...@@ -22,6 +22,7 @@ class BargainMiddlePage extends Component {
isShowOverlay: false, isShowOverlay: false,
isOriginator: '', isOriginator: '',
kanjiaIcon: require('./image/kanjia_icon.png'), kanjiaIcon: require('./image/kanjia_icon.png'),
course: {}, // 当前砍价课程
courseList: [], // 所有砍价课程 courseList: [], // 所有砍价课程
data: '', data: '',
bargainData: '', bargainData: '',
...@@ -53,14 +54,17 @@ class BargainMiddlePage extends Component { ...@@ -53,14 +54,17 @@ class BargainMiddlePage extends Component {
http.get(`${API.home}/m/bargain/info?bargaincode=${getParam('bargaincode')}&is_originator=${getParam('is_originator')}`).then((res) => { http.get(`${API.home}/m/bargain/info?bargaincode=${getParam('bargaincode')}&is_originator=${getParam('is_originator')}`).then((res) => {
if (res.data.code === 200) { if (res.data.code === 200) {
this.setState({ this.setState(
{
data: res.data.data, data: res.data.data,
isOriginator: res.data.data.is_originator, isOriginator: res.data.data.is_originator,
originatorUid: res.data.data.originator_uid, originatorUid: res.data.data.originator_uid,
course: res.data.data.course,
limitPeople: res.data.data.course.limit_people, limitPeople: res.data.data.course.limit_people,
bargainData: res.data.data.bargain, bargainData: res.data.data.bargain,
width: (res.data.data.bargain.bargain_price / res.data.data.bargain.total_price).toFixed(2) * 100 + '%' width: (res.data.data.bargain.bargain_price / res.data.data.bargain.total_price).toFixed(2) * 100 + '%'
}, () => { },
() => {
if (this.state.bargainData.expire_time) { if (this.state.bargainData.expire_time) {
let date = this.state.bargainData.expire_time * 1000 let date = this.state.bargainData.expire_time * 1000
let now = Date.now() let now = Date.now()
...@@ -81,7 +85,8 @@ class BargainMiddlePage extends Component { ...@@ -81,7 +85,8 @@ class BargainMiddlePage extends Component {
}, 1000) }, 1000)
} }
}) }
)
} else { } else {
Toast.info(res.data.msg, 2) Toast.info(res.data.msg, 2)
} }
...@@ -263,7 +268,6 @@ class BargainMiddlePage extends Component { ...@@ -263,7 +268,6 @@ class BargainMiddlePage extends Component {
} }
render() { render() {
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) {
...@@ -291,8 +295,6 @@ class BargainMiddlePage extends Component { ...@@ -291,8 +295,6 @@ class BargainMiddlePage extends Component {
} else if (this.state.isOriginator === 1 && this.state.data.bargain_status === 0) { } else if (this.state.isOriginator === 1 && this.state.data.bargain_status === 0) {
bargainBtn = <button className='active-btn' onClick={this.shareFriendBargain}>邀请好友砍价</button> 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}></HeaderBar> <HeaderBar title='砍价详情' arrow={true} cart={true}></HeaderBar>
...@@ -306,10 +308,13 @@ class BargainMiddlePage extends Component { ...@@ -306,10 +308,13 @@ class BargainMiddlePage extends Component {
<ul> <ul>
<VList <VList
info={<CourseDes img={this.state.course.course_img}
info={
<CourseDes
isOriginator={this.state.isOriginator} isOriginator={this.state.isOriginator}
data={this.state.data} data={this.state.data}
toCart={this.toCart}/>} toCart={this.toCart}/>
}
/> />
</ul> </ul>
<div className="bargain-detail"> <div className="bargain-detail">
......
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