<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="default.aspx.cs" Inherits="jiaowu.app._default" %>

<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>登录——<%=xxsoft_check.check.getseting("systitle") %></title>
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
    <link rel="stylesheet" href="../weui/css/weui.css"/>
    <link rel="stylesheet" href="../weui/css/weuix.css"/>

    <script src="../weui/js/zepto.min.js"></script>
    <script src="../weui/js/zepto.weui.js"></script>
    <script src="../weui/js/php.js"></script>
    <script>
        $(function(){
               $(document).on("click","#btn",function(){
                   var username = $("#uname").val();
                   var pwd= $("#pwd").val();
                   if(username==""){
                       $.toptip("用户名不能为空");
                       return false;
                   }
                   if(pwd==""){
                       $.toptip("密码不能为空");
                       return false;
                   }                   
                   $.post('default.aspx?action=login', { xm:username, pwd:md5(pwd) }, function (data, status) {
             if (status == "success") {
                 var jsonData = data;
                 if (jsonData.isOk == 1) {
                     //alert(jsonData.message)
                     window.location.href = 'main.aspx';
                 } else {
                     alert(jsonData.message);
                 }

             }
         }, 'json');
               })
			   //解决表单控件不能回弹 只有微信ios有这个问题
           $("input,select,textarea").blur(function(){
setTimeout(() => {
const scrollHeight = document.documentElement.scrollTop || document.body.scrollTop || 0;
window.scrollTo(0, Math.max(scrollHeight - 1, 0));
}, 100);
})    
  
        });
        
        var countdown=60;

        function settime(obj) {

            var code = $(obj);
            if (countdown == 0) {
                code.removeAttr('disabled');
                code.text("获取验证码");
                countdown =60;
                return;
            } else {
                code.text("重新发送(" + countdown + ")");
                code.attr('disabled',true);
                countdown--;
            }
            setTimeout(function() {
                settime(obj) }, 1000);

        }

        function getcode(){
            $("#code").attr("src","../php/code.php?random="+Math.random());
        };

        function cleartxt(obj){
            $(obj).prev().find('.weui-input').val("");
            return false;
        }

        function cleararea(obj){
            $(obj).prev().find('.weui-textarea').val("").next().find("span").text(0);
            return false;
        }

    </script>
</head>

<body ontouchstart>
<div class="weui-header bg-blue"> 
  <div class="weui-header-left"> <a class="icon icon-109 f-white">返回</a>  </div>
   <h1 class="weui-header-title">新翔绩效考核用户登录</h1>
    <div class="weui-header-right"></div> 
    </div>


<div class="weui-cells">
    <div class="weui-cell">
        <div class="weui-cell__bd">
            <input class="weui-input" placeholder="请输入用户名" type="text" name="uname" id="uname">
        </div>
        <i class="weui-icon-clear" onclick="cleartxt(this)"></i>
    </div>
</div>
<div class="weui-cells">
    <div class="weui-cell">
        <div class="weui-cell__bd">
            <input class="weui-input" placeholder="请输入密码" type="password" id="pwd" name="pwd">
        </div>
        <i class="weui-icon-clear" onclick="cleartxt(this)"></i>
    </div>
</div>


<div class="weui-btn-area">
    <a class="weui-btn weui-btn_primary" href="javascript:" id="btn">确定</a>
</div>


<br>
<br>

<div class="weui-footer weui-footer_fixed-bottom">
    <p class="weui-footer__links">
        
    </p>
    <p class="weui-footer__text">Copyright &copy; <%=xxsoft_check.check.getseting("danwei") %></p>
</div>
</body>
</html>