<li><input type="number" name="contactPhone" style="width: 160px;" maxlength="6"><input id="sendCheckCode" name="sendCheckCode" type="button" class="btn_yz cp " value="發送驗證碼"> </li>
/*獲取驗證碼倒計時*/
var wait=60;
function time(o) {
if (wait == 0) {
o.removeAttribute("disabled");
o.value="免費獲取驗證碼";
wait = 60;
$(".btn_yz").css("background-color","#5bb75b");
$(".btn_yz").css("color","#fff");
} else {
o.setAttribute("disabled", true);
o.value=wait+"s後"+"重新發送";
wait--;
setTimeout(function() {
time(o)
}, 1000)
$(".btn_yz").css("background-color","#f1f1f1");
$(".btn_yz").css("color","#666");
}
}
$(".btn_yz").click(function(){
var mobile = $("#expressive_phone").val();
if(mobile == ""){
alert('提現人手機號不能爲空!');
} else if (mobile != "") {
if (/^((\d{3}-\d{8}|\d{4}-\d{7,8})|(1[3|5|7|8][0-9]{9}))$/.test(mobile)) {
time(this);
$.ajax({
url: "${ctx}/api/b2b2c/storeApi!sendCheckCode.do?ajax=yes",
type: "POST",
data: "mobile=" + mobile,
async: false,
dataType: "json",
success: function (json) {
alert(json.message);
}
});
}else {
alert('提現人手機號輸入有誤請重新輸入!');
}
}
});