timer = setInterval(function () {
nowTime -=1
if (nowTime == -1) {
that.setData({
awaitShow: false,
playTime: 0,
playIndex: parseInt(that.data.playIndex) + 1,
scrollIndex: that.data.playIndex+1
})
clearInterval(timer)
timer = null
if (that.data.systemMes == ‘i’) {
that.musicNow.pause()
} else {
that.awaitMusic.pause()
that.awaitMusic.destroy()
}
that.playTimeNow()
} else {
that.setData({
playTime: all - nowTime,
nowTime: (parseInt(nowTime / 60) >= 10 ? parseInt(nowTime / 60) : (“0” + parseInt(nowTime / 60))) + “:” + (parseInt(nowTime % 60) < 10 ? (“0” + parseInt(nowTime % 60)) : parseInt(nowTime % 60))
})
if (that.data.nowTime == “00:03”) {
that.resetMusic.play()
if (that.data.systemMes == ‘i’) {
that.musicNow.pause()
} else {
that.awaitMusic.pause()
that.awaitMusic.destroy()
}
}
}
}, 1000)
有时侯会出现卡顿,卡顿之后会跳过某一段时间