147 lines
		
	
	
		
			8.0 KiB
		
	
	
	
		
			HTML
		
	
	
		
		
			
		
	
	
			147 lines
		
	
	
		
			8.0 KiB
		
	
	
	
		
			HTML
		
	
	
|  | {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;} | ||
|  |     .layui-form{ margin-top: 38px;} | ||
|  | </style> | ||
|  | <div class="layui-card layui-col-md12"> | ||
|  |     <div class="layui-card-body"> | ||
|  |         <form action="{:url('manager.content/page')}" method="post" class="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="50"> | ||
|  |                     {/if} | ||
|  |                     <col> | ||
|  |                     <col width="55%"> | ||
|  |                     <col width="75"> | ||
|  |                     <col width="300"> | ||
|  |                 </colgroup> | ||
|  |                 <thead> | ||
|  |                     {if $groupId == 1} | ||
|  |                     <td>键值</td> | ||
|  |                     {/if} | ||
|  |                     <td>标题</td> | ||
|  |                     <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 layui-hide">{$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::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}endif;{/php} | ||
|  |                     </td> | ||
|  |                     <td>{$block['status'] ? '<span class="text-green">正常</span>':'<span class="text-warning">隐藏</span>'}</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/delblock')}" 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> | ||
|  |                 </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> |