下面为什么不执行? let interval = setInterval(()=>{ let {orderTime, staticTime} = this.state; let nowTime = Date.now(); let sub = Math.floor((orderTime + staticTime - nowTime)/1000); console.log('sub',sub); if(sub<=0){ clearInterval(interval); this.setState({ tip:'支付超时', isFalse:true }); return; } let minutes = parseInt(sub/60); let Seconds = sub%60; let tip = '订单已提交,请在'+minutes+'分'+Seconds+'秒内完成支付'; console.log(tip); this.setState({ tip:tip, isFalse:false }); },1000);
我能吐槽下开放社区的代码插入功能吗?我能吐槽下开放社区的代码插入功能吗?非常不方便
2020-01-11