yanZhengInput: function (e) {
var that = this;
var yanzheng = e.detail.value;
var huozheng = this.data.huozheng
console.log(e.detail.value)
that.setData({
yanzheng: yanzheng,
zhengTrue: false,
})
if (yanzheng.length >= 4) {
if (yanzheng == huozheng) {
that.setData({
zhengTrue: true,
})
} else {
that.setData({
zhengTrue: false,
})
wx.showModal({
content: '输入验证码有误',
showCancel: false,
success: function (res) {
}
})
}
}
},
yanzhengBtn: function () {
// console.log(app.globalData.userId);
var getChange = this.data.getChange
var n = 59;
var that = this;
var phone = this.data.linPhone;
console.log(phone)
var user = wx.getStorageSync('user');
if (!(/^1[34578]\d{9}$/.test(phone))) {
wx.showToast({
title: '手机号有误',
icon: 'success',
duration: 2000
})
} else {
if (getChange) {
this.setData({
getChange: false
})
var time = setInterval(function () {
var str = '(' + n + ')' + '重新获取'
that.setData({
getText: str
})
if (n <= 0) {
that.setData({
getChange: true,
getText: '重新获取'
})
clearInterval(time);
}
n--;
}, 1000);
wx.request({
url: 'https://www.didu86.com/Clothes-manager-web/codenum',
data: {
tel: phone,
},
header: {
'content-type': 'application/json'
},
success: function (res) {
 
var result = res.data.code;
console.log(result)
that.setData({
huozheng: result,
})
}
})
}
}
 
},

微信小程序 功能函数 获取验证码*的更多相关文章

  1. 微信小程序 功能函数 openid本地和网络请求

    本地-------------------------------------------------------------------------------------------------- ...

  2. 微信小程序 功能函数 点击传参和页面

    // 商品详情页跳转函数 detailInto: function (e) { // console.log() var change = e.currentTarget.dataset.id; wx ...

  3. 微信小程序 功能函数picker-view的弹出模态

    <view class="list"> <form bindsubmit="formSubmit"> <view class=&q ...

  4. 微信小程序 功能函数 支付接口

    // 订单生成返回数据,弹出是否支付模态 wx.showModal({ title: '微信支付', content: '确定支付吗?', success: function (res) { if ( ...

  5. 微信小程序 功能函数 计时器

    let lovetime = setInterval(function () { let str = '(' + n + ')' + '重新获取' that.setData({ getText2: s ...

  6. 微信小程序 写一个获取验证码 及setInterval 使用基本方法

    <!--index.wxml--> <view class="container"> <view class="container_cont ...

  7. 微信小程序 功能函数 定时震动

    ffn: function () { let nnn = this.data.nnn nnn += 1; this.setData({ nnn: nnn }); if (nnn > 10) { ...

  8. 微信小程序 功能函数 客服

    <view> <view class='btn-img'> <image class='image-full' src='../../imgs/index/tab6.pn ...

  9. 微信小程序 功能函数 将对象的键添加到数组 (函数深入)

    // 将对象的键添加到数组 var arr = Object.keys(site); //英文 https://developer.mozilla.org/en-US/docs/Web/JavaScr ...

随机推荐

  1. Gitlab+Jenkins学习之路(五)之git merge和git rebase的区别

    命令行测试 [root@linux-node1 ~]# mkdir testing [root@linux-node1 ~]# [root@linux-node1 ~]# cd testing/ [r ...

  2. svn搭建多版本共存记录

    第一步下载 yum install subversion 第二步创建仓库 # cd /home # mkdir svn # svnadmin create /home/svn/project1 # l ...

  3. [BZOJ3451]normal 点分治,NTT

    [BZOJ3451]normal 点分治,NTT 好久没更博了,咕咕咕. BZOJ3451权限题,上darkbzoj交吧. 一句话题意,求随机点分治的期望复杂度. 考虑计算每个点对的贡献:如果一个点在 ...

  4. CentOS 7.X 关闭SELinux

    1.查看 [root@dev-server ~]# getenforce Disabled [root@dev-server ~]# /usr/sbin/sestatus -v SELinux sta ...

  5. mybatis学习(一)-------XML 映射配置文件详解

    XML 映射配置文件 MyBatis 的配置文件包含了会深深影响 MyBatis 行为的设置(settings)和属性(properties)信息.文档的顶层结构如下: configuration 配 ...

  6. Direct2D处理几何图形之间的碰撞检测(下)

    转载请注明出处:http://www.cnblogs.com/Ray1024 一.概述 上一篇文章中我们介绍了几何图形与点的碰撞检测.几何图形与点的位置关系比较简单:点在几何图形内.点在几何图形外.点 ...

  7. 设置pdsh的默认登录模式

    1.check your pdsh default rcmd rsh pdsh -q -w localhostSee what your pdsh default rcmd is. 2.Modify ...

  8. [原]Asp.net Core 2.1.2 测试成功Ajax上传文件新解法

    利用layui框架可以上传文件调试拦截成功! [HttpPost] public IActionResult Method1(IFormFile file) { return Json(new{suc ...

  9. C++实现从一个文件夹中读出所有txt文件

    前段时间做项目需要读取一个文件夹里面所有的txt文件,查询资料后得到以下实现方法:首先了解一下这个结构体struct _finddata_t {    unsigned    attrib;    t ...

  10. python图像处理(2)图像水印和PIL模式转化

    模式转化: PIL模式转化:将图片转化成其他模式 # 我们将image图像转化为灰度图像(python) from PIL import Image img = Image.open('c:\\1.J ...