Commit dcddddc4 by zhanghaozhe

周年庆

parent 8b1e6bde
...@@ -532,8 +532,7 @@ class Anniversary2020 extends Component { ...@@ -532,8 +532,7 @@ 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
...@@ -541,12 +540,13 @@ class Anniversary2020 extends Component { ...@@ -541,12 +540,13 @@ class Anniversary2020 extends Component {
countDown: `${d}${h}${m}分`, countDown: `${d}${h}${m}分`,
}, () => { }, () => {
if (totalSeconds > 0) { if (totalSeconds > 0) {
this.countDownTimer = setTimeout(() => {
this.setupCountDown(totalSeconds) this.setupCountDown(totalSeconds)
}, 1000 * 60)
} else { } else {
this.getActivityStage() 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