最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
微信小程序实现验证码获取倒计时效果
时间:2018-02-09 编辑:猪哥 来源:一聚教程网
本文实例为大家分享了微信小程序实现获取验证码倒计时效果的具体代码,供大家参考,具体内容如下
wxml
js
var interval = null //倒计时函数 Page({ data: { date:'请选择日期', fun_id:2, time: '获取验证码', //倒计时 currentTime:61 }, getCode: function (options){ var that = this; var currentTime = that.data.currentTime interval = setInterval(function () { currentTime--; that.setData({ time: currentTime+'秒' }) if (currentTime <= 0) { clearInterval(interval) that.setData({ time: '重新发送', currentTime:61, disabled: false }) } }, 100) }, getVerificationCode(){ this.getCode(); var that = this that.setData({ disabled:true }) }, })
相关文章
- 微信怎么上传抗原检测结果 微信上传抗原检测结果方法 04-15
- 微信运动如何设置状态 微信运动设置状态方法 03-30
- 微信怎么查询三个月前顺丰快递信息 微信查询三个月前顺丰快递信息方法 03-30
- 微信如何设置收款多人播报 微信设置收款多人播报方法 03-18
- 微信小老虎图标怎么设置 微信小老虎图标设置方法 03-09
- 微信如何绑定武汉通 微信绑定武汉通操作方法 03-19