<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">///&lt;reference path="jquery-1.4.4.min.js" /&gt;

$(function () {
    var telinput = '';

    if ($('#ctl00_Liuyan_txtTelephone').length &gt; 0)
        telinput = '#ctl00_Liuyan_txtTelephone';
    else if ($('#ctl00_Liuyan_txtTelephone').length &gt; 0)
        telinput = '#ctl00_Liuyan_txtTelephone';
    else if ($('#ctl00_Liuyan_txtTelephone').length &gt; 0)
        telinput = '#ctl00_Liuyan_txtTelephone';
    else if ($('#ctl00_cmliuyan_txtTelephone').length &gt; 0)
        telinput = '#ctl00_cmliuyan_txtTelephone';

    $(telinput).blur(function () {
        var cellphone = $(telinput).val();

        if (cellphone == "")
            alert("手机号不能为空!");
        else if (!isMobile(cellphone))
            alert("请输入正确的手机号!");
        else {
            var param = { phone: cellphone };

            $.ajax({
                url: "/ashx/SMSCheck.ashx?action=CheckPhoneIsOK",
                data: param,
                dataType: "json",
                async: false,
                success: function (data) {
                    var success = data.data;
                    //if (success == 0) {
                    //    $("[id$='GetSMSCode']").show();
                    //    $("[id$='IMGCode']").hide();
                    //    $("[id$='hiddcode']").val("SmsCode");
                    //}
                    //else {
                    //    $("[id$='GetSMSCode']").hide();
                    //    $("[id$='IMGCode']").show();
                    //    $("[id$='hiddcode']").val("NumCode");
                    //}
                    $("[id$='GetSMSCode']").show();
                    /*$("[id$='IMGCode']").hide();*/
                    $("[id$='hiddcode']").val("SmsCode");
                }
            });
        }
    });

    $("#ctl00_Liuyan_GetSMSCode").click(function () {

        var cellphone = $(telinput).val();

        if (cellphone == "") {
            alert("手机号不能为空!"); return;
        }

        time($(this));//	时间倒计时
        var param = {
            phone: $(telinput).val()
        };
        $.ajax({
            url: '/ashx/SMSCheck.ashx?action=Send',
            data: param,
            dataType: "json",
            async: false,
            success: function (data) {
                var success = data.data;
            }
        });
    });

    $("#GetSMSCode").click(function () {
        var cellphone = $(telinput).val();

        if (cellphone == "") {
            alert("手机号不能为空!"); return;
        }


        time($(this));//	时间倒计时
        var param = {
            phone: $(telinput).val()
        };
        $.ajax({
            url: '/ashx/SMSCheck.ashx?action=Send',
            data: param,
            dataType: "json",
            async: false,
            success: function (data) {
                var success = data.data;
            }
        });
    });
});

function isMobile(value) {
    return /^1[3|4|5|6|7|8|9][0-9]{9}$/.test(value);
}

var wait = 60;//时间 

function time(o) {//o为按钮的对对象
    if (wait == 0) {
        o.removeAttr("disabled");
        o.val("获取短信验证码");//改变按钮中value的值 
        wait = 60;
    } else {
        o.attr("disabled", true);//倒计时过程中禁止点击按钮 
        o.val("重新获取(" + wait + ")");//改变按钮中value的值 
        wait--;
        setTimeout(function () {
            time(o);//循环调用 
        }, 1000);
    }
}
</pre></body></html>