commit
119783c84b
@ -1,47 +1,51 @@
|
||||
// 页面DOM加载完成后执行初始化操作
|
||||
$(document).ready(function(){
|
||||
getCode();
|
||||
var h=$(window).height();
|
||||
$("#main").css("height",h);
|
||||
$("#loginBtn").click(function(){
|
||||
login();
|
||||
})
|
||||
$("#code").click(function(){
|
||||
getCode();
|
||||
})
|
||||
getCode();
|
||||
var h=$(window).height();
|
||||
$("#main").css("height",h);
|
||||
$("#loginBtn").click(function(){
|
||||
login();
|
||||
})
|
||||
$("#code").click(function(){
|
||||
getCode();
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
//获取验证码
|
||||
function getCode(){
|
||||
$("#code").attr("src","./user/createImage?code="+Math.random());
|
||||
$("#code").attr("src","./user/createImage?code="+Math.random());
|
||||
}
|
||||
|
||||
//登录
|
||||
function login(){
|
||||
var user=$("#inputName").val();
|
||||
var pwd=$("#inputPassword").val();
|
||||
var code=$("#inputCode").val();
|
||||
$.ajax({
|
||||
type:"POST",
|
||||
url:"./user/login.do",
|
||||
dataType:"JSON",
|
||||
data:{
|
||||
"useraccount":user,
|
||||
"password":pwd,
|
||||
"icode":code
|
||||
},
|
||||
success:function(data){
|
||||
console.log(data)
|
||||
if(data.code=="0"){
|
||||
var urlString="pages/myCenter.html?power="+data.power+"&userid="+data.userid;
|
||||
window.location.href=urlString;
|
||||
}
|
||||
else if(data.code=="-1"){
|
||||
alert("验证码或密码错误")
|
||||
}
|
||||
},
|
||||
error:function(){
|
||||
alert("登录 发生错误");
|
||||
}
|
||||
});
|
||||
var user=$("#inputName").val();
|
||||
var pwd=$("#inputPassword").val();
|
||||
var code=$("#inputCode").val();
|
||||
// 发起AJAX登录请求
|
||||
$.ajax({
|
||||
type:"POST",
|
||||
url:"./user/login.do",
|
||||
dataType:"JSON",
|
||||
data:{
|
||||
"useraccount":user,
|
||||
"password":pwd,
|
||||
"icode":code
|
||||
},
|
||||
// 请求成功的回调函数(后端返回数据后执行)
|
||||
success:function(data){
|
||||
console.log(data)
|
||||
if(data.code=="0"){
|
||||
var urlString="pages/myCenter.html?power="+data.power+"&userid="+data.userid;
|
||||
window.location.href=urlString;
|
||||
}
|
||||
else if(data.code=="-1"){
|
||||
alert("验证码或密码错误")
|
||||
}
|
||||
},
|
||||
// 请求失败的回调函数(网络错误或接口异常时执行)
|
||||
error:function(){
|
||||
alert("登录 发生错误");
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -1,60 +1,65 @@
|
||||
<!--员工视角的订单管理页面前端结构-->
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" Content="text/html; charset=utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="../css/myCenter.css">
|
||||
<link rel="stylesheet" type="text/css" href="../css/pages.css">
|
||||
<meta http-equiv="Content-Type" Content="text/html; charset=utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="../css/myCenter.css">
|
||||
<link rel="stylesheet" type="text/css" href="../css/pages.css">
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="col-md-8 col-xs-11 nopadding" style="padding-top:3rem;padding-left: 3rem">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-hover" style="margin-top: 10px" id="orderList">
|
||||
<tr><th>入住人</th><th>身份证号</th><th>开始时间</th><th>结束时间</th><th>总金额</th><th>状态</th><th>操作</th></tr>
|
||||
</table>
|
||||
<div class="col-md-12">
|
||||
<form class="form-inline">
|
||||
<div class="form-group" style="margin-right: 10xp">
|
||||
<a href="#" id="pre">上一页 </a>
|
||||
</div>
|
||||
<!--<div class="form-group">
|
||||
<input type="text" style="width: 5rem" class="form-control" id="inputPage">
|
||||
<input type="button" id="setPageBtn" class="btn btn-default" value="跳转">
|
||||
</div>-->
|
||||
<div class="form-group" style="margin-left: 10px">
|
||||
<a href="#" id="next">下一页</a>
|
||||
<div class="table-responsive">
|
||||
<!--定义订单列表表格-->
|
||||
<table class="table table-bordered table-hover" style="margin-top: 10px" id="orderList">
|
||||
<tr><th>入住人</th><th>身份证号</th><th>开始时间</th><th>结束时间</th><th>总金额</th><th>状态</th><th>操作</th></tr>
|
||||
<!--实现订单列表的分页查看-->
|
||||
</table>
|
||||
<div class="col-md-12">
|
||||
<form class="form-inline">
|
||||
<div class="form-group" style="margin-right: 10px">
|
||||
<a href="#" id="pre">上一页 </a>
|
||||
</div>
|
||||
<!--<div class="form-group">
|
||||
<input type="text" style="width: 5rem" class="form-control" id="inputPage">
|
||||
<input type="button" id="setPageBtn" class="btn btn-default" value="跳转">
|
||||
</div>-->
|
||||
<div class="form-group" style="margin-left: 10px">
|
||||
<a href="#" id="next">下一页</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<!--定义 “查看房间详情” 的弹窗-->
|
||||
<div class="modal fade" id="showRoomT" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title" id="myModalLabel">房间详情</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<table class="table table-bordered table-hover" style="margin-top: 10px" id="roomTable">
|
||||
</table>
|
||||
</div>
|
||||
<!--弹窗头部区域-->
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title" id="myModalLabel">房间详情</h4>
|
||||
</div>
|
||||
<!--弹窗主体区域,用于展示订单关联的房间信息-->
|
||||
<div class="modal-body">
|
||||
<table class="table table-bordered table-hover" style="margin-top: 10px" id="roomTable">
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--结束弹窗内容、容器和模态框整体标签。-->
|
||||
|
||||
|
||||
<script type="text/javascript" src="../js/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="../js/bootstrap.min.js"></script>
|
||||
<script type="text/javascript" src="../js/staff_order.js"></script>
|
||||
<script type="text/javascript" src="../js/staff_order.js"></script><!--自定义员工订单管理脚本-->
|
||||
|
||||
|
||||
Loading…
Reference in new issue