@extends('base.base')
@section('base')
    <!-- 内容区域 -->
    <div class="main-panel">
        <div class="content-wrapper">
            <div class="page-header">
                <h3 class="page-title">
                     <span class="page-title-icon bg-gradient-primary text-white mr-2">
                        <i class="mdi mdi-settings"></i>
                    </span>
                    {{ __('auto.渠道审核屏蔽ID白名单') }}
                </h3>
                <nav aria-label="breadcrumb">
                    <ol class="breadcrumb">
                        <li class="breadcrumb-item"><a href="#">{{ __('auto.渠道审核屏蔽ID白名单') }}</a></li>
                        <li class="breadcrumb-item active" aria-current="page">{{ __('auto.渠道管理') }}</li>
                    </ol>
                </nav>
            </div>
            <div class="row">
                <div class="col-lg-12 grid-margin stretch-card">
                    <div class="card">
                        <div class="card-body">
                            <form class="forms-sample" id="form">
                                <div class="form-group">
                                    <label for="exampleInputName1">{{ __('auto.游戏') }}ID</label>
                                    <input type="text" class="form-control" name="GameID">

                                </div>
                                <div class="form-group">
                                    <label for="exampleInputName1">{{ __('auto.备注') }}</label>
                                    <textarea class="form-control" rows="3" name="Remarks"></textarea>
                                </div>
                                <button type="button" onclick="commit()" class="btn btn-sm btn-gradient-primary btn-icon-text">
                                    <i class="mdi mdi-file-check btn-icon-prepend"></i>
                                    {{ __('auto.提交') }}
                                </button>
                                <button type="button" onclick="cancel()" class="btn btn-sm btn-gradient-warning btn-icon-text">
                                    <i class="mdi mdi-reload btn-icon-prepend"></i>
                                    {{ __('auto.取消') }}
                                </button>
                            </form>

                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script>

        function commit(){
            if(!checkForm()){
                return false;
            }
            var data = $("#form").serializeObject();
            myRequest("/admin/channel/channel_shield_id_white_add","post", data,function(res){
                layer.msg(res.msg)
                if(res.code == 200){
                    setTimeout(function(){
                        parent.location.reload();
                    },1500)
                }

            });
        }

        function cancel() {
            parent.location.reload();
        }

        function switch_control(id, config_id, type) {

            console.log(id)
            myConfirm("{{ __('auto.操作不可逆,是否继续') }}?", function () {
                myRequest("/admin/channel/update/" + id, "post", {config_id, type}, function (res) {
                    layer.msg(res.msg)
                    setTimeout(function () {
                        parent.location.reload();
                    }, 1500)
                });
            });
        }


    </script>
@endsection
