function getCodetimer(that) { const TIME_COUNT = 60; if (!that.data.settiemr) { that.setData({ second:TIME_COUNT }) that.data.settiemr = setInterval(() => { console.log(“1”) if (that.data.second > 0 && that.data.second <= TIME_COUNT) { that.setData({ second: --that.data.second }) } else { that.setData({ alreadySend:false, send:true, settiemr:null }) clearInterval(that.data.settiemr); } }, 1000) } } 调用方法;
页面隐藏删除