<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta name="renderer" content="webkit">
    <meta name="renderer" content="ie-comp">
    <meta name="renderer" content="ie-stand">
    <meta name="csrf-token" content="{{ csrf_token() }}">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title></title>
    <link rel="stylesheet" href="{{ asset('frame/layui/css/layui.css') }}" media="all">
    <style>
        body {
            margin: 10px;
        }

        .layui-form-label {
            width: 150px;
        }

        .layui-input-block {
            margin-left: 180px;
        }
    </style>
</head>
<body>


<div class="layui-collapse" lay-filter="test" lay-accordion="">
    <div class="layui-colla-item">
        <h2 class="layui-colla-title" data-type="{{$notice['infotype']}}">公告设置</h2>
        <div class="layui-colla-content layui-show">
            <form class="layui-form" action="">
                <input type="hidden" name="type" value="{{$notice['infotype']}}">
                <div class="layui-form-item">
                    <label class="layui-form-label">公告</label>
                    <div class="layui-input-block">
                        <input type="text" name="infocontent" lay-verify="title" autocomplete="off" placeholder="公告内容"
                               class="layui-input" value="{{$notice['infocontent']}}">
                    </div>
                </div>
            </form>
        </div>
    </div>
    <div class="layui-colla-item">
        <h2 class="layui-colla-title" data-type="{{$tan_box['infotype']}}">弹窗设置</h2>
        <div class="layui-colla-content">

            <form class="layui-form" action="">
                <input type="hidden" name="type" value="{{$tan_box['infotype']}}">
                <div class="layui-form-item">
                    <label class="layui-form-label">弹窗内容</label>
                    <div class="layui-input-block">
                        <input type="text" name="infocontent" lay-verify="title" autocomplete="off" placeholder=""
                               class="layui-input" value="{{$tan_box['infocontent']}}">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">是否开启弹窗</label>
                    <div class="layui-input-block">
                        <input type="radio" name="status" eventType="event-query" value="1" title="启用"
                               @if($tan_box['status']==1) checked @endif>
                        <input type="radio" name="status" eventType="event-query" value="0" title="关闭"
                               @if($tan_box['status']==0) checked @endif>
                    </div>
                </div>
            </form>

        </div>
    </div>
    <div class="layui-colla-item">
        <h2 class="layui-colla-title" data-type="{{$qq['infotype']}}">客服QQ设置</h2>
        <div class="layui-colla-content">
            <form class="layui-form" action="">
                <input type="hidden" name="type" value="{{$qq['infotype']}}">
                <div class="layui-form-item">
                    <label class="layui-form-label">QQ号码</label>
                    <div class="layui-input-block">
                        <input type="text" name="title" lay-verify="title" autocomplete="off" placeholder=""
                               class="layui-input" value="{{$qq['infocontent']}}">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">是否开启QQ</label>
                    <div class="layui-input-block">
                        <input type="radio" name="status" value="1" title="启用" @if($qq['status']==1) checked @endif>
                        <input type="radio" name="status" value="0" title="关闭" @if($qq['status']==0) checked @endif>
                    </div>
                </div>
            </form>

        </div>
    </div>
    <div class="layui-colla-item">
        <h2 class="layui-colla-title" data-type="{{$agent['infotype']}}">代理设置</h2>
        <div class="layui-colla-content">
            <form class="layui-form" action="">
                <input type="hidden" name="type" value="{{$agent['infotype']}}">
                <div class="layui-form-item">
                    <label class="layui-form-label">是否开启代理模式</label>
                    <div class="layui-input-block">
                        <input type="radio" name="status" value="1" title="启用" @if($agent['status']==1) checked @endif>
                        <input type="radio" name="status" value="0" title="关闭" @if($agent['status']==0) checked @endif>
                    </div>
                </div>
            </form>
        </div>
    </div>
    <div class="layui-colla-item">
        <h2 class="layui-colla-title" data-type="{{$plat['infotype']}}">平台维护</h2>
        <div class="layui-colla-content">
            <form class="layui-form" action="">
                <input type="hidden" name="type" value="{{$plat['infotype']}}">
                <div class="layui-form-item">
                    <label class="layui-form-label">是否开启平台维护</label>
                    <div class="layui-input-block">
                        <input type="radio" name="status" value="1" title="启用" @if($plat['status']==1) checked @endif>
                        <input type="radio" name="status" value="0" title="关闭" @if($plat['status']==0) checked @endif>
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">密码</label>
                    <div class="layui-input-inline">
                        <input type="password" name="password" lay-verify="title" autocomplete="off" placeholder="请输入密码"
                               class="layui-input">
                    </div>
                </div>

            </form>
        </div>
    </div>
    <div class="layui-colla-item">
        <h2 class="layui-colla-title" data-type="{{$game['infotype']}}">虚拟中奖信息设置</h2>
        <div class="layui-colla-content">
            <form class="layui-form" action="">
                <input type="hidden" name="type" value="{{$game['infotype']}}">
                <div class="layui-form-item">
                    <label class="layui-form-label">是否开启虚拟数据</label>
                    <div class="layui-input-block">
                        <input type="radio" name="status" value="1" title="启用" @if($game['status']==1) checked @endif>
                        <input type="radio" name="status" value="0" title="关闭" @if($game['status']==0) checked @endif>
                    </div>
                </div>

            </form>
        </div>
    </div>
    <div class="layui-colla-item">
        <h2 class="layui-colla-title" data-type="{{$run['infotype']}}">充值跑马灯设置</h2>
        <div class="layui-colla-content">

            <form class="layui-form" action="">
                <input type="hidden" name="type" value="{{$run['infotype']}}">
                <div class="layui-form-item">
                    <label class="layui-form-label">充值跑马灯内容</label>
                    <div class="layui-input-block">
                        <input type="text" name="title" lay-verify="title" autocomplete="off" placeholder=""
                               class="layui-input" value="{{$run['infocontent']}}">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">是否开启跑马灯</label>
                    <div class="layui-input-block">
                        <input type="radio" name="status" value="1" title="启用" @if($run['status']==1) checked @endif>
                        <input type="radio" name="status" value="0" title="关闭" @if($run['status']==0) checked @endif>
                    </div>
                </div>
            </form>

        </div>
    </div>
    <div class="layui-colla-item">
        <h2 class="layui-colla-title" data-type="">收账银行卡信息管理</h2>
        <div class="layui-colla-content" id='bank'>
        @foreach($bank as $v)
            <form class="layui-form" action="">
                <input type="hidden" name="type" value="{{$v['infotype']}}">
                <div class="layui-form-item">
                    <label class="layui-form-label">用户名：</label>
                    <div class="layui-input-block">
                        <input type="text" name="infoname" lay-verify="title" autocomplete="off" placeholder=""
                               class="layui-input" value="{{$v['infoname']}}">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">银行卡号：</label>
                    <div class="layui-input-block">
                        <input type="text" name="infocontent" lay-verify="title" autocomplete="off" placeholder=""
                               class="layui-input" value="{{$v['infocontent']}}">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">银行：</label>
                    <div class="layui-input-block">
                        <input type="text" name="remarks" lay-verify="title" autocomplete="off" placeholder=""
                               class="layui-input" value="{{$v['remarks']}}">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">开户网点：</label>
                    <div class="layui-input-block">
                        <input type="text" name="extinfo" lay-verify="title" autocomplete="off" placeholder=""
                               class="layui-input" value="{{$v['extinfo']}}">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">是否启用银行卡</label>
                    <div class="layui-input-block">
                        <input type="radio" name="status" value="1" title="启用" @if($v['status']==1) checked @endif>
                        <input type="radio" name="status" value="0" title="关闭" @if($v['status']==0) checked @endif>
                    </div>
                </div>
            </form>
        @endforeach
        </div>
    </div>
    <div class="layui-colla-item">
        <h2 class="layui-colla-title">会员注册设置</h2>
        <div class="layui-colla-content">
            <form class="layui-form" action="">
                <input type="hidden" name="type" value="huiyaun">
                <div class="layui-form-item">
                    <label class="layui-form-label">是否启用邮箱注册</label>
                    <div class="layui-input-block">
                        <input type="radio" name="enable_mail" value="1" title="启用"
                               @if($reg['enable_mail']==1) checked @endif>
                        <input type="radio" name="enable_mail" value="0" title="关闭"
                               @if($reg['enable_mail']==0) checked @endif>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">是否启QQ</label>
                    <div class="layui-input-block">
                        <input type="radio" name="enable_qq" value="1" title="启用"
                               @if($reg['enable_qq']==1) checked @endif>
                        <input type="radio" name="enable_qq" value="0" title="关闭"
                               @if($reg['enable_qq']==0) checked @endif>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">是否启用手机</label>
                    <div class="layui-input-block">
                        <input type="radio" name="enable_phone" value="1" title="启用"
                               @if($reg['enable_phone']==1) checked @endif>
                        <input type="radio" name="enable_phone" value="0" title="关闭"
                               @if($reg['enable_phone']==0) checked @endif>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">是否启用真实姓名验证</label>
                    <div class="layui-input-block">
                        <input type="radio" name="rel_name" value="1" title="启用"
                               @if($reg['rel_name']==1) checked @endif>
                        <input type="radio" name="rel_name" value="0" title="关闭"
                               @if($reg['rel_name']==0) checked @endif>
                    </div>
                </div>
                <!--<div class="layui-form-item">
                    <label class="layui-form-label">是否启用介绍人</label>
                    <div class="layui-input-block">
                        <input type="radio" name="sex" value="启用" title="启用" checked="">
                        <input type="radio" name="sex" value="关闭" title="关闭">
                    </div>
                </div>-->
                <div class="layui-form-item">
                    <label class="layui-form-label">是否启用短信验证</label>
                    <div class="layui-input-block">
                        <input type="radio" name="enable_sms" value="1" title="启用"
                               @if($reg['enable_sms']==1) checked @endif>
                        <input type="radio" name="enable_sms" value="0" title="关闭"
                               @if($reg['enable_sms']==0) checked @endif>
                    </div>
                </div>
            </form>
        </div>
    </div>
    <div class="layui-colla-item">
        <h2 class="layui-colla-title" data-type="{{$url['infotype']}}">前台接口域名</h2>
        <div class="layui-colla-content">
            <form class="layui-form" action="">
                <input type="hidden" name="type" value="{{$url['infotype']}}">
                <div class="layui-form-item">
                    <label class="layui-form-label">前台接口域名</label>
                    <div class="layui-input-block">
                        <input type="text" name="infocontent" lay-verify="title" autocomplete="off" placeholder=""
                               class="layui-input" value="{{$url['infocontent']}}">
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">是否开启</label>
                    <div class="layui-input-block">
                        <input type="radio" name="status" value="1" title="启用" @if($url['status']==1) checked @endif>
                        <input type="radio" name="status" value="0" title="关闭" @if($url['status']==0) checked @endif>
                    </div>
                </div>
            </form>
        </div>
    </div>
    <div class="layui-colla-item">
        <h2 class="layui-colla-title" data-type="{{$two['infotype']}}">二级密码</h2>
        <div class="layui-colla-content">
            <form class="layui-form" action="">
                <input type="hidden" name="type" value="{{$two['infotype']}}">
                <div class="layui-form-item">
                    <label class="layui-form-label">是否开启二级密码</label>
                    <div class="layui-input-block">
                        <input type="radio" name="status" value="1" eventType="event-query" title="启用"
                               @if($two['status']==1) checked @endif>
                        <input type="radio" name="status" value="0" eventType="event-query" title="关闭"
                               @if($two['status']==0) checked @endif>
                    </div>
                </div>
            </form>
        </div>
    </div>

</div>
@if(checkRriv('/admin/BaseSet/updateInfo'))<button class="layui-btn keep"style="margin-top: 10px;">保存设置</button>@endif

<script type="text/javascript" src="/frame/layui/layui.js"></script>
<script src="<?php echo e(URL::asset('admin/js/jquery-1.11.3.js')); ?>" charset="utf-8"></script>
<script>

    //    $.fn.serializeObject = function() {
    //        var o = {};
    //        var a = this.serializeArray();
    //        $.each(a, function() {
    //            if (o[this.name]) {
    //                if (!o[this.name].push) {
    //                    o[this.name] = [ o[this.name] ];
    //                }
    //                o[this.name].push(this.value || '');
    //            } else {
    //                o[this.name] = this.value || '';
    //            }
    //        });
    //        return o;
    //    }

    $.fn.serializeJson = function () {
        var serializeObj = {};
        var array = this.serializeArray();
        var str = this.serialize();
        $(array).each(function () {
            if (serializeObj[this.name]) {
                if ($.isArray(serializeObj[this.name])) {
                    serializeObj[this.name].push(this.value);
                } else {
                    serializeObj[this.name] = [serializeObj[this.name], this.value];
                }
            } else {
                serializeObj[this.name] = this.value;
            }
        });
        return serializeObj;
    };

    layui.use(['element', 'layer', 'form'], function () {
        var element = layui.element
            , form = layui.form
            , layer = layui.layer;

        var $ = layui.$;
        $.ajaxSetup({
            headers: {
                'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
            }
        });
        $('.keep').on('click', function () {
            var data = $('.layui-show').find('form').serializeJson();
            $.ajax({
                type: 'post',
                url: '/admin/BaseSet/updateInfo',
                data: {data: data},
                dataType: 'json',
                success: function (json) {
                    layer.msg(json.msg)
                }
            });
        });
    });

</script>
</body>
</html>
