后台优化
This commit is contained in:
138
application/adminghd/view/dashboard/index.html
Normal file
138
application/adminghd/view/dashboard/index.html
Normal file
@@ -0,0 +1,138 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="renderer" content="webkit|ie-comp|ie-stand">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
|
||||
<title>系统概览</title>
|
||||
<link rel="stylesheet" href="/static/adminghd/layui/css/layui.css">
|
||||
<style>
|
||||
body{
|
||||
background:#f5f7fb;
|
||||
padding:24px 24px 40px;
|
||||
box-sizing:border-box;
|
||||
font-family:"Microsoft YaHei",-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
|
||||
}
|
||||
.dash-card{
|
||||
background:#fff;
|
||||
border-radius:10px;
|
||||
box-shadow:0 10px 30px rgba(15,35,52,0.06);
|
||||
padding:20px 24px;
|
||||
margin-bottom:20px;
|
||||
}
|
||||
.dash-title{
|
||||
font-size:18px;
|
||||
font-weight:600;
|
||||
color:#1f2d3d;
|
||||
margin-bottom:4px;
|
||||
}
|
||||
.dash-sub{
|
||||
font-size:12px;
|
||||
color:#9aa4b1;
|
||||
margin-bottom:18px;
|
||||
}
|
||||
.dash-grid{
|
||||
display:flex;
|
||||
flex-wrap:wrap;
|
||||
gap:16px;
|
||||
}
|
||||
.dash-item{
|
||||
flex:1 1 200px;
|
||||
min-width:200px;
|
||||
background:#f8fafc;
|
||||
border-radius:8px;
|
||||
padding:14px 16px;
|
||||
cursor:pointer;
|
||||
transition:all 0.3s;
|
||||
}
|
||||
.dash-item:hover{
|
||||
background:#f0f4f8;
|
||||
transform:translateY(-2px);
|
||||
box-shadow:0 4px 12px rgba(15,35,52,0.1);
|
||||
}
|
||||
.dash-item-label{
|
||||
font-size:13px;
|
||||
color:#9aa4b1;
|
||||
}
|
||||
.dash-item-value{
|
||||
margin-top:6px;
|
||||
font-size:22px;
|
||||
font-weight:600;
|
||||
color:#1f2d3d;
|
||||
}
|
||||
.dash-item-desc{
|
||||
margin-top:4px;
|
||||
font-size:12px;
|
||||
color:#b0b7c3;
|
||||
}
|
||||
.dash-empty{
|
||||
margin-top:10px;
|
||||
font-size:13px;
|
||||
color:#9aa4b1;
|
||||
}
|
||||
.loading{
|
||||
text-align:center;
|
||||
padding:40px;
|
||||
color:#9aa4b1;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="dash-card">
|
||||
<div class="dash-title">欢迎使用后台管理系统</div>
|
||||
<div class="dash-sub">这里是系统概览,实时展示系统统计数据。</div>
|
||||
<div class="dash-grid" id="dashGrid">
|
||||
<div class="loading">数据加载中...</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="/static/adminghd/js/jquery.js"></script>
|
||||
<script>
|
||||
$(function(){
|
||||
// 加载统计数据
|
||||
loadStatistics();
|
||||
|
||||
function loadStatistics(){
|
||||
$.ajax({
|
||||
url: '/adminghd/Dashboard/getStatistics',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
success: function(res){
|
||||
if(res.status == 1){
|
||||
renderStatistics(res.data);
|
||||
} else {
|
||||
$('#dashGrid').html('<div class="loading">数据加载失败:' + res.msg + '</div>');
|
||||
}
|
||||
},
|
||||
error: function(){
|
||||
$('#dashGrid').html('<div class="loading">数据加载失败,请稍后重试</div>');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function renderStatistics(data){
|
||||
var html = `
|
||||
<div class="dash-item" onclick="parent.location.href='/adminghd/wechatinfro/wechatUserList'">
|
||||
<div class="dash-item-label">小程序注册用户</div>
|
||||
<div class="dash-item-value">${data.user_count}</div>
|
||||
<div class="dash-item-desc">今日新增:${data.today_user_count} 人</div>
|
||||
</div>
|
||||
<div class="dash-item" onclick="parent.location.href='/adminghd/wechatset/wechatRealTimeInfo'">
|
||||
<div class="dash-item-label">首页资讯数量</div>
|
||||
<div class="dash-item-value">${data.info_count}</div>
|
||||
<div class="dash-item-desc">可在「咨询管理」菜单中维护展示内容</div>
|
||||
</div>
|
||||
<div class="dash-item" onclick="parent.location.href='/adminghd/wechatinfro/wechatRecordList'">
|
||||
<div class="dash-item-label">总计算次数</div>
|
||||
<div class="dash-item-value">${data.total_calculate_count}</div>
|
||||
<div class="dash-item-desc">最近一次:${data.last_calculate_time}</div>
|
||||
</div>
|
||||
`;
|
||||
$('#dashGrid').html(html);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user