当前位置:网站首页>后台系统发送验证码功能
后台系统发送验证码功能
2022-07-05 15:26:00 【小蚂蚁hjk】

<div>
<p class="fl">
<input name="phone" type="number" placeholder="手机号" v-model="phone"/>
<button type="button" :disabled="disabled" @click="sendcode" class="btns">{ {btntxt}}</button>
</p>
<p class="fl" style="margin-left: 20px;">
<input type="text" placeholder="验证码"/>
</p>
</div>
<input type="button" value="查询" class="btns search" @click="query"/>
这里是script里的内容
export default {
data: function () {
return {
disabled:false,
time:0,
btntxt:"获取验证码",
formMess:{
email:this.email,
phone:this.phone
}
}
},
mounted: function () {
},
methods:{
//验证手机号码部分
sendcode(){
var reg=11 && /^((13|14|15|17|18)[0-9]{1}\d{8})$/;
//var url="/nptOfficialWebsite/apply/sendSms?mobile="+this.ruleForm.phone;
if(this.phone==''){
alert("请输入手机号码");
}else if(!reg.test(this.phone)){
alert("手机格式不正确");
}else{
this.time=60;
this.disabled=true;
this.timer();
/*axios.post(url).then(
res=>{
this.phonedata=res.data;
})*/
}
},
timer() {
if (this.time > 0) {
this.time--;
this.btntxt=this.time+"s后重新获取";
setTimeout(this.timer, 1000);
} else{
this.time=0;
this.btntxt="获取验证码";
this.disabled=false;
}
},
query(){
var formMess=this.formMess
Axios.post(api+"/order/select/reception", formMess)
.then(function (res) {
if(res.data.code==200){
console.log(res.data.data);
this.productResult=res.data.data;
this.productResult.length=3;
}else if(res.data.code==400){
alert(res.data.message)
}
}.bind(this))
},
//邮箱验证
sendEmail(){
var regEmail=/^[A-Za-zd]+([-_.][A-Za-zd]+)*@([A-Za-zd]+[-.])+[A-Za-zd]{2,5}$/;
if(this.email==''){
alert("请输入邮箱");
}else if(!regEmail.test(this.email)){
alert("邮箱格式不正确");
}
}
}
}
边栏推荐
- CSDN I'm coming
- Definition of episodic and batch
- Object. defineProperty() - VS - new Proxy()
- Virtual base class (a little difficult)
- Database learning - Database Security
- swiper. JS to achieve barrage effect
- The difference between SQL Server char nchar varchar and nvarchar
- Defining strict standards, Intel Evo 3.0 is accelerating the upgrading of the PC industry
- Verilog realizes the calculation of the maximum common divisor and the minimum common multiple
- 把 ”中台“ 的思想迁移到代码中去
猜你喜欢

MySQL giant pit: update updates should be judged with caution by affecting the number of rows!!!

The OBD deployment mode of oceanbase Community Edition is installed locally
![16.[STM32]从原理开始带你了解DS18B20温度传感器-四位数码管显示温度](/img/9f/c91904b6b1d3a1e85c0b50e43972e5.jpg)
16.[STM32]从原理开始带你了解DS18B20温度传感器-四位数码管显示温度

Usage and usage instructions of JDBC connection pool

I spring web upload

Bubble sort, insert sort

Replknet: it's not that large convolution is bad, but that convolution is not large enough. 31x31 convolution. Let's have a look at | CVPR 2022

【 note 】 résoudre l'erreur de code IDE golang

I spring and autumn blasting-1

六种常用事务解决方案,你方唱罢,我登场(没有最好只有更好)
随机推荐
Usage and usage instructions of JDBC connection pool
记录一下树莓派搭建环境中遇到的坑。。。
Li Kou today's question -729 My schedule I
异常com.alibaba.fastjson.JSONException: not match : - =
verilog实现计算最大公约数和最小公倍数
Ionic Cordova project modification plug-in
Go learning ----- relevant knowledge of JWT
机械臂速成小指南(九):正运动学分析
18.[stm32] read the ROM of DS18B20 temperature sensor and realize multi-point temperature measurement
Aike AI frontier promotion (7.5)
Reasons and solutions for redis cache penetration and cache avalanche
[brief notes] solve the problem of IDE golang code red and error reporting
研发效能度量指标构成及效能度量方法论
Number protection AXB function! (essence)
Arduino控制微小的六足3D打印机器人
Object. defineProperty() - VS - new Proxy()
CSRF, XSS science popularization and defense
Bubble sort, insert sort
wxml2canvas
复现Thinkphp 2.x 任意代码执行漏洞