|
|
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
|
|
pageEncoding="UTF-8"%>
|
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
|
|
<html>
|
|
|
<head>
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
|
|
<title>还车</title>
|
|
|
<!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
|
|
|
<link rel="stylesheet"
|
|
|
href="<%=request.getContextPath()%>/css/bootstrap.min.css">
|
|
|
<link rel="stylesheet"
|
|
|
href="<%=request.getContextPath()%>/css/bootstrap-datetimepicker.min.css">
|
|
|
<link rel="stylesheet"
|
|
|
href="<%=request.getContextPath()%>/css/bootstrap-table.min.css">
|
|
|
<!-- 可选的 Bootstrap 主题文件(一般不用引入) -->
|
|
|
<link rel="stylesheet"
|
|
|
href="<%=request.getContextPath()%>/css/bootstrap-theme.min.css">
|
|
|
<!-- 最新的 Bootstrap 核心 JavaScript 文件 要将jquery的包放在bootstrap之前-->
|
|
|
<script src="<%=request.getContextPath()%>/js/jquery-1.9.1.js"></script>
|
|
|
<script src="<%=request.getContextPath()%>/js/bootstrap.min.js"></script>
|
|
|
<script
|
|
|
src="<%=request.getContextPath()%>/js/bootstrap-datetimepicker.min.js"></script>
|
|
|
<script
|
|
|
src="<%=request.getContextPath()%>/js/bootstrap-datetimepicker.zh-CN.js"></script>
|
|
|
<script src="<%=request.getContextPath()%>/js/bootstrap-table.min.js"></script>
|
|
|
<script
|
|
|
src="<%=request.getContextPath()%>/js/bootstrap-table-zh-CN.min.js"></script>
|
|
|
<script type="text/javascript" src="js/jquery.qrcode.min.js"></script>
|
|
|
<script src="<%=request.getContextPath()%>/layer/layer.js"></script>
|
|
|
<script type="text/javascript"></script>
|
|
|
</head>
|
|
|
<body>
|
|
|
<table id="prjTable"></table>
|
|
|
<!-- 换车模态窗 -->
|
|
|
<div class="modal fade" id="modifyModal">
|
|
|
<div class="modal-dialog">
|
|
|
<div class="modal-content">
|
|
|
<div class="modal-header">
|
|
|
<button type="button" class="close" data-dismiss="modal">×</button>
|
|
|
<h4 class="modal-title">个人信息</h4>
|
|
|
</div>
|
|
|
<div class="modal-body">
|
|
|
<div class="form-inline">
|
|
|
<div class="form-group">
|
|
|
<label for="modifyNameText">余额:</label> <input
|
|
|
id="modifyUserId" type="hidden"> <input
|
|
|
id="modifyBalance"
|
|
|
readonly="readonly"
|
|
|
class="form-control input-sm">
|
|
|
</div>
|
|
|
<br /> <br /> <br />
|
|
|
<div class="form-group">
|
|
|
<label for="modifyAddressText">押金充值:</label>
|
|
|
<div class="vocation">
|
|
|
<select id="modifyAddBalance" class="form-control input-sm"
|
|
|
style="width: 518px">
|
|
|
<option></option>
|
|
|
<option>10元</option>
|
|
|
<option>20元</option>
|
|
|
<option>50元</option>
|
|
|
<option>100元</option>
|
|
|
</select>
|
|
|
</div>
|
|
|
<div class="form-group">
|
|
|
<label for="modifyAddressText">押金充值:</label>
|
|
|
<div class="vocation">
|
|
|
<select id="modifyDeposit" class="form-control input-sm"
|
|
|
style="width: 518px">
|
|
|
<option></option>
|
|
|
<option>退还押金</option>
|
|
|
<option>交付押金199元</option>
|
|
|
</select>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="modal-footer">
|
|
|
<button class="btn btn-default" data-dismiss="modal">取消支付</button>
|
|
|
<button class="btn btn-primary" id="saveModify">确认支付</button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<script type="text/javascript">
|
|
|
//定义一个全局标签
|
|
|
var flag=1;
|
|
|
var tableData = $('#prjTable');
|
|
|
tableData.bootstrapTable({
|
|
|
url: "<%=request.getContextPath()%>/getUserInfo",
|
|
|
dataType: "json",
|
|
|
pagination: true, //分页
|
|
|
singleSelect: false,
|
|
|
//toolbar:"#toolbar",
|
|
|
showRefresh:true,// 显示刷新按钮
|
|
|
showColumns:true, // 显示所有的列
|
|
|
//data-locale:"zh-CN", //表格汉化
|
|
|
search: false, //显示搜索框
|
|
|
striped:true,
|
|
|
sidePagination: "server", //服务端处理分页
|
|
|
pageList:[5,10,15,20,50],
|
|
|
sortName : 'createDate', // 排序字段
|
|
|
sortOrder : 'desc', // 排序方式
|
|
|
sortable: true, //是否启用排序
|
|
|
queryParams: function (params) {
|
|
|
return {
|
|
|
offset: params.offset, //页码
|
|
|
limit: params.limit, //页面大小
|
|
|
search : params.search, //搜索
|
|
|
order : params.order, //排序
|
|
|
ordername : params.sort, //排序
|
|
|
};
|
|
|
},
|
|
|
columns: [
|
|
|
{
|
|
|
title: '用户编号',
|
|
|
field: 'userId',
|
|
|
align: 'left',
|
|
|
valign: 'middle',
|
|
|
align: 'center'
|
|
|
},
|
|
|
{
|
|
|
title: '用户名称',
|
|
|
field: 'userName',
|
|
|
align: 'left',
|
|
|
valign: 'middle',
|
|
|
align: 'center'
|
|
|
},
|
|
|
{
|
|
|
title: '用户手机号码',
|
|
|
field: 'userPhonenum',
|
|
|
align: 'left',
|
|
|
valign: 'middle',
|
|
|
align: 'center'
|
|
|
},
|
|
|
{
|
|
|
title: '用户邮箱',
|
|
|
field: 'userEmail',
|
|
|
align: 'center'
|
|
|
},
|
|
|
{
|
|
|
title: '余额',
|
|
|
field: 'userBalance',
|
|
|
align: 'center'
|
|
|
},
|
|
|
{
|
|
|
title: '押金',
|
|
|
field: 'userDeposit',
|
|
|
align: 'center'
|
|
|
|
|
|
},
|
|
|
{
|
|
|
title: '操作',
|
|
|
field: 'userId',
|
|
|
align: 'center',
|
|
|
formatter:function(value,row,index){
|
|
|
var e = '<a href="javascript:void(0)" onclick="returnbike(\''+row.userId+'\')" input type="button" class="btn-sm btn-info" >充值与退还</a>'
|
|
|
return e;
|
|
|
}
|
|
|
}
|
|
|
]
|
|
|
});
|
|
|
|
|
|
function returnbike(userId){
|
|
|
$.get("<%=request.getContextPath()%>/returnUserInfo",{userId:userId},function(data){
|
|
|
$("#modifyUserId").val(data.userId);
|
|
|
$("#modifyBalance").val(data.userBalance);
|
|
|
},"json");
|
|
|
// 显示弹窗
|
|
|
$("#modifyModal").modal("show");
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$("#saveModify").click(function(){
|
|
|
var userId=$("#modifyUserId").val();
|
|
|
var userBalance=$("#modifyAddBalance").val();
|
|
|
var userDeposit=$("#modifyDeposit").val();
|
|
|
// 后台提交保存的请求
|
|
|
$.post("<%=request.getContextPath()%>/updateBalance", {userId : userId,userBalance : userBalance,userDeposit : userDeposit}, function(data) {
|
|
|
if (data == "ok") {
|
|
|
layer.alert('支付成功!');
|
|
|
// 关闭弹窗
|
|
|
$("#modifyModal").modal("hide");
|
|
|
// 刷新数据
|
|
|
$('#prjTable').bootstrapTable('refresh', {url : 'getUserInfo'});
|
|
|
}else{
|
|
|
layer.alert('骑行过程中不支持退还押金!');
|
|
|
// 关闭弹窗
|
|
|
$("#modifyModal").modal("hide");
|
|
|
// 刷新数据
|
|
|
$('#prjTable').bootstrapTable('refresh', {url : 'getUserInfo'});
|
|
|
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
</script>
|
|
|
</body>
|
|
|
</html> |