Browse Source

注册验证码的处理

master
453530270@qq.com 2 years ago
parent
commit
3fed7aef66
  1. 51
      pages/reg/reg.vue

51
pages/reg/reg.vue

@ -64,9 +64,6 @@
import * as Verify from '@/utils/verify' import * as Verify from '@/utils/verify'
import whpop from './components/WhPopup' import whpop from './components/WhPopup'
//120s
const st = 120
export default { export default {
components: { components: {
// nothing // nothing
@ -95,6 +92,8 @@
utchk2:false, utchk2:false,
// //
murl:"", murl:"",
//
st:120,
// / // /
showPopup: false, showPopup: false,
} }
@ -132,32 +131,34 @@
// //
getsmscode(){ getsmscode(){
this.$toast("sss")
this.countDown(2200)
// //
// let mb = this.mobile let mb = this.mobile
// if(this.validteMobile(mb)){ if(this.validteMobile(mb)){
// regApi.sendSms(mb).then(res=>{ regApi.sendSms(mb).then(res=>{
// if(res.resultCode=="00000000"){ if(res.resultCode=="00000000"){
// if(res.data ==1){ if(res.data ==1){
// this.$toast("") this.$toast("手机号已被注册")
// // //
// } this.countDown()
// } }
// console.log(res) }
// }); console.log(res)
// } });
}
}, },
// //
countDown(st){ countDown(){
this.$refs.abtn.$el.innerText=st+"秒" let app = this
const ss = setTimeout({ app.$refs.abtn.$el.innerText=app.st+"秒"
if(st>1){ let qq = app.st
st=st-1 console.log(qq)
countDown(st) setTimeout(function(){
// }else{ if(app.st>1){
// st = 0 app.st--
app.countDown(app.st)
}else{
app.st = "获取验证码"
} }
},1000) },1000)

Loading…
Cancel
Save