newqlogin.html 11.7 KB
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>快捷登陆 </title>
    <script type="text/javascript" src="__PUBLIC__/js/jquery-1.8.2.min.js"></script>
    <style type="text/css">
        ul li{ width:100%; height:50px; line-height:50px;}
        input{ width:100%;}
        #com1{ line-height:30px; height:30px; width:90%;}
        #com2{ line-height:30px; height:30px; width:90%;}
        table td{ border:1px solid #000;}

    </style>

</head>
<body>



<div style=" width:1000px; height:auto; min-height:300px; margin:0 auto; border:1px solid #aaaaaa;">
    <table>
        <tr>
            <td width="200" align="center">常用:</td><td><input id="com1"  value="" /></td><td align="center"><a href="" target="_blank">前台</a></td>
        </tr>
        <tr>
            <td>
                <form id="form1" action="">
                <input name="key" type="text" id="key" style=" width:80%;" value="{$key}" /><a href="common.aspx">置空</a>
                <input type="submit" value="搜哦" id="btnSearch" />
                </form>

            </td><td >商家后台用户:<input id="com2" name="ERPUser"  value="" /></td><td width="100" align="center"><a href="" target="_blank">后台</a></td>

        </tr>

        <tr>


            <td>


                <select name="store_list" id="store_list" onkeydown="strkeydown(event, this, 'sumbitbtn')">
				  
                   <option value="">请选择</option>
                   <?php foreach( $storelist as $key=>$v): ?>
				      <option value="{$v['store_id']}">{$v['store_name']}({$v['ERPId']})</option>
				   <?php endforeach;?>
                </select>
            </td><td colspan="2">手机号码:<input style=" width:120px;" id="com5" value="" />&nbsp;&nbsp;&nbsp;&nbsp;

            <select name="DropWeb" id="DropWeb">
                <option value="1">本地</option>
                <option value="2">测试</option>
                <option value="3">网上</option>

            </select>


           登陆密码: <input name="loginpwd" type="password" id="loginpwd" style=" width:100px;" value="" />
            <span onclick="go1()">跳转后台</span>&nbsp;&nbsp;
            <span id="com4">跳转前台</span>&nbsp;&nbsp;<span id="com6">获取数据</span>&nbsp;&nbsp;<span id="com7">验证线下</span>&nbsp;&nbsp;<span id="com8">微信信息</span></td>
        </tr>
        <tr>
            <td colspan="3">
      <textarea id="com3" rows="5" cols="5" style=" width:500px; height:200px;">

      </textarea>
            </td>
        </tr>
    </table>
</div>
<input type="hidden" id="hidindex" value="" />
</form>
</body>
</html>

<script type="text/javascript">


    function change(obj) {

        //aa = $(obj).val().split(",");
        $("#hidindex").val($(obj).val());
    };

    //后台
    function go1() {
        var selstore=$('#store_list').val();
        if (selstore=="")
        {
            alert('请选择商家');
            return false;
        }
        var getloginpwd=$("#loginpwd").val();
        if (getloginpwd=="")
        {
            alert('登陆密码不能为空');
            $("#loginpwd").focus();
            return false;
        }
        var aa = $("#hidindex").val().split(",");
        var urlhttp = "";
        switch  ($("#DropWeb").val())
        {
            case "1":
                urlhttp = "{:curHostURL()}";
                break;
            case "2":
                urlhttp = "http://jmh.xinda100.cn";
                break;
            case "3":
                urlhttp = "https://mshop.yolipai.net";
                break;
        }

        var gourl11 = "";
        $.ajax({
            url: "/test/Login/go",
            data: { storeid: selstore,loginpwd: $("#loginpwd").val(),erpuser:$("#com2").val() },
            dataType: "json",
            type: "POST",
            success: function (data) {

                if (data.code==0)
                {

                    gourl11=urlhttp+"/admin/index/get_post/?url="+data.link;


                    window.open(gourl11);
                }
                else
                {
                    alert(data.msg);
                }
            },
            beforeSend: function () {

                // showLoading();
            },
            error: function (XMLHttpRequest, textStatus, errorThrown) {
                alert("通讯异常");
            }
        });


    };



    $("#com4").click(function () {
        var aa = $("#hidindex").val().split(",");
        //验证
        var Mobile = $("#com5").val();
        if (Mobile=="")
        {
            alert('手机号码不能为空');
            $("#com5").focus();
            return false;
        }
        var getloginpwd=$("#loginpwd").val();
        if (getloginpwd=="")
        {
            alert('登陆密码不能为空');
            $("#loginpwd").focus();
            return false;
        }
        var supplyid = aa[1];

        var stoid=$("#store_list").val();
        var urlhttp = "";
        switch  ($("#DropWeb").val())
        {
            case "1":
                urlhttp = "{:curHostURL()}";
                break;
            case "2":
                urlhttp = "http://jmh.xinda100.cn";
                break;
            case "3":
                urlhttp = "https://mshop.yolipai.net";
                break;
        }
        urlhttp+="/mobile/index/index/stoid/"+stoid+".html";
      //  alert("/test/Login/mlogin/storeid/1/mobile/13599727122/loginpwd/111");
        $.ajax({
            url: "/mobile/fast/fast_login/stoid/"+stoid+"/mobile/"+Mobile+"/loginpwd/"+getloginpwd,
            dataType: "json",
            type: "POST",
            success: function (data) {
                if (data.code==0) {

                    window.open(urlhttp);
                }

                else
                {
                    alert(data.msg);
                }
            },
            beforeSend: function () {

                // showLoading();
            },
            error: function (XMLHttpRequest, textStatus, errorThrown) {
                alert("通讯异常");
            }
        });




    });
//    $("#com6").click(function () {
//        var aa = $("#hidindex").val().split(",");
//        //验证
//        var Mobile = $("#com5").val();
//        var supplyid = aa[1];
//
//        //        if (Mobile == "") {
//        //            alert("手机号码不能为空!");
//        //            return;
//        //        }
//
//
//        $.ajax({
//            url: "commonzfl.ashx?Method=mobile",
//            data: { mobile: Mobile, supplyid: supplyid },
//            async: false,
//            dataType: "json",
//            type: "POST",
//            success: function (data) {
//                var reg = data.result.toString().split("|");
//                if ("ok" == reg[0].toString()) {//成功
//                    //alert(aa[1]);
//                    if (Mobile != "") {
//                        $("#com3").val("前台:WXLogin/JsDefault.aspx?supplyid=" + supplyid + "&wx_openid=" + reg[1].toString() + "&verifypass=" + reg[2].toString() + "————————————————————" + "后台:App_admin/Main.aspx?SupplyId=" + supplyid + "&webpass=" + reg[3].toString() + "————————————————————" + "会员ID:  " + reg[4].toString());
//                    }
//                    else {
//                        if ($("#DropSel").val() == "1") {
//                            $("#com3").val("App_admin/Main.aspx?SupplyId=" + supplyid + "&webpass=" + reg[1].toString());
//                        } else {
//                            $("#com3").val("m_admin/Main.aspx?SupplyId=" + supplyid + "&webpass=" + reg[1].toString());
//                        }
//                    }
//                }
//                else {
//                    alert(data.result);
//                }
//
//            },
//            beforeSend: function () {
//                // showLoading();
//            },
//            error: function (XMLHttpRequest, textStatus, errorThrown) {
//                alert("通讯异常");
//            }
//        });
//
//    });
//
//    $("#com7").click(function () {
//        var aa = $("#hidindex").val().split(",");
//        //验证
//        var Mobile = $("#com5").val();
//        var supplyid = aa[1];
//
//        //        if (Mobile == "") {
//        //            alert("手机号码不能为空!");
//        //            return;
//        //        }
//
//
//        $.ajax({
//            url: "commonzfl.ashx?Method=erp",
//            data: { mobile: Mobile, supplyid: supplyid },
//            async: false,
//            dataType: "json",
//            type: "POST",
//            success: function (data) {
//                //alert(decodeURIComponent(data.result)); return;
//                var reg = data.result.toString().split("|");
//                if ("ok" == reg[0].toString()) {//成功
//                    $("#com3").val(HtmlUtil.htmlDecodeByRegExp(reg[1].toString()));
//
//                }
//                else if ("nomobile" == reg[0].toString()) {
//                    alert("请输入手机号码");
//                }
//                else {
//                    alert(data.result);
//                }
//
//            },
//            beforeSend: function () {
//                // showLoading();
//            },
//            error: function (XMLHttpRequest, textStatus, errorThrown) {
//                alert("通讯异常");
//            }
//        });
//
//    });
//    $("#com8").click(function () {
//        var aa = $("#hidindex").val().split(",");
//        //验证
//        var openid = $("#com5").val();
//        var supplyid = aa[1];
//
//        //        if (Mobile == "") {
//        //            alert("手机号码不能为空!");
//        //            return;
//        //        }
//        $("#com3").val('');
//        $("#img").remove();
//
//        $.ajax({
//            url: "commonzfl.ashx?Method=weixin",
//            data: { openid: openid, supplyid: supplyid },
//            async: false,
//            dataType: "json",
//            type: "POST",
//            success: function (data) {
//                //alert(decodeURIComponent(data.result)); return;
//                var reg = data.result.toString().split("|");
//                if ("ok" == reg[0].toString()) {//成功
//
//                    $("#com3").val("昵称:" + reg[1].toString());
//                    $("#com3").after("<img id='img' style=' width:100px; height:100px;' src='" + reg[2].toString() + "' alt=''>");
//
//                }
//                else {
//                    alert(data.result);
//                }
//
//            },
//            beforeSend: function () {
//                // showLoading();
//            },
//            error: function (XMLHttpRequest, textStatus, errorThrown) {
//                alert("通讯异常");
//            }
//        });
//
//    });

    var HtmlUtil = {
        /*1.用正则表达式实现html转码*/
        htmlEncodeByRegExp: function (str) {
            var s = "";
            if (str.length == 0) return "";
            s = str.replace(/&/g, "&amp;");
            s = s.replace(/</g, "&lt;");
            s = s.replace(/>/g, "&gt;");
            s = s.replace(/ /g, "&nbsp;");
            s = s.replace(/\'/g, "&#39;");
            s = s.replace(/\"/g, "&quot;");
            return s;
        },
        /*2.用正则表达式实现html解码*/
        htmlDecodeByRegExp: function (str) {
            var s = "";
            if (str.length == 0) return "";
            s = str.replace(/&amp;/g, "&");
            s = s.replace(/&lt;/g, "<");
            s = s.replace(/&gt;/g, ">");
            s = s.replace(/&nbsp;/g, " ");
            s = s.replace(/&#39;/g, "\'");
            s = s.replace(/&quot;/g, "\"");
            return s;
        }
    };
</script>