Commit a9885b44 by zhanghaozhe

抽奖

parent 3dd04d46
......@@ -77,11 +77,11 @@ class FormalDraw extends Component {
draw = id => {
let {surplus, is_prize, hot_value} = this.state.userValue
if(hot_value<50){
if (hot_value < 50) {
Toast.info('你的福气值未达到参与抽奖所需福气值分数,快去积攒福气值吧', 2, null, false)
} else if(is_prize == 1){
} else if (is_prize == 1) {
Toast.info('你已参与当前时段抽奖', 2, null, false)
} else if(surplus<1){
} else if (surplus < 1) {
Toast.info('你的抽奖次数已用光,快去积攒福气值可获得更多抽奖机会', 2, null, false)
} else {
http.post(`${API.home}/sys/activity/prize`, {
......@@ -96,23 +96,23 @@ class FormalDraw extends Component {
title: '你已成功参与本时段抽奖',
className: 'join-lottery',
content: (
<>
<div className="text">
<div className="code">抽奖码为:{data.code}</div>
<div className="time">本时段的中奖结果将在{data.date}公布</div>
<div className="hint">你可关注‘七月在线’服务号第一时间获得中奖信息。</div>
<img src={url} className='qr-code' alt=""/>
</div>
<button onClick={() => {
this.popupInstance.close()
}}>知道了
</button>
</>
<>
<div className="text">
<div className="code">抽奖码为:{data.code}</div>
<div className="time">本时段的中奖结果将在{data.date}公布</div>
<div className="hint">你可关注‘七月在线’服务号第一时间获得中奖信息。</div>
<img src={url} className='qr-code' alt=""/>
</div>
<button onClick={() => {
this.popupInstance.close()
}}>知道了
</button>
</>
)
})
this.setState({
userValue: {...this.state.userValue, ...{surplus: --surplus}}
})
userValue: {...this.state.userValue, ...{surplus: --surplus}, ...{is_prize: 1}}
}, () => {console.log(this.state.userValue)})
})
} else {
Toast.info(msg, 2, null, false)
......
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