<title>修改Banner图</title>

<div class="layui-card layadmin-header">
    <div class="layui-breadcrumb" lay-filter="breadcrumb">
        <a lay-href="">主页</a>
        <a><cite>运营设置</cite></a>
        <a><cite>Banner位管理</cite></a>
        <a><cite>修改Banner图</cite></a>
    </div>
</div>

<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header">修改Banner图</div>
                <div class="layui-card-body" pad15>
                    <form class="layui-form" wid100 lay-filter="LAY-info-form">
                        <div class="layui-fields">
                        </div>
                        <div class="layui-submit">
                            <div class="layui-form-item">
                                <div class="layui-input-block">
                                    <input type="hidden" name="id">
                                    <button class="layui-btn" lay-submit lay-filter="submit">确认修改</button>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
    if (typeof layui.router().search.position === 'number') {
        location.hash = '/content/banner/position/'
    }
    var config;
    layui.admin.req({
        url: '/manage/content/banner/position/info.json',
        method: 'POST',
        data: {id: layui.router().search.position},
        success: function (res) {
            config = {
                api: {
                    submit: '/manage/content/banner/banner/edit.json'
                },
                url: {
                    index: '/content/banner/position='+layui.router().search.position+'/'
                },
                fields: [
                    {name: 'position_id', key: 'position_id', type: 'hide', value: layui.router().search.position},
                    {name: '位置', type: 'label', value: res.data.title},
                    {name: '标题', key: 'title', type: 'text',},
                    {name: '图片', key: 'img', type: 'img', url: '/manage/content/banner/banner/upload.json'},
                    {name: '链接', key: 'url', type: 'text'},
                    {name: '描述', key: 'intro', type: 'text',},
                    {name: '排序', key: 'position', type: 'num',},
                    {name: '状态', key: 'status', type: 'switch', extra: '显示|隐藏'},
                ],
            };
            layui.use('curd/addOrEdit', layui.factory('curd/addOrEdit'));
        }
    });
</script>