zoukankan      html  css  js  c++  java
  • 正则手机号

    /*
     *获取短信验证码
    */ getCodenumber() { if(this.phoneRight) { let countdown = 60; document.querySelector(".btnCode").setAttribute("disabled",true) function count() { if(countdown == 0) { clearInterval(t) document.querySelector(".btnCode").removeAttribute("disabled") document.querySelector(".btnCode").innerHTML = "重新获取" return false }else{ countdown-- document.querySelector(".btnCode").innerHTML = '已发送' +countdown + "s" } } this.t = setInterval(function() { count() },1000) API.common.regPhone({ "phoneNum": this.phone, }).then((res) => { if(res.code == "0") { document.querySelector(".codeTips").innerHTML = "验证码已发送到您的手机上,有效时间为30分钟,请及时收查。" }else { alert(res) } console.log(res) }).catch((error) => { console.log(error) }) }else { this.$message.error('请输入手机号') } }, /* *正则匹配手机号格式 */ checkMobile(sMobile) { if(!(/0?(13|14|15|17|18|19)[0-9]{9}/.test(sMobile))){ this.codeTips = '请输入正确的手机号!' this.phoneRight = false return false; } else{ this.phoneRight = true } },
  • 相关阅读:
    替代PhotoShop:GIMP图形编辑器的使用
    Matlab: 主函数和子函数间接传递变量
    代码管理:SVN的使用
    Python: 科学计算
    Python: 代码调试
    Latex: article模板
    Matlab: 程序优化和调试
    LibreOffice的使用技巧
    mysql--多表联合查询
    mysql--数据查询
  • 原文地址:https://www.cnblogs.com/xuyan1/p/8320724.html
Copyright © 2011-2022 走看看