Commit 195a7a2c by zhanghaozhe

Merge branch '11-11-formal' into dev

parents d95d0ebd 9e806272
...@@ -81,7 +81,7 @@ class FormalDraw extends Component { ...@@ -81,7 +81,7 @@ class FormalDraw extends Component {
Toast.info('你的福气值未达到参与抽奖所需福气值分数,快去积攒福气值吧', 2, null, false) Toast.info('你的福气值未达到参与抽奖所需福气值分数,快去积攒福气值吧', 2, null, false)
} else if (is_prize == 1) { } else if (is_prize == 1) {
Toast.info('你已参与当前时段抽奖', 2, () => { Toast.info('你已参与当前时段抽奖', 2, () => {
this.requestDraw(id) this.requestDraw(id, true)
}, false) }, false)
} else if (surplus < 1) { } else if (surplus < 1) {
Toast.info('你的抽奖次数已用光,快去积攒福气值可获得更多抽奖机会', 2, null, false) Toast.info('你的抽奖次数已用光,快去积攒福气值可获得更多抽奖机会', 2, null, false)
...@@ -90,7 +90,7 @@ class FormalDraw extends Component { ...@@ -90,7 +90,7 @@ class FormalDraw extends Component {
} }
} }
requestDraw = id => { requestDraw = (id, isDrawn) => {
let {surplus} = this.state.userValue let {surplus} = this.state.userValue
http.post(`${API.home}/sys/activity/prize`, { http.post(`${API.home}/sys/activity/prize`, {
id id
...@@ -119,7 +119,7 @@ class FormalDraw extends Component { ...@@ -119,7 +119,7 @@ class FormalDraw extends Component {
) )
}) })
this.setState({ this.setState({
userValue: {...this.state.userValue, ...{surplus: --surplus}, ...{is_prize: 1}} userValue: {...this.state.userValue, ...{surplus: isDrawn ? surplus : --surplus}, ...{is_prize: 1}}
}) })
}) })
} else { } else {
...@@ -191,7 +191,7 @@ class FormalDraw extends Component { ...@@ -191,7 +191,7 @@ class FormalDraw extends Component {
{ {
list.map((listItem, index) => { list.map((listItem, index) => {
return ( return (
<div className={`content ${today === userValue.today ? 'current':''}`} key={index}> <div className={`content ${today === userValue.today ? 'current' : ''}`} key={index}>
{ {
(isLogin && (today === userValue.today)) (isLogin && (today === userValue.today))
? ?
......
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