Commit 778ebbd3 by 陈超

T

parent 86801f46
...@@ -131,11 +131,48 @@ ...@@ -131,11 +131,48 @@
}, },
onSendCode: function() { onSendCode: function() {
this.checkPhone(this.readyToSend)
},
readyToSend: function() {
if(!this.counting) { if(!this.counting) {
this.counting = true this.counting = true
this.onTick() let phone = this.phone
$.ajax({
type: "POST",
url:GET_PHONEVERIFY,
data:"phone="+phone,
dataType:"json",
success:function(data){
if(data.status=='0'){
ui.error(data.info)
return
}else{
this.onTick()
return
}
}
})
} }
}, },
checkPhone: function(call) {
let phone = this.phone
//验证此手机是否已被注册
$.ajax({
type: "POST",
url:CLICK_PHONE,
data:"phone="+phone,
dataType:"text",
success:function(data){
if(data==0){
ui.error('此手机已被注册,请更换');
return;
}else{
call && call()
}
}
});
},
onTick: function() { onTick: function() {
if(this.count > 0) { if(this.count > 0) {
this.count -= 1 this.count -= 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment