<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no">
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
<meta name="renderer" content="webkit">
<!-- 移动设备 viewport -->
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<jsp:include page="../../common.jsp" />
</head>
<body>
<div class="row animated fadeInRight" style="margin: 0;">
    <div class="wrapper wrapper-content mt5 right-content ml5 mr5">
        <div class="toolbar-panel bdd">
            <div class="toolbar-box">
                <div class="toolbar-head clearfix lgraybg pt5 pb10 pl10 bdbd">
                    <!-- 顶部按钮 -->
                    <div class="fl">
                        查询条件
                    </div>
                    <div class="tools fr">
                        <a href="javascript:void(0);" class="collapse dblock f14 dgray mr5">
                            <i class="fa-2x fa fa-angle-double-up"></i>
                        </a>
                    </div>
                </div>
            </div>
            <!--搜索条件 -->
            <div class="toolbar-body">
                <form class="layui-form" action="" style="margin-top: 10px">
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-label">用户ID</label>
                            <div class="layui-input-block">
                                <input type="text" name="userId" placeholder="请输入用户ID" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label">用户名称</label>
                            <div class="layui-input-block">
                                <input type="text" name="userName" placeholder="请输入用户名称" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label">登录账号</label>
                            <div class="layui-input-block">
                                <input type="text" name="loginName" placeholder="请输入登录账号" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label">商户简称</label>
                            <div class="layui-input-block">
                                <input type="text" name="alias" placeholder="请输入商户简称" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-label">联系人手机</label>
                            <div class="layui-input-block">
                                <input type="text" name="contactMobile" placeholder="请输入联系人手机号" autocomplete="off" class="layui-input">
                            </div>
                        </div>

                        <div class="layui-inline">
                            <label class="layui-form-label">上级手机号</label>
                            <div class="layui-input-block">
                                <input type="text" name="parentPhone" placeholder="请输入上级手机号" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
    <!-- 表单数据 -->
    <div class="mb50 mt10">
        <div class="whitebg pl10 pr10">
            <table class="layui-hide" id="actUserListTab" lay-filter="actUserListTab"></table>
        </div>
    </div>
</div>

<script type="text/html" id="leftBar">
    <button type="button" class="layui-btn layui-btn-normal layui-btn-sm" lay-event="search"><i class="layui-icon">&#xe615;</i>查询</button>
</script>
</body>

<script>
    layui.use(['table', 'layer','form'], function(){
        var table = layui.table;
        var layer = layui.layer;
        var form = layui.form;
        var tableIns = table.render({
            elem: '#actUserListTab'
            ,url:'${ctx}/promoter/queryActPage'
            ,id: 'actUserList'
            ,response: {
                statusName: 'code' //数据状态的字段名称，默认：code
                ,countName: 'count' //数据总数的字段名称，默认：count
                ,dataName: 'data' //默数据列表的字段名称，认：data
                ,statusCode : 200
            }
            ,parseData: function(res){ //res 即为原始返回的数据
                return {
                    "code": res.code, //解析接口状态
                    "msg": res.message, //解析提示文本
                    "count": res.data.total, //解析数据长度
                    "data": res.data.records //解析数据列表
                };
            }
            ,toolbar: '#leftBar' //开启头部工具栏，并为其绑定左侧模板
            , defaultToolbar: ['filter']
            ,defaultToolbar: ['filter', 'exports', 'print', { //自定义头部工具栏右侧图标。如无需自定义，去除该参数即可
                title: '提示'
                ,layEvent: 'LAYTABLE_TIPS'
                ,icon: 'layui-icon-tips'
            }]
            ,title: '活动商户邀请详情表'
            ,cols: [[
                {type: 'checkbox', fixed: 'left', hidden: true}
                ,{field:'numbers', title:'序号', fixed: 'left', unresize: true, width:80, type:'numbers'}
                ,{field:'userId', title:'用户ID'}
                ,{field:'userName', title:'用户名称'}
                ,{field:'loginName', title:'登录账号'}
                ,{field:'alias', title:'商户简称'}
                ,{field:'contactMobile', title:'联系人手机'}
                ,{field:'parentPhone', title:'上级手机号'}
                ,{field:'level', title:'推广等级'}
                ,{field:'status', title:'状态',templet: function (d) {
                    if(d.status == '0'){
                        return '<span>未实名</span>';
                    }else if(d.status == '1'){
                        return '<span style="color: orangered">审核中</span>';
                    }else if(d.status == '2'){
                        return '<span style="color: red">审核失败</span>';
                    }else if(d.status == '3'){
                        return '<span style="color: green">已认证</span>';
                    }
                 }}
                ,{field:'nextRegisterCount', title:'邀请注册数量'}
                ,{field:'nextCertCount', title:'邀请认证数量'}
                ,{field:'nextIncomingCount', title:'邀请进件数量'}
                ,{field: 'createDt', title: '创建时间', width:160,templet : "<div>{{layui.util.toDateString(d.createDt,'yyyy-MM-dd HH:mm:ss')}}</div>"}
                /*,{fixed: 'right', title:'操作',width:180, toolbar: '#toolBar'}*/
            ]]
            ,request: {
                pageName: 'current' //页码的参数名称，默认：page
                ,limitName: 'size' //每页数据量的参数名，默认：limit
            }
            ,page: true
        });
        //监听头工具栏事件
        table.on('toolbar(actUserListTab)', function (obj) {
            switch (obj.event) {
                case 'search':
                    var params= serialize($('#form1'));
                    table.reload('actUserList', {
                        where: params
                        , page: {
                            size: 10
                            , current: 1
                        }
                    });
                    break;
            }
        });
    });
</script>

</html>

