<html>
<head></head>
<body>
<div class="position-relative LoginBox">
<div class="LoginIcon display-flex justify-content align-center">
<img src="/static/index/img/login1.png" />
</div>
<input class="Login-input" type="text" name="rphone" placeholder="手机号" />
</div>
<div class="position-relative LoginBox">
<div class="LoginIcon display-flex justify-content align-center">
<img src="/static/index/img/login4.png" />
</div>
<input class="Login-input LoginTest" type="text" name="rsms_code" placeholder="短信验证码" />
<div class="LoginImg display-flex justify-content align-center">
<button class="getCodeBtn" onclick="sendSms($(this))" id="yanzhengma">获取验证码</button>
</div>
</div>
<div class="position-relative LoginBox">
<div class="LoginIcon display-flex justify-content align-center">
<img src="/static/index/img/login3.png" />
</div>
<input class="Login-input LoginTest" type="text" name="rcode" placeholder="请输入验证码" />
<div class="LoginImg display-flex justify-content align-center">
<img src="{:captcha_src()}" alt="captcha" id="captcha" onclick="this.src=this.src+'?'+Math.random()" />
</div>
</div>
</body>
</html>
function sendSms(obj)
{
obj[0].disabled = true;
var formData = new FormData();
formData.append("phone",$("input[name='rphone']").val())
formData.append("code",$("input[name='rcode']").val())
if(formData.get("phone") == "") {
Tpop("提示","请输入手机号");return;
}
if(formData.get("code") == "") {
Tpop("提示","请输入验证码");return;
}
$.ajax({
url: "/api/Login/sendVeri",
method:'POST',
data: formData,
processData:false,
contentType: false,
dataType:'json',
success:function(res){
if (res.code == 200) {
var time = 60;
var timeclose = setInterval(function(){
obj[0].innerHTML = time+"秒后重新获取";
time--;
if (time <= 0) {
clearInterval(timeclose);
obj[0].disabled = false;
obj[0].innerHTML = "重新获取";
}
},1000);
Tpop("提示",res.msg);return;
} else {
obj[0].disabled = false;
Tpop("提示",res.msg);
$('#captcha').click();
return;
}
}});
}