28,403
社区成员
var sends = {
checked:1,
send:function(){
var numbers = /^1[3456789]\d{9}$/;/*/^1\d{10}$/;*/
var val = $('#phone').val().replace(/\s+/g,""); //获取输入手机号码
if($('.div-phone').find('span').length == 0 && $('.div-phone a').attr('class') == 'send1'){
if(!numbers.test(val) || val.length ==0){
$('.div-phone').append('<span class="error">手机格式错误</span>');
return false;
}
}
if(numbers.test(val))
{
$('.div-phone span').remove();
/*下面这儿不生效,如何修改,弹不出div窗口*/
var yzm = layer.open({
type: 1,
title: false,
btnAlign: 'c',
closeBtn: false,
shade:0.2,
skin: 'shadows',
id: 'yzm',
moveType: 0, //拖拽模式,0或者1
content: '<div class="col-12"><div class="slidercaptcha card"><div class="card-header"><span>请完成安全验证</span></div><div class="card-body"><div id="captcha"></div></div></div></div>'
});
$('#captcha').sliderCaptcha({
repeatIcon: 'ff',
setSrc: function () {
return 'img/' + Math.round(Math.random() * 3) + '.jpg';
},
onSuccess: function () {
$.ajax({url:"phonename.html", data:{phone:phone}, type:"post", dataType:'json',
success: function (res) {
var json = eval("("+res+")");
if(json.title == "success"){
$("#btnSendCode").attr("disabled", "true");
$("#btnSendCode").val( + curCount + "秒再获取");
InterValObj = window.setInterval(SetRemainTime, 1000);
$("#btngo").removeAttr("disabled");
}else if(json.title == "fail"){
$('#tphone').find('label').addClass('error').text('手机号已注册');
return false;
}
}
});
layer.closeAll();
}
});