@extends('admin.layout-content')

@section('header')
    <style>

    </style>
@endsection

@section('content')
    <div class="layui-card">
        <div class="layui-card-header sg-card-header">修改密码</div>
        <div class="layui-card-body">
            <div class="layui-container">
                <div class="layui-row">
                    <div class="layui-col-sm8 layui-col-sm-offset2">
                        <form class="layui-form" method="POST" action="{{ $pre_uri . 'updatePassword' }}">

                            {{ csrf_field() }}
                            <input type="hidden" name="id" value="{{ $item->id }}">
                            @include('share.layui-form-item', ['type' => 'input', 'input_type' =>
                            'password', 'name' => 'old_password', 'label' => '原来密码', 'value' => '', 'placeholder' => '请输入原来密码'])
                            @include('share.layui-form-item', ['type' => 'input', 'input_type' =>
                            'password', 'name' => 'password', 'label' => '新的密码', 'value' => '', 'placeholder' => '请输入新密码'])
                            @include('share.layui-form-item', ['type' => 'input', 'input_type' =>
                            'password', 'name' => 'password_confirmation', 'label' => '确认密码', 'value' => ''])
                            <div class="layui-form-item">
                                <div class="layui-input-block">
                                    <button class="layui-btn" lay-submit lay-filter="formDemo">提交</button>
                                    <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
@endsection

@section('footer')
    <script>
        $(function () {
            layui.use('form', function(){
                // var form = layui.form;

                // form.verify({
                //     integer: function (value) {
                //         var pattern = /^[1-9]\d*$/;
                //         if(!(pattern.test(value) || value === '0')) {
                //             return '排序必须为大于等于0的整数';
                //         }
                //     }
                // })
            });
        })
    </script>
@endsection