Commit 75adef29 by zhanghaozhe

抽奖预约

parent 5909e197
......@@ -34,11 +34,11 @@ class FormalDraw extends Component {
}
shouldComponentUpdate(nextProps, nextState, nextContext) {
if(this.props.isApp !== nextProps.isApp) {
if (this.props.isApp !== nextProps.isApp) {
this.getPrizeData()
return false;
return false
}
return true;
return true
}
getPrizeData = () => {
......@@ -161,7 +161,8 @@ class FormalDraw extends Component {
if (this.subscribePopupInstance) {
return
}
http.get(`${API["base-api"]}/sys/activity/create_pre_qrcode`,{params:{id}})
if (!this.state.userValue['is_pre']) {
http.get(`${API["base-api"]}/sys/activity/create_pre_qrcode`, {params: {id}})
.then(res => {
const {code, data, msg} = res.data
if (code == 200) {
......@@ -180,6 +181,20 @@ class FormalDraw extends Component {
Toast.info(msg, 2, null, false)
}
})
} else {
http.get(`${API["base-api"]}/activity_pre/${id}`)
.then(res => {
const {code} = res.data
if (code == 200) {
Toast.info('预约成功', 2, null, false)
}
})
.catch(err => {
console.log(err)
})
}
}
render() {
......
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