layui.define([ 'form', 'laydate', 'table' ], function(exports) { var form = layui.form; var laydate = layui.laydate; var table = layui.table; var auditTable = null; var data = {}; var view ={ init:function(e){ data = e; this.initTable(); }, initTable:function(){ moneyTable = table.render({ elem : '#moneyTable', method : 'post', url : Common.ctxPath+ '/admin/cuser/qromoter/queryQromoterList.json' //数据接口 ,page : true //开启分页 ,limit : 10, where: data, parseData :function(res){ //res 即为原始返回的数据 if(res.data.length == 0){ Common.info('并没有数据'); } return res; }, cols : [ [ //表头 { field: '', title : '角色', width : 120, templet: function () { return '推广员'; } },{ title : '昵称', width : 150, templet: function (d) { if(d.nickName == null){ return '--'; }else{ return $.base64.atob(d.nickName, true) + '(姓名: '+ (d.name != null ? d.name : '无')+')'; } } },{ field : 'mobilePhone', title : '手机号', width : 120 }, { field : 'userId', title : '用户ID', width : 120 }, { field : 'unregistCount', title : '未注册用户', width : 150, templet:function (d) { return d.unregistCount == null ? '--' : d.unregistCount; }, sort : true }, { field : 'registCount', title : '已注册用户', width : 120, templet:function (d) { return d.registCount == null ? '--' : d.registCount; }, sort : true },{ field : 'orderCount', title : '已下单用户', width : 120, templet:function (d) { return d.orderCount == null ? '--' : d.orderCount; }, sort : true } ,{ field: 'registTime', title: '注册时时间', width: 180, sort : true }, { field: 'x', title: '登录时间', width: 180, templet:function (data1) { return "--"; }, sort : true }, { field: '', title: '操作', templet: function (data) { console.log(data); return '查看'; } } ] ] }); }, } // 搜索 $("#search").click(function () { data = {'nickName':$("#name").val(), 'mobilePhone':$("#phone").val(),'userType':6}; view.init(data); }); exports('promoterCuser',view); });