diff --git a/app.js b/app.js index 909d5f6..0d3c294 100644 --- a/app.js +++ b/app.js @@ -384,13 +384,15 @@ App({ //------定时等待某个值,有值才进行运算-------- waitfor:function(time,pop_value,func){ + var n=0; if(!time){ time=setInterval(function(){ - console.log(time); + console.log(time);n++; if(pop_value) { clearInterval(time); func(); - } + } + if(n>60) clearInterval(time); },1000); } }