<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">

    <title>运行统计历史数据</title>
</head>
<body>
    <div class="tip">
        正在对<span id="type">历史{{trans('other.'.$type)}}</span>数据进行统计，当前执行{{$page}}页,每页执行{{$list}}条,
        <span class="tatalpage">共{{$totalpage}}页</span>
    </div>
</body>
</html>
<script type="text/javascript" src="{{asset('/js/jquery.min.js')}}"></script>
<script>
    var page='{{$page}}';
    var list='{{$list}}';
    var type='{{$type}}';
    var token='{{$token}}';
    var totalpage='{{$totalpage}}';


    $.ajax({
        url:'/HistoryCount',
        type:'get',
        dataType:'json',
        data:{type:type,list:list,page:page},
        success:function (data) {
            console.log(data);
            if(data.status<0){
                totalpage=data.data.totalpage;
                var url='/countHistory?type='+type+'&list='+list+'&page='+(parseInt(page)+1)+'&totalpage='+totalpage+'&token='+token;
                console.log(url);
                window.location.href=url;
            }else{
                var name=$('#type').text();
                $('.tip').html('<span style="color: red">'+name+'完成</span>')
            }
        },error:function (e) {
            $('.tip').html('<span style="color: red">发生接口错误，请检测接口</span>')
        }

    })

</script>