|
|
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Login.aspx.cs" Inherits="DSWeb.Login1" %>
|
|
|
|
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
|
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
|
<head runat="server">
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
|
<title>登录窗口</title>
|
|
|
<link href="theme/style.css" type="text/css" rel="Stylesheet" media="screen"/>
|
|
|
<link href="theme/dhtmlxcombo.css" type="text/css" rel="Stylesheet" media="screen"/>
|
|
|
<link rel="icon name" href="TruckMng/Content/Images/dsico.ico">
|
|
|
<link rel="shortcut icon" href="TruckMng/Content/Images/ds.png" type="image/x-icon" />
|
|
|
<link href="Css/login.css" rel="Stylesheet" type="text/css" />
|
|
|
<script type="text/javascript" src="js/dhtmlxcommon.js"></script>
|
|
|
<script type="text/javascript" src="js/dhtmlxcombo.js"></script>
|
|
|
<script type="text/javascript" src="js/dhtmlxcombo_whp.js"></script>
|
|
|
<script type="text/javascript" src="js/jquery/jquery-1.5.2.min.js"></script>
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
var comboCUSTOMERNAME; //分公司
|
|
|
var comboCODENAME; //分公司人员
|
|
|
var mydate=new Date();
|
|
|
var year=mydate.getFullYear();
|
|
|
|
|
|
window.onload = function () {
|
|
|
if (!document.getElementById('CheckBox2').checked) {
|
|
|
//document.getElementById('list_CODENAME').value = '';
|
|
|
document.getElementById('tbpassword').value = '';
|
|
|
}
|
|
|
GetIp();
|
|
|
var rnd = Math.floor(Math.random() * 5 + 1);
|
|
|
switch (rnd) {
|
|
|
case 1:
|
|
|
document.getElementById("img1").style.display = "block";
|
|
|
break;
|
|
|
case 2:
|
|
|
document.getElementById("img2").style.display = "block";
|
|
|
break;
|
|
|
case 3:
|
|
|
document.getElementById("img3").style.display = "block";
|
|
|
break;
|
|
|
case 4:
|
|
|
document.getElementById("img4").style.display = "block";
|
|
|
break;
|
|
|
case 5:
|
|
|
document.getElementById("img5").style.display = "block";
|
|
|
break;
|
|
|
}
|
|
|
document.getElementById("lblCopyYear").innerHTML = year;
|
|
|
}
|
|
|
|
|
|
function $(id) {
|
|
|
return document.getElementById(id);
|
|
|
}
|
|
|
function initComboSubcompany()//分公司
|
|
|
{
|
|
|
|
|
|
var list_subcompany=document.getElementById('list_subcompany').value;
|
|
|
if (list_subcompany != "") {
|
|
|
var loader = dhtmlxAjax.getSync("FeeCodes/CompanysAdapter.aspx?mask=0&pos=0&ISDISABLE=0&ISDELETED=0&login=login&codename=" + list_subcompany + "&val=" + newGuid());
|
|
|
var strC = loader.xmlDoc.responseText;
|
|
|
if (strC == "") {
|
|
|
// $("lb_subcompany").value = "无此分公司!";
|
|
|
document.getElementById('lb_subcompany').value = "无此分公司!";
|
|
|
}
|
|
|
else {
|
|
|
// $("lb_subcompany").value = strC;
|
|
|
document.getElementById('lb_subcompany').value =strC;
|
|
|
|
|
|
}
|
|
|
}
|
|
|
else {
|
|
|
// $("lb_subcompany").value = "";
|
|
|
document.getElementById('lb_subcompany').value ="";
|
|
|
}
|
|
|
//
|
|
|
var list_CODENAME =document.getElementById('list_CODENAME').value;
|
|
|
|
|
|
if (list_CODENAME != "") {
|
|
|
var loader = dhtmlxAjax.getSync("FeeCodes/UserAdapter.aspx?mask=0&pos=0&login=login&strSubcompany=" + list_subcompany+ "&username=" +list_CODENAME + "&val=" + newGuid());
|
|
|
var strU = loader.xmlDoc.responseText;
|
|
|
if (strU == "") {
|
|
|
// $("lb_CODENAME").value = "无此用户!";
|
|
|
document.getElementById('lb_CODENAME').value ='无此用户!';
|
|
|
}
|
|
|
else {
|
|
|
// $("lb_CODENAME").value = strU;
|
|
|
document.getElementById('lb_CODENAME').value =strU;
|
|
|
}
|
|
|
}
|
|
|
else {
|
|
|
// $("lb_CODENAME").value = "";
|
|
|
document.getElementById('lb_CODENAME').value ="";
|
|
|
|
|
|
}
|
|
|
//
|
|
|
}
|
|
|
function newGuid() {
|
|
|
var guid = "";
|
|
|
for (var i = 1; i <= 32; i++) {
|
|
|
var n = Math.floor(Math.random() * 16.0).toString(16);
|
|
|
guid += n;
|
|
|
if ((i == 8) || (i == 12) || (i == 16) || (i == 20))
|
|
|
guid += "-";
|
|
|
}
|
|
|
return guid.toUpperCase();
|
|
|
}
|
|
|
function KeyDown(btn) {
|
|
|
if (event.keyCode == 13) {
|
|
|
var list_subcompany = document.getElementById('list_subcompany').value;
|
|
|
var list_CODENAME = document.getElementById('list_CODENAME').value;
|
|
|
var tbpassword=document.getElementById('tbpassword').value;
|
|
|
|
|
|
if (list_subcompany!= "" &&list_CODENAME != "" && tbpassword != "") {
|
|
|
|
|
|
try {
|
|
|
__doPostBack(btn, '');
|
|
|
return false;
|
|
|
}
|
|
|
catch (e) {
|
|
|
alert(e);
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
else if (event.keyCode == 9) //Tab键控制
|
|
|
{
|
|
|
if (event.srcElement.id == 'list_subcompany') {
|
|
|
document.getElementById('list_CODENAME').focus();
|
|
|
return false;
|
|
|
}
|
|
|
}
|
|
|
return true;
|
|
|
}
|
|
|
function login() {
|
|
|
var e = e || window.event;
|
|
|
if (e.keyCode == 13) {
|
|
|
document.getElementById("btLogin").click();
|
|
|
}
|
|
|
}
|
|
|
var countdown;
|
|
|
function startCountdown() {
|
|
|
tel = document.getElementById('lb_handphone2').value;
|
|
|
if (document.getElementById('lb_handphone2').value == "") {
|
|
|
|
|
|
alert('手机号不能为空!');
|
|
|
return;
|
|
|
}
|
|
|
if (!tel || !/1[3|4|5|6|7|8]\d{9}/.test(tel)) {
|
|
|
alert('请输入正确的手机号!');
|
|
|
return;
|
|
|
}
|
|
|
var btn = document.getElementById('send_btn');
|
|
|
if (btn.innerHTML == '验证码') {
|
|
|
$.ajax({
|
|
|
type: "POST",
|
|
|
url: "/Mobile/MpService/MobileCode?mobile=" + tel,
|
|
|
dataType: "json",
|
|
|
success: function (data) {
|
|
|
if (data.Success) {
|
|
|
alert('发送验证码成功!');
|
|
|
|
|
|
} else {
|
|
|
alert(data.Message);
|
|
|
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
} else {
|
|
|
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
|
|
|
// 获取按钮元素
|
|
|
// 设置倒计时时间(单位:秒)
|
|
|
var time = 30;
|
|
|
// 显示倒计时
|
|
|
document.getElementById('send_btn').innerHTML = time;
|
|
|
// 更新倒计时元素的内容
|
|
|
var countdownInterval = setInterval(function () {
|
|
|
time--;
|
|
|
document.getElementById('send_btn').innerHTML = time;
|
|
|
// 当倒计时结束时,禁用按钮并清除定时器
|
|
|
if (time <= 0) {
|
|
|
clearInterval(countdownInterval);
|
|
|
btn.disabled = true;
|
|
|
btn.innerHTML = '验证码';
|
|
|
}
|
|
|
}, 1000);
|
|
|
}
|
|
|
|
|
|
function sendphonecode() {
|
|
|
$.ajax({
|
|
|
url: 'https://api.example.com/data', // 接口地址
|
|
|
type: 'GET', // 请求方法,可以是'GET'或'POST'
|
|
|
dataType: 'json', // 预期服务器返回的数据类型,可以是'json'、'xml'等
|
|
|
success: function(data) { // 请求成功时的回调函数,参数为服务器返回的数据
|
|
|
console.log(data);
|
|
|
},
|
|
|
error: function(xhr, status, error) { // 请求失败时的回调函数,参数分别为XMLHttpRequest对象、状态码和错误信息
|
|
|
console.error('Error:', error);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
function GetIp()//分公司
|
|
|
{
|
|
|
fetch('https://api.ipify.org?format=json')
|
|
|
.then(response => response.json())
|
|
|
.then(data => document.getElementById('ipaddress').value = data.ip)
|
|
|
.catch(error => console.error(error));
|
|
|
}
|
|
|
|
|
|
</script>
|
|
|
</head>
|
|
|
<body>
|
|
|
<form id="form1" class="form1" runat="server">
|
|
|
<div class="topContainer">
|
|
|
<div class="top">
|
|
|
<img src="images/signICO.gif" width="340" height="80" border="0" />
|
|
|
<div class="lanContain">
|
|
|
<asp:DropDownList ID="selLan" runat="server" Width="120px" CssClass="listLogin"
|
|
|
AutoPostBack="True" onselectedindexchanged="selLan_SelectedIndexChanged">
|
|
|
<asp:ListItem Value="Chinese">中文</asp:ListItem>
|
|
|
<asp:ListItem Value="English">English</asp:ListItem>
|
|
|
</asp:DropDownList>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="mainContainer">
|
|
|
<div class="mainLeft"><img id="img1" src="images/loginImg/rndImg01.jpg" width="600" height="410" border="0" style="display:none;" /><img id="img2" src="images/loginImg/rndImg02.jpg" width="600" height="410" border="0" style="display:none;" /><img id="img3" src="images/loginImg/rndImg03.jpg" width="600" height="410" border="0" style="display:none;" /><img id="img4" src="images/loginImg/rndImg04.jpg" width="600" height="410" border="0" style="display:none;" /><img id="img5" src="images/loginImg/rndImg05.jpg" width="600" height="410" border="0" style="display:none;" /></div>
|
|
|
<div class="mainRight">
|
|
|
<div class="mainRightTitle">
|
|
|
<div class="tab active">快速登陆</div>
|
|
|
<div class="tab">手机号登陆</div>
|
|
|
</div>
|
|
|
<ul class="loginUL conAvtive">
|
|
|
<li class="loginTextLI">
|
|
|
<ul class="loginTextUL">
|
|
|
<li class="loginTextTitleLI">公司代码</li>
|
|
|
<li class="loginTextContainerLI" style="position:relative;"><asp:TextBox ID="list_subcompany" runat="server" CssClass="textLogin" MaxLength="10" onblur="initComboSubcompany();"></asp:TextBox><input id="lb_subcompany" type="text" runat=server style="position:absolute;top:50px;left:0;z-index:1000;border-style: none; border-color: #FFFFFF; font-size: 12px; width:200px;" disabled="disabled" readonly="readonly" /></li>
|
|
|
</ul>
|
|
|
</li>
|
|
|
<li class="loginTextLI">
|
|
|
<ul class="loginTextUL">
|
|
|
<li class="loginTextTitleLI">用 户 名</li>
|
|
|
<li class="loginTextContainerLI" style="position:relative;"><asp:TextBox ID="list_CODENAME" runat="server" CssClass="textLogin" MaxLength="10" onblur="initComboSubcompany();"></asp:TextBox><input id="lb_CODENAME" type="text" runat=server style="position:absolute;top:50px;left:0;z-index:1000;border-style: none; border-color: #FFFFFF; font-size: 12px; width:200px;" disabled="disabled" readonly="readonly" /></li>
|
|
|
</ul>
|
|
|
</li>
|
|
|
<li class="loginTextLI">
|
|
|
<ul class="loginTextUL">
|
|
|
<li class="loginTextTitleLI">密 码</li>
|
|
|
<li class="loginTextContainerLI" style="position:relative;"><input type="password" id="tbpassword" class="textLogin" runat="server" onkeydown="login();" /><asp:TextBox id="ipaddress" runat="server" CssClass="textLogin" MaxLength="10" style="display:none;"></asp:TextBox></li>
|
|
|
</ul>
|
|
|
</li>
|
|
|
<li class="loginParamLI"><asp:CheckBox ID="CheckBox1" runat="server" Text="记住公司代码和员工编码" Checked=true /> <asp:CheckBox
|
|
|
ID="CheckBox2" runat="server" Text="记住密码"
|
|
|
oncheckedchanged="CheckBox2_CheckedChanged" /></li><!--Checked=true-->
|
|
|
<li class="loginBtnLI"><asp:LinkButton ID="btLogin" runat="server"
|
|
|
CssClass="btnLogin" onclick="btLogin_Click">登录</asp:LinkButton></li>
|
|
|
</ul>
|
|
|
<ul class="loginUL">
|
|
|
<li class="loginTextLI" style="margin-top:30px">
|
|
|
<ul class="loginTextUL">
|
|
|
<li class="loginTextTitleLI">手 机 号</li>
|
|
|
<li class="loginTextContainerLI" style="position:relative;">
|
|
|
<input name="list_handphone"
|
|
|
type="text" maxlength="20" runat="server" id="lb_handphone2" class="textLogin" />
|
|
|
</li>
|
|
|
</ul>
|
|
|
</li>
|
|
|
<li class="loginTextLI">
|
|
|
<ul class="loginTextUL">
|
|
|
<li class="loginTextTitleLI">验 证 码</li>
|
|
|
<li class="loginTextContainerLI">
|
|
|
<input name="tbyanzheng" type="text" runat="server" id="tbyanzheng" class="textLogin" width="150px"/>
|
|
|
<div id="send_btn" class="send_btn" onclick="startCountdown()">验证码</div>
|
|
|
</li>
|
|
|
</ul>
|
|
|
</li>
|
|
|
<li class="loginBtnLI" style="margin-left:90px">
|
|
|
<asp:LinkButton runat="server" id="btLogin2" class="btnLogin" onclick="btLogin_Click2"
|
|
|
style="float:left;width:120px">登录</asp:LinkButton>
|
|
|
</li>
|
|
|
</ul>
|
|
|
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<div class="foot">Copyright © <span id="lblCopyYear"></span> Dongshengsoft Inc. All Rights Reserved.<br />青岛东胜伟业软件有限公司 版权所有</div>
|
|
|
<script type="text/javascript" src="js/jquery/jquery-1.5.2.min.js"></script>
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
$(".mainRightTitle .tab").bind("click", function () {
|
|
|
var divs = $(".loginUL")
|
|
|
var lis = $(".mainRightTitle .tab")
|
|
|
lis.removeClass('active')
|
|
|
$(this).addClass('active')
|
|
|
for (var i = 0; i < lis.length; i++) {
|
|
|
if (lis[i] == this) {
|
|
|
divs.removeClass('conAvtive')
|
|
|
divs.eq(i).addClass('conAvtive')
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
</form>
|
|
|
</body>
|
|
|
</html>
|