<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('领取用户列表')" />
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <input type="hidden" id="badgeId" th:value="${badgeId}">
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
    var prefix = ctx + "adam/caomei/badge";
    $(function() {
        var options = {
            url: prefix + "/claimUsers/list",
            queryParams: function(params) {
                return {
                    pageSize: params.limit,
                    pageNum: params.offset / params.limit + 1,
                    badgeId: $("#badgeId").val()
                };
            },
            modalName: "领取用户",
            columns: [
                {
                    field: 'nickname',
                    title: '用户昵称'
                },
                {
                    field: 'mobile',
                    title: '手机号'
                },
                {
                    field: 'claimedAt',
                    title: '领取时间'
                },
                {
                    field: 'source',
                    title: '获取途径',
                    formatter: function(value, row, index) {
                        if (value == 1) return '绑定护照自动发放';
                        if (value == 2) return '购票自动发放';
                        if (value == 3) return '补签审核通过';
                        if (value == 4) return '现场管理员手动发放';
                        return '未知';
                    }
                }
            ]
        };
        $.table.init(options);
    });
</script>
</body>
</html>
