HaniBlindBox/server/php/app/admin/view/user_rank/index.html
2026-01-01 20:46:07 +08:00

116 lines
5.6 KiB
HTML

{include file="Public:header2"/}
<body>
<div class="layui-fluid">
<div class="layui-row layui-col-space15">
<div class="layui-col-md12">
<div class="layui-card">
<div class="layui-card-header">用户排行榜</div>
<div class="layui-card-body">
<!-- 排行榜类型选择 -->
<div class="layui-form">
<div class="layui-form-item">
<div class="layui-input-block" style="margin-left: 0;">
<input type="radio" name="rank_type" value="invite" title="邀请新人排行榜" {if $type=='invite'}checked{/if} lay-filter="rank_type">
<input type="radio" name="rank_type" value="loss" title="亏损补贴排行榜" {if $type=='loss'}checked{/if} lay-filter="rank_type">
<input type="radio" name="rank_type" value="dadajuan" title="达达卷排行榜" {if $type=='dadajuan'}checked{/if} lay-filter="rank_type">
<input type="radio" name="rank_type" value="diamond" title="钻石排行榜" {if $type=='diamond'}checked{/if} lay-filter="rank_type">
<input type="radio" name="rank_type" value="integral" title="UU币排行榜" {if $type=='integral'}checked{/if} lay-filter="rank_type">
</div>
</div>
</div>
<!-- 数据表格 -->
<table class="layui-table">
<thead>
<tr>
<th>排名</th>
<th>用户ID</th>
<th>用户昵称</th>
<th>头像</th>
<th class="value-title">
{if $type=='invite'}邀请人数
{elseif $type=='loss'}亏损金额
{elseif $type=='dadajuan'}达达卷数量
{elseif $type=='diamond'}钻石数量
{elseif $type=='integral'}UU币数量
{/if}
</th>
<!-- 亏损排行榜特有的列 -->
{if $type=='loss'}
<th>消耗金额</th>
<th>达达卷金额</th>
<th>出货金额</th>
<th>亏损率</th>
{/if}
</tr>
</thead>
<tbody>
{volist name="list" id="vo"}
<tr>
<td>{$vo.rank}</td>
<td>{$vo.user_id}</td>
<td>{$vo.nickname}</td>
<td>
<img src="{$vo.headimg}" style="width: 40px; height: 40px; border-radius: 50%;">
</td>
<td class="value-content">{$vo.value} {$vo.unit}</td>
<!-- 亏损排行榜特有的列 -->
{if $type=='loss'}
<td>{$vo.consume_money} 元</td>
<td>{$vo.dada_money} 元</td>
<td>{$vo.output_money} 元</td>
<td>{$vo.loss_rate}%</td>
{/if}
</tr>
{/volist}
</tbody>
</table>
<!-- 分页 -->
<div id="page"></div>
</div>
</div>
</div>
</div>
</div>
{include file="Public:footer"/}
<script>
layui.use(['form', 'laypage'], function() {
var form = layui.form;
var laypage = layui.laypage;
// 排行榜类型切换
form.on('radio(rank_type)', function(data) {
var type = data.value;
// 跳转到对应类型的排行榜页面
window.location.href = '{:url("/admin/user_rank")}?type=' + type;
});
// 初始化分页
laypage.render({
elem: 'page',
count: {$list|count},
limit: {$limit},
curr: {$page},
layout: ['count', 'prev', 'page', 'next', 'limit', 'skip'],
jump: function(obj, first) {
if (!first) {
// 页码或每页显示条数变更时,跳转到对应页
var url = '{:url("/admin/user_rank")}?type={$type}';
url += '&page=' + obj.curr;
url += '&limit=' + obj.limit;
if ('{$type}' === 'loss') {
url += '';
}
window.location.href = url;
}
}
});
});
</script>
</body>
</html>