wxml:60秒倒计时
//js里面绑定点击发送事件,sendMessageCode:function(e){ console.log(e); let that = this; that.setData({ code:false }) that.countdown(); },countdown:function(){ let second = 60; let that=this; let appCount = setInterval(function(){ second -= 1; that.setData({ count: second }) if (second < 1){ clearInterval(appCount);//取消指定的setInterval函数将要执行的代码 that.setData({ second: 60, code: true }) } console.log(second); },1000); },
微信小程序点击发送短信验证(60秒倒计时)
最新推荐文章于 2024-08-07 15:18:34 发布