zoukankan      html  css  js  c++  java
  • 小程序验证码

    Page({
      data:{
        verifyCodeUrl:'',
      }
      getVerifyCode:function(){
        Ajax('url?'+new Date().getTime()).then(res=>{
          this.setData({
            verifyCodeUrl:res.data
          })
        })
      },
      changeVerifyCode:function(){
        this.getVerifyCode()
      },
      onLoad: function () {
        this.getVerifyCode()
      }
    });
    <view class="input-text">
      <view class="text">验证码:</view>
      <view class="input">
        <input bindinput="bindKeyInput" type="text" name="captch" placeholder="请输入验证码" />
      </view>
      <view class="code" bindtap="changeVerifyCode">
        <image style="180rpx;height:60rpx;display:block" wx:if="{{verifyCodeUrl}}" src="{{verifyCodeUrl}}"></image>
      </view>
    </view>
    <view class="code-alert" bindtap="changeVerifyCode">
      <view class="tip">看不清,换一张</view>
    </view>

  • 相关阅读:
    病毒
    最短母串
    单词
    Censoring
    玄武密码
    Keywords Search
    聚会
    异象石
    暗的连锁
    pat 1048. Find Coins (25)
  • 原文地址:https://www.cnblogs.com/CMing/p/8336048.html
Copyright © 2011-2022 走看看