diff --git a/pages/timer/timer.js b/pages/timer/timer.js index 7edbd32..1ed775a 100644 --- a/pages/timer/timer.js +++ b/pages/timer/timer.js @@ -66,8 +66,11 @@ Page({ // Reset reminder state this._halfwaySignaled = false + this._last30Signaled = false + this._last10Signaled = false this._lastMinuteAt = 0 this._lastCountdown = 0 + this._saving = false this._timer = new Timer({ onTick: (tick) => { @@ -188,8 +191,14 @@ Page({ }, finishTraining() { + // Guard against double-tap: stop button is still visible during the + // 1.5s navigateBack delay, so a second tap would create a duplicate. + if (this._saving) return + this._saving = true + const elapsed = this._timer.stop() if (elapsed < 3) { + this._saving = false wx.showToast({ title: '训练时间太短', icon: 'none', duration: 1500 }) setTimeout(() => { wx.navigateBack() }, 1500) return