@extends('vip.layouts')
@section('content')


    @if($data['action']== 1)
        <form class="layui-form" action="{{ url()->full() }}" id="submitForm" name="submitForm" method="post" eventType="eventAjaxForm">
            {!! csrf_field() !!}
            <div class="layui-form-item">
                <label>审核会员状态</label>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">会员</label>
                <div class="layui-input-block">
                    <input type="text" name="account_name" required lay-verify="required" autocomplete="off" class="layui-input"
                           value="{{isset($data['account_name'])?$data['account_name']:''}}" disabled="disabled">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">备注</label>
                <div class="layui-input-block">
                    <input type="text" readonly autocomplete="off" class="layui-input"
                           value="{{isset($data['detail'])?$data['detail']:''}}" disabled="disabled">
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">{{ trans('user.statuss') }}</label>
                <div class="layui-input-block">
                    <select name="status" id="form_status" lay-verify="" autocomplete="off" class="layui-input" eventType=event-query readonly="true">
                        <option value="1">通过</option>
                    </select>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-submit lay-filter="submitForm">立即提交</button>
                </div>
            </div>
            <input type="hidden" name="status" value="{{$data['status']}}">
        </form>

    @elseif($data['action']== 2 )

        <form class="layui-form" action="{{ url()->full() }}" id="submitForm" name="submitForm" method="post" eventType="eventAjaxForm">
            {!! csrf_field() !!}
            <div class="layui-form-item">
                <label>审核会员状态</label>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">会员</label>
                <div class="layui-input-block">
                    <input type="text" name="account_name" required lay-verify="required" autocomplete="off" class="layui-input"
                           value="{{isset($data['account_name'])?$data['account_name']:''}}" disabled="disabled">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">备注</label>
                <div class="layui-input-block">
                    <input type="text" readonly autocomplete="off" class="layui-input"
                           value="{{isset($data['detail'])?$data['detail']:''}}" disabled="disabled">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">{{ trans('user.statuss') }}</label>
                <div class="layui-input-block">
                    <select name="status" id="form_status" lay-verify="" autocomplete="off" class="layui-input" eventType=event-query>

                        <option value="2" selected="selected" readonly="true">不通过</option>

                    </select>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">理由备注</label>
                <div class="layui-input-block">
                            <textarea type="text" name="remark" lay-verify="required" autocomplete="off" class="layui-input"
                                      style="width: 800px;height: 200px;resize: none;" value="">{{$data['remark']}}</textarea>
                </div>
            </div>


            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-submit lay-filter="submitForm">立即提交</button>
                </div>
            </div>
            <input type="hidden" name="status" value="{{$data['status']}}">
        </form>
    @else

        {!! csrf_field() !!}
        <div class="layui-form-item">
            <label>审核会员状态</label>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">会员</label>
            <div class="layui-input-block">
                <input type="text" name="account_name" required lay-verify="required" autocomplete="off" class="layui-input"
                       value="{{isset($data['account_name'])?$data['account_name']:''}}" disabled="disabled">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">备注</label>
            <div class="layui-input-block">
                <input type="text" readonly autocomplete="off" class="layui-input"
                       value="{{isset($data['detail'])?$data['detail']:''}}" disabled="disabled">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">{{ trans('user.statuss') }}</label>

            @if($data['status']==1)
                <div class="layui-input-block">
                    <input type="text" readonly autocomplete="off" class="layui-input"
                           value="通过" disabled="disabled">
                </div>
            @else
                <div class="layui-input-block">
                    <input type="text" readonly autocomplete="off" class="layui-input"
                           value="驳回" disabled="disabled">
                </div>
            @endif
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">理由备注</label>
            <div class="layui-input-block">
                            <textarea type="text" name="remark" readonly autocomplete="off" class="layui-input"
                                      style="width: 800px;height: 200px;resize: none;" value="">{{$data['remark']}}</textarea>
            </div>
        </div>


        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="submitForm" onclick="window.history.back()">我知道了</button>
            </div>
        </div>

    @endif
    <script>
        //Demo
        layui.use(['form'], function () {
            var form = layui.form;

            //监听提交
            form.on('submit(submitForm)', function (data) {
                return true;
            });
        });

        /*function cbFormFail(data){
            layer.alert(data.msg,{},function(){


            });
        }*/

        function cbFormSuccess(data) {
            layer.alert(data.msg, {}, function () {
                var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                parent.layer.close(index);
                window.history.go(-1);

            });
        }
    </script>
@endsection
