chore: update files
This commit is contained in:
@@ -33,12 +33,15 @@ type RoadInfo struct {
|
||||
Balance float64
|
||||
RequestAll int
|
||||
RequestSuccess int
|
||||
ProductCode string
|
||||
UpdateTime time.Time
|
||||
CreateTime time.Time
|
||||
PaymentHtml string
|
||||
TransactionType string
|
||||
TodayRequestAll int `json:"TodayRequestAll"`
|
||||
TodayRequestSuccess int
|
||||
IsAllowDifferentResend int
|
||||
TransactionType string
|
||||
PaymentHtml string
|
||||
IsRepeatSubmit int // 是否设置重复提交
|
||||
ProductCode string
|
||||
CreateTime time.Time
|
||||
UpdateTime time.Time
|
||||
}
|
||||
|
||||
const ROAD_INFO = "road_info"
|
||||
|
||||
272
views/road.html
272
views/road.html
@@ -1,10 +1,9 @@
|
||||
<!doctype html>
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta charset="utf-8" />
|
||||
<title>管理后台</title>
|
||||
<link href="../static/css/basic.css" rel="stylesheet" type="text/css">
|
||||
<link href="../static/css/basic.css" rel="stylesheet" type="text/css" />
|
||||
<script src="../static/js/filter.js"></script>
|
||||
<style media="screen" type="text/css">
|
||||
.search div {
|
||||
@@ -82,17 +81,34 @@
|
||||
<div class="search">
|
||||
<div>
|
||||
<span>通道名称</span>
|
||||
<input class="road-name-search" placeholder="模糊匹配" type="text" value="">
|
||||
<input
|
||||
class="road-name-search"
|
||||
placeholder="模糊匹配"
|
||||
type="text"
|
||||
value=""
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<span>产品名称</span>
|
||||
<input class="product-name-search" placeholder="模糊匹配" type="text" value="">
|
||||
<input
|
||||
class="product-name-search"
|
||||
placeholder="模糊匹配"
|
||||
type="text"
|
||||
value=""
|
||||
/>
|
||||
</div>
|
||||
<div>
|
||||
<button class="btn btn-default road-search" type="button">搜索</button>
|
||||
<button class="btn btn-default road-search" type="button">
|
||||
搜索
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<button class="btn btn-default btn-xs glyphicon glyphicon-plus add-road-button" type="button">添加通道</button>
|
||||
<button
|
||||
class="btn btn-default btn-xs glyphicon glyphicon-plus add-road-button"
|
||||
type="button"
|
||||
>
|
||||
添加通道
|
||||
</button>
|
||||
<div class="menu-table">
|
||||
<table>
|
||||
<thead class="thead-dark">
|
||||
@@ -116,8 +132,7 @@
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="road-table-body">
|
||||
</tbody>
|
||||
<tbody id="road-table-body"></tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- 分页插件 -->
|
||||
@@ -132,28 +147,32 @@
|
||||
</select>
|
||||
</li>
|
||||
|
||||
<li class="current_total_page">第<span class="current_page">0</span>/<span class="total_page">0</span>页</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="">
|
||||
<li class="jump_page">
|
||||
跳转 <input name="jump_page" type="text" value="" />
|
||||
<button class="btn btn-default" type="button">Go</button>
|
||||
</li>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="add-edit-road">
|
||||
<input class="road-uid" type="hidden" value="">
|
||||
<input class="road-uid" type="hidden" value="" />
|
||||
<fieldset>
|
||||
<legend style="width: 75px;">通道基本信息</legend>
|
||||
<legend style="width: 75px">通道基本信息</legend>
|
||||
<div>
|
||||
<label>
|
||||
<span>通道名称:</span>
|
||||
<input class="road-name" type="text" value="">
|
||||
<input class="road-name" type="text" value="" />
|
||||
<span class="star">*</span>
|
||||
</label>
|
||||
<label>
|
||||
<span>通道编码:</span>
|
||||
<input class="product-code" type="text" value="">
|
||||
<input class="product-code" type="text" value="" />
|
||||
<span class="star">*</span>
|
||||
</label>
|
||||
<label>
|
||||
@@ -196,14 +215,13 @@
|
||||
</label>
|
||||
<label>
|
||||
<span>备注: </span>
|
||||
<input class="road-remark" type="text" value="">
|
||||
<input class="road-remark" type="text" value="" />
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<span>产品名称:</span>
|
||||
<label>
|
||||
<select id="product-name">
|
||||
</select>
|
||||
<select id="product-name"></select>
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
@@ -213,39 +231,56 @@
|
||||
<option value="1">是</option>
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<span>卡号/卡密重复发送:</span>
|
||||
<select id="is-repeat-submit">
|
||||
<option value="0">否</option>
|
||||
<option value="1">是</option>
|
||||
</select>
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend style="width: 50px;">费用配置</legend>
|
||||
<legend style="width: 50px">费用配置</legend>
|
||||
<div>
|
||||
<span>成本费率: </span>
|
||||
<input class="basic-rate" placeholder="样例:1.2" type="text" value="">
|
||||
<input
|
||||
class="basic-rate"
|
||||
placeholder="样例:1.2"
|
||||
type="text"
|
||||
value=""
|
||||
/>
|
||||
<span class="star">*</span>
|
||||
<span>代付手续费: </span>
|
||||
<input class="settle-fee" placeholder="单位:元" type="text" value="">
|
||||
<input
|
||||
class="settle-fee"
|
||||
placeholder="单位:元"
|
||||
type="text"
|
||||
value=""
|
||||
/>
|
||||
<span class="star">*</span>
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend style="width: 50px;">额度设置</legend>
|
||||
<legend style="width: 50px">额度设置</legend>
|
||||
<div>
|
||||
<span>通道总额度: </span>
|
||||
<input class="road-total-limit" type="text" value="">
|
||||
<input class="road-total-limit" type="text" value="" />
|
||||
<span class="star">*</span>
|
||||
<span>每天额度: </span>
|
||||
<input class="road-everyday-limit" type="text" value="">
|
||||
<input class="road-everyday-limit" type="text" value="" />
|
||||
<span class="star">*</span>
|
||||
</div>
|
||||
<div>
|
||||
<span>单笔金额最小:</span>
|
||||
<input class="single-min-limit" type="text" value="">
|
||||
<input class="single-min-limit" type="text" value="" />
|
||||
<span class="star">*</span>
|
||||
<span>单笔金额最大:</span>
|
||||
<input class="single-max-limit" type="text" value="">
|
||||
<input class="single-max-limit" type="text" value="" />
|
||||
<span class="star">*</span>
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend style="width: 50px;">时间规则</legend>
|
||||
<legend style="width: 50px">时间规则</legend>
|
||||
<div>
|
||||
<span>开始时间:</span>
|
||||
<select id="road-start-hour">
|
||||
@@ -305,7 +340,7 @@
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend style="width: 110px;">参数配置JSON格式</legend>
|
||||
<legend style="width: 110px">参数配置JSON格式</legend>
|
||||
<div>
|
||||
<code>
|
||||
<textarea class="road-param-json"></textarea>
|
||||
@@ -330,21 +365,20 @@
|
||||
url: "/get/product",
|
||||
success: function (res) {
|
||||
if (res.Code === 404) {
|
||||
window.parent.location = "/login.html"
|
||||
window.parent.location = "/login.html";
|
||||
} else if (res.Code === -1) {
|
||||
|
||||
} else {
|
||||
let str = "";
|
||||
for (let key in res.ProductMap) {
|
||||
let v = res.ProductMap[key];
|
||||
str = str + '<option value="' + key + '">' + v + '</option>'
|
||||
str = str + '<option value="' + key + '">' + v + "</option>";
|
||||
}
|
||||
$("#product-name").html(str);
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
alert("系统异常,请稍后再试");
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -365,12 +399,11 @@
|
||||
if (res.Code == 404) {
|
||||
window.parent.location = "/login.html";
|
||||
} else {
|
||||
|
||||
$(".current_page").html(res.CurrentPage);
|
||||
$(".total_page").html(res.TotalPage);
|
||||
$("#display_count option").each(function () {
|
||||
if ($(this).text() == res.DisplayCount) {
|
||||
$(this).attr('selected', true);
|
||||
$(this).attr("selected", true);
|
||||
}
|
||||
});
|
||||
$(".jump_page input").val("");
|
||||
@@ -380,22 +413,85 @@
|
||||
let v = res.RoadInfoList[i];
|
||||
let t = "";
|
||||
if (v.Status === "unactive") {
|
||||
t = "<tr style=\"color: red;\">"
|
||||
t = '<tr style="color: red;">';
|
||||
} else {
|
||||
t = "<tr>";
|
||||
}
|
||||
let tmp = t + "<th>" + (res.StartIndex + i + 1) + "</th>" +
|
||||
"<th>" + v.RoadName + "</th>" + "<th>" + v.TransactionType + "</th>" + "<th>" + v.ProductName + "</th>" + "<th>" + v.ProductCode + "</th>" +
|
||||
"<th>" + v.BasicFee + "</th>" + "<th>" + v.Status + "</th>" + "<th>" + v.TotalLimit + "</th>" +
|
||||
"<th>" + v.TodayLimit + "</th>" + "<th>" + v.SingleMinLimit + "-" + v.SingleMaxLimit + "</th>" +
|
||||
"<th>" + v.StarHour + "-" + v.EndHour + "</th>" + "<th>" + v.TotalIncome + "</th>" + "<th>" + v.TodayIncome + "</th>" +
|
||||
"<th>" + v.TotalProfit + "</th>" + "<th>" + v.TodayProfit + "</th>" + "<th>" + v.RequestSuccess + "/" + v.RequestAll + '</th>';
|
||||
let tmp =
|
||||
t +
|
||||
"<th>" +
|
||||
(res.StartIndex + i + 1) +
|
||||
"</th>" +
|
||||
"<th>" +
|
||||
v.RoadName +
|
||||
"</th>" +
|
||||
"<th>" +
|
||||
v.TransactionType +
|
||||
"</th>" +
|
||||
"<th>" +
|
||||
v.ProductName +
|
||||
"</th>" +
|
||||
"<th>" +
|
||||
v.ProductCode +
|
||||
"</th>" +
|
||||
"<th>" +
|
||||
v.BasicFee +
|
||||
"</th>" +
|
||||
"<th>" +
|
||||
v.Status +
|
||||
"</th>" +
|
||||
"<th>" +
|
||||
v.TotalLimit +
|
||||
"</th>" +
|
||||
"<th>" +
|
||||
v.TodayLimit +
|
||||
"</th>" +
|
||||
"<th>" +
|
||||
v.SingleMinLimit +
|
||||
"-" +
|
||||
v.SingleMaxLimit +
|
||||
"</th>" +
|
||||
"<th>" +
|
||||
v.StarHour +
|
||||
"-" +
|
||||
v.EndHour +
|
||||
"</th>" +
|
||||
"<th>" +
|
||||
v.TotalIncome +
|
||||
"</th>" +
|
||||
"<th>" +
|
||||
v.TodayIncome +
|
||||
"</th>" +
|
||||
"<th>" +
|
||||
v.TotalProfit +
|
||||
"</th>" +
|
||||
"<th>" +
|
||||
v.TodayProfit +
|
||||
"</th>" +
|
||||
"<th>" +
|
||||
v.RequestSuccess +
|
||||
"/" +
|
||||
v.RequestAll +
|
||||
"</th>";
|
||||
tmp = tmp.replace("unactive", "冻结").replace("active", "激活");
|
||||
tmp = tmp + "<th>" + '<div class="btn-group" role="group" aria-label="...">' +
|
||||
'<button type="button" value="' + v.RoadUid + '" class="btn btn-default" onclick="editRoad(this.value);"><span class="glyphicon glyphicon-pencil"></span></button>' +
|
||||
'<button type="button" value="' + v.RoadUid + '" class="btn btn-default" onclick="updateRoadStatus(this.value);">' + "激活|冻结" + '</button>' +
|
||||
'<button type="button" value="' + v.RoadUid + '" class="btn btn-default" onclick="deleteRoad(this.value);"><span class="glyphicon glyphicon-trash"></span></button>' +
|
||||
'</div>' + "</th>" + "</tr>";
|
||||
tmp =
|
||||
tmp +
|
||||
"<th>" +
|
||||
'<div class="btn-group" role="group" aria-label="...">' +
|
||||
'<button type="button" value="' +
|
||||
v.RoadUid +
|
||||
'" class="btn btn-default" onclick="editRoad(this.value);"><span class="glyphicon glyphicon-pencil"></span></button>' +
|
||||
'<button type="button" value="' +
|
||||
v.RoadUid +
|
||||
'" class="btn btn-default" onclick="updateRoadStatus(this.value);">' +
|
||||
"激活|冻结" +
|
||||
"</button>" +
|
||||
'<button type="button" value="' +
|
||||
v.RoadUid +
|
||||
'" class="btn btn-default" onclick="deleteRoad(this.value);"><span class="glyphicon glyphicon-trash"></span></button>' +
|
||||
"</div>" +
|
||||
"</th>" +
|
||||
"</tr>";
|
||||
str = str + tmp;
|
||||
}
|
||||
|
||||
@@ -405,7 +501,7 @@
|
||||
|
||||
error: function () {
|
||||
alert("系统异常,请稍后再试");
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -484,7 +580,7 @@
|
||||
$.ajax({
|
||||
url: "/get/oneRoad",
|
||||
data: {
|
||||
"roadUid": roadUid
|
||||
roadUid: roadUid,
|
||||
},
|
||||
success: function (res) {
|
||||
if (res.Code === 404) {
|
||||
@@ -497,11 +593,12 @@
|
||||
$(".road-name").val(v.RoadName);
|
||||
$(".product-code").val(v.ProductCode);
|
||||
$(".payment-html").val(v.PaymentHtml);
|
||||
$(".transaction-type").val(v.TransactionType)
|
||||
$(".transaction-type").val(v.TransactionType);
|
||||
$(".road-name").prop("readonly", "readonly");
|
||||
$(".road-remark").val(v.Remark);
|
||||
$("#product-name").val(v.ProductUid);
|
||||
$("#product-name").val(v.ProductUid);IsRepeatSubmit
|
||||
$("#is-allow-different-resend").val(v.IsAllowDifferentResend);
|
||||
$("#is-repeat-submit").val(v.IsRepeatSubmit);
|
||||
$(".basic-rate").val(v.BasicFee);
|
||||
$(".settle-fee").val(v.SettleFee);
|
||||
$(".road-total-limit").val(v.TotalLimit);
|
||||
@@ -514,27 +611,27 @@
|
||||
$(".road-record").hide();
|
||||
$(".add-edit-road").show();
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
function updateRoadStatus(roadUid) {
|
||||
$.ajax({
|
||||
url: "/update/roadStatus",
|
||||
data: { "roadUid": roadUid },
|
||||
data: { roadUid: roadUid },
|
||||
success: function (res) {
|
||||
if (res.Code === 404) {
|
||||
window.parent.location = "/login.html";
|
||||
} else if (res.Code !== 200) {
|
||||
alert("状态更新失败");
|
||||
} else {
|
||||
alert("更新状态成功")
|
||||
alert("更新状态成功");
|
||||
showRoadRecord(getRoadCutPagevalues());
|
||||
}
|
||||
},
|
||||
error: function (res) {
|
||||
alert("系统异常,请稍后再试");
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -552,7 +649,7 @@
|
||||
if (res.Code === 404) {
|
||||
window.parent.location = "/login.html";
|
||||
} else if (res.Code !== 200) {
|
||||
alert("删除失败")
|
||||
alert("删除失败");
|
||||
} else {
|
||||
alert("删除成功");
|
||||
showRoadRecord(getRoadCutPagevalues());
|
||||
@@ -560,7 +657,7 @@
|
||||
},
|
||||
error: function (res) {
|
||||
alert("系统异常,请稍后再试");
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -573,16 +670,16 @@
|
||||
let roadUid = $(".road-number-search").val();
|
||||
let productName = $(".product-name-search").val();
|
||||
let productUid = $(".product-number-search").val();
|
||||
return dataJSON = {
|
||||
"roadName": roadName,
|
||||
"roadUid": roadUid,
|
||||
"productName": productName,
|
||||
"productUid": productUid,
|
||||
"displayCount": displayCount,
|
||||
"currentPage": currentPage,
|
||||
"totalPage": totalPage,
|
||||
"jumpPage": jumpPage
|
||||
};
|
||||
return (dataJSON = {
|
||||
roadName: roadName,
|
||||
roadUid: roadUid,
|
||||
productName: productName,
|
||||
productUid: productUid,
|
||||
displayCount: displayCount,
|
||||
currentPage: currentPage,
|
||||
totalPage: totalPage,
|
||||
jumpPage: jumpPage,
|
||||
});
|
||||
}
|
||||
|
||||
function clearRoadValues() {
|
||||
@@ -606,7 +703,7 @@
|
||||
try {
|
||||
// statements
|
||||
var obj = JSON.parse(str);
|
||||
if (typeof obj == 'object' && obj) {
|
||||
if (typeof obj == "object" && obj) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
@@ -635,35 +732,36 @@
|
||||
let paymentHtml = $(".payment-html").val();
|
||||
let transactionType = $(".transaction-type").val();
|
||||
let isAllowDifferentResend = $("#is-allow-different-resend").val();
|
||||
let isRepeatSubmit = $("#is-repeat-submit").val();
|
||||
|
||||
if (params.length > 0) {
|
||||
if (!isJSON(params)) {
|
||||
alert("参数配置不是json格式");
|
||||
return
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
"roadUid": roadUid,
|
||||
"roadName": roadName,
|
||||
"roadRemark": roadRemark,
|
||||
"productName": productName,
|
||||
"basicRate": basicRate,
|
||||
"settleFee": settleFee,
|
||||
"roadTotalLimit": roadTotalLimit,
|
||||
"roadEverydayLimit": roadEverydayLimit,
|
||||
"singleMinLimit": singleMinLimit,
|
||||
"singleMaxLimit": singleMaxLimit,
|
||||
"startHour": startHour,
|
||||
"endHour": endHour,
|
||||
"params": params,
|
||||
"productCode": productCode,
|
||||
"paymentHtml": paymentHtml,
|
||||
"transactionType": transactionType,
|
||||
"isAllowDifferentResend": isAllowDifferentResend
|
||||
roadUid: roadUid,
|
||||
roadName: roadName,
|
||||
roadRemark: roadRemark,
|
||||
productName: productName,
|
||||
basicRate: basicRate,
|
||||
settleFee: settleFee,
|
||||
roadTotalLimit: roadTotalLimit,
|
||||
roadEverydayLimit: roadEverydayLimit,
|
||||
singleMinLimit: singleMinLimit,
|
||||
singleMaxLimit: singleMaxLimit,
|
||||
startHour: startHour,
|
||||
endHour: endHour,
|
||||
params: params,
|
||||
productCode: productCode,
|
||||
paymentHtml: paymentHtml,
|
||||
transactionType: transactionType,
|
||||
isAllowDifferentResend: isAllowDifferentResend,
|
||||
isRepeatSubmit: isRepeatSubmit,
|
||||
};
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user