当前位置:网站首页>Background system sending verification code function
Background system sending verification code function
2022-07-05 15:58:00 【Ant HJK】
<div>
<p class="fl">
<input name="phone" type="number" placeholder=" cell-phone number " 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=" Verification Code "/>
</p>
</div>
<input type="button" value=" Inquire about " class="btns search" @click="query"/>
Here is script
Contents of Li
export default {
data: function () {
return {
disabled:false,
time:0,
btntxt:" Get verification code ",
formMess:{
email:this.email,
phone:this.phone
}
}
},
mounted: function () {
},
methods:{
// Verify the mobile number section
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(" Please enter your mobile number ");
}else if(!reg.test(this.phone)){
alert(" The phone format is not correct ");
}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 Reacquire after ";
setTimeout(this.timer, 1000);
} else{
this.time=0;
this.btntxt=" Get verification code ";
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))
},
// Mailbox validation
sendEmail(){
var regEmail=/^[A-Za-zd]+([-_.][A-Za-zd]+)*@([A-Za-zd]+[-.])+[A-Za-zd]{2,5}$/;
if(this.email==''){
alert(" Please enter email address ");
}else if(!regEmail.test(this.email)){
alert(" The email format is incorrect ");
}
}
}
}
边栏推荐
- wyt 。。
- go语言编程规范梳理总结
- 17. [stm32] use only three wires to drive LCD1602 LCD
- 17.[STM32]仅用三根线带你驱动LCD1602液晶
- I spring and autumn blasting-1
- 21. [STM32] I don't understand the I2C protocol. Dig deep into the sequence diagram to help you write the underlying driver
- 对象和类的关系
- Codasip为RISC-V处理器系列增加Veridify安全启动功能
- Modify PyUnit_ Time makes it support the time text of 'xx~xx months'
- 机械臂速成小指南(九):正运动学分析
猜你喜欢
21.[STM32]I2C协议弄不懂,深挖时序图带你编写底层驱动
keep-alive
Why should we learn mathematical modeling?
Bugku alert
Appium automation test foundation - appium basic operation API (II)
lvgl 显示图片示例
I spring web upload
verilog实现计算最大公约数和最小公倍数
SQL injection sqllabs (basic challenges) 1-10
Fundamentals of data communication - Principles of IP routing
随机推荐
Bugku's Ah Da
视觉体验全面升级,豪威集团与英特尔Evo 3.0共同加速PC产业变革
Summary of the second lesson
复现Thinkphp 2.x 任意代码执行漏洞
Intelligent metal detector based on openharmony
MySQL5.7的JSON基本操作
一文搞定vscode编写go程序
抽象类和接口的区别
This article takes you through the addition, deletion, modification and query of JS processing tree structure data
I spring and autumn blasting-1
wxml2canvas
16.[STM32]从原理开始带你了解DS18B20温度传感器-四位数码管显示温度
CSDN I'm coming
Li Kou today's question -729 My schedule I
MySQL giant pit: update updates should be judged with caution by affecting the number of rows!!!
vant tabbar遮挡内容的解决方式
Fundamentals of data communication - Principles of IP routing
示例项目:简单的六足步行者
MySQL overview
19.[STM32]HC_ SR04 ultrasonic ranging_ Timer mode (OLED display)