当前位置:网站首页>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 ");
}
}
}
}
边栏推荐
- 五种常见的咨询公司谈判策略以及如何维护自己的利益
- I spring and autumn blasting-2
- Record the pits encountered in the raspberry pie construction environment...
- Go language programming specification combing summary
- F. Min cost string problem solving Report
- 定义严苛标准,英特尔Evo 3.0正在加速PC产业升级
- 抽象类中子类与父类
- CODING DevSecOps 助力金融企业跑出数字加速度
- This article takes you through the addition, deletion, modification and query of JS processing tree structure data
- D-snow halo solution
猜你喜欢
随机推荐
【簡記】解决IDE golang 代碼飄紅報錯
CODING DevSecOps 助力金融企业跑出数字加速度
Bugku's Eval
Appium automation test foundation - appium basic operation API (II)
Modify PyUnit_ Time makes it support the time text of 'xx~xx months'
How to introduce devsecops into enterprises?
项目中批量update
Li Kou today's question -729 My schedule I
Go language programming specification combing summary
Value series solution report
Codasip为RISC-V处理器系列增加Veridify安全启动功能
Arduino controls a tiny hexapod 3D printing robot
20.[STM32]利用超声波模块和舵机实现智能垃圾桶功能
keep-alive
Good article inventory
20. [stm32] realize the function of intelligent garbage can by using ultrasonic module and steering gear
vant popup+其他组件的组合使用,及避坑指南
Memo 00
abstract关键字和哪些关键字会发生冲突呢
Noi / 1.5 37: mercenaries




![17.[STM32]仅用三根线带你驱动LCD1602液晶](/img/c6/b56c54da2553a451b526179f8b5867.png)




