-精简HTML结构,优化`account.html`,`apple-card/account.html`,和`t-mall-game/account.html`中iframe的布局。 - 调整CSS样式,以增强用户界面的一致性和可读性。 - 优化`account_history.html`中的表格和搜索栏的样式与对齐。 fix(controller): 修正新增控制器参数顺序 - 修正`addController.go`中的参数顺序,确保交易类型正确传递给服务层。 - 更新数据库插入操作,确保UUID正确分配给新记录,防止SQL错误。
409 lines
14 KiB
HTML
409 lines
14 KiB
HTML
<!doctype html>
|
|
<!DOCTYPE html>
|
|
<html xmlns="http://www.w3.org/1999/html">
|
|
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>管理后台</title>
|
|
<link href="../static/css/basic.css" rel="stylesheet" type="text/css">
|
|
<script src="../static/js/filter.js"></script>
|
|
<style type="text/css">
|
|
.explain {
|
|
display: block;
|
|
color: blue;
|
|
padding-left: 10px;
|
|
margin-bottom: 10px;
|
|
}
|
|
|
|
.account-edit .col-md-6 div {
|
|
line-height: 40px;
|
|
margin-right: 20px;
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body>
|
|
<div class="account-record">
|
|
<div class="search">
|
|
<div>
|
|
商户名称:
|
|
<input id="account-name" type="text">
|
|
</div>
|
|
<div>
|
|
商户编号:
|
|
<input id="account-no" type="text">
|
|
</div>
|
|
<div>
|
|
<button class="btn btn-default" id="account-search" type="button">搜索</button>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<span class="explain" style="color: red;">
|
|
账户余额:用户充值成功后立马相加,提款成功后相减的结果。
|
|
</span>
|
|
<span class="explain" style="color: red;">
|
|
待结算金额:用户充值后,还没有加到可结算金中。
|
|
</span>
|
|
<span class="explain" style="color: red;">
|
|
结算金额: 可以提现的金额 = (账户余额 - 待结算金额 - 押款金额 - 冻结金额 - 正在出款金额)
|
|
</span>
|
|
</div>
|
|
<div class="menu-table">
|
|
<table>
|
|
<thead class="thead-dark">
|
|
<tr>
|
|
<th>序列号</th>
|
|
<th>账户编号</th>
|
|
<th>账户名称</th>
|
|
<th>账户余额</th>
|
|
<th>结算金额</th>
|
|
<th>待结算金额</th>
|
|
<th>押款金额</th>
|
|
<th>冻结金额</th>
|
|
<th>正在出款的金额</th>
|
|
{{/*
|
|
<th>可用金额</th>
|
|
*/}}
|
|
<th>账户状态</th>
|
|
<th>操作</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="account-table-body">
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<!-- 分页插件 -->
|
|
<div class="cut_page">
|
|
<li>
|
|
每页显示
|
|
<select id="display_count">
|
|
<option value="4">4</option>
|
|
<option value="20">20</option>
|
|
<option value="30">30</option>
|
|
<option value="50">50</option>
|
|
<option value="100">100</option>
|
|
</select>
|
|
</li>
|
|
<li class="current_total_page">
|
|
第
|
|
<span class="current_page">
|
|
0
|
|
</span>
|
|
/
|
|
<span class="total_page">
|
|
0
|
|
</span>
|
|
页
|
|
</li>
|
|
<li class="pre_page">上一页</li>
|
|
<li class="next_page">下一页</li>
|
|
<li class="jump_page">跳转 <input name="jump_page" type="text" value="">
|
|
<button class="btn btn-default" type="button">Go</button>
|
|
</li>
|
|
</div>
|
|
</div>
|
|
<div aria-labelledby="myModalLabel" class="modal fade" id="account-solve" role="dialog" tabindex="-1">
|
|
<div class="modal-dialog" role="document">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h4 class="modal-title">订单处理</h4>
|
|
</div>
|
|
<div class="modal-body modal-body-order-solve">
|
|
<input hidden id="account-uid-edit" type="text">
|
|
<div style="display: flex">
|
|
<div>
|
|
<label>
|
|
操作:
|
|
<select id="account-edit-operator" value="">
|
|
<option value="plus_amount">加款</option>
|
|
<option value="sub_amount">减款</option>
|
|
</select>
|
|
</label>
|
|
</div>
|
|
<div>
|
|
<label>
|
|
<input id="account-edit-operator-amount" placeholder="请输入增加(减少)金额" type="text"
|
|
value="">
|
|
</label>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<label>
|
|
二次验证:
|
|
<input id="order-info-totp" type="text" value="">
|
|
</label>
|
|
</div>
|
|
<div>
|
|
<p class="error-msg" style="color: red"></p>
|
|
</div>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button class="btn btn-default account-edit-save" type="button">确定</button>
|
|
<button class="btn btn-default cancel-order-solve" data-dismiss="modal" type="button">取消</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div aria-labelledby="myModalDeleteLabel" class="modal fade" id="delete-solve" role="dialog" tabindex="-1">
|
|
<div class="modal-dialog" role="document">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h4 class="modal-title">二次验证</h4>
|
|
</div>
|
|
<div class="modal-body modal-body-order-solve">
|
|
<input hidden id="account-uid-delete" type="text">
|
|
<div>
|
|
<label>
|
|
二次验证:
|
|
<input id="order-info-delete-totp" type="text" value="">
|
|
</label>
|
|
</div>
|
|
<div>
|
|
<p class="error-msg" style="color: red"></p>
|
|
</div>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button class="btn btn-default account-delete-save" type="button">确定</button>
|
|
<button class="btn btn-default cancel-order-solve" data-dismiss="modal" type="button">取消</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
<script>
|
|
function getAccountCutPageValues() {
|
|
let displayCount = $("#display_count").val();
|
|
let currentPage = $(".current_page").html();
|
|
let totalPage = $(".total_page").html();
|
|
let jumpPage = $(".jump_page input").val();
|
|
let accountName = $("#account-name").val();
|
|
let accountNo = $("#account-no").val();
|
|
|
|
return {
|
|
"displayCount": displayCount,
|
|
"currentPage": currentPage,
|
|
"totalPage": totalPage,
|
|
"jumpPage": jumpPage,
|
|
"accountName": accountName,
|
|
"accountNo": accountNo
|
|
};
|
|
}
|
|
|
|
function clearAccountSearchValues() {
|
|
$("#account-name").val("");
|
|
$("#account-no").val("");
|
|
}
|
|
|
|
function clearAccountCutPageValues(res) {
|
|
$(".current_page").html(res.CurrentPage);
|
|
$(".total_page").html(res.TotalPage);
|
|
$("#display_count option").each(function () {
|
|
if ($(this).text() === res.DisplayCount) {
|
|
$(this).attr('selected', true);
|
|
}
|
|
});
|
|
$(".jump_page input").val("");
|
|
}
|
|
|
|
//渲染账户数据列表
|
|
function showAccountList(res) {
|
|
clearAccountCutPageValues(res);
|
|
let str = "";
|
|
for (let i = 0; i < res.AccountList.length; i++) {
|
|
let v = res.AccountList[i];
|
|
let tmp = "<tr>" + "<th>" + (res.StartIndex + i + 1) + "</th>" +
|
|
"<th>" + v.AccountUid + "</th>" + "<th>" + v.AccountName + "</th>" + "<th>" + v.Balance + "</th>" +
|
|
"<th>" + v.SettleAmount + "</th>" + "<th>" + v.WaitAmount + "</th>" + "<th>" + v.LoanAmount + "</th>" +
|
|
"<th>" + v.FreezeAmount + "</th>" + "<th>" + v.PayforAmount + "</th>" + "<th>" + v.Status + "</th>";
|
|
tmp = tmp.replace("unactive", "冻结").replace("active", "激活");
|
|
tmp = tmp + "<th>" +
|
|
'<div class="btn-group" role="group" aria-label="...">' +
|
|
'<button type="button" value="' +
|
|
v.AccountUid +
|
|
'" class="btn btn-default" onclick="updateAccountStatus(this.value);">' +
|
|
"激活|冻结" +
|
|
'</button>' +
|
|
`<button type="button" value="${v.AccountUid}" class="btn btn-default" onclick="showTotpModal(this.value)">变更钱包余额</button>` +
|
|
'<button type="button" value="' +
|
|
v.AccountUid +
|
|
'" class="btn btn-default" onclick="showDeleteModal(this.value);"><span class="glyphicon glyphicon-trash"></span></button>' +
|
|
'</div>' +
|
|
"</th>" +
|
|
"</tr>";
|
|
if (v.Status === "unactive") {
|
|
tmp = tmp.replace("<tr>", "<tr style='color: red;'>");
|
|
}
|
|
str = str + tmp;
|
|
}
|
|
|
|
$("#account-table-body").html(str);
|
|
}
|
|
|
|
function updateAccountStatus(accountUid) {
|
|
$.ajax({
|
|
url: "/update/account/status",
|
|
data: {
|
|
"accountUid": accountUid
|
|
},
|
|
|
|
success: function (res) {
|
|
if (res.Code === 404) {
|
|
window.parent.location = "/login.html";
|
|
} else if (res.Code === -1) {
|
|
alert("操作失败");
|
|
} else {
|
|
alert("操作成功");
|
|
ajaxAccountList(getAccountCutPageValues());
|
|
}
|
|
},
|
|
error: function (res) {
|
|
alert("系统异常,请稍后再试");
|
|
}
|
|
});
|
|
}
|
|
|
|
function ajaxAccountList(dataJSON) {
|
|
$.ajax({
|
|
url: "/get/account",
|
|
data: dataJSON,
|
|
|
|
success: function (res) {
|
|
if (res.Code == 404) {
|
|
window.parent.location = "/login.html";
|
|
} else if (res.Code == -1) {
|
|
alert("获取账户数据列表失败");
|
|
} else {
|
|
showAccountList(res);
|
|
}
|
|
},
|
|
error: function (res) {
|
|
alert("系统异常,请稍后再试");
|
|
}
|
|
});
|
|
}
|
|
|
|
// 改变账户余额
|
|
$(".account-edit-save").click(function () {
|
|
const accountUid = $("#account-uid-edit").val();
|
|
const accountOperator = $("#account-edit-operator").val();
|
|
const amount = $("#account-edit-operator-amount").val();
|
|
const totpCode = $("#order-info-totp").val();
|
|
|
|
if (accountUid === "" || accountOperator === "" || amount === "") {
|
|
$(".error-msg").text("信息填写不完全,请重新填写");
|
|
return
|
|
}
|
|
|
|
$.ajax({
|
|
url: "/account/operator",
|
|
data: {
|
|
accountUid: accountUid,
|
|
accountOperator: accountOperator,
|
|
amount: amount,
|
|
totpCode: totpCode,
|
|
},
|
|
success: function (res) {
|
|
if (res.Code === 404) {
|
|
window.parent.location = "/login.html";
|
|
} else {
|
|
alert(res.Msg);
|
|
if (res.Code === 200) {
|
|
$(".cancel-order-solve").click();
|
|
ajaxAccountList({});
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
$(".account-delete-save").click(function () {
|
|
const accountUid = $("#account-uid-delete").val();
|
|
const totpCode = $("#order-info-delete-totp").val();
|
|
|
|
if (accountUid === "") {
|
|
$(".error-msg").text("信息填写不完全,请重新填写");
|
|
return
|
|
}
|
|
|
|
$.ajax({
|
|
url: "/delete/account",
|
|
data: {
|
|
accountUid: accountUid,
|
|
totpCode: totpCode,
|
|
},
|
|
success: function (res) {
|
|
if (res.Code === 404) {
|
|
window.parent.location = "/login.html";
|
|
} else if (res.Code === -1) {
|
|
alert(res.Msg);
|
|
} else {
|
|
alert("操作成功");
|
|
$(".cancel-order-solve").click();
|
|
ajaxAccountList(getAccountCutPageValues());
|
|
}
|
|
},
|
|
error: function (res) {
|
|
alert("系统异常,请稍后再试");
|
|
}
|
|
});
|
|
})
|
|
|
|
//当每页显示数更改后,执行的操作
|
|
$("#display_count").change(function () {
|
|
let dataJSON = getAccountCutPageValues();
|
|
ajaxAccountList(dataJSON);
|
|
});
|
|
|
|
//点击上一页的按钮
|
|
$(".pre_page").click(function () {
|
|
let dataJSON = getAccountCutPageValues();
|
|
|
|
if (dataJSON["currentPage"] === 1) {
|
|
return;
|
|
}
|
|
dataJSON["currentPage"] = parseInt(dataJSON["currentPage"]) - 1;
|
|
ajaxAccountList(dataJSON);
|
|
});
|
|
//点击下一页的按钮时
|
|
$(".next_page").click(function () {
|
|
let dataJSON = getAccountCutPageValues();
|
|
if (dataJSON["currentPage"] === dataJSON["totalPage"]) {
|
|
return;
|
|
}
|
|
dataJSON["currentPage"] = parseInt(dataJSON["currentPage"]) + 1;
|
|
ajaxAccountList(dataJSON);
|
|
});
|
|
//点击跳转那一页的按钮
|
|
$(".jump_page button").click(function () {
|
|
let dataJSON = getAccountCutPageValues();
|
|
|
|
if (dataJSON["jumpPage"].length <= 0) {
|
|
return;
|
|
}
|
|
ajaxAccountList(dataJSON);
|
|
});
|
|
$(".account-edit-back").click(function () {
|
|
$(".account-record").show();
|
|
$(".account-edit").hide();
|
|
ajaxAccountList({});
|
|
});
|
|
$(function () {
|
|
$(".account-record").show();
|
|
$(".account-edit").hide();
|
|
clearAccountSearchValues();
|
|
ajaxAccountList({});
|
|
});
|
|
|
|
function showTotpModal(merchantUid) {
|
|
$("#account-solve").modal("show");
|
|
$("#account-uid-edit").val(merchantUid);
|
|
}
|
|
|
|
function showDeleteModal(merchantUid) {
|
|
$("#delete-solve").modal("show");
|
|
$("#account-uid-delete").val(merchantUid);
|
|
}
|
|
</script>
|
|
|
|
</html> |