<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">var speed = 1000; //执行间隔
var wait = 60; //倒计时时间
var tipId;
var isclick = true; //是否可以点击
var show = false;
var apiUrl = "https://upassport.zuobiao.wang/";
var $checks;
function closeDialog() {
    $("#lyj-dialog0").hide();
};
function agreePolicy() {
    $("#lyj-dialog0").hide();
    $($checks).prop('checked', 'checked');
    $("#validateImg").attr('src', apiUrl + "Home/GetValidateCode?t=" + new Date().getTime());
    $("#txtImgCode").val('');
    $("#gbg").hide();
    $(".yyDialog.imgCode").show();
};
function closeDialog1() {
    $("#lyj-dialog").hide();
};
function agreePolicy1() {
    $("#lyj-dialog").hide();
    $($checks).prop('checked', 'checked');
};
function StartEnds(obj) {
    if (wait &gt; 0) {
        $(obj).addClass('disabled').find('em').html(wait + "秒后重新发送");
        $(obj).attr('disabled', "disabled"); //添加disabled属性
        isclick = false;
        wait = wait - 1;
        if (wait == 50) {
            //$(".yuyin").css({"display":"block"});
        }
    }
    else {
        isclick = true;
        clearInterval(tipId);
        $(obj).removeClass('disabled').removeAttr('disabled'); //移除disabled属性
        $(obj).find('em').html("重新发送验证码");
    }
};
//登录页面验证
function loginclick() {
    $(".overlay_bg").fadeIn(100);
    $("#dialog").show();
};

//验证手机号码格式
function validateMobile(phoneNumber) {
    var reg = /^(13[0-9]|14[0-9]|15(0|1|2|3|5|6|7|8|9)|16[0-9]|17[0-9]|18[0-9]|19[0-9])\d{8}$/;
    if (!reg.test(phoneNumber)) {
        return false;
    } else {
        return true;
    }
};
function showError(info) {
    $(".toast").fadeIn(100).fadeOut(2000);
    $(".toast span").html(info);
    return;
};
//快捷登录验证码
function kjcheck(obj) {
    var mob = $.trim($("#dialog_tel .account").val());
    var imgCodes = $.trim($("#txtImgCode").val());
    if (mob == "" || !validateMobile(mob)) {
        showError('请输入有效的手机号码');
    }
    else {
        $.ajax({
            type: 'post',
            url: "/Login/SendCode",
            data: { action: "sendcode", mobile: mob, code: '123', smsType: 1, imgCode: imgCodes },
            datatype: 'json',
            success: function (json) {
                if (json != "") {
                    var data = eval('(' + json + ')');
                    if (data.success == 1) {                        
                        document.getElementById('msg').innerHTML = '成功！'
                        wait = 60;
                        tipId = window.setInterval(function () { StartEnds(obj); }, speed);
                        StartEnds();
                    }
                    else {
                        showError(data.message);
                    }
                }
                else {
                    showError('短信发送错误');
                }
            },
            error: function () {
                showError('短信发送错误');
            }
        });
    }
};
//注册验证码
function regcheckcode(obj) {
    var mob = $.trim($("#dialog_reg .account").val());
    var imgCodes = $.trim($("#txtImgCode").val());
    if (mob == "" || !validateMobile(mob)) {
        showError('请输入有效的手机号码');
    }
    else {
        $.ajax({
            type: 'post',
            url: "/Login/SendCode",
            data: { action: "sendcode", mobile: mob, code: '123', smsType: 2, imgCode: imgCodes },
            datatype: 'json',
            success: function (json) {
                if (json != "") {
                    var data = eval('(' + json + ')');
                    if (data.success == 1) {
                        document.getElementById('msg').innerHTML = '成功！'
                        wait = 60;
                        tipId = window.setInterval(function () { StartEnds(obj); }, speed);
                        StartEnds();
                    }
                    else {
                        showError(data.message);
                    }
                }
                else {
                    showError('短信发送错误');
                }
            },
            error: function () {
                showError('短信发送错误');
            }
        });
    }
};
//找回密码验证码
function forgetcode(obj) {
    var mob = $.trim($("#dialog_forget .account").val());
    var imgCodes = $.trim($("#txtImgCode").val());
    if (mob == "" || !validateMobile(mob)) {
        showError('请输入有效的手机号码');
    }
    else {
        $.ajax({
            type: 'post',
            url: "/Login/SendCode",
            data: { action: "sendcode", mobile: mob, code: '123', smsType: 3, imgCode: imgCodes },
            datatype: 'json',
            success: function (json) {
                if (json != "") {
                    var data = eval('(' + json + ')');
                    if (data.success == 1) {
                        document.getElementById('msg').innerHTML = '成功！'
                        wait = 60;
                        tipId = window.setInterval(function () { StartEnds(obj); }, speed);
                        StartEnds();
                    }
                    else {
                        showError(data.message);
                    }
                }
                else {
                    showError('短信发送错误');
                }
            },
            error: function () {
                showError('短信发送错误');
            }
        });
    }
}
//快捷登录
function kjlogin() {
    var mob = $.trim($("#dialog_tel .account").val());
    var verifycode = $.trim($(".send_verify_code").val());
    if (mob == "" || !validateMobile(mob)) {
        showError('请输入有效的手机号码');
    }
    else {
        if (verifycode == '') {
            showError('请输入短信验证码');
        }
        else {
            $.ajax({
                type: 'get',
                url: "/Login/FastLogin",
                data: { action: "kjlogin", mobile: mob, code: verifycode },
                datatype: 'json',
                success: function (json) {
                    if (json != "") {
                        var data = json;
                        if (data.state == 200) {
                            location.reload();
                        }
                        else {
                            showError(data.message);
                        }
                    }
                    else {
                        showError('登录错误');
                    }
                },
                error: function () {
                    showError('登录错误');
                }
            });
        }
    }
};
//会员登录
function hylogin() {
    var username = $.trim($('#dialog_mm .account').val());
    var pwd = $.trim($('#dialog_mm .password').val());
    if (username != "" &amp;&amp; username != null &amp;&amp; pwd != "" &amp;&amp; pwd != null) {
        if (validateMobile(username)) {
            $.ajax({
                type: 'get',
                url: "/Login/Login",
                data: { action: 'userLogin', username: username, password: pwd },
                success: function (data) {
                    if (data.state == 200) {
                        window.location.reload();
                    } else {
                        showError('账号或密码不正确');
                    }
                },
                error: function () {
                    showError('登录失败');
                }
            });
        } else {
            showError('请输入有效的手机号码');
        }
    } else if (username == "" || (username != "" &amp;&amp; !validateMobile(username))) {
        showError('请输入有效的手机号码');
    } else {
        showError('请输入密码');
    }
};
//会员注册
function memberReg() {
    var mob = $.trim($("#dialog_reg .account").val());
    var mcode = $.trim($("#dialog_reg .validCode").val());
    var pwd = $.trim($("#dialog_reg .password").val());
    if (mob == "" || !validateMobile(mob)) {
        showError('请输入有效的手机号码');
    }
    else {
        if (mcode == '') {
            showError('请输入短信验证码');
        }
        else if (pwd == '' || pwd.length &lt; 8) {
            showError('请输入不少于8位登录密码');
        }
        else {
            $.ajax({
                type: 'post',
                url: "/Login/UserReg",
                data: { action: "reguser", mobile: mob, verifyCode: mcode, password: pwd, nickName: "" },
                datatype: 'json',
                success: function (json) {
                    if (json != "") {
                        var data = eval('(' + json + ')');
                        if (data.success == 1) {
                            location.reload();
                        }
                        else {
                            showError(data.message);
                        }
                    }
                    else {
                        showError('短信发送错误');
                    }
                },
                error: function () {
                    showError('短信发送错误');
                }
            });
        }
    }
};
//找回密码
function findPwd() {
    var mob = $.trim($("#dialog_forget .account").val());
    var mcode = $.trim($("#dialog_forget .validCode").val());
    var pwd = $.trim($("#dialog_forget .password").val());
    if (mob == "" || !validateMobile(mob)) {
        showError('请输入有效的手机号码');
    }
    else if (mcode == "") {
        showError('请输入短信验证码');
    }
    else if (pwd == "") {
        showError('请输入登录密码');
    }
    else {
        $.ajax({
            type: 'post',
            url: "/Login/FindPwd",
            data: { action: 'changpwd', mobile: mob, code: mcode, pwd: pwd, imgcode: '123' },
            datatype: 'html',
            success: function (json) {
                if (json != "") {
                    var data = eval('(' + json + ')');
                    if (data.success == 1) {
                        //$(".link.loagin-quick.jjs_bd_log").trigger("click");
                        showError('修改成功');
                    }
                    else {
                        showError(data.message);
                    }
                }
                else {
                    showError('找回密码失败');
                }
            },
            error: function () {
                showError('找回密码失败');
            }
        });
    }
};
// 生成唯一标识
function randomString(length) {
    var chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
    var result = '';
    for (var i = length; i &gt; 0; --i) {
        result += chars[Math.floor(Math.random() * chars.length)];
    }
    return result;
};
function cleanMsg() {
    document.getElementById('msg').innerHTML = '';
}
var regx = {
    mobile: /^\d{8,11}$/,
    password: /^[A-Za-z0-9]{8,40}$/
};
var d = null;
var llqTimeout = null;
var index = 0; // 0 =&gt;手机 1=&gt;账号 2=&gt;微信 3=&gt;注册
var isLoginDialog = false;
function wxLoginInterval(authKey) {
    var timestamp = (new Date()).getTime();
    var maxTimeLimit = 60 * 60;
    clearInterval(d);
    if (maxTimeLimit &gt; 0) {
        index = 0;
        djs(maxTimeLimit, timestamp, d, authKey)
    }
}
function djs(t, timestamp, d, authKey) {
    d = setInterval(function () {
        if (t &gt; 0) {
            t--;
            checkHasSuccess(timestamp, d, authKey);
        } else {
            wxEwm = false;
            clearInterval(d);
            // todo 提示用户刷新二维码,需要把以前的二维码覆盖掉，不能让用户在扫
            $('body').find('.ewm-refresh').show();
            return;
        }
    }, 1000);
};
//验证是否授权登录
function checkHasSuccess(timestamp, d, authKey) {
    if (timestamp &gt; 0 &amp;&amp; authKey) {
        $.ajax({
            url: "/Login/loginByApplet",
            type: "post",
            data: { "businessValue": authKey },
            datatype: 'json',
            success: function (res) {
                if (res.data &amp;&amp; res.data.mobile) {
                    location.reload();
                } else {
                    $('#wxQrcord .wxQrcord-load').hide();
                    $('#wxQrcord .wxQrcord-end').show();
                    $('body').find('.ewm-refresh').hide();
                }
            },
            error: function (msg) {
                wxEwm = false;
                clearInterval(d);
                showError('请刷新二维码');
                $('body').find('.ewm-refresh').show();
                $('#dialog').find('.login-binding').hide().siblings('.login-wx').show();
            }
        });
    }
};
function wxLogin() {
    $('#wxQrcord .wxQrcord-load').show().siblings().hide();
    $('.wx-desc .wx-desc-inp').show();
    wxEwm = true;
    var authKey = "authkey" + randomString(20)
    var url = "http://upassport.zuobiao.wang/api/Oauth/wxImg";
    url += "?uid=" + authKey;
    $(".wxQrcord-end").attr('src', url);
    wxLoginInterval(authKey)
};
$(function () {
    //弹出输入图片验证码
    $(".change").on('click', function () {
        setTimeout(function () {
            $("#validateImg").attr('src', apiUrl + "Home/GetValidateCode?t=" + new Date().getTime());
        }, 100);
    });
    $(".btns .confirm").on('click', function () {
        var txtImgCode = $.trim($("#txtImgCode").val());
        if (txtImgCode == '') {
            showError('图形验证码不为空');
            return;
        } else {
            show = true;
            if (index == 0) {
                setTimeout(function () {
                    kjcheck($("#dialog_tel .getCode"));
                }, 1000);
            }
            if (index == 3) {
                setTimeout(function () {
                    regcheckcode($("#dialog_reg .getCode"));
                }, 1000);
            }
            if (index == 4) {
                setTimeout(function () {
                    forgetcode($("#dialog_forget .getCode"));
                }, 1000);
            }
            $(".yyDialog.imgCode").hide();
        }
    });
    //登录
    $(".totellogin,#loginBtn").click(function () {
        index = 2;
        $("#lyj-dialog0").hide();

        $("#lyj-dialog").hide();

        $(".yyDialog.imgCode").hide();
        $(".login-dialog-sub").removeClass('phone').addClass('wx');
        $(".login-dialog-cont h2 a").removeClass('curr');
        $(".login-dialog-cont h2 a").eq(2).addClass('curr');
        $(".loginBox").hide();
        $("#dialog").show();
        $(".login-dialog,.overlay_bg").show();
        wxLogin();
    });
    //注册
    $("#areg").click(function () {
        index = 3;
        $("#lyj-dialog0").hide();

        $("#lyj-dialog").hide();
        $(".loginBox").hide();
        $(".yyDialog.imgCode").hide();
        $(".login-dialog-cont h2 a").removeClass('curr');
        $(".login-dialog-cont h2 a").eq(3).addClass('curr');
        $("#dialog").hide();
        $("#dialog_mm").hide();
        $("#dialog_tel").hide();
        $(".login-dialog,.overlay_bg").show();
        $("#dialog_reg").show();
    });
    var login = $('#loginDialog');
    login.on('click', '#ewmRefresh', function () {
        if (!wxEwm) {
            $('#wxQrcord .wxQrcord-load').show().next().next().hide()
            wxLogin();
        }
    });
    $('.overlay_bg').click(function () {
        $('.overlay_bg,#loginDialog').fadeOut(100);
    });
    //关闭
    $(".login-dialog-closed").click(function () {
        $('.overlay_bg,#loginDialog').fadeOut(100);
    });
    //方式切换
    $(".login-dialog-sub").on('click', function () {
        if ($(this).hasClass('wx')) {
            index = 0;
            $(this).removeClass('wx').addClass('phone');
            $(".login-dialog-cont h2 a").removeClass('curr');
            $(".login-dialog-cont h2 a").eq(0).addClass('curr');
            $(".loginBox").hide();
            $("#dialog_tel").show();
        } else {
            index = 2;
            $(this).removeClass('phone').addClass('wx');
            $(".login-dialog-cont h2 a").removeClass('curr');
            $(".login-dialog-cont h2 a").eq(2).addClass('curr');
            $(".loginBox").hide();
            $("#dialog").show();
            wxLogin();
        }
    });
    $(".link.loagin-account.jjs_bd_log").on('click', function () {
        index = 1;
        $(".login-dialog-cont h2 a").removeClass('curr');
        $(".login-dialog-cont h2 a").eq(1).addClass('curr');
        $("#dialog_tel").hide();
        $("#dialog_mm").show();
    });
    $(".link.loagin-quick.jjs_bd_log").on('click', function () {
        index = 0;
        $(".login-dialog-cont h2 a").removeClass('curr');
        $(".login-dialog-cont h2 a").eq(0).addClass('curr');
        $("#dialog_mm,#dialog_reg,#dialog_forget").hide();
        $("#dialog_tel").show();
    });
    $(".link.bod-r.loagin-reg.jjs_bd_log").on('click', function () {
        index = 3;
        $(".login-dialog-cont h2 a").removeClass('curr');
        $(".login-dialog-cont h2 a").eq(3).addClass('curr');
        $("#dialog_mm").hide();
        $("#dialog_tel").hide();
        $("#dialog").hide();
        $("#dialog_reg").show();
    });
    $(".fr.retrieve").on('click', function () {
        index = 4;
        $(".login-dialog-cont h2 a").removeClass('curr');
        $(".login-dialog-cont h2 a").eq(4).addClass('curr');
        $("#dialog_mm").hide();
        $("#dialog_forget").show();
    });
    //输入手机号
    login.find('.account').on("input focus", function () {
        var parent = $(this).parents('.loginBox');
        if ($(this).attr("readonly")) {
            return false;
        }
        var text = $.trim($(this).val());
        if (text) {
            $(this).siblings(".del").show();
        } else {
            $(this).siblings(".del").hide();
        }
        if (text.length &gt;= 11) {
            if (validateMobile(text)) {
                $(".getCode").attr('disabled', false);
            } else {
                $(".getCode").attr('disabled', true);
            }
        } else {
            $(".getCode").attr('disabled', true);
        }
    });
    //输入验证码
    login.find('.validCode').on('keyup', function () {
        var parent = $(this).parents('.loginBox');
        var text = $.trim($(this).val());
        var phone = $.trim(parent.find('.account').val());
        if (text) {
            $(this).siblings(".del").show();
        } else {
            $(this).siblings(".del").hide();
        }
        if (text &amp;&amp; (text.length &gt;= 4) &amp;&amp; (phone.length &gt;= 11)) {
            if (parent.attr('id') === 'dialog_reg') {
                // 注册
                if (regx.password.test($.trim(parent.find('.password').val()))) {
                    parent.find('.btn-submit').attr('disabled', false);
                }
            } else {
                parent.find('.btn-submit').attr('disabled', false);
            }
        } else {
            if (parent.attr('id') === '#dialog_reg') {
                // 注册
                if (regx.password.test($.trim(parent.find('.password').val()))) {
                    parent.find('.btn-submit').attr('disabled', true);
                }
            } else {
                parent.find('.btn-submit').attr('disabled', true);
            }
        }
    });
    //密码输入
    login.find('.password').on('keyup focus', function () {
        var parent = $(this).parents('.loginBox');
        var text = $.trim($(this).val());
        var phone = $.trim(parent.find('.account').val());
        if (text &amp;&amp; (text.length &gt;= 6) &amp;&amp; (phone.length &gt;= 11)) {
            if (parent.attr('id') === 'dialog_reg') {
                // 注册
                if (parent.find('.validCode').val().length === 6) {
                    parent.find('.btn-submit').attr('disabled', false);
                }
            } else {
                parent.find('.btn-submit').attr('disabled', false);
            }
        } else {
            if (parent.attr('id') === '#dialog_reg') {
                // 注册
                if (parent.find('.validCode').val().length !== 6) {
                    parent.find('.btn-submit').attr('disabled', true);
                }
            } else {
                parent.find('.btn-submit').attr('disabled', true);
            }
        }
    }).on("blur", function () {
        var text = $.trim($(this).val());
        if (!text &amp;&amp; index !== 3) {
            showError("请输入密码");
        } else if (text.length &lt; 6) {
            showError("请输入正确的密码");
        }
    });
    login.on('click', '.getCode', function () {
        var $parents = $(this).parents('.loginBox');
        $checks = $($parents).find('.protocol-check');
        if ($(this).hasClass("waitjy") || $(this).attr("disabled") || $(this).hasClass("disabled")) {
            return;
        } else {
            //$(".geetest_panel_bg").show();
            if ($($checks).prop('checked')) {
                $("#validateImg").attr('src', apiUrl + "Home/GetValidateCode?t=" + new Date().getTime());
                $("#txtImgCode").val('');
                $("#gbg").hide();
                $(".yyDialog.imgCode").show();
            } else {
                $("#lyj-dialog0").show();
            }
        }
    });
    //快捷登录
    login.on('click', '.login-user-tel-btn', function () {
        kjlogin();
    });
    //账号登录
    login.on('click', '#loginBtn2', function () {
        var $parents = $(this).parents('.loginBox');
        $checks = $($parents).find('.protocol-check');
        if ($($checks).prop('checked')) {
            hylogin();
        } else {
            $("#lyj-dialog").show();
        }
    });
    //会员注册
    login.on('click', '#loginBtn4', function () {
        memberReg();
    });
    //找回密码
    login.on('click', '#Submit1', function () {
        findPwd();
    });
    //记住我
    login.on('click', '.remenber', function () {
        $(this).find("i").toggleClass('checked');
        var checkbox = $(this).find(':checkbox');
        checkbox.prop('checked', !checkbox.prop('checked'));
    });
    //删除
    login.on('click', '.del', function () {
        $(this).siblings("input").val("").focus();
        $(this).hide();
    });
    //查看密码
    login.on("click", '.eyes', function () {
        $(this).toggleClass("visible");
        if ($(this).hasClass("visible")) {
            $(this).siblings("input").prop("type", "text");
        } else {
            $(this).siblings("input").prop("type", "password");
        }
    });
});</pre></body></html>