样式修改完成,待测试

This commit is contained in:
rain
2026-07-07 17:07:34 +08:00
parent 0f6ed0cad3
commit 8a6a8acab7
32 changed files with 2097 additions and 505 deletions
+48 -44
View File
@@ -1,4 +1,4 @@
<!doctype html>
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
@@ -90,6 +90,11 @@
<div class="table-section-title">
<i class="layui-icon layui-icon-group"></i> 下级用户列表
</div>
<div class="promo-filter" id="distStatusFilter">
<button class="active" type="button" data-status="0">未转余额</button>
<button type="button" data-status="1">已转余额</button>
<button type="button" data-status="2">已提现</button>
</div>
<table id="distTable" lay-filter="distTable" lay-even></table>
<div id="distPage"></div>
</div>
@@ -131,6 +136,9 @@
var $ = layui.$;
var table = layui.table;
var laypage = layui.laypage;
var currentPage = 1;
var pageSize = 20;
var currentStatus = 0;
// Load page config
CommonUtil.loadPageConfig({ ads: false, links: false });
@@ -206,10 +214,11 @@
function loadDistList(pageNum) {
currentPage = pageNum;
ApiClient.get(
ApiClient.API.referralInviteList,
ApiClient.API.referralRebateList,
{
pageNum: pageNum,
pageSize: pageSize,
status: currentStatus,
},
{
headers: CommonUtil.authHeaders(),
@@ -217,8 +226,9 @@
)
.then(function (res) {
if (res.code === 0 && res.data) {
renderTable(res.data.records || []);
renderPagination(res.data.total || 0);
var records = ApiClient.asArray(res.data.records || res.data.rows || res.data.list || res.data);
renderTable(records);
renderPagination(res.data.total || res.data.totalRow || records.length || 0);
} else {
layer.msg(res.msg || "获取数据失败", { icon: 2 });
}
@@ -240,73 +250,60 @@
elem: "#distTable",
cols: [
[
{ field: "id", title: "记录ID", width: 140, align: "center" },
{
field: "nickName",
title: "昵称",
width: 160,
align: "center",
},
{
field: "phoneNumber",
title: "手机号",
title: "订阅用户",
width: 160,
align: "center",
templet: function (d) {
if (d.phoneNumber) {
return d.phoneNumber.replace(
/(\d{3})\d{4}(\d{4})/,
"$1****$2",
);
}
return "--";
return CommonUtil.escapeHtml(d.nickName || d.userName || d.inviteeName || "--");
},
},
{
field: "level",
title: "层级",
width: 100,
field: "articleTitle",
title: "文章/彩种",
minWidth: 180,
align: "center",
templet: function (d) {
return d.level === 1
? '<span style="color:#102b6a;font-weight:600;">一级</span>'
: '<span style="color:#5b2c8e;font-weight:600;">二级</span>';
return CommonUtil.escapeHtml(d.menuName || d.articleTitle || d.title || "--");
},
},
{
field: "createTime",
title: "注册时间",
width: 180,
field: "expertName",
title: "专家",
width: 140,
align: "center",
templet: function (d) {
return d.createTime
? d.createTime.substring(0, 19).replace("T", " ")
: "--";
return CommonUtil.escapeHtml(d.nickNameExpert || d.expertName || "--");
},
},
{
field: "totalRecharge",
title: "累计充值",
field: "amount",
title: "订阅价格",
width: 130,
align: "center",
templet: function (d) {
return (
'<span style="color:#f15a22;font-weight:600;">' +
(d.totalRecharge || 0).toFixed(2) +
"</span>"
);
return CommonUtil.escapeHtml(d.subscriptionPrice || d.orderAmount || d.amount || "0.00");
},
},
{
field: "distributionIncome",
title: "分销收益",
field: "rebateMoney",
title: "分销金额",
width: 130,
align: "center",
templet: function (d) {
return (
'<span style="color:#fdb933;font-weight:600;">' +
(d.distributionIncome || 0).toFixed(2) +
"</span>"
);
return '<span style="color:#f15a22;font-weight:600;">' + CommonUtil.escapeHtml(d.rebateMoney || d.rebateAmount || d.money || "0.00") + "</span>";
},
},
{
field: "status",
title: "状态",
width: 130,
align: "center",
templet: function (d) {
var statusMap = { 0: "未转余额", 1: "已转余额", 2: "已提现" };
return CommonUtil.escapeHtml(d.statusText || statusMap[d.status] || statusMap[d.withdrawStatus] || "--");
},
},
],
@@ -333,6 +330,13 @@
},
});
}
$("#distStatusFilter").on("click", "button", function () {
$("#distStatusFilter button").removeClass("active");
$(this).addClass("active");
currentStatus = Number($(this).data("status")) || 0;
loadDistList(1);
});
});
</script>
</body>