<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
    <head>
        <script th:replace="common/head"></script>
    </head>

    <body>

        <div class="layui-fluid">
            <div class="layui-row layui-col-space15">
                <div class="layui-col-md12">
                    <div class="layui-card">

                        <div class="layui-card-body">
                            <!-- 修改 -->
                            <div class="layui-form">
                                <!-- 广告名称 -->
                                <div class="layui-form-item">
                                    <label class="layui-form-label">
                                        <span class="must">*</span>
                                        <span>广告名称</span>
                                    </label>
                                    <div class="layui-input-inline">
                                        <input type="text" name="adTitle" lay-verify="required|specialCharacters|length" class="layui-input" th:value="${adContent.adTitle}">
                                    </div>
                                </div>

                                <!-- 广告类别 -->
                                <div class="layui-form-item" lay-filter="adType_entity">
                                    <label class="layui-form-label">
                                        <span class="must">*</span>
                                        <span>广告类别</span>
                                    </label>
                                    <div class="layui-input-inline">
                                        <select name="adTypeId" id="adTypeId" lay-verify="required" lay-search="" th:value="${adContent.adTypeId}">
                                            <option value=""></option>
                                        </select>
                                    </div>
                                </div>

                                <!-- 广告位类别 -->
                                <div class="layui-form-item" lay-filter="onlineOrOffline">
                                    <label class="layui-form-label">
                                        <span class="must">*</span>
                                        <span>广告位类别</span>
                                    </label>
                                    <div class="layui-input-inline">
                                        <div id="onlineOrOffline"></div>
                                        <input type="hidden" id="onlineOrOfflineValue" th:value="${adContent.onlineOrOffline}">
                                        <!--<select name="onlineOrOffline" id="onlineOrOffline" lay-verify="required" lay-search="">
                                            <option value=""></option>
                                            <option value="0" th:selected="${adContent.onlineOrOffline == 0}">线下</option>
                                            <option value="1" th:selected="${adContent.onlineOrOffline == 1}">线上</option>
                                        </select>-->
                                    </div>
                                </div>

                                <fieldset class="layui-elem-field layui-field-title" style="margin-top: 50px;">
                                    <legend>关联素材</legend>
                                </fieldset>
                                <!--素材类别 -->
                                <div class="layui-form-item" lay-filter="adType_entity">
                                    <label class="layui-form-label">
                                        <span>素材类别</span>
                                    </label>
                                    <div class="layui-input-inline">
                                        <div id="materialType"></div>
                                        <input type="hidden" id="materialTypeValue" th:value="${adContent.materialType}">
                                        <!--<select name="materialType" id="materialType" class="select" lay-filter="materialType">
                                            <option value=""></option>
                                            <option value="图片" th:selected="${adContent.materialType == '图片'}">图片</option>
                                            <option value="视频" th:selected="${adContent.materialType == '视频'}">视频</option>
                                        </select>-->
                                    </div>
                                </div>
                                <!-- 素材 -->
                                <div class="layui-form-item">
                                    <label class="layui-form-label">
                                        <span>素材</span>
                                    </label>
                                    <div class="layui-input-inline">
                                        <select name="adMaterialId" id="adMaterialId"  lay-search="">
                                            <option th:value="${adContent.adMaterialId}" th:selected="${1==1}" th:text="${adContent.materialName}"></option>
                                        </select>
                                    </div>
                                </div>
<!--                                <fieldset class="layui-elem-field layui-field-title" style="margin-top: 50px;">-->
<!--                                    <legend>关联广告位</legend>-->
<!--                                </fieldset>-->
<!--                                <div class="layui-form-item">-->
<!--                                    <label class="layui-form-label">-->
<!--                                        <span>地区</span>-->
<!--                                    </label>-->
<!--                                    <div class="layui-input-inline">-->
<!--                                        <div class="layui-input-inline">-->
<!--                                            <div id="regionProvince"></div>-->
<!--                                        </div>-->
<!--                                    </div>-->
<!--                                    <div class="layui-input-inline">-->
<!--                                        <div class="layui-input-inline">-->
<!--                                            <div id="regionCity"></div>-->
<!--                                        </div>-->
<!--                                    </div>-->
<!--                                    <div class="layui-input-inline">-->
<!--                                        <div class="layui-input-inline">-->
<!--                                            <div id="regionArea" name="residentialArea"></div>-->
<!--                                        </div>-->
<!--                                    </div>-->
<!--                                </div>-->
<!--                                <div class="layui-form-item">-->
<!--                                    <label class="layui-form-label">-->
<!--                                        <span>小区</span>-->
<!--                                    </label>-->
<!--                                    <div class="layui-input-inline">-->
<!--                                        <div class="layui-input-inline">-->
<!--                                            <div id="residential" name="residentialId"></div>-->
<!--                                        </div>-->
<!--                                    </div>-->
<!--                                </div>-->
<!--                                <div class="layui-form-item">-->
<!--                                    <label class="layui-form-label">-->
<!--                                        <span>广告位</span>-->
<!--                                    </label>-->
<!--                                    <div class="layui-input-inline">-->
<!--                                        <div class="layui-input-inline">-->
<!--                                            <div id="adsenseId" name="adsenseId"></div>-->
<!--                                        </div>-->
<!--                                    </div>-->
<!--                                </div>-->

                                <!-- 广告视频上传 -->
<!--                                <div class="layui-upload" style="margin-left: 110px;margin-top: 40px;">-->
<!--                                    <button type="button" class="layui-btn" id="videButton">广告视频上传</button>-->
<!--                                    <blockquote class="layui-elem-quote layui-quote-nm" style="margin-top: 10px;">-->
<!--                                        预览视频：-->
<!--                                        &lt;!&ndash;<div class="layui-upload-list" id="demo5"></div>&ndash;&gt;-->
<!--                                        <video id="showVideoUri"style="width: 20%;height: 20%" th:src="${fastDfsServer+adContent.videoUri}" controls="controls">您的浏览器不支持HTML5</video>-->
<!--                                        <input type="hidden" name="videoUri" id="videoUri" th:value="${adContent.videoUri}">-->
<!--                                        <input type="hidden" name="videoMd5" id="videoMd5" th:value="${adContent.videoMd5}">-->
<!--                                    </blockquote>-->
<!--                                </div>-->

<!--                                &lt;!&ndash; 广告图片 &ndash;&gt;-->
<!--                                <div class="layui-upload"  style="margin-left: 110px;margin-top: 40px;">-->
<!--                                    <button type="button" class="layui-btn" id="imageButton">广告图片上传</button>-->
<!--                                    &lt;!&ndash;保存图片地址，逗号隔开&ndash;&gt;-->
<!--                                    <blockquote class="layui-elem-quote layui-quote-nm" style="margin-top: 10px;">-->
<!--                                        预览图：-->
<!--                                        <div class="layer-photos-demo" id="previewImage">-->
<!--                                            &lt;!&ndash;编辑时，图片遍历&ndash;&gt;-->
<!--                                            <div class="layer-photos-content" style="width: 150px; height: 150px;" th:each="adContentImg:${adContent.adContentImgs}">-->
<!--                                                <input type="hidden" name="imgUri" th:attr="value=${adContentImg.imgUri},md5=${adContentImg.imgMd5}" />-->
<!--                                                <img style="width: 150px; height: 150px; margin: 0 10px 10px 0;" th:src="${fastDfsServer+adContentImg.imgUri}" >-->
<!--                                                <div class="layui-layer-imgsee">-->
<!--                                                </div>-->
<!--                                                <span class="layui-layer-setwin">-->
<!--	                                                <a class="layui-layer-ico layui-layer-close layui-layer-close2" href="javascript:;"></a>'-->
<!--                                                </span>-->
<!--                                                <a href="javascript:;" class="layui-laypage-next">-->
<!--                                                    <i class="layui-icon"></i>-->
<!--                                                </a>-->
<!--                                                <a href="javascript:;" class="layui-laypage-prev ">-->
<!--                                                    <i class="layui-icon"></i>-->
<!--                                                </a>-->
<!--                                            </div>-->
<!--                                        </div>-->
<!--                                    </blockquote>-->
<!--                                </div>-->

<!--                                <input id="fastDfsServer" type="hidden" th:value="${fastDfsServer}">-->
                                <input id="id" name="id" type="hidden" th:value="${adContent.id}">
                                <!-- 按钮 -->
                                <div class="layui-form-item">
                                    <div class="layui-input-block">
                                        <button class="layui-btn" lay-filter="addConfirm" lay-submit>提交</button>
                                        <button type="reset" class="layui-btn layui-btn-primary" >取消</button>
                                    </div>
                                </div>

                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </body>

    <!-- javascript -->
    <script th:src="@{'/layui/layui.js'}" charset="utf-8"></script>
    <script>
        layui.config({
            base: '/' //静态资源所在路径
        });
    </script>
    <script th:src="@{'/js/ad/ad-content-edit.js'}" charset="utf-8"></script>
    <!--编辑图片样式-->
    <link xmlns:th="http://www.thymeleaf.org" rel="stylesheet" th:href="@{'/css/ad/ad.css'}" media="all">
</html>
