<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('待审核列表')"/>
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <ul>
                        <li>
                            <label>手机号：</label>
                            <input type="text" name="activityTitle"/>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                    class="fa fa-search"></i>&nbsp;搜索</a>
<!--                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i-->
<!--                                    class="fa fa-refresh"></i>&nbsp;重置</a>-->
                        </li>
                    </ul>
                </div>
            </form>
        </div>
        <div class="col-sm-12 select-table table-bordered">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
    var detailFlag = [[${@permission.hasPermi('smile:userPendingList:detail')}]];
    var smilePrefix = ctx + "smile/user";

    //     // createUrl: prefix + "/add",
    //     // updateUrl: prefix + "/edit/{id}",
    //     // removeUrl: prefix + "/remove",
    //     // exportUrl: prefix + "/export",
    //     // modalName: "订单",
    $(function() {
        var options = {
            url: smilePrefix + "/check/list",
            columns: [{
                checkbox: true
            },
                {
                    field: 'id',
                    title: '用户id'
                },
                {
                    field: 'img',
                    title: '生活照',
                    formatter: function(value, row, index) {
                        return $.table.imageView(value,"300", "300");
                    }
                },
                {
                    field: 'name',
                    title: '姓名'
                },
                {
                    field: 'sex',
                    title: '性别',
                    formatter: function(value, row, index) {
                        if (value == 1) {
                            return '男';
                        } else {
                            return '女';
                        }
                    }
                },
                {
                    field: 'birthday',
                    title: '年龄'
                },
                {
                    field: 'phone',
                    title: '手机号'
                },
                {
                    field: 'identity',
                    title: '身份',
                    formatter: function(value, row, index) {
                        if (value == 1) {
                            return '在校学生';
                        } else {
                            return '已毕业';
                        }
                    }
                },
                {
                    field: 'schoolName',
                    title: '学校/公司名称'
                },
                {
                    field: 'area',
                    title: '地区'
                },
                {
                    field: 'type',
                    title: '状态',
                    formatter: function(value, row, index) {
                        if (value == 0) {
                            return '未审核';
                        } else if (value == 1) {
                            return '总代';
                        } else if (value == 2) {
                            return '普代';
                        } else if (value == 3) {
                            return '未认证';
                        } else {
                            return '';
                        }
                    }
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + detailFlag + '" href="javascript:void(0)" onclick="toDetail(\'' + row.uid + '\')"><i class="fa fa-edit"></i>查看</a> ');
                        return actions.join('');
                    }
                }]
        };
        $.table.init(options);
    });

    /* 跳转详情 */
    function toDetail(id) {
        window.localStorage.setItem('penddingId', id);
        var url = '/local/smilePendingDetail';
        $.modal.openTab("待审核详情", url);
    }
</script>
</body>
</html>