当前位置:网站首页>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 ");
}
}
}
}
边栏推荐
- MySQL 巨坑:update 更新慎用影响行数做判断!!!
- lvgl 显示图片示例
- 【网易云信】超分辨率技术在实时音视频领域的研究与实践
- Appium自动化测试基础 — APPium基础操作API(一)
- 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
- Linear DP (basic questions have been updated)
- D-snow halo solution
- 研发效能度量指标构成及效能度量方法论
- 后台系统发送验证码功能
- Bugku's Ah Da
猜你喜欢
Appium自动化测试基础 — APPium基础操作API(一)
vlunhub- BoredHackerBlog Moriarty Corp
21.[STM32]I2C协议弄不懂,深挖时序图带你编写底层驱动
一文搞定vscode编写go程序
Appium automation test foundation - appium basic operation API (II)
Bugku's Eval
16.[STM32]从原理开始带你了解DS18B20温度传感器-四位数码管显示温度
19.[STM32]HC_SR04超声波测距_定时器方式(OLED显示)
16. [stm32] starting from the principle, I will show you the DS18B20 temperature sensor - four digit digital tube displays the temperature
Data communication foundation - dynamic routing protocol rip
随机推荐
Codasip为RISC-V处理器系列增加Veridify安全启动功能
CSDN I'm coming
开发中Boolean类型使用遇到的坑
Good article inventory
wyt 。。
把 ”中台“ 的思想迁移到代码中去
抽象类和接口的区别
How difficult is it to pass the certification of Intel Evo 3.0? Yilian technology tells you
First PR notes
Li Kou today's question -729 My schedule I
list去重并统计个数
CODING DevSecOps 助力金融企业跑出数字加速度
21.[STM32]I2C协议弄不懂,深挖时序图带你编写底层驱动
I'm fat, huh
复现Thinkphp 2.x 任意代码执行漏洞
DataArts Studio数据架构——数据标准介绍
Data communication foundation - dynamic routing protocol rip
Lesson 4 knowledge summary
F. Weights assignment for tree edges problem solving Report
抽象类中子类与父类