|
发表于 2017-7-18 20:19:25
|
显示全部楼层
楼主,代码在这里,你有没有兴趣玩玩?
var countdown=60;
function sendsms_bd(obj){
var reg = /^0?1[3|4|5|6|7|8][0-9]\d{8}$/;
if (reg.test(document.getElementById("it618_tel").value)) {
IT618_MEMBERS.post("http://www.crystalradio.cn/plugin.php?id=it618_members:ajax&ac=sendsms&ac1=bd&formhash=88540c48", "it618_members_tel="+document.getElementById("it618_tel").value,function (data, textStatus){
if(data=="ok"){
settime_bd(obj);
}else{
alert(data);
}
}, "html");
}else{
alert("请输入有效的11位手机号码!");
document.getElementById("it618_tel").focus();
}
}
function sendsms_password(obj){
if(document.getElementById("it618_password1").value==''){
alert("抱歉,请输入新密码!");
document.getElementById("it618_password1").focus();
return;
}
if(document.getElementById("it618_password2").value==''){
alert("抱歉,请输入确认密码!");
document.getElementById("it618_password2").focus();
return;
}
if(document.getElementById("it618_password1").value!=document.getElementById("it618_password2").value){
alert("抱歉,新密码与确认密码不一致!");
return;
}
var reg = /^0?1[3|4|5|6|7|8][0-9]\d{8}$/;
if (reg.test(document.getElementById("it618_tel").value)) {
IT618_MEMBERS.post("http://www.crystalradio.cn/plugin.php?id=it618_members:ajax&ac=sendsms&ac1=password&formhash=88540c48", "it618_members_tel="+document.getElementById("it618_tel").value,function (data, textStatus){
if(data=="ok"){
settime_bd(obj);
}else{
alert(data);
}
}, "html");
}else{
alert("请输入有效的11位手机号码!");
document.getElementById("it618_tel").focus();
}
}
function settime_bd(obj) {
if (countdown == 0) {
obj.removeAttribute("disabled");
document.getElementById("it618_tel").removeAttribute("readonly");
document.getElementById("telspanbd").style.display="none";
countdown = 60;
return;
} else {
document.getElementById("it618_tel").setAttribute("readonly", "readonly");
obj.setAttribute("disabled", true);
document.getElementById("telspanbd").style.display="";
document.getElementById("telspanbd").innerHTML="<br>验证码发送成功,重新发送(" + countdown + ")";
countdown--;
}
setTimeout(function() {
settime_bd(obj) }
,1000)
}
function gettip_bd(obj){IT618_MEMBERS.post("http://www.crystalradio.cn/plugin.php?id=it618_members:ajax&ac=gettip&formhash=88540c48", "it618_members_code="+obj.value+"&it618_members_tel="+document.getElementById("it618_tel").value,function (data, textStatus){IT618_MEMBERS("#it618_codetip").html(data);}, "html");}
function bdtel(){
if (confirm("确定要绑定此手机号码到当前会员?")) {
IT618_MEMBERS.post("http://www.crystalradio.cn/plugin.php?id=it618_members:ajax&ac=bd&ac1=&formhash=88540c48", "it618_members_code="+document.getElementById("it618_code").value+"&it618_members_tel="+document.getElementById("it618_tel").value,function (data, textStatus){
if(data=="ok"){
alert("绑定成功!");
hideWindow('it618_showsms');
}else{
alert(data);
}
}, "html");
}
}
function passwordtel(){
if(document.getElementById("it618_password1").value==''){
alert("抱歉,请输入新密码!");
document.getElementById("it618_password1").focus();
return;
}
if(document.getElementById("it618_password2").value==''){
alert("抱歉,请输入确认密码!");
document.getElementById("it618_password2").focus();
return;
}
if(document.getElementById("it618_password1").value!=document.getElementById("it618_password2").value){
alert("抱歉,新密码与确认密码不一致!");
return;
}
if (confirm("确定要重置新密码?")) {
IT618_MEMBERS.post("http://www.crystalradio.cn/plugin.php?id=it618_members:ajax&ac=password&formhash=88540c48", "it618_members_code="+document.getElementById("it618_code").value+"&it618_members_tel="+document.getElementById("it618_tel").value+"&it618_password="+document.getElementById("it618_password1").value,function (data, textStatus){
if(data=="ok"){
alert("新密重置码成功!");
hideWindow('it618_showsms');
}else{
alert(data);
}
}, "html");
}
} |
|