luck-draw/view/manager/block/edit.html

347 lines
19 KiB
HTML

{layout name="manager/layout" /}
<style>
.upload-file-div{position: relative}
.upload-file-div-close{position: absolute;right: 0;top: 0;}
</style>
<div id="image_exts" data-exts="{:str_replace(',','|',$uploadConfig['img_type'])}"></div>
<div class="layui-form layuimini-form location-operate-page">
<div class="page-form">
<!-- 栏目 -->
<div class="layui-form-item">
<label class="layui-form-label required">栏目</label>
<div class="layui-input-block">
<div id="parent-menu" data-show="{$showList ?? ''}" data-menu="{$jsonList ?? ''}"></div>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">名称</label>
<div class="layui-input-block">
<input type="text" class="layui-input field-title" name="title" value="{$item['title']}" lay-verify="required" placeholder="标题名称" />
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">别名</label>
<div class="layui-input-inline">
<input type="text" class="layui-input field-name" name="name" disabled value="{$item['name']}" lay-verify="required" placeholder="支持字母、数字、下划线" />
</div>
<div class="layui-form-mid layui-word-aux"><span style="color: red">! 非开发人员,请慎重修改</span></div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">链接</label>
<div class="layui-input-block">
<input type="text" class="layui-input field-name" name="url" value="{$item['url']}" placeholder="" />
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">类型</label>
<div class="layui-input-inline">
<select name="type" class="field-type" lay-filter="type" type="select">
{foreach $types as $key=> $titem}
<option value="{$key}" {if $item['type'] == $key } selected {/if}>{$titem}</option>
{/foreach}
</select>
</div>
</div>
<!-- 富文本-->
<div class="layui-form-item content" {if $item['type'] != 1} style="display:none" {/if}>
<label class="layui-form-label">内容</label>
<div class="layui-input-block" style="width:80%;z-index:0;">
<div class="editor"></div>
<textarea name="content1" class="layui-textarea layui-hide">{if (isset($item['content']) && $item['type'] == 1)}{:htmlspecialchars_decode($item['content'])}{/if}</textarea>
</div>
</div>
<!-- 文本-->
<div class="layui-form-item content" {if $item['type'] != 2 } style="display:none" {/if}>
<label class="layui-form-label">内容</label>
<div class="layui-input-block">
<textarea class="layui-textarea" name="content2" rows="30" placeholder="碎片内容">{if (isset($item['content']) && $item['type'] == 2)}{$item['content']}{/if}</textarea>
</div>
</div>
<!-- 图片-->
<div class="layui-form-item content" {if $item['type'] != 3 } style="display:none" {/if}>
<label class="layui-form-label">内容</label>
<div class="layui-inline layui-col-xs12 layui-col-md8">
<div class="layui-row upload-file-div">
<div class=" layui-col-xs12 layui-col-md8">
<input class="layui-input upload-file-value" name="content3" type="text" value="{if (isset($item['content']) && $item['type'] == 3)}{$item['content']}{/if}">
<div class="layui-form-mid layui-word-aux">图片尺寸:请上传合适尺寸</div>
</div>
<div class="layui-col-xs12 layui-col-md3">
<span>
<button type="button" class="layui-btn layui-btn-danger upload-btn"
data-type="image"
data-multiple="false"
data-field="image_image"
data-accept="images"
data-mimetype="images/*"
data-exts="{:str_replace(',','|',$uploadConfig['img_type'])}"
>
<i class="fa fa-upload"></i> 上传
</button>
</span>
<span><button type="button" class="layui-btn layui-btn-primary upload-choose-btn"
data-url="/manager/attachment/image"
data-type="image"
data-multiple="false"
data-field="image_image"
data-accept="images"
data-mimetype="images/*"
data-exts="{:str_replace(',','|',$uploadConfig['img_type'])}"
>
<i class="fa fa-list"></i> 选择
</button></span>
</div>
<ul class="layui-row layui-col-xs12 layui-col-md9 preview-list layui-col-space5"></ul>
</div>
</div>
</div>
<!-- 组图-->
<div class="layui-form-item content" {if $item['type'] != 4 } style="display:none" {/if}>
<label class="layui-form-label required">组图:</label>
<div class="layui-inline layui-col-xs12 layui-col-md8">
<div class="layui-row upload-file-div">
<div class=" layui-col-xs12 layui-col-md8">
<input class="layui-input upload-file-value" name="content4" type="text" value="{if (isset($item['content']) && $item['type'] == 4)}{$item['content']}{/if}">
<div class="layui-form-mid layui-word-aux">图片尺寸:请上传合适尺寸</div>
</div>
<div class="layui-col-xs12 layui-col-md3">
<span>
<button type="button" class="layui-btn layui-btn-danger upload-btn"
data-type="image"
data-multiple="true"
data-field="image_image"
data-accept="images"
data-mimetype="images/*"
data-exts="{:str_replace(',','|',$uploadConfig['img_type'])}"
>
<i class="fa fa-upload"></i> 上传
</button>
</span>
<span><button type="button" class="layui-btn layui-btn-primary upload-choose-btn"
data-url="/manager/attachment/image"
data-type="image"
data-field="image_image"
data-accept="images"
data-mimetype="images/*"
data-exts="{:str_replace(',','|',$uploadConfig['img_type'])}"
>
<i class="fa fa-list"></i> 选择
</button></span>
</div>
<ul class="layui-row layui-col-xs12 layui-col-md9 preview-list layui-col-space5"></ul>
</div>
</div>
</div>
<!-- 文件-->
<div class="layui-form-item content" {if $item['type'] != 5 } style="display:none" {/if}>
<label class="layui-form-label">内容</label>
<div class="layui-inline layui-col-xs12 layui-col-md8">
<div class="layui-row upload-file-div">
<div class=" layui-col-xs12 layui-col-md8">
<input class="layui-input upload-file-value" name="content5"
type="text" value="{if (isset($item['content']) && $item['type'] == 5)}{$item['content']}{/if}">
</div>
<div class="layui-col-xs12 layui-col-md3">
<span>
<button type="button"
data-url='/manager/upload/file'
data-field='file_file'
data-accept='file'
data-multiple='false'
data-mimetype=''
data-acceptMime='file/*'
data-exts="{:str_replace(',','|',$uploadConfig['file_type'])}"
class="layui-btn layui-btn-danger upload-btn">
<i class="fa fa-upload"></i> 上传
</button>
</span>
<span><button type="button" class="layui-btn layui-btn-primary upload-choose-btn"
data-url="/manager/attachment/file"
data-field='file_file'
data-accept='file'
data-multiple='false'
data-mimetype=''
data-acceptMime='file/*'
data-exts="{:str_replace(',','|',$uploadConfig['file_type'])}"
>
<i class="fa fa-list"></i> 选择
</button></span>
</div>
<ul class="layui-row layui-col-xs12 layui-col-md9 preview-list layui-col-space5"></ul>
</div>
</div>
</div>
<!-- 文件-->
<div class="layui-form-item content" {if $item['type'] != 6} style="display:none" {/if}>
<label class="layui-form-label">视频</label>
<div class="layui-inline layui-col-xs12 layui-col-md8">
<div class="layui-row upload-file-div">
<div class=" layui-col-xs12 layui-col-md8">
<input class="layui-input upload-file-value" name="content6"
type="text" value="{if (isset($item['content']) && $item['type'] == 6)}{$item['content']}{/if}">
</div>
<div class="layui-col-xs12 layui-col-md3">
<span>
<button type="button"
data-url='/manager/upload/video'
data-type="file"
data-field='video_video'
data-accept='file'
data-multiple='false'
data-mimetype=''
data-acceptMime='video/*'
data-exts="{:str_replace(',','|',$uploadConfig['video_type'])}"
class="layui-btn layui-btn-danger upload-btn">
<i class="fa fa-upload"></i> 上传
</button>
</span>
<span><button type="button" class="layui-btn layui-btn-primary upload-choose-btn"
data-url="/manager/attachment/video"
data-multiple="false"
data-type="file"
data-field='video_video'
data-accept='file'
data-mimetype=''
data-acceptMime='video/*'
data-exts="{:str_replace(',','|',$uploadConfig['video_type'])}"
>
<i class="fa fa-list"></i> 选择
</button></span>
</div>
<ul class="layui-row layui-col-xs12 layui-col-md9 preview-list layui-col-space5"></ul>
</div>
</div>
</div>
<!-- 图文列表-->
<div class="layui-form-item content" {if $item['type'] != 7} style="display:none" {/if}>
<label class="layui-form-label">图文列表</label>
<div class="layui-inline layui-col-md8 " >
<div id="img_list">
{if $item['type'] == 7}
{foreach $item['content'] as $ckey =>$citem}
<div class="layui-row upload-file-div">
<div class=" layui-col-xs12 layui-col-md4">
<input class="layui-input upload-file-value" name="content7[{$ckey}][src]" type="text" value="{$citem['src']}">
<div class="layui-form-mid layui-word-aux">图片尺寸:请上传合适尺寸</div>
</div>
<div class="layui-col-xs12 layui-col-md3">
<span>
<button type="button" class="layui-btn layui-btn-danger " id="ImgListNode-upload-btn-{$ckey}"
data-type="image"
data-multiple="false"
data-field="image_image"
data-accept="images"
data-mimetype="images/*"
data-exts="{:str_replace(',','|',$uploadConfig['img_type'])}"
>
<i class="fa fa-upload"></i> 上传
</button>
</span>
<span><button type="button" class="layui-btn layui-btn-primary upload-choose-btn"
data-url="/manager/attachment/image"
data-type="image"
data-multiple="false"
data-field="image_image"
data-accept="images"
data-mimetype="images/*"
data-exts="{:str_replace(',','|',$uploadConfig['img_type'])}"
>
<i class="fa fa-list"></i> 选择
</button></span>
</div>
<ul class="layui-row layui-col-xs12 layui-col-md9 preview-list layui-col-space5"></ul>
<div class="layui-row">
<div class="layui-inline">
<label class="layui-form-label">标题</label>
<div class="layui-input-inline">
<input type="text" name="content7[{$ckey}][title]" class="layui-input" value="{$citem['title']}">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">副标题</label>
<div class="layui-input-inline">
<input type="text" name="content7[{$ckey}][subtitle]" value="{$citem['subtitle']}" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">描述</label>
<div class="layui-input-inline">
<input type="text" name="content7[{$ckey}][description]" value="{$citem['description']}" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">链接</label>
<div class="layui-input-inline">
<input type="text" name="content7[{$ckey}][link]" value="{$citem['link']}" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">时间</label>
<div class="layui-input-inline">
<input type="text" name="content7[{$ckey}][time]" value="{$citem['time']}" class="layui-input">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">排序</label>
<div class="layui-input-inline">
<input type="number" name="content7[{$ckey}][sort]" value="{$citem['sort']??0}" class="layui-input">
</div>
</div>
</div>
<button class="layui-btn upload-file-div-close">删除</button>
</div>
{/foreach}
{/if}
</div>
<div class="layui-input-block">
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
<legend> <button class="layui-btn " id="addrImgListNode">增加一个节点</button></legend>
</fieldset>
</div>
</div>
</div>
</div>
<div class="layui-form-item">
<input type="hidden" name="id" value="{$item['id']}">
<div class="layui-input-block">
<button class="layui-btn layui-btn-normal" data-url="/manager/block/edit" lay-submit lay-filter="saveBtn">确认保存</button>
</div>
</div>
</div>
</div>
<script>
addImgListNode = false;
var ImgListNodeKey = {$maxKey??0};//初始值
</script>
<script src="__MANAGER__/js/block.js?v={:mt_rand()}"></script>