| <div class="layui-fluid layui-anim febs-anim" id="febs-receive" lay-title="会员活动领取"> | 
|     <div class="layui-row febs-container"> | 
|         <div class="layui-col-md12"> | 
|             <div class="layui-card"> | 
|                 <div class="layui-card-body febs-table-full"> | 
|                     <form class="layui-form layui-table-form" lay-filter="user-table-form"> | 
|                         <div class="layui-row"> | 
|                             <div class="layui-col-md10"> | 
|                                 <div class="layui-form-item"> | 
|                                     <div class="layui-inline"> | 
|                                         <div class="layui-input-inline"> | 
|                                             <input type="text" placeholder="手机号/邮箱/邀请码" name="account" autocomplete="off" class="layui-input"> | 
|                                         </div> | 
|                                     </div> | 
|                                 </div> | 
|                             </div> | 
|                             <div class="layui-col-md2 layui-col-sm12 layui-col-xs12 table-action-area"> | 
|                                 <div class="layui-btn layui-btn-sm layui-btn-primary febs-button-blue-plain table-action" id="query"> | 
|                                     <i class="layui-icon"></i> | 
|                                 </div> | 
|                                 <div class="layui-btn layui-btn-sm layui-btn-primary febs-button-green-plain table-action" id="reset"> | 
|                                     <i class="layui-icon"></i> | 
|                                 </div> | 
|                             </div> | 
|                         </div> | 
|                     </form> | 
|                     <table lay-filter="userTable" lay-data="{id: 'userTable'}"></table> | 
|                 </div> | 
|             </div> | 
|         </div> | 
|     </div> | 
| </div> | 
| <!-- 表格操作栏 end --> | 
| <script data-th-inline="none" type="text/javascript"> | 
|     // 引入组件并初始化 | 
|     layui.use(['jquery', 'form', 'table', 'febs'], function () { | 
|         var $ = layui.jquery, | 
|             febs = layui.febs, | 
|             form = layui.form, | 
|             table = layui.table, | 
|             $view = $('#febs-receive'), | 
|             $query = $view.find('#query'), | 
|             $reset = $view.find('#reset'), | 
|             $searchForm = $view.find('form'), | 
|             sortObject = {field: 'phone', type: null}, | 
|             tableIns; | 
|   | 
|         form.render(); | 
|   | 
|         // 表格初始化 | 
|         initTable(); | 
|   | 
|         // 初始化表格操作栏各个按钮功能 | 
|         table.on('tool(userTable)', function (obj) { | 
|             var data = obj.data, | 
|                 layEvent = obj.event; | 
|   | 
|             if (layEvent === 'seeReceiveInfo') { | 
|                 febs.modal.open('领取详情', 'modules/member/seeReceiveInfo/' + data.id, { | 
|                     area: $(window).width() <= 750 ? '90%' : '80%', | 
|                     offset: '30px', | 
|                     btn2: function () { | 
|                         layer.closeAll(); | 
|                     }, | 
|                     cancel: function(){ | 
|                         var index=parent.layer.getFrameIndex(window.name); //获取当前窗口的name | 
|                         parent.layer.close(index);//关闭当前窗口 | 
|                         window.parent.location.reload();//刷新 | 
|                     } | 
|                 }); | 
|             } | 
|         }); | 
|         // 查询按钮 | 
|         $query.on('click', function () { | 
|             var params = $.extend(getQueryParams(), {field: sortObject.field, order: sortObject.type}); | 
|             tableIns.reload({where: params, page: {curr: 1}}); | 
|         }); | 
|   | 
|         // 刷新按钮 | 
|         $reset.on('click', function () { | 
|             $searchForm[0].reset(); | 
|             tableIns.reload({where: getQueryParams(), page: {curr: 1}}); | 
|         }); | 
|   | 
|         function initTable() { | 
|             tableIns = febs.table.init({ | 
|                 elem: $view.find('table'), | 
|                 id: 'userTable', | 
|                 url: ctx + 'member/memberActivityReceive', | 
|                 totalRow: true, | 
|                 cols: [[ | 
|                     {field: 'phone', title: '手机号', minWidth: 100, align: 'left'}, | 
|                     {field: 'realName', title: '姓名', minWidth: 100, align: 'left'}, | 
|                     {field: 'inviteId', title: '邀请码UID', minWidth: 80, align: 'center'}, | 
|                     {field: 'receiveTotal', title: '待领取', minWidth: 80, align: 'center',totalRow: true}, | 
|                     {field: 'receivedTotal', title: '已领取', minWidth: 80, align: 'center',totalRow: true}, | 
|                     {title: '领取记录', | 
|                         templet: function (d) { | 
|                             return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="seeReceiveInfo" shiro:hasPermission="user:update">查看</button>' | 
|                         }, minWidth: 100, align: 'center' | 
|                     }, | 
|                     {field: 'accountType', title: '账号类型', | 
|                         templet: function (d) { | 
|                             if (d.accountType === 2) { | 
|                                 return '<span style="color:green;">测试账号</span>' | 
|                             } else if (d.accountType === 1) { | 
|                                 return '<span style="color:red;">正常账号</span>' | 
|                             } else { | 
|                                 return '' | 
|                             } | 
|                         }, minWidth: 80, align: 'center' | 
|                     }, | 
|                     {field: 'email', title: '邮箱', minWidth: 100, align: 'left'}, | 
|                 ]] | 
|             }); | 
|         } | 
|   | 
|         // 获取查询参数 | 
|         function getQueryParams() { | 
|             return { | 
|                 account: $searchForm.find('input[name="account"]').val().trim(), | 
|             }; | 
|         } | 
|   | 
|     }) | 
| </script> |