<!DOCTYPE html>
<html>
<head>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8"><meta name="description" content="<!--{$page_keyword}-->">

    <meta name="keywords" content="<!--{$page_keyword}-->">

    <meta charset="UTF-8">

    <title>
        登录<!--{$page_title}-->-
        <!--{$copyright_header}-->
    </title>
    <meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0, maximum-scale=1.0,user-scalable=no">

    <meta http-equiv="X-UA-Compatible" content="IE=Edge">
    <link type="text/css" rel="stylesheet" href="<!--{$skinpath}-->assets/css/bootstrap.min123.css">
    <link type="text/css" rel="stylesheet" href="<!--{$skinpath}-->assets/css/index123.css">
    <link rel="stylesheet" href="<!--{$skinpath}-->assets/css/base.min.css">
    <link rel="stylesheet" href="<!--{$skinpath}-->assets/css/login.css">
    <link rel="stylesheet" href="<!--{$skinpath}-->assets/css/login1.css">
    <script src="<!--{$skinpath}-->assets/js/jquery-1.8.3.min.js"></script>
    <script type="text/javascript" src="<!--{$skinpath}-->assets/js/layer/layer.js"></script>

</head>

<body>
<!---引用开始--->
<div class="h_panel">
    <div class="h_logo" style="background: url('<!--{$config.logo}-->');    width: 230px;
    height: 65px;">
        <a href="<!--{$config.siteurl}-->" target="_parent" >良精网</a>
    </div>
</div>
<div class="login_banner_panel" id="J_panel" style="background-image: url(&quot;https://cdn.cnbj1.fds.api.mi-img.com/mi-mall/83854f0abf1c124c4406166b58862192.jpg&quot;);">
    <!-- 底部定位的bg -->
</div>
<div class="wrap" style="    margin-top: -680px; margin-left:750px;">
    <div class="layout_panel">
        <div class="layout" id="layout">
            <!--表单输入登录-->
            <div class="mainbox form-panel" id="login-main" style="display: block;">

                  <div class="nav_tabs_panel">
                      <div id="nav-tabs" class="nav_tabs">
                          <a class="navtab-link now" href="javascript:void(0);" data-tab="pwd" id="login">帐号登录</a><span class="line"></span>
                          <a class="navtab-link" href="javascript:void(0);" data-tab="qr" id="reg">账号注册</a>
                      </div>
                  </div>                      <!-- tab e -->                      <!-- tab con s -->
                <div class="tabs-con tabs_con now" id="login1" data-con="pwd" style="display: block; ">
                    <div>
                        <div class="login_area">
                            <form action="" method="POST" id="companyinfologin">
                                <div class="loginbox c_b">
                                    <!-- 输入框 -->
                                    <div class="lgn_inputbg c_b login-panel pwdLogin" style="margin-top: 50px;">
                                        <label id="region-code" class="labelbox login_user c_b" for="">
                                            <div class="country_list">
                                                <div class="animation countrycode_selector" id="countrycode_selector">
                                                    <span class="country_code"><tt class="countrycode-value" id="countrycode_value"></tt><i class="icon_arrow_down"></i></span>
                                                </div>
                                            </div>
                                            <input class="item_account" autocomplete="off" type="text" name="username" id="username" placeholder="账号">
                                            <input type="hidden" name="log" id="debug_log">
                                        </label>
                                        <div class="country-container" id="countrycode_container" style="display: none;">
                                            <div class="country_container_con" id="countrycode_container_con"></div>
                                        </div>
                                        <label class="labelbox pwd_panel c_b">
                                            <input class="item_account" type="password" placeholder="密码" autocomplete="off" id="password" name="password">
                                        </label>
                                    </div>

                                    <div class="btns_bg" style="margin-top: 50px;">
                                        <input class="btnadpt" id="login-button" type="button" value="登录">
                                    </div>
                                    <div class="other_panel clearfix" style="display: none;">
                                        <!-- 其他登录方式 s -->
                                        <div style="display: block;" class="other_login_type sns-login-container" id="custom_display_16">
                                            <fieldset class="oth_type_tit">
                                                <legend align="center" class="oth_type_txt">其他方式登录</legend>
                                            </fieldset>
                                            <div id="sns-login-links" class="oth_type_links">
                                                <a class="icon_type btn_qq sns-login-link" data-type="qq" href="" title="QQ登录" target="_blank">
                                                    <i class="btn_sns_icontype icon_default_qq"></i>
                                                </a>
                                                <a class="icon_type btn_weibo sns-login-link" data-type="weibo" href="" title="微博登录" target="_blank">
                                                    <i class="btn_sns_icontype icon_default_weibo"></i>
                                                </a>
                                                <a class="icon_type btn_alipay sns-login-link" data-type="alipay" href="" title="支付宝登录" target="_blank">
                                                    <i class="btn_sns_icontype icon_default_alipay"></i>
                                                </a>
                                                <a class="icon_type btn_weixin sns-login-link" data-type="weixin" href="" title="微信登录" target="_blank">
                                                    <i class="btn_sns_icontype icon_default_weixin"></i>
                                                </a>
                                            </div>
                                        </div>
                                        <!-- 其他登录方式 e -->
                                        <p class="acq_tips" style="display: none;"></p>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
                <div class="tabs-con tabs_con"  data-con="qr" style="display: none;">
                </div>                      <!-- tab con e -->
            </div>
            <div class="ercode_area tab_qr_area" id="reg1" style="height: 474px; width: 410px; display: none;">
                <div class="tabs-con tabs_con now" id="login1" data-con="pwd" style="display: block; ">
                    <div>
                        <div class="login_area">
                            <form action="" method="POST" id="companyinforeg">
                                <div class="loginbox c_b">
                                    <!-- 输入框 -->
                                    <div class="lgn_inputbg c_b login-panel pwdLogin" style="margin-top: 50px;">
                                        <label id="region-code" class="labelbox login_user c_b" for="">
                                            <div class="country_list">
                                                <div class="animation countrycode_selector" id="countrycode_selector">
                                                    <span class="country_code"><tt class="countrycode-value" id="countrycode_value"></tt><i class="icon_arrow_down"></i></span>
                                                </div>
                                            </div>
                                            <input class="item_account" autocomplete="off" type="text" name="username1" id="username1" placeholder="请输入手机号码">
                                            <input type="hidden" name="log" id="debug_log">
                                        </label>
                                        <div class="country-container" id="countrycode_container" style="display: none;">
                                            <div class="country_container_con" id="countrycode_container_con"></div>
                                        </div>
                                        <label class="labelbox pwd_panel c_b">
                                            <input class="item_account" type="password" placeholder="请输入6-16位密码" autocomplete="off" id="password1" name="password1">
                                        </label>
                                        <label class="labelbox pwd_panel c_b">
                                            <input class="item_account" type="password" placeholder="请再次输入密码" autocomplete="off" id="assertpassword" name="assertpassword">
                                        </label>
                                        <label class="labelbox pwd_panel c_b">
                                            <input class="item_account" type="text" placeholder="请输入会员邮箱" autocomplete="off" id="email" name="email" >
                                        </label>
                                        <label class="labelbox pwd_panel c_b">
                                            <input class="item_account" type="text" placeholder="验证码" autocomplete="off" id="checkcode" name="checkcode" >
                                            <img alt="图片验证码" title="看不清换一张" class="chkcode_img" src="<!--{$urlpath}-->source/include/imagecode.php?act=verifycode" style="height: 50px;" />

                                        </label>

                                    </div>

                                    <div class="btns_bg" ">
                                        <input class="btnadpt" id="submit" type="button" value="注册">
                                    </div>
                                    <div class="other_panel clearfix" style="display: none;">
                                        <!-- 其他登录方式 s -->
                                        <div style="display: block;" class="other_login_type sns-login-container" id="custom_display_16">
                                            <fieldset class="oth_type_tit">
                                                <legend align="center" class="oth_type_txt">其他方式登录</legend>
                                            </fieldset>
                                            <div id="sns-login-links" class="oth_type_links">
                                                <a class="icon_type btn_qq sns-login-link" data-type="qq" href="" title="QQ登录" target="_blank">
                                                    <i class="btn_sns_icontype icon_default_qq"></i>
                                                </a>
                                                <a class="icon_type btn_weibo sns-login-link" data-type="weibo" href="" title="微博登录" target="_blank">
                                                    <i class="btn_sns_icontype icon_default_weibo"></i>
                                                </a>
                                                <a class="icon_type btn_alipay sns-login-link" data-type="alipay" href="" title="支付宝登录" target="_blank">
                                                    <i class="btn_sns_icontype icon_default_alipay"></i>
                                                </a>
                                                <a class="icon_type btn_weixin sns-login-link" data-type="weixin" href="" title="微信登录" target="_blank">
                                                    <i class="btn_sns_icontype icon_default_weixin"></i>
                                                </a>
                                            </div>
                                        </div>
                                        <!-- 其他登录方式 e -->
                                        <p class="acq_tips" style="display: none;"></p>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>

            </div>                    <!-- 取号注册 -->

        </div>
    </div>
</div>

<!---引用结束--->


<style>
    #floatDivr{display: none;}
</style>

<script>
    $("#login-button").click(function(event) {

        var username=document.getElementById("username").value;//获取form中的用户名
        var password=document.getElementById("password").value;
        var regex=/^[/s]+$/;//声明一个判断用户名前后是否有空格的正则表达式
        if(regex.test(username)||username.length==0)//判定用户名的是否前后有空格或者用户名是否为空
        {
            layer.msg("用户名格式不对", {icon: 5});
            return false;
        }
        if(regex.test(password)||password.length==0)//同上述内容
        {
            layer.msg("密码格式不对", {icon: 5});
            return false;
        }

        event.preventDefault();
        var form = new FormData(document.getElementById("companyinfologin"));

        $.ajax({
            url: "./index.php?c=user&a=ajaxlogin",
            type: "POST",
            data: form,
            dataType: "json",
            processData: false,
            contentType: false,
            success: function(data) {
                var json = eval(data);
                var response = json.response;
                var result = json.result;
                if(response == 1) {
                    layer.msg(result, {icon: 1});
                    window.location.href = './index.php';
                } else {
                    layer.msg(result, {icon: 5});
                }
            },
            error: function(XMLHttpRequest, textStatus, errorThrown) {
                layer.alert('错误');
            }
        });
    });
    $("#submit").click(function() {
        var username=document.getElementById("username1").value;//获取form中的用户名
        var password=document.getElementById("password1").value;
        var assertpassword=document.getElementById("assertpassword").value;
        var email=document.getElementById("email").value;
        var checkcode=document.getElementById("checkcode").value;
        var regex=/^[/s]+$/;//声明一个判断用户名前后是否有空格的正则表达式
        if(regex.test(username)||username.length==0)//判定用户名的是否前后有空格或者用户名是否为空
        {
            layer.msg("手机格式不对", {icon: 5});
            return false;
        }
        if(regex.test(password)||password.length==0)//同上述内容
        {
            layer.msg("密码格式不对", {icon: 5});
            return false;
        }
        if(regex.test(assertpassword)||assertpassword.length==0)//同上述内容
        {
            layer.msg("密码确认格式不对", {icon: 5});

            return false;
        }

        if(regex.test(password)!=regex.test(assertpassword)){
            layer.msg("密码不一致", {icon: 5});
            return false;
        }
        if(regex.test(email)||email.length==0)//同上述内容
        {
            layer.msg("邮箱格式不对", {icon: 5});
            return false;
        }
        if(regex.test(checkcode)||checkcode.length==0)//同上述内容
        {
            layer.msg("验证码不能为空", {icon: 5});
            return false;
        }

        event.preventDefault();
      //  var form = new FormData(document.getElementById("companyinforeg"));
        $.ajax({
            url: "index.php?c=user&a=ajaxreg",
            type: "post",
            cache: false,
            data: {username:username,password:password,email:email,assertpassword:assertpassword,checkcode:checkcode},
            dataType: "json",
            success: function(data) {
                var json = eval(data);
                var response = json.response;
                var result = json.result;

                if(response == "1") {
                    alert(result);
                    window.location.href = 'index.php?c=user';
                } else {
                    alert(result);
                  //  layer.msg(result, {icon: 5});

                }
            },
            error: function(e) {
                alert("错误！！");

            }
        });
    });
    $("#reg").click(function(event) {
        $('.navtab-link').removeClass('now');
        $(this).addClass('now');
        $("#login1").css("display","none");
        $("#reg1").css("display","block");
    });
    $("#login").click(function(event) {
        $('.navtab-link').removeClass('now');
        $(this).addClass('now');
        $("#login1").css("display","block");
        $("#reg1").css("display","none");
    });
</script>
<!--{include file="<!--{$tplpath}-->botton.tpl"}-->
