Commit 47eb88e7 by zhanghaozhe

Merge branch '2020-717-formal' into dev

parents 2c7730ac dcddddc4
...@@ -532,21 +532,21 @@ class Anniversary2020 extends Component { ...@@ -532,21 +532,21 @@ class Anniversary2020 extends Component {
} }
setupCountDown = (totalSeconds) => { setupCountDown = (totalSeconds) => {
this.countDownTimer = setTimeout(() => { totalSeconds -= 60
totalSeconds-- const d = Math.floor(totalSeconds / 60 / 60 / 24)
const d = Math.floor(totalSeconds / 60 / 60 / 24) const h = Math.floor(totalSeconds / 60 / 60) % 24
const h = Math.floor(totalSeconds / 60 / 60) % 24 const m = Math.floor(totalSeconds / 60) % 60
const m = Math.floor(totalSeconds / 60) % 60 this.setState({
this.setState({ countDown: `${d}${h}${m}分`,
countDown: `${d}${h}${m}分`, }, () => {
}, () => { if (totalSeconds > 0) {
if (totalSeconds > 0) { this.countDownTimer = setTimeout(() => {
this.setupCountDown(totalSeconds) this.setupCountDown(totalSeconds)
} else { }, 1000 * 60)
this.getActivityStage() } else {
} this.getActivityStage()
}); }
}, 1000 * 60) });
} }
render() { 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