123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151 |
- {extend name="public/layout"}
- {block name="body"}
- <style>
- .layui-table thead tr,
- .layui-table-header {
- background-color: #D8E6F1 !important;
- }
-
- .layui-tab-title .layui-this {
- background-color: #249EFB;
- color: #fff;
- }
- .layui-tab-title .layui-this:after {
- border-bottom: none;
- border: none;
- }
- .layui-tab-title li {
- background-color: #F2F2F2;
- margin: 0px 5px;
- }
- .layui-btn-xs,.layui-btn-xs:hover {
- border: 1px solid #249EFB;
- background-color: #fff;
- color: #249EFB;
- padding: 0px 10px;
- }
- .layui-btn-danger,.layui-btn-danger:hover{
- color: #FF5722;
- background-color: #fff;
- border: 1px solid #FF5722;
- padding: 0px 10px;
- }
- </style>
- <body>
- <div class="layui-fluid">
- <div class="layui-row layui-col-space15">
- <div class="layui-col-md12" style="background-color:#ffffff">
- <div class="tplay-body-div">
- <div class="layui-tab">
- <ul class="layui-tab-title">
- <li style="margin-left: 0px;">
- <a href="{:url('broad/chat')}">聊天记录</a>
- </li>
- <li class="layui-this">
- 黑名单
- </li>
- {if condition="$marketing_account eq 1"}
- <li>
- <a href="{:url('broad/waistcoat')}">系统客服</a>
- </li>
- {/if}
- </ul>
- </div>
- <div class="layui-card-body">
- <table class="layui-hide" id="user" lay-filter="user"></table>
- </div>
- </div>
- </div>
- </div>
- </div>
- {/block}
- {block name="js"}
- <script type="text/html" id="bt">
- <a class="layui-btn layui-btn-primary layui-btn-xs edit" title="删除" lay-event="del">删除</a>
- </script>
- <script>
- var indexurl = '{:url("broad/blacklist")}';
- var delurl= '{:url("live/blacklist_del")}';
- var t;
- layui.use(['table', 'form'], function () {
- var form = layui.form
- , table = layui.table
- , $ = layui.jquery
- , active = {
- reload: function () {
- var title = $('#title');
- //执行重载
- table.reload('userTable', {
- page: {
- curr: 1 //重新从第 1 页开始
- }
- , where: {
- title: title.val()
- }
- });
- }
- , del: function(){
- var that = this;
- var uid = this.data.uid;
- layer.confirm('确定要将该用户从黑名单中删除么?',{title: ['信息', 'color:#333333;background-color:#D8E6F1;']},function(index){
- $.post(delurl,{uid:uid}, function(res){
- var resp = JSON.parse(res);
- if (resp.code == 0) {
- layer.msg(resp.msg,{anim: 0},function(){
- location.reload();
- });
- } else {
- layer.msg(resp.msg,{anim: 6});
- }
- });
- layer.close(index);
- });
- }
- };
- //展示已知数据
- t = table.render({
- elem: '#user'
- , url: indexurl
- , page: true
- , autoSort: true
- , cols: [[ //标题栏
- {type: 'numbers', title: '序号', fixed: 'left', width: 50}
- , {templet: function(d){
- return d.user.nickname;
- }, title: '昵称'}
- , {field: 'addtime',title: '拉黑时间', width: 200, align:'center'}
- , {fixed: 'right', title: '操作', toolbar: '#bt', width: 100, align:'right'}
- ]]
- , id: 'userTable'
- });
- $('.layui-form>.layui-btn').on('click', function () {
- var type = $(this).data('type');
- active[type] ? active[type].call(this) : '';
- });
- table.on('sort(user)', function (obj) {
- table.reload('userTable', {
- initSort: obj
- , where: obj
- });
- });
- table.on('toolbar(user)', function (obj) {
- var type = obj.event;
- active[type] ? active[type].call(this) : '';
- });
- table.on('tool(user)', function (obj) {
- var type = obj.event;
- active[type] ? active[type].call(obj) : '';
- });
- });
- </script>
- {/block}
|