Files
kami_boss/views/self_plus_sub.html
danial c3906e940e refactor(account): 重构账户管理页面布局和样式
-精简HTML结构,优化`account.html`,`apple-card/account.html`,和`t-mall-game/account.html`中iframe的布局。
- 调整CSS样式,以增强用户界面的一致性和可读性。
- 优化`account_history.html`中的表格和搜索栏的样式与对齐。

fix(controller): 修正新增控制器参数顺序

- 修正`addController.go`中的参数顺序,确保交易类型正确传递给服务层。
- 更新数据库插入操作,确保UUID正确分配给新记录,防止SQL错误。
2024-09-04 09:54:18 +08:00

210 lines
6.9 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>管理后台</title>
<link href="../static/css/basic.css" rel="stylesheet" type="text/css">
<link href="../static/lib/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css">
<link href="../static/lib/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css" rel="stylesheet"
type="text/css">
<script src="../static/js/filter.js"></script>
<script src="../static/js/jquery.min.js"></script>
<script src="../static/lib/bootstrap/js/bootstrap.min.js"></script>
<script src="../static/lib/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
<script src="../static/lib/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"></script>
<script src="../static/js/basic.js"></script>
<style>
.panel-body label {
font-weight: normal;
margin-right: 10px;
}
#select-self-name {
height: 30px;
line-height: 30px;
}
</style>
</head>
<body>
<div class="panel panel-danger">
<div class="panel-heading">
<h3 class="panel-title">自定义商户金额操作</h3>
</div>
<div class="panel-body">
<label for="">
<span>操作账户:</span>
<select id="select-self-name" name="">
</select>
</label>
<label for="">
<span>操作类型:</span>
<select id="select-self-type" name="">
<option value="">请选择</option>
<option value="plus_amount">加款</option>
<option value="sub_amount">减款</option>
<option value="freeze_amount">冻结</option>
<option value="unfreeze_amount">解冻</option>
</select>
</label>
<label for="">
<span>操作金额:</span>
<input id="select-self-amount" placeholder="单位:元" type="text">
</label>
<input class="btn btn-primary" onclick="selfOperateAccount();" type="button" value="执行">
</div>
</div>
<div class="panel panel-success">
<div class="panel-heading">
<h3 class="panel-title">操作结果</h3>
</div>
<div class="panel-body">
<table class="table table-responsive table-bordered">
<thead>
<tr>
<td class="algin-right">结果</td>
<td><span id="operate-result">待处理......</span></td>
</tr>
</thead>
<tbody>
<tr>
<td class="algin-right">账户余额</td>
<td><span id="balance"> </span></td>
</tr>
<tr>
<td class="algin-right">结算金额</td>
<td><span id="settle-amount"></span></td>
</tr>
<tr>
<td class="algin-right">在途金额</td>
<td><span id="wait-amount"></span></td>
</tr>
<tr>
<td class="algin-right">冻结金额</td>
<td><span id="freeze-amount"></span></td>
</tr>
<tr>
<td class="algin-right">押款金额</td>
<td><span id="loan-amount"></span></td>
</tr>
<tr>
<td class="algin-right">代付中金额</td>
<td><span id="payfor-amount"></span></td>
</tr>
</tbody>
</table>
</div>
</div>
<script>
function getValues() {
let accountUid = $("#select-self-name").val();
let accountOperator = $("#select-self-type").val();
let amount = $("#select-self-amount").val();
return {
"accountUid": accountUid,
"accountOperator": accountOperator,
"amount": amount
};
}
function clearResult() {
$("#operate-result").html("待处理......");
$("#balance").html("");
$("#settle-amount").html("");
$("#wait-amount").html("");
$("#freeze-amount").html("");
$("#loan-amount").html("");
$("#payfor-amount").html("");
}
function randResult(res) {
let account = res.AccountList[0];
$("#operate-result").html(res.Msg);
$("#balance").html(account.Balance);
$("#settle-amount").html(account.SettleAmount);
$("#wait-amount").html(account.WaitAmount);
$("#freeze-amount").html(account.FreezeAmount);
$("#loan-amount").html(account.LoanAmount);
$("#payfor-amount").html(account.PayforAmount);
}
function selfOperateAccount() {
clearResult();
let dataJSON = getValues();
$.ajax({
url: "/account/operator",
data: dataJSON,
success: function (res) {
if (res.Code == 404) {
window.parent.location = "/login.html";
} else if (res.Code == -1) {
$("#operate-result").html(res.Msg);
} else {
randResult(res);
alert("当前用户的信息如下......");
}
},
error: function () {
alert("系统异常,请稍后再试")
}
});
}
function getAccount() {
let dataJSON = getValues();
$.ajax({
url: "/get/one/account",
data: dataJSON,
success: function (res) {
if (res.Code == 404) {
window.parent.location = "/login.html";
} else if (res.Code == -1) {
$("#operate-result").html(res.Msg);
} else {
randResult(res);
}
},
error: function () {
alert("系统异常,请稍后再试")
}
});
}
$("#select-self-name").change(function () {
clearResult();
let accountUid = $("#select-self-name").val();
if (accountUid === "" || accountUid.length <= 0) {
return false;
}
getAccount();
});
$("#select-self-type").click(function () {
// clearResult();
});
function setAccount() {
$.ajax({
url: "/get/all/account",
success: function (res) {
if (res.Code == 404) {
window.parent.location = "/login.html";
} else {
let str = '<option value="' + "" + '">' + "请选择" + '</option>';
for (let i = 0; i < res.AccountList.length; i++) {
let account = res.AccountList[i];
str = str + '<option value="' + account.AccountUid + '">' + account.AccountName + '</option>';
}
$("#select-self-name").html(str);
}
}
});
}
$(function () {
setAccount();
});
</script>
</body>
</html>