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

    <form class="layui-form" action="{{ url()->full() }}" id="submitForm" name="submitForm" method="post"
          eventType=eventAjaxForm>
        {!! csrf_field() !!}
        <div class="layui-form-item">
            <label class="layui-form-label">订单号</label>
            <div class="layui-input-inline">
                <input type="text" name="name" required lay-verify="required" autocomplete="off" class="layui-input"
                       value="{{isset($data['order_id'])?$data['order_id']:''}}" readonly="readonly">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">用户</label>
            <div class="layui-input-inline" >
                <input type="text" name="account_name" lay-verify="" 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-inline">
                <input type="text" name="hot" lay-verify="" autocomplete="off" class="layui-input"
                       value="{{isset($data['id'])?$data['id']:''}}" disabled="disabled">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">是否退款</label>
            <div class="layui-input-block">
                <input type="radio" name="type" value="1" title="退款" checked>
                <input type="radio" name="type" value="2" title="不退款">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">撤单理由</label>
            <div class="layui-input-block">
                 <textarea class="layui-textarea" name="reason"  ></textarea>
            </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="password" autocomplete="off" class="layui-input"
                       value="">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">确认密码</label>
            <div class="layui-input-inline">
                <input type="password" name="repassword" lay-verify="password" autocomplete="off" class="layui-input"
                       value="">
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="submitForm">立即提交</button>
                <button type="reset" class="layui-btn layui-btn-normal">重置</button>
            </div>
        </div>
    </form>

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

            var editIndex = layedit.build('LAY_demo_editor');
            form.verify({
                password: function(value){
                    if(value.length < 1){
                        return '密码不能为空';
                    }
                }

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


        });
        //创建一个编辑器

    </script>
@endsection
