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

Loading…
Cancel
Save