本文主要和大家详细介绍微信小程序实现验证码获取倒计时效果,具有一定的参考价值,感兴趣的小伙伴们可以参考一下,希望能帮助到大家。
wxml
<button>
{{time}}
</button>
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 <p>相关推荐:</p><p><a href="http://www.php.cn/js-tutorial-386385.html" target="_self">canvas绚丽倒计时实现代码分享</a></p><div class="aritcle_card flexRow artxards">
<div class="artcardd flexRow">
<a class="aritcle_card_img" rel="nofollow" href="/xiazai/code/11411" title="小程序管理平台系统源码"><img
src="https://img.php.cn/upload/webcode/000/000/000/6a5440c80e261283.png" alt="小程序管理平台系统源码" onerror="this.onerror='';this.src='/static/lhimages/moren/morentu.png'" ></a>
<div class="aritcle_card_info flexColumn">
<a rel="nofollow" href="/xiazai/code/11411" title="小程序管理平台系统源码" class="overflowclass">小程序管理平台系统源码</a>
<p class="overflowclass">小程序管理平台系统源码是一套面向小程序服务商的一站式管理程序,基于 uniapp + ThinkPHP(PHP)开发,支持微信小程序、微信公众号与 H5 端。系统主打"全开源、独立部署、无限开 SAAS 账号",适合需要集中管理多个小程序、为客户代开通与授权的小程序服务商使用。</p>
</div>
<a rel="nofollow" href="/xiazai/code/11411" title="小程序管理平台系统源码" class="aritcle_card_btn flexRow flexcenter"><b></b><span>下载</span>
</a>
</div>
</div><p><a href="http://www.php.cn/js-tutorial-386384.html" target="_self">限时抢购倒计时功能实现方法</a></p><p><a href="http://www.php.cn/js-tutorial-386332.html" target="_self">jquery倒计时小应用实现代码</a></p><p class="art_xg"><br></p>










