<div class="quick-login">
    <form id="login_form" action="{:url('/Home/Login/login',['inajax'=>'1'])}" method="post" class="bg" >
    <dl>
      <dt>账&nbsp;&nbsp;&nbsp;号</dt>
      <dd>
        <input type="text" class="text" autocomplete="off"  name="member_name" id="member_name" autofocus >
      </dd>
    </dl>
    <dl>
      <dt>{$Think.lang.login_index_password}</dt>
      <dd>
        <input type="password" class="text" name="member_password" autocomplete="off"  id="member_password">
      </dd>
    </dl>
    <?php if(config('captcha_status_login') == '1') { ?>
    <dl>
      <dt>{$Think.lang.login_index_checkcode}</dt>
      <dd>
        <input type="text" name="captcha" class="text fl w60" id="captcha" maxlength="4" size="10" />
        <img class="fl ml10" src="{:url('seccode/makecode')}" title="{$Think.lang.login_index_change_checkcode}" name="codeimage" border="0" id="codeimage" onclick="this.src='{:url('seccode/makecode')}'"><span></span></dd>
    </dl>
    <?php } ?>
    <ul>
      <li>{$Think.lang.quick_login_please_regist1}<a href="{:url('/Home/Login/register')}" class="register">{$Think.lang.quick_login_please_regist2}</a>{$Think.lang.quick_login_please_regist3}</li>
      <li>{$Think.lang.quick_login_please_forget1}<a href="{:url('/Home/Login/forget_password')}" class="forget">{$Think.lang.quick_login_please_forget2}</a>{$Think.lang.quick_login_please_forget3}</li>
    </ul>
    <div class="enter">
      <input type="submit" class="submit" value="登&#12288;录" name="Submit">
      <?php if (config('qq_isuse') == 1 || config('sina_isuse') == 1 || config('weixin_isuse') == 1){?>
      <span class="other">
      <?php if (config('qq_isuse') == 1){?>
      <a href="{:url('api/oa_qq')}" title="QQ账号登录" class="qq"><i></i></a>
       <?php } ?>
      <?php if (config('sina_isuse') == 1){?>
      <a href="{:url('api/oa_sina')}" title="{$Think.lang.ds_otherlogintip_sina}" class="sina"><i></i></a>
      <?php } ?>
       <?php if (config('weixin_isuse') == 1){?>
      <a href="javascript:void(0);" onclick="ajax_form('weixin_form', '微信账号登录', '{:url('connectwx/index')}', 360);" title="微信账号登录" class="wx"><i></i></a>
      <?php } ?>
      </span>
      <?php } ?>
    </div>
    <input type="hidden" value="{$Think.get.ref_url}" name="ref_url">
  </form>
</div>
<script src="{$Think.config.url_domain_root}static/plugins/jquery.validate.min.js"></script>
<script>
$(document).ready(function(){
	$("#login_form").validate({
        errorPlacement: function(error, element){
            var error_td = element.parent('dd');
            error_td.append(error);
            element.addClass('error');
        },
        onkeyup: false,
    	submitHandler:function(form){
    		ajaxpost('login_form', '', '', 'error');
    	},
		rules: {
			member_name: "required",
			member_password: "required"
			<?php if(config('captcha_status_login') == '1') { ?>
            ,captcha : {
                required : true,
                remote   : {
                    url : '{:url('Seccode/check')}',
                    type: 'get',
                    data:{
                        captcha : function(){
                            return $('#captcha').val();
                        }
                    },
                    complete: function(data) {
                        if(data.responseText == 'false') {
                        	document.getElementById('codeimage').src='{:url('Seccode/makecode')}';
                        }
                    }
                }
            }
			<?php } ?>
		},
		messages: {
			member_name: "",
			member_password: ""
			<?php if(config('captcha_status_login') == '1') { ?>
            ,captcha : {
                required : '',
				remote	 : '验证码错误'
            }
			<?php } ?>
		}
	});
});
</script>
