define(["jquery", "easy-admin"], function ($, ea) {

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'app.member/index',
        add_url: 'app.member/add',
        edit_url: 'app.member/edit',
        delete_url: 'app.member/delete',
        export_url: 'app.member/export',
        modify_url: 'app.member/modify',
    };

    var Controller = {

        index: function () {
            ea.table.render({
                init: init,
                toolbar: ['refresh'],
                cols: [[
                    {type: 'checkbox'},
                    {field: 'uid', title: '融合uid'},
                    {field: 'uname', title: '融合账号'},
                    {field: 'veruniqid', title: '渠道用户标识',search:false},
                    {field: 'app_id', title: '注册游戏ID'},
                    {
                        field: 'status',
                        title: '用户分类',
                        search:false,
                        templet: function (d) {
                            if (d.ver_status === 1) {
                                return '<span class="layui-badge layui-bg-green">正常注册</span>';
                            }else {
                                return '<span class="layui-badge layui-bg-yellow">游客</span>';
                            }
                        }
                    },
                    {field: 'ver', title: '注册渠道号'},
                    {field: 'reg_time', title: '注册时间',search:false},
                    {field: 'login_time', title: '最近登录时间',search:false},
                    {field: 'reg_ip', title: '注册IP',search:false},
                    {field: 'login_ip', title: '最近登录IP',search:false},
                    {field: 'add_time', title: '添加时间',search:false},
                ]],
            });

            ea.listen();
        },
        add: function () {
            ea.listen();
        },
        edit: function () {
            ea.listen();
        },
    };
    return Controller;
});
