174 lines
9.5 KiB
HTML
Executable File
174 lines
9.5 KiB
HTML
Executable File
{php}
|
||
use app\model\Block;
|
||
{/php}
|
||
{layout name="manager/layout" /}
|
||
|
||
<style type="text/css">
|
||
.fudong{ width: calc(100% - 295px); position: fixed; top: 50px; z-index: 20; background: #fff; padding: 15px 0 5px;}
|
||
.fudong .layui-row{ width: auto; float: left;}
|
||
.fudong button.layui-btn{ float: right;}
|
||
#list-layui-form{ margin-top: 100px;}
|
||
</style>
|
||
<div class="layui-card layui-col-md12">
|
||
<div class="layui-card-body">
|
||
<form action="{:url('manager.content/page')}" method="post" class="layui-form" id="list-layui-form">
|
||
<input type="hidden" name="__token__" value="{$_token}" />
|
||
|
||
<style type="text/css">
|
||
table tr td{ vertical-align: top;}
|
||
</style>
|
||
{notempty name="blocks"}
|
||
<table class="layui-table">
|
||
<colgroup>
|
||
{if $groupId == 1}
|
||
<col width="15%">
|
||
{/if}
|
||
<col width="20%">
|
||
<col width="45%">
|
||
<col width="25%">
|
||
</colgroup>
|
||
<thead>
|
||
{if $groupId == 1}
|
||
<td>键值</td>
|
||
{/if}
|
||
<td>标题</td>
|
||
<td>内容</td>
|
||
<td>操作</td>
|
||
</thead>
|
||
{foreach $blocks as $block}
|
||
<tr class="select_box table-lv1" data-id="{$block.id}" data-url="{:url('manager.page/sort')}">
|
||
{if $groupId == 1}
|
||
<td style="padding-top: 15px;">{$block.keyword}</td>
|
||
{/if}
|
||
<td><a class="layui-btn layui-btn-title" data-href="{:url('manager.page/'.$types[$block['type']],['id'=>$block['id']])}" title="编辑">{$block.title}</a></td>
|
||
<td>
|
||
{php} if($block['type'] == Block::BLOCK):{/php}
|
||
<textarea class="layui-textarea" name="block[{$block.id}]" rows="5">{$block.value}</textarea>
|
||
{php}
|
||
elseif($block['type'] == Block::IMG):
|
||
if($block['width'] && $block['height']){
|
||
$imgSize = $block['width'].'像素 X '.$block['height'].'像素';
|
||
}else{
|
||
$imgSize = '';
|
||
}
|
||
{/php}
|
||
{:widget('manager.upload/image',['src' => $block.value??'', 'imgSize' => $imgSize, 'append' => "_img_" . $block['id']])}
|
||
{php}elseif($block['type'] == Block::TEXT):{/php}
|
||
|
||
<div class="layui-form-item editor-text">
|
||
<!-- <div class="editor"></div>-->
|
||
<textarea name="text[{$block.id}]" id="ueditor" class="layui-textarea tinymce-editor">{$block.value??''}</textarea>
|
||
</div>
|
||
|
||
{php}
|
||
elseif($block['type'] == Block::GROUP):
|
||
if($block['width'] && $block['height']){
|
||
$imgSize = $block['width'].'像素 X '.$block['height'].'像素';
|
||
}else{
|
||
$imgSize = '';
|
||
}
|
||
{/php}
|
||
<input type="hidden" name="groupIds[]" value="{$block.id ?? 0}" />
|
||
{:widget('manager.upload/multi',['imgs' => $block.value??'', 'num' => $block.num??10, 'imgSize' => $imgSize, 'append' => "_group_" . $block['id']])}
|
||
|
||
{php}
|
||
elseif($block['type'] == Block::VIDEOS):
|
||
{/php}
|
||
<input type="hidden" name="videoGroupIds[]" value="{$block.id ?? 0}" />
|
||
{:widget('manager.upload/multiVideo',['videos' => $block.value??'', 'num' => $block.num??10, 'append' => "_videos_" . $block['id']])}
|
||
|
||
{php}
|
||
elseif($block['type'] == Block::VIDEO):
|
||
if($block['width'] && $block['height']){
|
||
$imgSize = $block['width'].'像素 X '.$block['height'].'像素';
|
||
}else{
|
||
$imgSize = '';
|
||
}
|
||
{/php}
|
||
{:widget('manager.upload/image',['src' => $block.img??'', 'imgSize' => $imgSize, 'append' => "_video_" . $block['id']])}
|
||
{:widget('manager.upload/video',['src' => $block.value??'', 'append' => "_video_" . $block['id']])}
|
||
{php}
|
||
elseif($block['type'] == Block::CODE):
|
||
{/php}
|
||
<div class="layui-form-item">
|
||
<textarea name="code[{$block.id}]" class="codeEditor" class="layui-textarea">{$block.value??''}</textarea>
|
||
</div>
|
||
|
||
{php}
|
||
elseif($block['type'] == Block::MAP):
|
||
{/php}
|
||
{php}
|
||
$thisValue = json_decode($block['value'],true);
|
||
{/php}
|
||
<div class="layui-form-item">
|
||
公司名称:{$thisValue.company_name??''}<br>
|
||
地址:{$thisValue.address??''}<br>
|
||
经纬度:{$thisValue.lng??''},{$thisValue.lat??''}<br>
|
||
</div>
|
||
{php}endif;{/php}
|
||
</td>
|
||
<td>
|
||
<div style="width: 265px;">
|
||
<a class="sort layui-btn layui-btn-primary layui-btn-xs" data-url="{:url('manager.page/sort')}" data-sort="up" data-id="{$block.id}" href="javascript:void(0)">
|
||
<i class=""></i>向上
|
||
</a>
|
||
<a class="sort layui-btn layui-btn-primary layui-btn-xs" data-url="{:url('manager.page/sort')}" data-sort="down" data-id="{$block.id}" href="javascript:void(0)">
|
||
<i class=""></i>向下
|
||
</a>
|
||
<a class="layui-btn layui-btn-warm layui-btn-xs" data-href="{:url('manager.page/'.$types[$block['type']],['id'=>$block['id']])}" title="编辑" data-width="1300">
|
||
<i class=""></i>编辑
|
||
</a>
|
||
{if $groupId == 1}
|
||
<a class="layui-btn layui-btn-danger layui-btn-xs del" data-url="{:url('manager.page/del')}" data-id="{$block.id}" href="javascript:;">
|
||
<i class=""></i>删除
|
||
</a>
|
||
{/if}
|
||
</div>
|
||
</td>
|
||
</tr>
|
||
{/foreach}
|
||
</table>
|
||
{/notempty}
|
||
<div class="fudong">
|
||
{if $groupId == 1}
|
||
<div class="layui-row top-operate">
|
||
<a class="layui-btn layui-btn-normal" data-href="{:url('manager.page/img',['category_id' => $categoryId])}" title="添加图片">
|
||
<i class=""></i>添加图片
|
||
</a>
|
||
<a class="layui-btn layui-btn-normal" data-href="{:url('manager.page/block',['category_id' => $categoryId])}" title="添加文字">
|
||
<i class=""></i>添加文字
|
||
</a>
|
||
<a class="layui-btn layui-btn-normal" data-href="{:url('manager.page/text',['category_id' => $categoryId])}" title="添加富文本" data-width="1300">
|
||
<i class=""></i>添加富文本
|
||
</a>
|
||
<a class="layui-btn layui-btn-normal" data-href="{:url('manager.page/group',['category_id' => $categoryId])}" title="添加组图" >
|
||
<i class=""></i>添加组图
|
||
</a>
|
||
<a class="layui-btn layui-btn-normal" data-href="{:url('manager.page/video',['category_id' => $categoryId])}" title="添加视频" >
|
||
<i class=""></i>添加视频
|
||
</a>
|
||
<a class="layui-btn layui-btn-normal" data-href="{:url('manager.page/code',['category_id' => $categoryId])}" title="添加代码" data-width="1300">
|
||
<i class=""></i>添加代码
|
||
</a>
|
||
<br>
|
||
<br>
|
||
<a class="layui-btn layui-btn-normal" data-href="{:url('manager.page/audios',['category_id' => $categoryId])}" title="添加音频组" data-width="1300">
|
||
<i class=""></i>添加音频组
|
||
</a>
|
||
<a class="layui-btn layui-btn-normal" data-href="{:url('manager.page/videos',['category_id' => $categoryId])}" title="添加视频组" data-width="1300">
|
||
<i class=""></i>添加视频组
|
||
</a>
|
||
<a class="layui-btn layui-btn-normal" data-href="{:url('manager.page/map',['category_id' => $categoryId])}" title="添加地图" >
|
||
<i class=""></i>添加地图
|
||
</a>
|
||
</div>
|
||
{/if}
|
||
{if !empty($blocks)}
|
||
<button type="button" class="layui-btn layui-btn-normal" lay-submit lay-filter="submitAll">保存</button>
|
||
{/if}
|
||
</div>
|
||
<input type="hidden" name="category_id" value="{$categoryId}" />
|
||
</form>
|
||
</div>
|
||
</div>
|