一个活动页面,写了一个简单的倒计时功能,出问题了:
1、安卓手机出现卡顿、闪烁
2、ios系统,开发环境倒计时不显示、上线版也不显示,只有真机调试显示
请问官方,或者别人都是怎么解决的??
countDown(){
this.disTimestamp = 10
var end = ()=>{
clearInterval(this.handle)
this.handle = 0
this.setData({
showDaojishi: !1,
daojishiCount: 0
})
}
this.handle && end();
this.handle = setInterval(function()=>{
console.log(this.disTimestamp)
this.disTimestamp <= 0 ? end() : (this.disTimestamp <= 120 && this.disTimestamp > 0 ? this.setData({
showDaojishi: !0,
daojishiCount: this.disTimestamp–
}) : void 0)
}.bind(this), 1000)
}