



<?php $__env->startSection('content'); ?>
    <div class="layui-row layui-col-space15">

        <div class="layui-col-md8">

            <div class="layui-row layui-col-space15">

                <div class="layui-col-md6">

                    <div class="layui-card">

                        <div class="layui-card-header">订单</div>

                        <div class="layui-card-body">
                            <div class="layui-carousel layadmin-carousel layadmin-backlog">

                                <div >

                                    <ul class="layui-row layui-col-space10">

                                        <li class="layui-col-xs6">

                                            <a href="<?php echo e(route('admin.apply')); ?>" class="layadmin-backlog-body">

                                                <h3>待接单</h3>

                                                <p><cite><?php echo e($order['wait']); ?></cite></p>

                                            </a>

                                        </li>

                                        <li class="layui-col-xs6">

                                            <a href="<?php echo e(route('admin.apply')); ?>" class="layadmin-backlog-body">

                                                <h3>执行中</h3>

                                                <p><cite><?php echo e($order['execute']); ?></cite></p>

                                            </a>

                                        </li>

                                        <li class="layui-col-xs6">

                                            <a href="<?php echo e(route('admin.apply')); ?>" class="layadmin-backlog-body">

                                                <h3>已完成</h3>

                                                <p><cite><?php echo e($order['finish']); ?></cite></p>

                                            </a>

                                        </li>

                                        <li class="layui-col-xs6">

                                            <a href="<?php echo e(route('admin.apply')); ?>"  class="layadmin-backlog-body">

                                                <h3>已流失</h3>

                                                <p><cite><?php echo e($order['lost']); ?></cite></p>

                                            </a>

                                        </li>

                                    </ul>

                                </div>

                            </div>

                        </div>

                    </div>

                </div>
                <div class="layui-col-md6">

                    <div class="layui-card">

                        <div class="layui-card-header">资源</div>

                        <div class="layui-card-body">



                            <div class="layui-carousel layadmin-carousel layadmin-backlog">

                                <div >

                                    <ul class="layui-row layui-col-space10">
                                        <li class="layui-col-xs6">
                                            <a href="<?php echo e(route('admin.product.cloud')); ?>"  class="layadmin-backlog-body">
                                                <h3>云资源</h3>
                                                <p><cite><?php echo e($source['cloud']); ?></cite></p>

                                            </a>

                                        </li>

                                    </ul>
                                </div>

                            </div>

                        </div>

                    </div>

                </div>

                <div class="layui-col-md12">

                    <div class="layui-card">

                        <div class="layui-card-header">数据概览</div>

                        <div class="layui-card-body">



                            <div class="layui-carousel layadmin-carousel layadmin-dataview" data-anim="fade" lay-filter="LAY-index-dataview">

                                <div  id="LAY-index-dataview">

                                    <div><i class="layui-icon layui-icon-loading1 layadmin-loading"></i></div>

                                    <div></div>

                                    <div></div>

                                </div>

                            </div>



                        </div>

                    </div>

                </div>

            </div>

        </div>

        <div class="layui-col-md4">

            <div class="layui-card">

                <div class="layui-card-header">版本信息</div>

                <div class="layui-card-body layui-text">

                    <table class="layui-table">

                        <colgroup>

                            <col width="100">

                            <col>

                        </colgroup>

                        <tbody>

                        <tr>
                            <td>当前版本</td>
                            <td>
                                1.0.0
                            </td>
                        </tr>

                        <tr>

                            <td>主要特色</td>

                            <td>  大气 / 清爽 / 极简</td>

                        </tr>
                        <tr>

                            <td>主要功能</td>

                            <td>媒体 / 广告 / 云资源 / 分销</td>

                        </tr>
                        <tr>

                            <td>官方网站</td>

                            <td style="padding-bottom: 0;">

                                <div class="layui-btn-container">

                                    <a href="http://www.kouhaobang.com" target="_blank" class="layui-btn layui-btn-danger">口号帮</a>

                                </div>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
            <div class="layui-card">
                <div class="layui-card-header">
                    用户
                    <span class="layui-badge layui-bg-blue layuiadmin-badge">周</span>
                </div>
                <div class="layui-card-body layuiadmin-card-list">
                    <p class="layuiadmin-big-font"><?php echo e($all_week); ?></p>
                    <p>
                        总计用户
                        <span class="layuiadmin-span-color"> <?php echo e($users); ?> <i class="layui-inline layui-icon layui-icon-flag"></i></span>
                    </p>
                </div>
            </div>
            <div class="layui-card">
                <div class="layui-card-header">
                    收入
                    <span class="layui-badge layui-bg-blue layuiadmin-badge">周</span>
                </div>
                <div class="layui-card-body layuiadmin-card-list">
                    <p class="layuiadmin-big-font"><?php echo e($money_week); ?></p>
                    <p>
                        总计收入
                        <span class="layuiadmin-span-color"><?php echo e($money); ?><i class="layui-inline layui-icon layui-icon-flag"></i></span>
                    </p>
                </div>
            </div>

        </div>

    </div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('script'); ?>
    <script>
        layui.use(['layer','table','form','echarts','echartsTheme','laydate'],function () {
            var layer = layui.layer;
            var form = layui.form;
            var table = layui.table;
            var laydate = layui.laydate;
            var echarts = layui.echarts;
            var echartsTheme = layui.echartsTheme;
            // hover查看版本信息
            $('.show-version').hover(function(e){
                // var xx = e.pageX;
                // var yy = e.pageY;
                $.ajax({
                    url: '/admin/version',
                    type: 'GET',
                    dataType: 'JSON',
                    data: {},
                    success: function (res) {
                        layer.open({
                            type: 1
                            ,shade:0
                            ,title: '版本信息'
                            ,content: '<div style="width:300px;padding:20px;"><p>当前版本：'+res.data.version+'</p><p>更新日期：'+res.data.date+'</p><p> 更新内容：'+res.data.content+'</p></div>'
                        })
                    },
                    error: function () {}
                })
            },function(){
                layer.closeAll();
            })

            //统计表格初始化
            var dataTable = table.render({
                elem: '#dataTable'
                , url: "<?php echo e(route('admin.access.app.data')); ?>" //数据接口
                , page: true //开启分页
                , autoSort: false
                , cols: [[ //表头
                    {field: 'today', title: '日期'}
                    , {field: 'act', title: '激活数'}
                    , {field: 'pv', title: '浏览次数(PV)'}
                    , {field: 'uv', title: '独立访客(UV)'}
                ]]
                , done: function (res, curr, count) {
                    var sum = res.sum;
                    $('.act').find('strong').html(sum.act);
                    $('.pv').find('strong').html(sum.pv);
                    $('.uv').find('strong').html(sum.uv);
                    if (res.slug !== 'all') {
                        $(".layui-table-box").find("[data-field='act']").css("display", "none");
                    }
                    setChart(res.chart, res.slug);
                }
            });


            function setChart(chart, slug) {
                var x = chart.x;
                var y = chart.y;
                var legendArr = ['激活量', '浏览次数(PV)', '独立访客(UV)'];
                var seriesArr = [
                    {
                        name: '激活量',
                        type: 'line',
                        data: y.act,
                        itemStyle: {
                            normal: {
                                color: '#393D49',
                                lineStyle: {
                                    color: '#393D49'
                                }
                            }
                        },
                    },
                    {
                        name: '浏览次数(PV)',
                        type: 'line',
                        data: y.pv,
                        itemStyle: {
                            normal: {
                                color: '#01AAED',
                                lineStyle: {
                                    color: '#01AAED'
                                }
                            }
                        },

                    },
                    {
                        name: '独立访客(UV)',
                        type: 'line',
                        data: y.uv,
                        itemStyle: {
                            normal: {
                                color: '#5FB878',
                                lineStyle: {
                                    color: '#5FB878'
                                }
                            }
                        },
                    }
                ];
                if (slug !== 'all') {
                    legendArr.splice(0, 1);
                    seriesArr.splice(0, 1);
                }
                var option = {
                    title: {
                        text: ''
                    },
                    tooltip: {
                        trigger: 'axis'
                    },
                    legend: {
                        data: legendArr
                    },
                    grid: {
                        left: '3%',
                        right: '4%',
                        bottom: '3%',
                        containLabel: true
                    },
                    toolbox: {
                        feature: {
                            saveAsImage: {}
                        }
                    },
                    xAxis: {
                        type: 'category',
                        boundaryGap: false,
                        data: x
                    },
                    yAxis: {
                        type: 'value'
                    },
                    series: seriesArr
                };

                var myChart = echarts.init(document.getElementById('chart'), echartsTheme);
                myChart.setOption(option);
            }
            var start=laydate.render({
                elem: '#start'
                ,type: 'date'
                ,max: "<?php echo e(\Carbon\Carbon::now()->toDateString()); ?>"
                ,done: function (value, dates) {
                    end.config.min = {
                        year: dates.year,
                        month: dates.month - 1, //关键
                        date: dates.date,
                        hours: 0,
                        minutes: 0,
                        seconds: 0
                    };
                }
            });
            var end=laydate.render({
                elem: '#end'
                ,max: "<?php echo e(\Carbon\Carbon::now()->toDateString()); ?>"
                ,done: function (value, dates) {
                    start.config.max = {
                        year: dates.year,
                        month: dates.month - 1,//关键
                        date: dates.date,
                        hours: 0,
                        minutes: 0,
                        seconds: 0
                    }
                }
            });

            form.render();
        });
    </script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('admin.layouts.base', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>