Commit 4a8c8991ce31c2c088f0a3f5f2538c6a3f9caeeb
1 parent
d3dddbf6
最后1分钟的等待时间
Showing
1 changed file
with
4 additions
and
2 deletions
app.js
| ... | ... | @@ -384,13 +384,15 @@ App({ |
| 384 | 384 | |
| 385 | 385 | //------定时等待某个值,有值才进行运算-------- |
| 386 | 386 | waitfor:function(time,pop_value,func){ |
| 387 | + var n=0; | |
| 387 | 388 | if(!time){ |
| 388 | 389 | time=setInterval(function(){ |
| 389 | - console.log(time); | |
| 390 | + console.log(time);n++; | |
| 390 | 391 | if(pop_value) { |
| 391 | 392 | clearInterval(time); |
| 392 | 393 | func(); |
| 393 | - } | |
| 394 | + } | |
| 395 | + if(n>60) clearInterval(time); | |
| 394 | 396 | },1000); |
| 395 | 397 | } |
| 396 | 398 | } | ... | ... |