<!doctype html>
|
<html>
|
<head>
|
<title>用户登录</title>
|
<base href="/cbi/">
|
<meta charset="utf-8" />
|
<meta http-equiv="Pragma" content="no-cache">
|
<meta http-equiv="Cache-Control" content="no-cache">
|
<meta http-equiv="Expires" content="0">
|
<meta name="viewport" content="user-scalable=no, initial-scale=1, width=device-width, height=device-height" />
|
<meta name="format-detection" content="telephone=no" />
|
<meta name="apple-mobile-web-app-capable" content="yes" />
|
<link href="css/foundation.css" rel="stylesheet" />
|
<link href="css/soldier.css" rel="stylesheet" />
|
<link href="css/login.css" rel="stylesheet" />
|
<script src="js/jquery-1.7.2.min.js"></script>
|
<script src="js/foundation-2.0.js"></script>
|
<script src="js/soldier.js"></script>
|
|
<!-- <script type="text/javascript" src="js/index.js"></script> -->
|
<script type="text/javascript">
|
var edt_phone, edt_vcode, btn_vcode, lbl_message;
|
var timer, waitfor = 0;
|
|
function onError(errorcode) {
|
if ("multiOrg" == errorcode) {
|
lbl_message.html("您隶属于多家公司,请输入公司简称或代码");
|
return;
|
}
|
else if ("phoneOrOrgError" == errorcode) {
|
Dialog.alert("该公司下无此用户");
|
return;
|
}
|
else if ("notExists" == errorcode) {
|
Dialog.alert("您的手机尚未登记");
|
return;
|
}
|
else if ("orgcheck" == errorcode) {
|
Dialog.alert("请输入公司码");
|
return;
|
}
|
else if ("emptyVcode") {
|
lbl_message.html("请填写验证码");
|
return;
|
}
|
else if ("invalidVcode") {
|
lbl_message.html("验证码不正确");
|
return;
|
}
|
else if ("needGetVcode") {
|
lbl_message.html("您需要先获取验证码");
|
return;
|
}
|
else {
|
lbl_message.html(result.error);
|
return;
|
}
|
}
|
|
function getVcode() {
|
var phone = edt_phone.val();
|
if (phone == "") {
|
lbl_message.html("请填写“手机号”");
|
return;
|
}
|
|
lbl_message.val("");
|
|
Server.call("root/user/getvcade", "logcode=client&phone=" + phone, function(result) {
|
if (result.success) {
|
lbl_message.html("验证码已发,请接收");
|
}
|
else {
|
onError(result.error);
|
}
|
});
|
|
timer = setInterval(onTime, 1000);
|
refreshButton();
|
}
|
//准时
|
function onTime() {
|
try {
|
waitfor = waitfor + 1;
|
refreshButton();
|
}
|
catch (e) {
|
if (timer) {
|
clearInterval(timer);
|
timer = null;
|
btn_vcode.removeAttr("disabled");
|
}
|
}
|
}
|
|
function refreshButton() {
|
if (waitfor >= 15) {
|
clearTimeout(timer);
|
timer = null;
|
btn_vcode.removeAttr("disabled");
|
btn_vcode.html("获取");
|
waitfor = 0;
|
}
|
else {
|
var value = 15 - waitfor;
|
btn_vcode.html("获取(" + value + ")");
|
}
|
}
|
|
function clear() {
|
edt_vcode.val("");
|
}
|
|
function login() {
|
var phone = edt_phone.val();
|
var vcode = edt_vcode.val();
|
if (!phone || !vcode) {
|
lbl_message.html("请输入手机号和验证码");
|
return;
|
}
|
|
doLogin(phone, vcode);
|
}
|
|
function doLogin(phone, vcode) {
|
setLocalData("app_phone", phone);
|
|
var param = "phone=" + phone + "&vcode=" + vcode + "&logcode=client";
|
Server.call("root/user/login", param, function(result) {
|
if (result.success) {
|
setLocalData("account", {"phone": phone, "valid": true});
|
jumpTo("page/system/index.html");
|
}
|
else {
|
onError(result.error);
|
}
|
});
|
}
|
|
function vcodeClear() {
|
$("#edt_vcode").val("");
|
$("#vcodeimg").hide();
|
$("#edt_vcode").focus();
|
}
|
|
function phoneClear() {
|
$("#edt_phone").val("");
|
$("#phoneimg").hide();
|
$("#edt_phone").focus();
|
}
|
|
$(document).ready(function() {
|
edt_phone = $("#edt_phone");
|
edt_vcode = $("#edt_vcode");
|
btn_vcode = $("#btn_vcode");
|
lbl_message = $("#lbl_message");
|
|
var height = $(window).height();
|
var curheight = height/8;
|
$("#line").css("margin-top", $(window).height() - (curheight * 7) + "px");
|
|
$("#div_login_area").css("margin-top", height/3.8 + "px");
|
|
|
$("#phoneimg").hide();
|
$("#vcodeimg").hide();
|
|
var object = {
|
init: function() {
|
window.addEventListener("focus", this, true);
|
window.addEventListener("blur", this, true);
|
window.addEventListener("keyup", this, true);
|
},
|
handleEvent: function(e) {
|
var target = e.srcElement || e.target;
|
var strValue = target.id;
|
var len, inputValue;
|
switch(e.type) {
|
case "focus":
|
this.action(strValue);
|
break;
|
case "blur":
|
if (strValue == "edt_phone") {
|
$("#phoneimg").hide();
|
} else if (strValue == "edt_vcode"){
|
$("#vcodeimg").hide();
|
}
|
break;
|
case "keyup":
|
this.action(strValue);
|
break;
|
}
|
},
|
action: function(strValue) {
|
if (strValue == "edt_phone") {
|
inputValue = $("#edt_phone").val();
|
if (inputValue.length > 0) {
|
$("#phoneimg").show();
|
} else {
|
$("#phoneimg").hide();
|
}
|
} else if (strValue == "edt_vcode"){
|
inputValue = $("#edt_vcode").val();
|
if (inputValue.length > 0) {
|
$("#vcodeimg").show();
|
} else {
|
$("#vcodeimg").hide();
|
}
|
}
|
}
|
};
|
|
try {
|
var phone = getLocalData("app_phone");
|
if (phone) {
|
edt_phone.val(phone);
|
|
var account = getLocalData("account");
|
var menualLogin = getSessionData("menualLogin");
|
|
if (account && !menualLogin) {
|
doLogin(phone, "78321900");
|
}
|
}
|
}
|
finally {
|
setSessionData("menualLogin", null);
|
}
|
|
object.init();
|
});
|
</script>
|
</head>
|
|
<body>
|
|
<div id="page_login" class="div_full" style="display: block;">
|
<div class="div_page_title">用户登录</div>
|
<!-- <div class="div_menu_back" onclick="jumpTo('index.html')"></div> -->
|
<div class="div_page_lite">
|
<div id="div_login_area" align="center" style="margin-top:100px;">
|
<div id="lbl_message" style="text-align: center;font-size: 12px; line-height: 16px; margin-bottom: 8px;"></div>
|
<div>
|
<div>
|
<div style="width:30px;background:#FFFFFF;height:35px;display:inline-block;position: absolute;">
|
<img src="image/login_phone.png" style="width:15px;height:25px;margin-top:5px;">
|
</div>
|
<div style="display:inline-block;margin-left:30px;">
|
<input type="tel" class="input_phone" id="edt_phone" value="13884488448" placeholder="请输入手机号" style="background:#FFFFFF;width:184px;height:33px;border-radius:0px;border: 0px solid;"/>
|
</div>
|
<div id="cleanphone" style="width:30px;background:#FFFFFF;margin-left:-32px;height:35px;position: absolute;display:inline-block;" onclick="phoneClear();">
|
<img id="phoneimg" src="image/login_clean.png" style="width:30px;height:30px;margin-top:3px;">
|
</div>
|
</div>
|
|
<div style="padding-top: 10px;">
|
<div style="width:30px;background:#FFFFFF;height:35px;display:inline-block;position: absolute;">
|
<img src="image/login_password.png" style="width:15px;height:25px;margin-top:5px;">
|
</div>
|
<div style="display:inline-block;position: absolute;margin-left:30px;">
|
<input type="tel" class="input_vcode" id="edt_vcode" placeholder="请输入验证码" value="0023" style="background:#FFFFFF;width:100px;height:33px;border-radius:0px;border: 0px solid;"/>
|
</div>
|
<div id="cleanvcode" style="width:30px;background:#FFFFFF;height:35px;position: absolute;margin-left: 100px;display:inline-block;" onclick="vcodeClear();">
|
<img id="vcodeimg" src="image/login_clean.png" style="width:30px;height:30px;margin-top:3px;">
|
</div>
|
<div id="btn_vcode" style="margin-left: 135px;display:inline-block;border-radius: 0px;height: 35px;width: 80px;background: #A7B7D1;color: white;font-size: 13px;font-weight: bolder;line-height: 40px;" onclick="getVcode()">获取验证码</div>
|
</div>
|
</div>
|
|
<div class="div_login_row">
|
<div class="div_button_login" style="font-weight:bolder;width:216px;background:#A7B7D1;height:33px;line-height:33px;"onclick="login()">登录</div>
|
</div>
|
|
</div>
|
|
<div style="color: #ddddfb; font-size: 18px; text-align: center; margin-top: 100px; font-weight: bold;">CBI管理系统</div>
|
|
</div>
|
|
</div>
|
|
</body>
|
</html>
|