初始化
@ -27,7 +27,7 @@
|
||||
<div class="stat-icon">📦</div>
|
||||
</div> -->
|
||||
</div>
|
||||
|
||||
<!--
|
||||
<div class="quick-actions">
|
||||
<h2>快捷操作</h2>
|
||||
<div class="action-buttons">
|
||||
@ -47,7 +47,7 @@
|
||||
<i class="fas fa-broom"></i>清除缓存
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<div class="recent-activity">
|
||||
<h2>最近动态</h2>
|
||||
@ -79,14 +79,14 @@
|
||||
<h2>文章统计</h2>
|
||||
<div id="articleStats" class="chart-container"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<script src="__JS__/echarts.min.js"></script>
|
||||
<script>
|
||||
function updateTime() {
|
||||
function updateTime() {
|
||||
var now = new Date();
|
||||
var year = now.getFullYear();
|
||||
var month = now.getMonth() + 1;
|
||||
@ -95,7 +95,7 @@ function updateTime() {
|
||||
var minutes = now.getMinutes();
|
||||
var seconds = now.getSeconds();
|
||||
|
||||
var padZero = function(num) {
|
||||
var padZero = function (num) {
|
||||
return num < 10 ? '0' + num : num;
|
||||
};
|
||||
|
||||
@ -107,10 +107,10 @@ function updateTime() {
|
||||
padZero(seconds);
|
||||
|
||||
document.getElementById('current-time').innerHTML = timeString;
|
||||
}
|
||||
}
|
||||
|
||||
// 获取用户统计数据
|
||||
function getUserCounts() {
|
||||
// 获取用户统计数据
|
||||
function getUserCounts() {
|
||||
fetch('{:url("users/counts")}')
|
||||
.then(response => response.json())
|
||||
.then(res => {
|
||||
@ -143,10 +143,10 @@ function getUserCounts() {
|
||||
console.error('获取用户统计失败:', error);
|
||||
document.querySelector('.stat-card:nth-child(1) .stat-value').textContent = '0';
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// 获取文章统计数据
|
||||
function getArticleCounts() {
|
||||
// 获取文章统计数据
|
||||
function getArticleCounts() {
|
||||
fetch('{:url("articles/counts")}')
|
||||
.then(response => response.json())
|
||||
.then(res => {
|
||||
@ -179,56 +179,56 @@ function getArticleCounts() {
|
||||
console.error('获取文章统计失败:', error);
|
||||
document.querySelector('.stat-card:nth-child(3) .stat-value').textContent = '0';
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// // 获取资源统计数据
|
||||
// function getResourcesCounts() {
|
||||
// fetch('{:url("resources/counts")}')
|
||||
// .then(response => response.json())
|
||||
// .then(res => {
|
||||
// // console.log('资源统计接口返回数据:', res);
|
||||
// if (res.code === 0 && res.data) {
|
||||
// // 更新资源总数
|
||||
// document.querySelector('.stat-card:nth-child(4) .stat-value').textContent = res.data.total.toLocaleString();
|
||||
// // 获取资源统计数据
|
||||
// function getResourcesCounts() {
|
||||
// fetch('{:url("resources/counts")}')
|
||||
// .then(response => response.json())
|
||||
// .then(res => {
|
||||
// // console.log('资源统计接口返回数据:', res);
|
||||
// if (res.code === 0 && res.data) {
|
||||
// // 更新资源总数
|
||||
// document.querySelector('.stat-card:nth-child(4) .stat-value').textContent = res.data.total.toLocaleString();
|
||||
|
||||
// // 更新资源统计图表
|
||||
// if (window.resourceChart) {
|
||||
// window.resourceChart.setOption({
|
||||
// xAxis: {
|
||||
// data: res.data.dates
|
||||
// },
|
||||
// series: [{
|
||||
// name: '新增资源',
|
||||
// data: res.data.counts
|
||||
// }, {
|
||||
// name: '总资源数',
|
||||
// data: res.data.totalCounts
|
||||
// }]
|
||||
// });
|
||||
// }
|
||||
// } else {
|
||||
// console.warn('资源统计接口返回异常:', res);
|
||||
// document.querySelector('.stat-card:nth-child(4) .stat-value').textContent = '0';
|
||||
// }
|
||||
// })
|
||||
// .catch(error => {
|
||||
// console.error('获取资源统计失败:', error);
|
||||
// document.querySelector('.stat-card:nth-child(4) .stat-value').textContent = '0';
|
||||
// });
|
||||
// }
|
||||
// // 更新资源统计图表
|
||||
// if (window.resourceChart) {
|
||||
// window.resourceChart.setOption({
|
||||
// xAxis: {
|
||||
// data: res.data.dates
|
||||
// },
|
||||
// series: [{
|
||||
// name: '新增资源',
|
||||
// data: res.data.counts
|
||||
// }, {
|
||||
// name: '总资源数',
|
||||
// data: res.data.totalCounts
|
||||
// }]
|
||||
// });
|
||||
// }
|
||||
// } else {
|
||||
// console.warn('资源统计接口返回异常:', res);
|
||||
// document.querySelector('.stat-card:nth-child(4) .stat-value').textContent = '0';
|
||||
// }
|
||||
// })
|
||||
// .catch(error => {
|
||||
// console.error('获取资源统计失败:', error);
|
||||
// document.querySelector('.stat-card:nth-child(4) .stat-value').textContent = '0';
|
||||
// });
|
||||
// }
|
||||
|
||||
updateTime();
|
||||
setInterval(updateTime, 1000);
|
||||
updateTime();
|
||||
setInterval(updateTime, 1000);
|
||||
|
||||
// 页面加载完成后获取统计数据
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
// 页面加载完成后获取统计数据
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
getUserCounts();
|
||||
getArticleCounts();
|
||||
// getResourcesCounts();
|
||||
});
|
||||
});
|
||||
|
||||
// 访问趋势图表
|
||||
function initVisitTrend() {
|
||||
// 访问趋势图表
|
||||
function initVisitTrend() {
|
||||
var chart = echarts.init(document.getElementById('visitTrend'));
|
||||
var option = {
|
||||
tooltip: {
|
||||
@ -246,15 +246,15 @@ function initVisitTrend() {
|
||||
bottom: '3%',
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
data: {$chartData.visitTrend.dates|json_encode|raw},
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: '#e2e8f0'
|
||||
}
|
||||
}
|
||||
},
|
||||
// xAxis: {
|
||||
// type: 'category',
|
||||
// data: { $chartData.visitTrend.dates | json_encode | raw },
|
||||
// axisLine: {
|
||||
// lineStyle: {
|
||||
// color: '#e2e8f0'
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
axisLine: {
|
||||
@ -268,258 +268,261 @@ function initVisitTrend() {
|
||||
}
|
||||
}
|
||||
},
|
||||
series: [{
|
||||
name: '访问量',
|
||||
data: {$chartData.visitTrend.visits|json_encode|raw},
|
||||
type: 'line',
|
||||
smooth: true,
|
||||
areaStyle: {
|
||||
opacity: 0.1
|
||||
},
|
||||
itemStyle: {
|
||||
color: '#3881fd'
|
||||
},
|
||||
lineStyle: {
|
||||
width: 3
|
||||
}
|
||||
}, {
|
||||
name: '独立访客',
|
||||
data: {$chartData.visitTrend.uvs|json_encode|raw},
|
||||
type: 'line',
|
||||
smooth: true,
|
||||
itemStyle: {
|
||||
color: '#10b981'
|
||||
},
|
||||
lineStyle: {
|
||||
width: 3
|
||||
}
|
||||
}]
|
||||
// series: [{
|
||||
// name: '访问量',
|
||||
// data: { $chartData.visitTrend.visits | json_encode | raw },
|
||||
// type: 'line',
|
||||
// smooth: true,
|
||||
// areaStyle: {
|
||||
// opacity: 0.1
|
||||
// },
|
||||
// itemStyle: {
|
||||
// color: '#3881fd'
|
||||
// },
|
||||
// lineStyle: {
|
||||
// width: 3
|
||||
// }
|
||||
// },
|
||||
// {
|
||||
// name: '独立访客',
|
||||
// data: { $chartData.visitTrend.uvs | json_encode | raw },
|
||||
// type: 'line',
|
||||
// smooth: true,
|
||||
// itemStyle: {
|
||||
// color: '#10b981'
|
||||
// },
|
||||
// lineStyle: {
|
||||
// width: 3
|
||||
// }
|
||||
// }
|
||||
// ]
|
||||
};
|
||||
chart.setOption(option);
|
||||
}
|
||||
|
||||
// 用户增长图表
|
||||
function initUserGrowth() {
|
||||
var chart = echarts.init(document.getElementById('userGrowth'));
|
||||
var option = {
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'cross',
|
||||
label: {
|
||||
backgroundColor: '#6a7985'
|
||||
}
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
data: ['新增用户', '总用户数']
|
||||
},
|
||||
grid: {
|
||||
left: '3%',
|
||||
right: '4%',
|
||||
bottom: '3%',
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
boundaryGap: false,
|
||||
data: {$chartData.userGrowth.dates|json_encode|raw}
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value'
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '新增用户',
|
||||
type: 'bar',
|
||||
data: {$chartData.userGrowth.newUsers|json_encode|raw},
|
||||
itemStyle: {
|
||||
color: '#3881fd'
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '总用户数',
|
||||
type: 'line',
|
||||
smooth: true,
|
||||
data: {$chartData.userGrowth.totalUsers|json_encode|raw},
|
||||
itemStyle: {
|
||||
color: '#10b981'
|
||||
},
|
||||
lineStyle: {
|
||||
width: 3
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
chart.setOption(option);
|
||||
}
|
||||
|
||||
// 资源统计图表
|
||||
function initResourceStats() {
|
||||
var chart = echarts.init(document.getElementById('resourceStats'));
|
||||
var option = {
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'cross',
|
||||
label: {
|
||||
backgroundColor: '#6a7985'
|
||||
}
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
data: ['新增资源', '总资源数', '下载量']
|
||||
},
|
||||
grid: {
|
||||
left: '3%',
|
||||
right: '4%',
|
||||
bottom: '3%',
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
boundaryGap: false,
|
||||
data: {$chartData.resourceStats.dates|json_encode|raw}
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value'
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '新增资源',
|
||||
type: 'bar',
|
||||
data: {$chartData.resourceStats.newResources|json_encode|raw},
|
||||
itemStyle: {
|
||||
color: '#3881fd'
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '总资源数',
|
||||
type: 'line',
|
||||
smooth: true,
|
||||
data: {$chartData.resourceStats.totalResources|json_encode|raw},
|
||||
itemStyle: {
|
||||
color: '#10b981'
|
||||
},
|
||||
lineStyle: {
|
||||
width: 3
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '下载量',
|
||||
type: 'line',
|
||||
smooth: true,
|
||||
data: {$chartData.resourceStats.downloads|json_encode|raw},
|
||||
itemStyle: {
|
||||
color: '#f59e0b'
|
||||
},
|
||||
lineStyle: {
|
||||
width: 3
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
chart.setOption(option);
|
||||
}
|
||||
|
||||
// 文章统计图表
|
||||
function initArticleStats() {
|
||||
var chart = echarts.init(document.getElementById('articleStats'));
|
||||
var option = {
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'cross',
|
||||
label: {
|
||||
backgroundColor: '#6a7985'
|
||||
}
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
data: ['新增文章', '总文章数', '浏览量']
|
||||
},
|
||||
grid: {
|
||||
left: '3%',
|
||||
right: '4%',
|
||||
bottom: '3%',
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
boundaryGap: false,
|
||||
data: {$chartData.articleStats.dates|json_encode|raw}
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value'
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '新增文章',
|
||||
type: 'bar',
|
||||
data: {$chartData.articleStats.newArticles|json_encode|raw},
|
||||
itemStyle: {
|
||||
color: '#3881fd'
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '总文章数',
|
||||
type: 'line',
|
||||
smooth: true,
|
||||
data: {$chartData.articleStats.totalArticles|json_encode|raw},
|
||||
itemStyle: {
|
||||
color: '#10b981'
|
||||
},
|
||||
lineStyle: {
|
||||
width: 3
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '浏览量',
|
||||
type: 'line',
|
||||
smooth: true,
|
||||
data: {$chartData.articleStats.views|json_encode|raw},
|
||||
itemStyle: {
|
||||
color: '#f59e0b'
|
||||
},
|
||||
lineStyle: {
|
||||
width: 3
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
chart.setOption(option);
|
||||
}
|
||||
|
||||
// 初始化所有图表
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
// 确保ECharts已加载
|
||||
if (typeof echarts === 'undefined') {
|
||||
console.error('ECharts未加载');
|
||||
return;
|
||||
}
|
||||
|
||||
// 初始化图表
|
||||
try {
|
||||
initVisitTrend();
|
||||
initUserGrowth();
|
||||
// initResourceStats();
|
||||
initArticleStats();
|
||||
// 用户增长图表
|
||||
// function initUserGrowth() {
|
||||
// var chart = echarts.init(document.getElementById('userGrowth'));
|
||||
// var option = {
|
||||
// tooltip: {
|
||||
// trigger: 'axis',
|
||||
// axisPointer: {
|
||||
// type: 'cross',
|
||||
// label: {
|
||||
// backgroundColor: '#6a7985'
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
// legend: {
|
||||
// data: ['新增用户', '总用户数']
|
||||
// },
|
||||
// grid: {
|
||||
// left: '3%',
|
||||
// right: '4%',
|
||||
// bottom: '3%',
|
||||
// containLabel: true
|
||||
// },
|
||||
// xAxis: {
|
||||
// type: 'category',
|
||||
// boundaryGap: false,
|
||||
// data: { $chartData.userGrowth.dates | json_encode | raw }
|
||||
// },
|
||||
// yAxis: {
|
||||
// type: 'value'
|
||||
// },
|
||||
// series: [
|
||||
// {
|
||||
// name: '新增用户',
|
||||
// type: 'bar',
|
||||
// data: { $chartData.userGrowth.newUsers | json_encode | raw },
|
||||
// itemStyle: {
|
||||
// color: '#3881fd'
|
||||
// }
|
||||
// },
|
||||
// {
|
||||
// name: '总用户数',
|
||||
// type: 'line',
|
||||
// smooth: true,
|
||||
// data: { $chartData.userGrowth.totalUsers | json_encode | raw },
|
||||
// itemStyle: {
|
||||
// color: '#10b981'
|
||||
// },
|
||||
// lineStyle: {
|
||||
// width: 3
|
||||
// }
|
||||
// }
|
||||
// ]
|
||||
// };
|
||||
// chart.setOption(option);
|
||||
// }
|
||||
|
||||
// 监听窗口大小变化,重绘图表
|
||||
window.addEventListener('resize', function() {
|
||||
var charts = document.querySelectorAll('.chart-container');
|
||||
charts.forEach(function(chart) {
|
||||
var instance = echarts.getInstanceByDom(chart);
|
||||
if (instance) {
|
||||
instance.resize();
|
||||
}
|
||||
});
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('初始化图表失败:', error);
|
||||
}
|
||||
});
|
||||
</script><script src="__STATIC__/js/jquery.min.js"></script>
|
||||
// 资源统计图表
|
||||
// function initResourceStats() {
|
||||
// var chart = echarts.init(document.getElementById('resourceStats'));
|
||||
// var option = {
|
||||
// tooltip: {
|
||||
// trigger: 'axis',
|
||||
// axisPointer: {
|
||||
// type: 'cross',
|
||||
// label: {
|
||||
// backgroundColor: '#6a7985'
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
// legend: {
|
||||
// data: ['新增资源', '总资源数', '下载量']
|
||||
// },
|
||||
// grid: {
|
||||
// left: '3%',
|
||||
// right: '4%',
|
||||
// bottom: '3%',
|
||||
// containLabel: true
|
||||
// },
|
||||
// xAxis: {
|
||||
// type: 'category',
|
||||
// boundaryGap: false,
|
||||
// data: { $chartData.resourceStats.dates | json_encode | raw }
|
||||
// },
|
||||
// yAxis: {
|
||||
// type: 'value'
|
||||
// },
|
||||
// series: [
|
||||
// {
|
||||
// name: '新增资源',
|
||||
// type: 'bar',
|
||||
// data: { $chartData.resourceStats.newResources | json_encode | raw },
|
||||
// itemStyle: {
|
||||
// color: '#3881fd'
|
||||
// }
|
||||
// },
|
||||
// {
|
||||
// name: '总资源数',
|
||||
// type: 'line',
|
||||
// smooth: true,
|
||||
// data: { $chartData.resourceStats.totalResources | json_encode | raw },
|
||||
// itemStyle: {
|
||||
// color: '#10b981'
|
||||
// },
|
||||
// lineStyle: {
|
||||
// width: 3
|
||||
// }
|
||||
// },
|
||||
// {
|
||||
// name: '下载量',
|
||||
// type: 'line',
|
||||
// smooth: true,
|
||||
// data: { $chartData.resourceStats.downloads | json_encode | raw },
|
||||
// itemStyle: {
|
||||
// color: '#f59e0b'
|
||||
// },
|
||||
// lineStyle: {
|
||||
// width: 3
|
||||
// }
|
||||
// }
|
||||
// ]
|
||||
// };
|
||||
// chart.setOption(option);
|
||||
// }
|
||||
|
||||
// 文章统计图表
|
||||
// function initArticleStats() {
|
||||
// var chart = echarts.init(document.getElementById('articleStats'));
|
||||
// var option = {
|
||||
// tooltip: {
|
||||
// trigger: 'axis',
|
||||
// axisPointer: {
|
||||
// type: 'cross',
|
||||
// label: {
|
||||
// backgroundColor: '#6a7985'
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
// legend: {
|
||||
// data: ['新增文章', '总文章数', '浏览量']
|
||||
// },
|
||||
// grid: {
|
||||
// left: '3%',
|
||||
// right: '4%',
|
||||
// bottom: '3%',
|
||||
// containLabel: true
|
||||
// },
|
||||
// xAxis: {
|
||||
// type: 'category',
|
||||
// boundaryGap: false,
|
||||
// data: { $chartData.articleStats.dates | json_encode | raw }
|
||||
// },
|
||||
// yAxis: {
|
||||
// type: 'value'
|
||||
// },
|
||||
// series: [
|
||||
// {
|
||||
// name: '新增文章',
|
||||
// type: 'bar',
|
||||
// data: { $chartData.articleStats.newArticles | json_encode | raw },
|
||||
// itemStyle: {
|
||||
// color: '#3881fd'
|
||||
// }
|
||||
// },
|
||||
// {
|
||||
// name: '总文章数',
|
||||
// type: 'line',
|
||||
// smooth: true,
|
||||
// data: { $chartData.articleStats.totalArticles | json_encode | raw },
|
||||
// itemStyle: {
|
||||
// color: '#10b981'
|
||||
// },
|
||||
// lineStyle: {
|
||||
// width: 3
|
||||
// }
|
||||
// },
|
||||
// {
|
||||
// name: '浏览量',
|
||||
// type: 'line',
|
||||
// smooth: true,
|
||||
// data: { $chartData.articleStats.views | json_encode | raw },
|
||||
// itemStyle: {
|
||||
// color: '#f59e0b'
|
||||
// },
|
||||
// lineStyle: {
|
||||
// width: 3
|
||||
// }
|
||||
// }
|
||||
// ]
|
||||
// };
|
||||
// chart.setOption(option);
|
||||
// }
|
||||
|
||||
// 初始化所有图表
|
||||
// document.addEventListener('DOMContentLoaded', function () {
|
||||
// // 确保ECharts已加载
|
||||
// if (typeof echarts === 'undefined') {
|
||||
// console.error('ECharts未加载');
|
||||
// return;
|
||||
// }
|
||||
|
||||
// // 初始化图表
|
||||
// try {
|
||||
// initVisitTrend();
|
||||
// initUserGrowth();
|
||||
// // initResourceStats();
|
||||
// initArticleStats();
|
||||
|
||||
// // 监听窗口大小变化,重绘图表
|
||||
// window.addEventListener('resize', function () {
|
||||
// var charts = document.querySelectorAll('.chart-container');
|
||||
// charts.forEach(function (chart) {
|
||||
// var instance = echarts.getInstanceByDom(chart);
|
||||
// if (instance) {
|
||||
// instance.resize();
|
||||
// }
|
||||
// });
|
||||
// });
|
||||
// } catch (error) {
|
||||
// console.error('初始化图表失败:', error);
|
||||
// }
|
||||
// });
|
||||
</script>
|
||||
<script src="__STATIC__/js/jquery.min.js"></script>
|
||||
<style>
|
||||
.dashboard-container {
|
||||
padding: 24px;
|
||||
@ -527,6 +530,7 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
/* background-color: #f5f7fa; */
|
||||
/* min-height: calc(100vh - 60px); */
|
||||
}
|
||||
|
||||
.welcome-header {
|
||||
background: linear-gradient(135deg, #3881fd 0%, #2c5fd9 100%);
|
||||
border-radius: 12px;
|
||||
@ -535,22 +539,26 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
margin-bottom: 24px;
|
||||
box-shadow: 0 4px 20px rgba(56, 129, 253, 0.15);
|
||||
}
|
||||
|
||||
.welcome-header h1 {
|
||||
font-size: 28px;
|
||||
font-weight: 600;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.welcome-header p {
|
||||
font-size: 15px;
|
||||
opacity: 0.9;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.stats-container {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
|
||||
gap: 24px;
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
.stat-card {
|
||||
background: white;
|
||||
border-radius: 12px;
|
||||
@ -560,6 +568,7 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.stat-card::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
@ -569,10 +578,12 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
height: 100%;
|
||||
background: #3881fd;
|
||||
}
|
||||
|
||||
.stat-card:hover {
|
||||
transform: translateY(-5px);
|
||||
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
|
||||
}
|
||||
|
||||
.stat-card .stat-value {
|
||||
font-size: 32px;
|
||||
font-weight: 600;
|
||||
@ -581,6 +592,7 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
}
|
||||
|
||||
.stat-card .stat-title {
|
||||
color: #64748b;
|
||||
font-size: 14px;
|
||||
@ -588,6 +600,7 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
|
||||
.stat-card .stat-icon {
|
||||
position: absolute;
|
||||
right: 20px;
|
||||
@ -596,12 +609,14 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
font-size: 48px;
|
||||
opacity: 0.1;
|
||||
}
|
||||
|
||||
.quick-actions {
|
||||
background: white;
|
||||
border-radius: 12px;
|
||||
padding: 24px;
|
||||
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
|
||||
}
|
||||
|
||||
.quick-actions h2 {
|
||||
color: #1e293b;
|
||||
font-size: 18px;
|
||||
@ -610,6 +625,7 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.quick-actions h2::before {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
@ -619,11 +635,13 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
margin-right: 8px;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.action-buttons {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.action-button {
|
||||
background: #f8fafc;
|
||||
border: 1px solid #e2e8f0;
|
||||
@ -638,15 +656,18 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
justify-content: center;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.action-button:hover {
|
||||
background: #3881fd;
|
||||
color: white;
|
||||
border-color: #3881fd;
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
|
||||
.action-button i {
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
.recent-activity {
|
||||
margin-top: 24px;
|
||||
background: white;
|
||||
@ -654,18 +675,22 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
padding: 24px;
|
||||
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
|
||||
}
|
||||
|
||||
.activity-list {
|
||||
margin-top: 16px;
|
||||
}
|
||||
|
||||
.activity-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 12px 0;
|
||||
border-bottom: 1px solid #f1f5f9;
|
||||
}
|
||||
|
||||
.activity-item:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.activity-icon {
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
@ -676,29 +701,35 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
justify-content: center;
|
||||
margin-right: 12px;
|
||||
}
|
||||
|
||||
.activity-content {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.activity-title {
|
||||
font-weight: 500;
|
||||
color: #9b9b9b;
|
||||
}
|
||||
|
||||
.activity-time {
|
||||
font-size: 12px;
|
||||
color: #64748b;
|
||||
}
|
||||
|
||||
.charts-container {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
|
||||
gap: 24px;
|
||||
margin-top: 24px;
|
||||
}
|
||||
|
||||
.chart-card {
|
||||
background: white;
|
||||
border-radius: 12px;
|
||||
padding: 24px;
|
||||
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
|
||||
}
|
||||
|
||||
.chart-card h2 {
|
||||
color: #1e293b;
|
||||
font-size: 18px;
|
||||
@ -707,6 +738,7 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.chart-card h2::before {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
@ -716,6 +748,7 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
margin-right: 8px;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.chart-container {
|
||||
height: 300px;
|
||||
width: 100%;
|
||||
|
||||
@ -718,7 +718,7 @@ class UserController extends BaseController
|
||||
{
|
||||
// 检查用户是否登录
|
||||
if (!cookie('user_account')) {
|
||||
return json(['code'=> -1,'msg'=> '请先登录']);
|
||||
return json(['code' => -1, 'msg' => '请先登录']);
|
||||
}
|
||||
|
||||
// 获取当前用户信息
|
||||
@ -751,4 +751,10 @@ class UserController extends BaseController
|
||||
return json(['code' => -1, 'msg' => '二维码生成失败: ' . $e->getMessage()]);
|
||||
}
|
||||
}
|
||||
|
||||
//getSecurityInfo
|
||||
public function getSecurityInfo()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,8 +1,4 @@
|
||||
<script src="__LAYUI__/layui.js" charset="utf-8"></script>
|
||||
<script src="__JS__/bootstrap.bundle.js"></script>
|
||||
<script charset="UTF-8" id="LA_COLLECT" src="//www.yunzer.cn/plugins/js-sdk-pro.min.js"></script>
|
||||
<script>LA.init({ id: "KoyzaWWEcLvPzkQn", ck: "KoyzaWWEcLvPzkQn", autoTrack: true, prefix: 'event' })</script>
|
||||
<script src="__JS__/banner.js"></script>
|
||||
|
||||
|
||||
<script>
|
||||
// 在页面加载时立即执行
|
||||
|
||||
@ -10,6 +10,11 @@
|
||||
<link rel="stylesheet" href="__CSS__/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="__CSS__/fontawesome.css">
|
||||
|
||||
<script src="__LAYUI__/layui.js" charset="utf-8"></script>
|
||||
<script src="__JS__/bootstrap.bundle.js"></script>
|
||||
<script charset="UTF-8" id="LA_COLLECT" src="//www.yunzer.cn/plugins/js-sdk-pro.min.js"></script>
|
||||
<script>LA.init({ id: "KoyzaWWEcLvPzkQn", ck: "KoyzaWWEcLvPzkQn", autoTrack: true, prefix: 'event' })</script>
|
||||
<script src="__JS__/banner.js"></script>
|
||||
<style>
|
||||
/* 用户头像样式 */
|
||||
#userAvatar {
|
||||
|
||||
@ -97,4 +97,29 @@
|
||||
content: '/index/user/component/bindPhone'
|
||||
});
|
||||
}
|
||||
|
||||
function loadSecurityInfo() {
|
||||
// 示例:你可以根据实际需求发起 AJAX 请求获取用户安全信息
|
||||
// 这里只做简单演示
|
||||
// 假设后端返回 { phone: '138****8888' } 或 { phone: null }
|
||||
$.ajax({
|
||||
url: '/index/user/getSecurityInfo',
|
||||
type: 'GET',
|
||||
dataType: 'json',
|
||||
success: function (res) {
|
||||
if (res.code === 0 && res.data) {
|
||||
if (res.data.phone) {
|
||||
$('#phoneNumber').text(res.data.phone);
|
||||
} else {
|
||||
$('#phoneNumber').text('未绑定');
|
||||
}
|
||||
} else {
|
||||
$('#phoneNumber').text('未绑定');
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
$('#phoneNumber').text('未绑定');
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@ -57,6 +57,25 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
layui.use(['jquery'], function () {
|
||||
var $ = layui.jquery;
|
||||
|
||||
// 菜单切换
|
||||
$('.menu-item').on('click', function () {
|
||||
var target = $(this).data('target');
|
||||
|
||||
// 移除所有active类
|
||||
$('.menu-item').removeClass('active');
|
||||
$('.content-section').removeClass('active');
|
||||
|
||||
// 添加active类
|
||||
$(this).addClass('active');
|
||||
$('#' + target).addClass('active');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.profile-container {
|
||||
display: flex;
|
||||
@ -153,23 +172,4 @@
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
layui.use(['jquery'], function(){
|
||||
var $ = layui.jquery;
|
||||
|
||||
// 菜单切换
|
||||
$('.menu-item').on('click', function(){
|
||||
var target = $(this).data('target');
|
||||
|
||||
// 移除所有active类
|
||||
$('.menu-item').removeClass('active');
|
||||
$('.content-section').removeClass('active');
|
||||
|
||||
// 添加active类
|
||||
$(this).addClass('active');
|
||||
$('#' + target).addClass('active');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
{include file="component/foot" /}
|
||||
|
After Width: | Height: | Size: 32 KiB |
|
After Width: | Height: | Size: 522 KiB |
|
After Width: | Height: | Size: 114 KiB |
|
After Width: | Height: | Size: 32 KiB |
|
After Width: | Height: | Size: 114 KiB |
|
After Width: | Height: | Size: 114 KiB |
|
After Width: | Height: | Size: 90 KiB |
|
After Width: | Height: | Size: 67 KiB |
|
After Width: | Height: | Size: 114 KiB |
|
After Width: | Height: | Size: 88 KiB |
|
After Width: | Height: | Size: 173 KiB |
|
After Width: | Height: | Size: 88 KiB |
|
After Width: | Height: | Size: 88 KiB |
|
After Width: | Height: | Size: 32 KiB |
|
After Width: | Height: | Size: 67 KiB |
|
After Width: | Height: | Size: 173 KiB |
|
After Width: | Height: | Size: 88 KiB |
|
After Width: | Height: | Size: 67 KiB |
|
After Width: | Height: | Size: 173 KiB |
|
After Width: | Height: | Size: 173 KiB |
|
After Width: | Height: | Size: 61 KiB |
|
After Width: | Height: | Size: 67 KiB |
|
After Width: | Height: | Size: 32 KiB |
|
After Width: | Height: | Size: 90 KiB |
|
After Width: | Height: | Size: 61 KiB |
|
After Width: | Height: | Size: 173 KiB |
|
After Width: | Height: | Size: 173 KiB |
|
After Width: | Height: | Size: 32 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 89 KiB |
|
After Width: | Height: | Size: 89 KiB |
|
After Width: | Height: | Size: 310 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 53 KiB |
|
After Width: | Height: | Size: 18 KiB |
|
After Width: | Height: | Size: 47 KiB |
|
After Width: | Height: | Size: 31 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 7.8 KiB |
|
After Width: | Height: | Size: 93 KiB |
|
After Width: | Height: | Size: 3.8 KiB |
|
After Width: | Height: | Size: 25 KiB |
|
After Width: | Height: | Size: 8.9 KiB |
|
After Width: | Height: | Size: 3.8 KiB |
|
After Width: | Height: | Size: 3.4 KiB |
|
After Width: | Height: | Size: 49 KiB |
|
After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 7.8 KiB |
|
After Width: | Height: | Size: 49 KiB |
|
After Width: | Height: | Size: 49 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 253 KiB |
|
After Width: | Height: | Size: 253 KiB |
|
After Width: | Height: | Size: 253 KiB |
|
After Width: | Height: | Size: 166 KiB |
|
After Width: | Height: | Size: 166 KiB |
|
After Width: | Height: | Size: 399 KiB |
|
After Width: | Height: | Size: 583 KiB |
|
After Width: | Height: | Size: 653 KiB |
|
After Width: | Height: | Size: 68 KiB |
|
After Width: | Height: | Size: 62 KiB |
|
After Width: | Height: | Size: 64 KiB |
|
After Width: | Height: | Size: 433 KiB |
|
After Width: | Height: | Size: 74 KiB |
|
After Width: | Height: | Size: 62 KiB |
|
After Width: | Height: | Size: 58 KiB |
|
After Width: | Height: | Size: 63 KiB |
|
After Width: | Height: | Size: 433 KiB |
|
After Width: | Height: | Size: 56 KiB |
|
After Width: | Height: | Size: 553 KiB |
|
After Width: | Height: | Size: 64 KiB |
|
After Width: | Height: | Size: 32 KiB |
|
After Width: | Height: | Size: 586 KiB |
|
After Width: | Height: | Size: 437 KiB |
|
After Width: | Height: | Size: 399 KiB |
|
After Width: | Height: | Size: 49 KiB |
|
After Width: | Height: | Size: 40 KiB |
|
After Width: | Height: | Size: 653 KiB |
|
After Width: | Height: | Size: 586 KiB |
|
After Width: | Height: | Size: 485 KiB |
|
After Width: | Height: | Size: 166 KiB |
|
After Width: | Height: | Size: 54 KiB |
|
After Width: | Height: | Size: 437 KiB |
|
After Width: | Height: | Size: 59 KiB |
|
After Width: | Height: | Size: 65 KiB |
|
After Width: | Height: | Size: 553 KiB |
|
After Width: | Height: | Size: 31 KiB |
|
After Width: | Height: | Size: 54 KiB |
|
After Width: | Height: | Size: 305 KiB |
|
After Width: | Height: | Size: 55 KiB |
|
After Width: | Height: | Size: 78 KiB |
|
After Width: | Height: | Size: 485 KiB |