<html lang="zh-cn">
|
|
<head>
|
<meta charset="utf-8">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="referrer" content="never">
|
<title>首页</title>
|
<link href="css/bootstrap.min.css" rel="stylesheet">
|
<link href="css/maincontent.css" rel="stylesheet">
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.4.0/Chart.bundle.min.js"></script>
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.4.0/Chart.min.js"></script>
|
<!--[if lt IE 9]>
|
<script src="js/html5shiv.js"></script>
|
<script src="js/respond.min.js"></script>
|
<![endif]-->
|
</head>
|
|
<body>
|
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
|
</nav>
|
<div id="mainbody">
|
<div id="sidebar">
|
<dl>
|
<dd>
|
</dd>
|
</dl>
|
</div>
|
<div id="contentyouce">
|
<div class="container-fluid">
|
<div class="row">
|
<div class="col-md-4">
|
<div class="card" style="background-color:#6ad6e3">
|
<div class="header">
|
<h4 class="title">昨日播放数据</h4>
|
</div>
|
<div class="content">
|
<div class="ct-chart ct-perfect-fourth" id="wcount">0</div>
|
</div>
|
</div>
|
</div>
|
<div class="col-md-4">
|
<div class="card" style="background-color:#add370">
|
<div class="header">
|
<h4 class="title">累计注册用户数量</h4>
|
</div>
|
<div class="content">
|
<div class="ct-chart ct-perfect-fourth" id="trcount">0</div>
|
</div>
|
</div>
|
</div>
|
<div class="col-md-4">
|
<div class="card" style="background-color:#f88a6f">
|
<div class="header">
|
<h4 class="title">昨日注册用户数量</h4>
|
</div>
|
<div class="content">
|
<div class="ct-chart ct-perfect-fourth" id="rcount">0</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
|
<div class="row">
|
<div class="col-md-12">
|
<div class="card1">
|
<div class="content">
|
|
<div class="footer">
|
<div class="legend" style="display: flex;justify-content: space-between">
|
<h4>今日视频搜索数据TOP50</h4>
|
<button type="button" id="refresh_search" class="btn btn-default">刷新</button>
|
</div>
|
<hr>
|
</div>
|
|
<div>
|
<div id="container_search" style="min-width:400px;height: 1800px;"></div>
|
</div>
|
|
</div>
|
</div>
|
</div>
|
</div>
|
|
<div class="row">
|
<div class="col-md-12">
|
<div class="card1">
|
<div class="content">
|
|
<div class="footer">
|
<div class="legend">
|
<h4>昨日播放数据TOP100视频</h4>
|
</div>
|
<hr>
|
</div>
|
|
<div>
|
<div id="container" style="min-width:400px;height: 1800px;"></div>
|
</div>
|
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
<script src="js/jquery.min.js"></script>
|
<script src="js/bootstrap.min.js"></script>
|
<script src="js/nav.js"></script>
|
<script src="http://cdn.hcharts.cn/highcharts/highcharts.js"></script>
|
<script src="http://cdn.hcharts.cn/highcharts/modules/exporting.js"></script>
|
<script src="js/common.js"></script>
|
<script src="layer/layer.js"></script>
|
|
<script>
|
function fillData(names, datas) {
|
$('#container').highcharts({
|
chart: {
|
type: 'bar'
|
},
|
title: {
|
text: '视频观看次数'
|
},
|
xAxis: {
|
categories: names,
|
},
|
yAxis: {
|
min: 0,
|
labels: {
|
overflow: 'justify'
|
}
|
},
|
|
plotOptions: {
|
bar: {
|
dataLabels: {
|
enabled: true
|
}
|
}
|
},
|
legend: {
|
layout: 'vertical',
|
align: 'right',
|
verticalAlign: 'top',
|
x: -40,
|
y: 100,
|
floating: true,
|
borderWidth: 1,
|
backgroundColor: ((Highcharts.theme && Highcharts.theme.legendBackgroundColor) || '#FFFFFF'),
|
shadow: true
|
},
|
credits: {
|
enabled: false
|
},
|
series: [{
|
name: '视频观看数',
|
data: datas
|
}]
|
});
|
}
|
|
function fillSearchData(names, datas) {
|
$('#container_search').highcharts({
|
chart: {
|
type: 'bar'
|
},
|
title: {
|
text: '搜索用户数'
|
},
|
xAxis: {
|
categories: names,
|
},
|
yAxis: {
|
min: 0,
|
labels: {
|
overflow: 'justify'
|
}
|
},
|
|
plotOptions: {
|
bar: {
|
dataLabels: {
|
enabled: true
|
}
|
}
|
},
|
legend: {
|
layout: 'vertical',
|
align: 'right',
|
verticalAlign: 'top',
|
x: -40,
|
y: 100,
|
floating: true,
|
borderWidth: 1,
|
backgroundColor: ((Highcharts.theme && Highcharts.theme.legendBackgroundColor) || '#FFFFFF'),
|
shadow: true
|
},
|
credits: {
|
enabled: false
|
},
|
series: [{
|
name: '搜索用户数',
|
data: datas
|
}]
|
});
|
}
|
|
function fillYData(data) {
|
$("#rcount").html(data.data.rcount);
|
$("#trcount").html(data.data.trcount);
|
$("#wcount").html(data.data.wcount);
|
|
}
|
|
$(function() {
|
var date = new Date();
|
date.setTime(date.getTime() - 24 * 60 * 60 * 1000);
|
var time = date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate();
|
console.log(time);
|
var index = layer.load(2, {
|
shade: false //0.1透明度的白色背景
|
});
|
$.post('api/statistics/gettopplay', {
|
'startdate': time,
|
'enddate': time,
|
'detailsystem': 0
|
}, function(data) {
|
layer.close(index);
|
doResponse(data, fillData(data.data.name, data.data.count));
|
}, 'json');
|
|
$.post('api/statistics/gettesterdaydata', {
|
'startdate': time,
|
'enddate': time,
|
'detailsystem': 0
|
}, function(data) {
|
doResponse(data, fillYData(data));
|
}, 'json');
|
|
$.post('api/statistics/gettopsearch', {
|
'detailsystem': 0
|
}, function(data) {
|
doResponse(data,fillSearchData(data.data.name, data.data.count));
|
}, 'json');
|
|
//刷新搜索关键字
|
$("#refresh_search").click(function () {
|
$.post('api/statistics/refreshtopsearch', {
|
'detailsystem': 0
|
}, function(data) {
|
doResponse(data,function(){
|
|
});
|
}, 'json');
|
});
|
|
});
|
</script>
|
</body>
|
|
</html>
|