wxmlbuttondisabled'{{disabled}}'data-id"2"bindtap"getVerificationCode"{{time}}/buttonjsvarintervalnull//倒计时函数Page({data:{date:'请选择日期',fun_id:2,time:'获取验证码',//倒计时currentTime:61},getCode:function(options){varthatthis;varcurrentTimethat.data.currentTimeintervalsetInterval(function(){currentTime--;that.setData({time:currentTime+'秒'})if(currentTime0){clearInterval(interval)that.setData({time:'重新发送',currentTime:61,disabled:false})}},100)},getVerificationCode(){this.getCode();varthatthisthat.setData({disabled:true})},})

TAG标签: 微信小程序验证码获取倒计时效果微信小程序验证码功能小程序图形验证码

http://www.xiaochengxub.com/read-96227.html