@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.茶叶手续费设置') }}
                </h3>
            </div>

            <div class="row">
                <div class="col-lg-12 grid-margin stretch-card">
                    <div class="card">
                        <div class="card-body">
                            <h4 class="card-title">{{ __('auto.茶叶手续费设置') }}</h4>
                            <form class="well form-inline margin-top-20" method="post" action='/admin/global/userlist'>
                                <div>
                                    @csrf
                                </div>

                            </form>
                            <div class="form-group form-inline">

                                {{ __('auto.扣除：') }}<input type="text" class="form-control"  name="StatusValue" id="StatusValue"  value="{{$info}}">
                                <div>
                                    <h4>{{ __('auto.注：手续费默认为万分比，以万为单位，如填写300，即需要') }}3%{{ __('auto.手续费') }}</h4>
                                </div>
                            </div>

                            <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>
                            </div>

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

        function commit(){
            var StatusValue = $("#StatusValue").val()
            myConfirm("{{ __('auto.是否继续') }}?",function(){
                myRequest("/admin/withdrawal/fee","post",{StatusValue},function(res){
                    layer.msg(res.msg)
                    setTimeout(function(){
                        parent.location.reload();
                    },1500)
                });
            });
        }
        function checkbox(){
            var num=document.getElementsByName('checkbox');
            for(var i=0;i<num.length;i++){
                if(num[i].checked){
                    num[i].checked=false;
                }else{
                    num[i].checked=true;
                }
            }
        }


        function agree(){
            // 获取单选框选中的值
            var val = $("input[type='radio']:checked").val()
            // 获取多选框选中的值
            var num=document.getElementsByName('checkbox');

            var str='';
            for(var i=0;i<num.length;i++){
                if(num[i].checked){
                    str=str+num[i].id+',';
                }
            }
            console.log(val)
            console.log(str)
        }




        function ban(ban){
            //1封号 2解封
            var num=document.getElementsByName('checkbox');

            var str='';
            for(var i=0;i<num.length;i++){
                if(num[i].checked){
                    str=str+num[i].id+',';
                }
            }

            if (str==''){
                alert('{{ __('auto.请选择要操作的数据') }}');return false;
            }
            var id=str.substr(0,str.length-1);
            console.log(id)

            return false;
        }
    </script>
@endsection
