<?php /*a:3:{s:68:"/home/affivpnx/app.peakwork.pro/app/admin/view/finance/reg_list.html";i:1763742184;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>

<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/Finance/withdraw'); ?>">
                        <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>
                        <div class="layui-inline">
                            <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>
                                <option value="3" <?php if($status == '3'): ?>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-normal">
                        总充值：<?php echo htmlentities($stat['price']); ?>
                    </button>
                    <!--<button class="layui-btn layui-btn-normal">-->
                    <!--    总手续：<?php echo htmlentities($stat['fee']); ?>-->
                    <!--</button>-->
                    <button class="layui-btn layui-btn-danger">
                        合计：<?php echo htmlentities($stat['total']); ?>
                    </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>用户</th>
                            <th>上级用户</th>
                            <th>银行信息</th>
                            <th>充值金额</th>
                            <th>支付凭证</th>
                            <th>状态</th>
                            <th>审核信息</th>
                            <th>创建时间</th>
                            <th>处理时间</th>
                            <th>操作</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><?php echo htmlentities($vo['username']); ?></td>
                            <td><?php echo htmlentities((isset($parent[$vo['pid']]) && ($parent[$vo['pid']] !== '')?$parent[$vo['pid']]:"暂无")); ?>(<?php echo htmlentities($vo['pid']); ?>)</td>
                            <td>
                                银行名称：<?php echo htmlentities($vo['name']); ?><br>
                                银行卡号：<?php echo htmlentities($vo['card_no']); ?><br>
                                
                                开户户名：<?php echo htmlentities($vo['account_name']); ?>
                            </td>
                            <td><?php echo htmlentities($vo['price']); ?></td>
                            <td>
                                <?php if($vo['proof'] != ''): ?>
                                <a href="javascript:;" onclick="viewProof('<?php echo htmlentities($vo['proof']); ?>')" class="layui-btn layui-btn-xs layui-btn-normal">
                                    查看
                                </a>
                                <?php else: ?>
                                <span style="color:#999;">无</span>
                                <?php endif; ?>
                            </td>
                            <td><?php echo htmlentities($vo['status_txt']); ?></td>
                            <td><?php echo htmlentities($vo['remark']); ?></td>
                            <td><?php echo htmlentities($vo['create_time']); ?></td>
                            <td><?php echo htmlentities($vo['handle_time']); ?></td>
                            <td class="td-manage" style="padding: 10px 5px">
                                <?php if($vo['status'] == '1'): ?>
                                <a class="layui-btn layui-btn-mini layui-btn-normal"
                                   href="javascript:;" onclick="regProcess(this,'<?php echo htmlentities($vo['id']); ?>')">
                                    审核
                                </a>
                                <?php endif; ?>
                            </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;
        laydate.render({
            elem: '#start_time', //指定元素
            type: 'datetime',
        });
    });

    function viewProof(proofPath) {
        layer.open({
            type: 1,
            title: '支付凭证',
            content: '<div style="text-align:center;padding:20px;"><img src="' + proofPath + '" style="max-width:100%;" /></div>',
            area: ['80%', '80%'],
            btn: ['关闭'],
            yes: function(index) {
                layer.close(index);
            }
        });
    }

    function regProcess(obj, id) {
        layer.open({
            type: 1,
            title: '充值审核',
            content: '<div style="padding: 10px"><input class="layui-input" id="process" type="text" autocomplete="off" placeholder="驳回原因"></div>',
            btn: ['通过', '驳回', '取消'],
            btnAlign: 'c',
            yes: function (index) {
                $.ajax({
                    url: '<?php echo url("admin/Finance/regProcess"); ?>',
                    type: 'post',
                    data: {'status': 2, 'id': id},
                    dataType: 'json',
                    success: function (res) {
                        if (res.status == '200') {
                            layer.close(index);
                            $(obj).parent().prevAll().eq(3).text('已通过');
                            $(obj).parent().prevAll().eq(0).text(res.data.time);
                            $(obj).remove();
                            tipAction(1, res.msg);
                        } else
                            tipAction(2, res.msg);
                    },
                    error: function () {
                        // layer.close(index);
                        tipAction(2, '系统繁忙');
                    }
                });
            },
            btn2: function (index) {
                var process = $('#process').val();
                if (process == '') {
                    tipAction(2, '请填写驳回原因');
                    return false;
                }
                $.ajax({
                    url: '<?php echo url("admin/Finance/regProcess"); ?>',
                    type: 'post',
                    data: {'status': 3, 'process': process, 'id': id},
                    dataType: 'json',
                    success: function (res) {
                        // layer.close(index)
                        if (res.status == '200') {
                            layer.close(index);
                            $(obj).parent().prevAll().eq(3).text('已驳回');
                            $(obj).parent().prevAll().eq(2).text(process);
                            $(obj).parent().prevAll().eq(0).text(res.data.time);
                            $(obj).remove();
                            tipAction(1, res.msg);
                        } else
                            tipAction(2, res.msg);
                    },
                    error: function () {
                        // layer.close(index);
                        tipAction(2, '系统繁忙');
                    }
                });
                return false;
            }
        });
    }
</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>

