From 4a8c8991ce31c2c088f0a3f5f2538c6a3f9caeeb Mon Sep 17 00:00:00 2001 From: yvan.ni <765199919@qq.com> Date: Mon, 16 Mar 2020 16:53:45 +0800 Subject: [PATCH] 最后1分钟的等待时间 --- app.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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); } } -- libgit2 0.21.4