<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>layui</title>
    <meta name="csrf-token" content="<?php echo e(csrf_token()); ?>">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="<?php echo e(URL::asset('admin/frame/layui/css/layui.css')); ?>" media="all">
    <link rel="stylesheet" href="<?php echo e(URL::asset('admin/css/welcome.css')); ?>" media="all">
    <!-- 注意：如果你直接复制所有代码到本地，上述css路径需要改成你本地的 -->
</head>
<body>
<!--<div class="layui-btn-group demoTable">
    <button class="layui-btn" data-type="getCheckData">获取选中行数据</button>
    <button class="layui-btn" data-type="getCheckLength">获取选中数目</button>
    <button class="layui-btn" data-type="isAll">验证是否全选</button>
</div>-->

<form class="layui-form" eventType=eventForm>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">开奖期号：</label>
            <div class="layui-input-inline">
                <input type="text" name="number" lay-verify="required|number" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">时间：</label>
            <div class="layui-input-inline">
                <input type="text" name="date" class="layui-input" id="test6" placeholder="">
            </div>
        </div>

        <div class="layui-inline">
            <button class="layui-btn" lay-submit="" lay-filter="demo1">搜索</button>
        </div>


    </div>
</form>


<table class="layui-hide" id="LAY_table_user" lay-filter="demo"></table>

<script type="text/html" id="barDemo">
    <a class="layui-btn  layui-btn-xs" lay-event="detail">重新开奖</a>
    <!--<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>-->
</script>
<script type="text/html" id="sexTpl">
    @{{#  if(d.status == '0'){ }}
    投注中
    @{{#  } else if(d.status == '1'){ }}
    封盘
    @{{#  }else{ }}
    已开奖
    @{{#  }}}
</script>
<script src="<?php echo e(URL::asset('admin/js/jquery-1.11.3.js')); ?>" charset="utf-8"></script>
<script src="<?php echo e(URL::asset('admin/frame/layui/layui.js')); ?>" charset="utf-8"></script>
<script src="<?php echo e(URL::asset('admin/js/configure.js')); ?>" charset="utf-8"></script>
<script>
    $.ajaxSetup({
        headers: {
            'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
        }
    });
    var url1 = '<?php echo e(URL::asset("admin/json/package.json")); ?>';
    var url2 = '/admin/game/gameBet';

    var thead = type('/admin/game/getBetTable',{game:'xy28'});


    var returnData = getData(url2, {status: 1});
    layui.use(['laydate', 'laypage', 'layer', 'table'], function () {
        var laydate = layui.laydate //日期
            , laypage = layui.laypage //分页
            , laytpl = layui.laytpl;
        layer = layui.layer //弹层
            , table = layui.table //表格


        //时间选择器
        laydate.render({
            elem: '#test6'
            , range: true
        });
        //执行一个 table 实例
        table.render({
            elem: '#LAY_table_user'
            , page: true //开启分页
            , id: 'tab'
            , cols: [
                thead.data
//                [ //表头
////                {checkbox: true, fixed: 'left'},
//                {field: 'info_identity', title: '游戏', width: 100}
//                , {field: 'info_no', title: '期数', width: 200, sort: true}
//                , {field: 'open_time', title: '期数', width: 200, sort: true}
//                , {field: 'status', title: '赢取金额', templet: '#sexTpl', width: 120, sort: true}
//                , {fixed: 'right', title: '查看', width: 100, align: 'center', toolbar: '#barDemo'}
//            ]
            ]
            ,data:returnData.data.data

        });


        //监听工具条
        table.on('tool(demo)', function (obj) {
            var data = obj.data //获得当前行数据
                , layEvent = obj.event; //获得 lay-event 对应的值
            if (obj.event === 'detail') {
                var str = '';
                str += '<div class="resume center">';
                str += '<p>游戏名称:广东11选5</p>';
                str += '<p>游戏期号:' + data.info_no + '</p>';
                str += '<p class="number">开奖号码: <input type="text"><input type="text"><input type="text"><input type="text"></p>';
                str += '<p class="password">开奖密码: <input type="password"></p>';
                str += '</div>';
                layer.open({
                    type: 1
                    , id: 'LAY_layuipro'
                    , btn: ['提交', '取消']
                    , area: '400px;'
                    , shade: 0.4
                    , moveType: 1
                    , content: str
                    , yes: function (index, layero) {

                    }
                });
            }
        })


        var $ = layui.$, active = {
            reload: function () {
                var demoReload = $('input[name="number"]');
                //执行重载
                table.reload('tab', {
                    page: {
                        curr: 1 //重新从第 1 页开始
                    }
                    , where: {
                        key: {
                            id: demoReload.val()
                        }
                    }
                });
            }
        };

        $('.layui-btn').on('click', function () {
            var type = $(this).data('type');
            active[type] ? active[type].call(this) : '';
        });
    })
    ;
</script>
</body>
</html>