97无码免费人妻超级碰碰夜夜_xxx.www国产_av激情在线_成人久久18_国产精品特级片_鲁一鲁啪一啪

18842388900

網站建設 APP開發 小程序

Article/文章

記錄成長點滴 分享您我感悟

您當前位置>首頁 > 知識 > 軟件開發

微信小程序如何實現獲取驗證碼后倒計時效果?(代碼示例)

發表時間:2019-05-20 08:50:05

文章來源:沈陽網站建設

標簽:微信小程序 驗證碼倒計時

分享:

瀏覽次數:0

本篇文章給大家帶來的內容是介紹微信小程序如何實現獲取驗證碼后倒計時效果?(代碼示例)。有一定的參考價值,有需要的朋友可以參考一下,希望對你們有所幫助。

首先我們來看看效果圖:

1.jpg

wxml代碼:

<input class='input-pwd' placeholder="新密碼" placeholder-style='color: #000' password focus bindconfirm='getPwd'/><input class='input-tel' type='number' placeholder="手機號" placeholder-style='color: #000' maxlength='11 confirm-type='done' /><input class='input-verify' type='number' placeholder-style='color: #000' placeholder='手機驗證碼'></input><button class='verify-btn' disabled='{{disabled}}' bindtap="getVerificationCode">{{time}}</button><button class='confirm-btn' bindtap='confirm_btn'>確認修改</butt沈陽軟件設計

<a href=http://www.www.dlc21.cn target=_blank class=infotextkey>沈陽<a href=http://www.www.dlc21.cn target=_blank class=infotextkey>軟件開發</a></a>,<a href=http://www.www.dlc21.cn target=_blank class=infotextkey>沈陽<a href=http://www.www.dlc21.cn target=_blank class=infotextkey>軟件公司</a></a>

on>

wxss代碼:

/* pages/forgetpwd/forgetpwd.wxss */input{  padding-left: 20rpx;  border-bottom: 1rpx solid #ccc;  height: 80rpx;  line-height: 80rpx;  width: 95%;  margin: 0 auto;  font-size: 28rpx;}.input-verify{  width: 67%;  margin-left: 10rpx;  float: left;}.verify-btn{  width: 26%;  height: 65rpx;  float: right;  line-height: 65rpx;  background: #fff;      color: #5FD79D;  margin: 20rpx 10rpx;  font-size: 28rpx;}.confirm-btn{  width: 80%;  height: 90rpx;  margin: 150rpx auto;  background: #5FD79D;      color: #fff;}

js代碼:

// pages/forgetpwd/forgetpwd.jsvar interval = null //倒計時函數Page({  /**   * 頁面的初始數據   */  data: {    time: '獲取驗證碼', //倒計時     currentTime: 60  },  /**   * 生命周期函數--監聽頁面加載   */  onLoad: function (options) {  },  getPwd:function(e){    console.log(e.detail.value)  },  /**   * 確認修改   */  confirm_btn:function(){    wx.redirectTo({      url: '/pages/login/login',    })  },    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:60,          disabled: false           })      }    }, 1000)    },  getVerificationCode(){    this.getCode();    var that = this    that.setData({      disabled:true    })  },})

總結:以上就是本篇文章的全部內容,希望能對大家的學習有所幫助。

以上就是微信小程序如何實現獲取驗證碼后倒計時效果?(代碼示例)的詳細內容,更多請關注沈陽網站建設其它相關文章!

微信小程序,驗證碼倒計時

相關案例查看更多

主站蜘蛛池模板: 尤溪县| 陵川县| 瑞安市| 仁布县| 措勤县| 白城市| 阜阳市| 清流县| 天长市| 山阳县| 利津县| 鹤壁市| 新野县| 瑞丽市| 永川市| 将乐县| 玉树县| 德令哈市| 修文县| 广丰县| 青海省| 龙岩市| 万山特区| 繁昌县| 泾川县| 萝北县| 江津市| 常德市| 玉屏| 荔波县| 黄龙县| 瑞安市| 白玉县| 合水县| 南岸区| 手游| 祥云县| 清徐县| 绥宁县| 牟定县| 松阳县|