<?php /*a:3:{s:68:"/home/affivpnx/app.peakwork.pro/app/admin/view/member/user_list.html";i:1770231727;s:65:"/home/affivpnx/app.peakwork.pro/app/admin/view/public/header.html";i:1763742186;s:65:"/home/affivpnx/app.peakwork.pro/app/admin/view/public/footer.html";i:1763742186;}*/ ?>
<!doctype html>
<html class="x-admin-sm">
<head>
    <meta charset="UTF-8">
    <title>后台登录-<?php echo htmlentities($system_name); ?></title>
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi"/>
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <link rel="stylesheet" href="/static/admin/css/font.css">
    <link rel="stylesheet" href="/static/admin/css/xadmin.css">
    <script type="text/javascript" src="/static/admin/js/jquery.min.js"></script>
    <!-- <link rel="stylesheet" href="./css/theme5.css"> -->
    <script src="/static/admin/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="/static/admin/js/xadmin.js?date=<?php echo date('Ymd'); ?>"></script>
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
    <script src="/static/admin/js/html5.min.js"></script>
    <script src="/static/admin/js/respond.min.js"></script>
    <![endif]-->
</head>

<style>
    .td-hidden-txt {
        text-overflow: ellipsis;
        overflow: hidden;
        white-space: nowrap;
    }

    /* Button Grouping Styles */
    .btn-group {
        margin: 8px 0;
        padding: 8px 0;
        display: block;
    }

    .btn-group-primary {
        border-left: 4px solid #1E9FFF;
        padding-left: 10px;
        background: rgba(30, 159, 255, 0.05);
        border-radius: 4px;
        margin-bottom: 10px;
    }

    .btn-group-view {
        border-left: 4px solid #5FB878;
        padding-left: 10px;
        background: rgba(95, 184, 120, 0.05);
        border-radius: 4px;
        margin-bottom: 10px;
    }

    .btn-group-account {
        border-left: 4px solid #FFB800;
        padding-left: 10px;
        background: rgba(255, 184, 0, 0.05);
        border-radius: 4px;
        margin-bottom: 10px;
    }

    .btn-group-utility {
        border-left: 4px solid #999;
        padding-left: 10px;
        background: rgba(153, 153, 153, 0.05);
        border-radius: 4px;
        margin-bottom: 10px;
    }

    /* Make buttons display as block within groups */
    .btn-group a {
        display: block;
        width: 100%;
        margin: 4px 0;
        text-align: left;
    }


    /* Responsive Design */
    @media (max-width: 768px) {
        .td-manage {
            min-width: 200px;
        }

        .btn-group {
            display: flex;
            flex-direction: column;
            gap: 5px;
        }

        .btn-group a {
            width: 100%;
            text-align: center;
        }
    }

    /* Button spacing - removed as buttons are now block in groups */
    .td-manage {
        min-width: 180px;
    }
</style>

<body>
    <div class="x-nav">
        <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right"
            onclick="location.reload()" title="刷新">
            <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i>
        </a>
    </div>
    <div class="layui-fluid">
        <div class="layui-row layui-col-space15">
            <div class="layui-col-md12">
                <div class="layui-card">
                    <div class="layui-card-body ">
                        <form class="layui-form layui-col-space5" action="<?php echo url('admin/Member/userList'); ?>">
                            <div class="layui-inline layui-show-xs-block">
                                <input type="text" name="nickname" placeholder="请输入用户账号" autocomplete="off"
                                    class="layui-input" value="<?php echo htmlentities($nickname); ?>">
                            </div>
                            <?php if(!(empty($agent) || (($agent instanceof \think\Collection || $agent instanceof \think\Paginator ) && $agent->isEmpty()))): ?>
                            <div class="layui-inline layui-show-xs-block">
                                <select name="ag_id">
                                    <option value="0">请选择下级代理</option>
                                    <?php if(is_array($agent) || $agent instanceof \think\Collection || $agent instanceof \think\Paginator): if( count($agent)==0 ) : echo "" ;else: foreach($agent as $ko=>$vo): ?>
                                    <option value="<?php echo htmlentities($ko); ?>" <?php if($ag_id == $ko): ?>selected<?php endif; ?>><?php echo htmlentities($vo); ?></option>
                                    <?php endforeach; endif; else: echo "" ;endif; ?>
                                </select>
                            </div>
                            <?php endif; ?>
                            <div class="layui-inline layui-show-xs-block">
                                <select name="type">
                                    <option value="0">请选择用户类型</option>
                                    <option value="1" <?php if($type == '1'): ?>selected<?php endif; ?>>测试用户</option>
                                    <option value="2" <?php if($type == '2'): ?>selected<?php endif; ?>>正式用户</option>
                                    <option value="3" <?php if($type == '3'): ?>selected<?php endif; ?>>代理用户</option>
                                </select>
                            </div>
                            <div class="layui-inline layui-show-xs-block">
                                <select name="status">
                                    <option value="0">请选择状态</option>
                                    <option value="1" <?php if($status == '1'): ?>selected<?php endif; ?>>启用</option>
                                    <option value="2" <?php if($status == '2'): ?>selected<?php endif; ?>>禁用</option>
                                </select>
                            </div>
                            <div class="layui-input-inline layui-show-xs-block">
                                <input type="text" name="start_time" placeholder="开始时间" autocomplete="off" readonly
                                    id="start_time" value="<?php echo htmlentities($start_time); ?>" class="layui-input">
                            </div>
                            <div class="layui-inline layui-show-xs-block">
                                <button class="layui-btn" lay-filter="sreach">
                                    <i class="layui-icon">&#xe615;</i>
                                </button>
                            </div>
                        </form>
                    </div>
                    <div class="layui-card-header">
                        <button class="layui-btn layui-btn-danger" onclick="disAll()">
                            <i class="layui-icon layui-icon-delete"></i>批量禁用
                        </button>
                        <button class="layui-btn"
                            onclick="xadmin.open('添加会员','<?php echo url('admin/Member/userAdd'); ?>',800,500)">
                            <i class="layui-icon layui-icon-add-1"></i>添加会员
                        </button>
                        <span style="float: right">共有数据：<?php echo htmlentities($list->total()); ?> 条</span>
                    </div>
                    <div class="layui-card-body" style="overflow-x: auto">
                        <table class="layui-table layui-form">
                            <thead>
                                <tr>
                                    <th>
                                        <input type="checkbox" lay-filter="checkall" name="" lay-skin="primary">
                                    </th>
                                    <th width="30px">ID</th>
                                    <th>基础信息</th>
                                    <th>账号信息</th>
                                    <th>钱包信息</th>
                                    <th>任务情况</th>
                                    <th>邀请码</th>
                                    <th>登录信息</th>
                                    <th>注册时间</th>
                                    <th width="230px">操作</th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php if(is_array($list) || $list instanceof \think\Collection || $list instanceof \think\Paginator): if( count($list)==0 ) : echo "" ;else: foreach($list as $key=>$vo): ?>
                                <tr>
                                    <td>
                                        <input type="checkbox" name="uid" value="<?php echo htmlentities($vo['id']); ?>" lay-skin="primary">
                                    </td>
                                    <td><?php echo htmlentities($vo['id']); ?></td>
                                    <td>
                                        账号：<?php echo htmlentities($vo['username']); ?><br>
                                        昵称：<?php echo htmlentities($vo['nickname']); ?><br>
                                        等级：<?php echo htmlentities($vo['level_name']); ?><br>
                                        上级：<?php echo htmlentities((isset($parent[$vo['pid']]) && ($parent[$vo['pid']] !== '')?$parent[$vo['pid']]:"暂无")); ?>(<?php echo htmlentities($vo['pid']); ?>)<br>
                                        代理：<?php echo htmlentities((isset($parent[$vo['agent_id']]) && ($parent[$vo['agent_id']] !== '')?$parent[$vo['agent_id']]:"暂无")); ?>(<?php echo htmlentities($vo['agent_id']); ?>)
                                    </td>
                                    <td>
                                        类型：<span id="type<?php echo htmlentities($vo['id']); ?>"><?php echo htmlentities($vo['type']); ?></span><br>
                                        状态：<span id="status<?php echo htmlentities($vo['id']); ?>"><?php echo htmlentities($vo['status_txt']); ?></span><br>
                                        交易：<span id="trade<?php echo htmlentities($vo['id']); ?>"><?php echo htmlentities($vo['trade_txt']); ?></span><br>
                                        信用：<?php echo htmlentities($vo['credit_score']); ?>
                                    </td>
                                    <td>
                                        可用资金：<span id="balance<?php echo htmlentities($vo['id']); ?>"><?php echo htmlentities($vo['balance']); ?></span><br>
                                        冻结资金：<?php echo htmlentities($vo['freeze_balance']); ?><br>
                                        累计充值：<span id="recharge<?php echo htmlentities($vo['id']); ?>"><?php echo htmlentities($vo['recharge']); ?></span><br>
                                        累计提现：<?php echo htmlentities($vo['withdraw']); ?><br>
                                        累计佣金：<span id="commission<?php echo htmlentities($vo['id']); ?>"><?php echo htmlentities($vo['commission']); ?></span>
                                    </td>
                                    <td><?php echo htmlentities($vo['order_total']); ?>-<?php echo htmlentities($vo['order_num']); ?></td>
                                    <td><?php echo htmlentities($vo['invite_code']); ?></td>
                                    <td>
                                        登录时间：<?php echo htmlentities($vo['login_time']); ?><br>
                                        登录ip：<?php echo htmlentities($vo['login_ip']); ?>
                                    </td>
                                    <td><?php echo htmlentities($vo['create_time']); ?></td>
                                    <td class="td-manage" style="padding: 10px 5px">
                                        <!-- Primary Actions Group -->
                                        <div class="btn-group btn-group-primary">
                                            <a class="layui-btn layui-btn-mini" href="javascript:;"
                                                onclick="xadmin.open('编辑会员','<?php echo url('admin/Member/userAdd',['id'=>$vo['id']]); ?>',800,500)"
                                                title="编辑会员基本信息">
                                                <i class="layui-icon layui-icon-edit"></i>编辑资料
                                            </a>
                                            <a class="layui-btn layui-btn-mini layui-btn-normal" href="javascript:;"
                                                onclick="balanceChange('<?php echo htmlentities($vo['id']); ?>')" title="调整会员余额">
                                                <i class="layui-icon layui-icon-rmb"></i>余额调整
                                            </a>
                                            <a class="layui-btn layui-btn-mini layui-btn-warm" href="javascript:;"
                                                onclick="xadmin.open('编辑订单设置','<?php echo url('admin/Member/orderConfig',['uid'=>$vo['id']]); ?>',1000,700)"
                                                title="配置订单规则">
                                                <i class="layui-icon layui-icon-set"></i>订单设置
                                            </a>
                                            <a class="layui-btn layui-btn-mini layui-btn-warm"
                                                data-num="<?php echo htmlentities($vo['order_num']); ?>" href="javascript:;"
                                                onclick="resetOrder(this,'<?php echo htmlentities($vo['id']); ?>')" title="重置订单">
                                                <i class="layui-icon layui-icon-refresh-3"></i>重置订单
                                            </a>
                                            <a class="layui-btn layui-btn-mini layui-btn-normal" href="javascript:;"
                                                onclick="commissionChange('<?php echo htmlentities($vo['id']); ?>', '<?php echo htmlentities($vo['commission']); ?>')"
                                                title="调整累计佣金 (UI显示的佣金)">
                                                <i class="layui-icon layui-icon-set-fill"></i>佣金设置
                                            </a>
                                        </div>

                                        <!-- View Actions Group -->
                                        <div class="btn-group btn-group-view">
                                            <a class="layui-btn layui-btn-mini layui-btn-normal" href="javascript:;"
                                                onclick="xadmin.open('团队信息','<?php echo url('admin/Member/team',['pid'=>$vo['id']]); ?>',1200,700)"
                                                title="查看下级团队">
                                                <i class="layui-icon layui-icon-group"></i>查看团队
                                            </a>
                                            <a class="layui-btn layui-btn-mini layui-btn-normal" href="javascript:;"
                                                onclick="xadmin.open('钱包明细','<?php echo url('admin/Finance/wallet',['uid'=>$vo['id']]); ?>',1200,700)"
                                                title="查看账变记录">
                                                <i class="layui-icon layui-icon-chart"></i>账变数据
                                            </a>
                                        </div>

                                        <!-- Account Management Group -->
                                        <div class="btn-group btn-group-account">
                                            <a class="layui-btn layui-btn-mini layui-btn-warm" href="javascript:;"
                                                onclick="changePass('<?php echo htmlentities($vo['id']); ?>')" title="修改登录密码 and 取款密码">
                                                <i class="layui-icon layui-icon-password"></i>密码修改
                                            </a>
                                            <a class="layui-btn layui-btn-mini <?php if($vo['status'] == '1'): ?>layui-btn-danger<?php else: ?>layui-btn-normal<?php endif; ?>"
                                                href="javascript:;" data-status="<?php echo htmlentities($vo['status']); ?>"
                                                onclick="userDisable(this,0,'<?php echo htmlentities($vo['id']); ?>')" title="启用或禁用账号">
                                                <i
                                                    class="layui-icon <?php if($vo['status'] == '1'): ?>layui-icon-pause<?php else: ?>layui-icon-play<?php endif; ?>"></i>
                                                账号<?php if($vo['status'] == '1'): ?>禁用<?php else: ?>启用<?php endif; ?>
                                            </a>
                                            <a class="layui-btn layui-btn-mini <?php if($vo['trade_status'] == '1'): ?>layui-btn-danger<?php else: ?>layui-btn-normal<?php endif; ?>"
                                                href="javascript:;" data-status="<?php echo htmlentities($vo['trade_status']); ?>"
                                                onclick="userDisable(this,1,'<?php echo htmlentities($vo['id']); ?>')" title="启用或禁用交易功能">
                                                <i
                                                    class="layui-icon <?php if($vo['trade_status'] == '1'): ?>layui-icon-pause<?php else: ?>layui-icon-play<?php endif; ?>"></i>
                                                交易<?php if($vo['trade_status'] == '1'): ?>禁用<?php else: ?>启用<?php endif; ?>
                                            </a>
                                        </div>

                                        <!-- Utility Actions Group -->
                                        <div class="btn-group btn-group-utility">
                                            <?php if($vo['is_agent'] == '0'): ?>
                                            <a class="layui-btn layui-btn-mini layui-btn-danger" href="javascript:;"
                                                data-type="<?php echo htmlentities($vo['is_test']); ?>" onclick="typeChange(this,0,'<?php echo htmlentities($vo['id']); ?>')"
                                                title="切换测试/正式用户">
                                                <i class="layui-icon layui-icon-user"></i>
                                                设为<?php if($vo['is_test'] == '1'): ?>正式<?php else: ?>测试<?php endif; ?>
                                            </a>
                                            <a class="layui-btn layui-btn-mini layui-btn-danger" href="javascript:;"
                                                data-type="<?php echo htmlentities($vo['is_agent']); ?>" onclick="typeChange(this,1,'<?php echo htmlentities($vo['id']); ?>')"
                                                title="切换普通/代理用户">
                                                <i class="layui-icon layui-icon-user"></i>
                                                设为<?php if($vo['is_agent'] == '1'): ?>普通<?php else: ?>代理<?php endif; ?>
                                            </a>
                                            <?php endif; ?>
                                        </div>
                                    </td>
                                </tr>
                                <?php endforeach; endif; else: echo "" ;endif; ?>
                            </tbody>
                        </table>
                    </div>
                    <div class="layui-card-body">
                        <div class="page">
                            <?php echo $list; ?>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
<script type="text/javascript">
    layui.use(['form', 'laydate'], function () {
        var laydate = layui.laydate;
        var form = layui.form;
        laydate.render({
            elem: '#start_time', //指定元素
            type: 'datetime',
        });
        // 监听全选
        form.on('checkbox(checkall)', function (data) {
            if (data.elem.checked) {
                $('tbody input').prop('checked', true);
            } else {
                $('tbody input').prop('checked', false);
            }
            form.render('checkbox');
        });
    });

    function balanceChange(id) {
        layer.open({
            type: 1,
            title: '余额调整',
            content: '<div style="padding: 10px"><input class="layui-input" id="balance_change" type="text" autocomplete="off" placeholder="请输入调整金额"></div>',
            btn: ['加款', '扣款', '取消'],
            btnAlign: 'c',
            yes: function (index) {
                var price = parseFloat($('#balance_change').val());
                var balance = parseFloat($('#balance' + id + '').text()) + price;
                var recharge = parseFloat($('#recharge' + id + '').text()) + price;
                $.ajax({
                    url: '<?php echo url("admin/Member/balanceChange"); ?>',
                    type: 'post',
                    data: { 'dire': 1, 'price': price, 'uid': id },
                    dataType: 'json',
                    success: function (res) {
                        if (res.status == '200') {
                            layer.close(index);
                            $('#balance' + id + '').text(balance);
                            $('#recharge' + id + '').text(recharge);
                            tipAction(1, res.msg);
                        } else
                            tipAction(2, res.msg);
                    },
                    error: function () {
                        // layer.close(index);
                        tipAction(2, '系统繁忙');
                    }
                });
            },
            btn2: function (index) {
                var price = parseFloat($('#balance_change').val());
                var balance = parseFloat($('#balance' + id + '').text()) - price;
                var recharge = parseFloat($('#recharge' + id + '').text()) - price;
                $.ajax({
                    url: '<?php echo url("admin/Member/balanceChange"); ?>',
                    type: 'post',
                    data: { 'dire': 2, 'price': price, 'uid': id },
                    dataType: 'json',
                    success: function (res) {
                        // layer.close(index)
                        if (res.status == '200') {
                            layer.close(index);
                            $('#balance' + id + '').text(balance);
                            $('#recharge' + id + '').text(recharge);
                            tipAction(1, res.msg);
                        } else
                            tipAction(2, res.msg);
                    },
                    error: function () {
                        // layer.close(index);
                        tipAction(2, '系统繁忙');
                    }
                });
                return false;
            }
        });
    }

    //重置
    function resetOrder(obj, id) {
        layer.confirm('是否要重置今日任务量', function () {
            $.ajax({
                url: '<?php echo url("admin/Member/resetOrder"); ?>',
                type: 'post',
                data: { "id": id },
                dataType: 'json',
                success: function (res) {
                    if (res.status == '200') {
                        tipAction(1, res.msg);
                        $(obj).parent().prevAll().eq(3).text('0-' + $(obj).data('num'));
                    } else
                        tipAction(2, res.msg);
                }
            });
        })
    }

    //批量禁用
    function disAll() {
        layer.confirm('确认要禁用吗？', function (index) {
            //发异步删除数据
            var id_arr = [];
            $('input[name="uid"]:checked').each(function () {
                id_arr.push(this.value);
            });
            if (id_arr.length > 0) {
                $.ajax({
                    url: '<?php echo url("admin/Member/userDisable"); ?>',
                    type: 'post',
                    data: { 'ids': id_arr, 'type': 0, 'status': 2 },
                    dataType: 'json',
                    success: function (res) {
                        if (res.status == '200') {
                            tipAction(1, res.msg);
                        } else {
                            tipAction(2, res.msg);
                        }
                    },
                    error: function () {
                        tipAction(2, '系统繁忙');
                    }
                });
            }
            layer.close(index);
        });
    }

    //状态禁用
    function userDisable(obj, type, id) {
        var txt, status_txt, status_new, status_txt_new;
        var status = $(obj).attr('data-status');
        if (status == 1) {
            status_txt = '禁用';
            status_new = 2;
            status_txt_new = '启用';
        } else {
            status_txt = '启用';
            status_new = 1;
            status_txt_new = '禁用';
        }
        if (type)
            txt = '是否要设置交易状态：' + status_txt;
        else
            txt = '是否要设置用户状态：' + status_txt;
        layer.confirm(txt, function (index) {
            //发异步删除数据
            $.ajax({
                url: '<?php echo url("admin/Member/userDisable"); ?>',
                type: 'post',
                data: { 'id': id, 'type': type, 'status': status_new },
                dataType: 'json',
                success: function (res) {
                    if (res.status == '200') {
                        if (type) {
                            $(obj).attr('data-status', status_new).text('交易' + status_txt_new);
                            $('#trade' + id + '').text(status_txt);
                        } else {
                            $(obj).attr('data-status', status_new).text('账号' + status_txt_new);
                            $('#status' + id + '').text(status_txt);
                        }
                        tipAction(1, res.msg);
                    } else {
                        tipAction(2, res.msg);
                    }
                },
                error: function () {
                    tipAction(2, '系统繁忙');
                }
            });
        });
    }

    function typeChange(obj, type, id) {
        var txt, status_txt, status_new, status_txt_new;
        var status = $(obj).attr('data-type');
        if (status == 1) {
            if (type) {
                status_txt = '普通用户';
                status_txt_new = '代理';
            } else {
                status_txt = '正式用户';
                status_txt_new = '测试';
            }
            status_new = 0;
        } else {
            if (type) {
                status_txt = '代理用户';
                status_txt_new = '普通';
            } else {
                status_txt = '测试用户';
                status_txt_new = '正式';
            }
            status_new = 1;
        }
        if (type)
            txt = '是否设置为：' + status_txt;
        else
            txt = '是否设置为：' + status_txt;
        layer.confirm(txt, function (index) {
            //发异步删除数据
            $.ajax({
                url: '<?php echo url("admin/Member/typeChange"); ?>',
                type: 'post',
                data: { 'id': id, 'type': type, 'status': status_new },
                dataType: 'json',
                success: function (res) {
                    if (res.status == '200') {
                        if (type) {
                            $(obj).prev().prev().remove();
                            $(obj).prev().remove();
                            $(obj).remove();
                        } else {
                            $(obj).attr('data-type', status_new).text('设为' + status_txt_new);
                        }
                        $('#type' + id + '').text(status_txt);
                        tipAction(1, res.msg);
                    } else {
                        tipAction(2, res.msg);
                    }
                },
                error: function () {
                    tipAction(2, '系统繁忙');
                }
            });
        });
    }

    //密码修改
    function changePass(id) {
        layer.open({
            type: 1,
            title: '密码修改',
            content: '<div style="padding: 15px 20px 0 0"><div class="layui-form-item"><label for="password" class="layui-form-label">登录密码</label><div class="layui-input-inline">' +
                '<input type="text" id="password" autocomplete="off" class="layui-input" value=""></div></div>' +
                '<div class="layui-form-item"><label for="deal_pass" class="layui-form-label">取款密码</label><div class="layui-input-inline">' +
                '<input type="text" id="deal_pass" autocomplete="off" class="layui-input" value=""></div></div></div>',
            btn: ['确定', '取消'],
            yes: function (index) {
                var password = $('#password').val();
                var deal_pass = $('#deal_pass').val();
                if (password == '' && deal_pass == '') {
                    tipAction(2, '无任何修改');
                } else {
                    $.ajax({
                        url: '<?php echo url("admin/Member/changePass"); ?>',
                        type: 'post',
                        data: { 'id': id, 'password': password, 'deal_pass': deal_pass },
                        dataType: 'json',
                        success: function (res) {
                            if (res.status == '200') {
                                tipAction(1, res.msg);
                                layer.close(index);
                            } else {
                                tipAction(2, res.msg);
                            }
                        }
                    });
                }
            }
        });
    }

    //佣金修改
    function commissionChange(id, current) {
        layer.open({
            type: 1,
            title: '佣金设置',
            content: '<div style="padding: 10px"><input class="layui-input" id="commission_new" type="text" autocomplete="off" placeholder="请输入新佣金值" value="' + current + '"></div>',
            btn: ['确定', '取消'],
            btnAlign: 'c',
            yes: function (index) {
                var commission = $('#commission_new').val();
                $.ajax({
                    url: '<?php echo url("admin/Member/commissionChange"); ?>',
                    type: 'post',
                    data: { 'commission': commission, 'uid': id },
                    dataType: 'json',
                    success: function (res) {
                        if (res.status == '200') {
                            layer.close(index);
                            $('#commission' + id + '').text(commission);
                            tipAction(1, res.msg);
                        } else
                            tipAction(2, res.msg);
                    },
                    error: function () {
                        tipAction(2, '系统繁忙');
                    }
                });
            }
        });
    }
</script>
</html>
<script type="application/javascript">
    /**
     * 统一接口返回提示弹窗
     * type 1-成功 2-失败
     * info 提示信息
     * */
    function tipAction(type, info) {
        layer.msg(info, {icon: type, time: 1500})
    }

    //图片放大
    function showBig(obj) {
        let img_src = $(obj).attr('src');
        layer.open({
            type: 1,
            area: ['70%', 'auto'],
            shadeClose: true,
            title: false,
            closeBtn: false,
            content: `<div style=""><img src="${img_src}" alt="" width="100%"></div>`
        });
    }
</script>
