Commit 8e30482d by zhanghaozhe

周年庆

parent ac4d21a6
...@@ -420,6 +420,9 @@ class Anniversary2020 extends Component { ...@@ -420,6 +420,9 @@ class Anniversary2020 extends Component {
} }
draw = debounce((i) => { draw = debounce((i) => {
if(this.isGotoLogin()){
return
}
const {activityData, prizeData, isDrawing} = this.state const {activityData, prizeData, isDrawing} = this.state
if (i !== 4 || isDrawing || prizeData.odd_times === 0 || activityData.stage === 4) { if (i !== 4 || isDrawing || prizeData.odd_times === 0 || activityData.stage === 4) {
return return
...@@ -484,7 +487,7 @@ class Anniversary2020 extends Component { ...@@ -484,7 +487,7 @@ class Anniversary2020 extends Component {
this.setState((state, props) => { this.setState((state, props) => {
return { return {
prizeData: {...state.prizeData, ...{odd_times: state.prizeData.odd_times + 1}}, prizeData: {...state.prizeData, ...{odd_times: state.prizeData.odd_times + 1}},
activityData: {...state.activity_stage, ...{is_sign: true}}, activityData: {...state.activityData, ...{is_sign: true}},
} }
}); });
} else { } else {
...@@ -686,7 +689,7 @@ class Anniversary2020 extends Component { ...@@ -686,7 +689,7 @@ class Anniversary2020 extends Component {
prizeData.prizes && !!prizeData.prizes.length && prizeData.prizes.map((item, index) => { prizeData.prizes && !!prizeData.prizes.length && prizeData.prizes.map((item, index) => {
return <li key={index} return <li key={index}
className={classnames([ className={classnames([
index === 4 ? (prizeData.odd_times ? 'available' : 'unavailable') : '', index === 4 ? (user.hasError || prizeData.odd_times ? 'available' : 'unavailable') : '',
{ {
active: drawingItemId === item.id, active: drawingItemId === item.id,
}, },
...@@ -696,11 +699,21 @@ class Anniversary2020 extends Component { ...@@ -696,11 +699,21 @@ class Anniversary2020 extends Component {
? <div className={'prize'}> ? <div className={'prize'}>
<img src={item.img_name} alt=""/> <img src={item.img_name} alt=""/>
</div> </div>
: activityData.stage === 1 ? : activityData.stage === 1
<div className={'draw'} style={{lineHeight: '350%'}}>715日开始</div> : <div className={'draw'}> ? <div className={'draw'} style={{lineHeight: '350%'}}>715日开始</div>
<div>抽奖</div> : user.hasError
<div>剩余{prizeData.odd_times || 0}次机会</div> ? <div className="draw" style={{
</div> height: '100%',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
}}>
<div>抽奖</div>
</div>
: <div className={'draw'}>
<div>抽奖</div>
<div>剩余{prizeData.odd_times || 0}次机会</div>
</div>
} }
</li> </li>
}) })
......
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