当前位置:网站首页>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 ");
}
}
}
}
边栏推荐
- Go language programming specification combing summary
- Misc Basic test method and knowledge points of CTF
- Why should we learn mathematical modeling?
- F. Min cost string problem solving Report
- Memo 00
- 复现Thinkphp 2.x 任意代码执行漏洞
- 抽象类和接口的区别
- Noi / 1.5 37: mercenaries
- Data communication foundation smart_ Link_&_ Monitor_ Link
- String modification problem solving Report
猜你喜欢
16. [stm32] starting from the principle, I will show you the DS18B20 temperature sensor - four digit digital tube displays the temperature
Intelligent metal detector based on openharmony
Value series solution report
Lesson 4 knowledge summary
swiper. JS to achieve barrage effect
力扣今日题-729. 我的日程安排表 I
19.[STM32]HC_SR04超声波测距_定时器方式(OLED显示)
机械臂速成小指南(九):正运动学分析
sql中set标签的使用
Nine hours, nine people, nine doors problem solving Report
随机推荐
示例项目:简单的六足步行者
五种常见的咨询公司谈判策略以及如何维护自己的利益
Data communication foundation NAT network address translation
How can the boss choose programmers to help me with development?
Xiao Sha's arithmetic problem solving Report
Basic JSON operations of MySQL 5.7
lv_font_conv离线转换
How to introduce devsecops into enterprises?
Optional parameters in the for loop
【簡記】解决IDE golang 代碼飄紅報錯
Noi / 1.5 37: mercenaries
abstract关键字和哪些关键字会发生冲突呢
sql中查询最近一条记录
【 note 】 résoudre l'erreur de code IDE golang
Memo 00
MySQL5.7的JSON基本操作
Number protection AXB function! (essence)
MySQL overview
Data communication foundation - routing communication between VLANs
F. Weights assignment for tree edges problem solving Report