zzwy2/view/manager/category/edit.html

268 lines
15 KiB
HTML
Executable File
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

{php}
$imgSize = '';
if(!empty($item['width']) && is_int($item['width']) && $item['width'] > 0 && !empty($item['height']) && is_int($item['height']) && $item['height'] > 0){
$imgSize = $item['width'] . '像素 X ' . $item['height'] . '像素';
}
{/php}
<div class="layui-card layui-col-md12">
<div class="layui-card-body">
{empty name='item'}
<p class="empty-msg">无效请求,该信息不存在</p>
{else /}
<form class="layui-form" data-action="{:url('manager.category/edit')}">
<input type="hidden" name="__token__" value="{$_token}" />
<div class="layui-form-item">
<label class="layui-form-label" >上级</label>
<div class="layui-form-mid">
{$parent.title??'顶级分类'}
<input type="hidden" name="top" value="{$parent.title??'顶级分类'}" />
<input type="hidden" name="item[parent_id]" value="{$parent.id??0}" />
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label" >名称</label>
<div class="layui-input-block">
<input class="layui-input" type="text" name="item[title]" value="{$item.title}" placeholder="填写栏目名称" />
</div>
</div>
<div class="layui-form-item layui-hide">
<label class="layui-form-label">标识</label>
<div class="layui-input-block">
<input class="layui-input {if !empty($item['category_key'])}layui-disabled{/if}" type="text" name="item[category_key]" value="{$item.category_key}"
placeholder="填写栏目标识(唯一性)" {if !empty($item['category_key'])}readonly{/if}/>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">路由</label>
<div class="layui-input-block">
<input class="layui-input" type="text" name="item[route]" value="{$item.route}" maxlength="60" />
<div class="layui-form-mid layui-word-aux">以/开头,完全匹配 需保证全局唯一</div>
</div>
</div>
<div class="layui-form-item layui-hide">
<label class="layui-form-label">顶部导航分组</label>
<div class="layui-input-block">
<input class="layui-input" type="text" name="item[group_name]" value="{$item.group_name}" placeholder="选填项" />
</div>
</div>
<div class="layui-form-item layui-hide">
<label class="layui-form-label">底部导航分组</label>
<div class="layui-input-block">
<input class="layui-input" type="text" name="item[footer_group]" value="{$item.footer_group}" placeholder="选填项" />
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label" >模型</label>
<div class="layui-input-block">
<select class="layui-input cate-model" data-selected="{$item.model_id}" lay-filter="cate-model" name="item[model_id]" >
{volist name="models" id="v" key="k"}
<option value="{$v.id}" data-template="{$v.template}" {if condition="$item.model_id eq $v.id"}selected="selected"{/if}>{$v.name}</option>
{/volist}
</select>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label" >链接</label>
<div class="layui-input-block">
<input class="layui-input" type="text" name="item[url]" value="{$item.url}" placeholder="链接地址,没有则不填写" />
</div>
</div>
<div class="layui-form-item layui-hide">
<label class="layui-form-label" >栏目图标</label>
<div class="layui-input-block">
{:widget('manager.upload/image',['src' => $item['icon_img']??'', 'append'=>'icon', 'imgSize' => $iconImgSize])}
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label" >栏目封面图</label>
<div class="layui-input-block">
{:widget('manager.upload/image',['src' => $item['src']??'', 'imgSize' => $imgSize])}
</div>
</div>
<div class="layui-form-item layui-hide">
<label class="layui-form-label">手机端栏目封面图</label>
<div class="layui-input-block">
{:widget('manager.upload/image',["append"=>"_mobile",'src' => $item['src_mobile']??'', 'imgSize' => $imgSize])}
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label" >打开方式</label>
<div class="layui-input-block">
<select lay-filter="aihao" name="item[style]" >
<option {$item.style=="_self"?"selected":""} value="_self">当前页面</option>
<option {$item.style=="_blank"?"selected":""} value="_blank">新页面</option>
</select>
</div>
</div>
<div class="layui-form-item hidden">
<label class="layui-form-label" >菜单显示</label>
<div class="layui-input-block" style="display:flex;">
<input type="radio" name="item[state]" value="1" title="是" {if condition="$item.state eq 1"}checked="checked" {else /} disabled{/if} />
<input type="radio" name="item[state]" value="0" title="否" {if condition="$item.state eq 0"}checked="checked"{/if} />
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">后台栏目显示</label>
<div class="layui-input-block">
<input type="radio" checked="checked" name="item[backend_show]" value="1" title="是" {if condition="$item.backend_show eq 1"}checked="checked" {/if}/>
<input type="radio" name="item[backend_show]" value="0" title="否" {if condition="$item.backend_show eq 0"}checked="checked"{/if}/>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">前台导航显示</label>
<div class="layui-input-block">
<input type="radio" checked="checked" name="item[frontend_show]" value="1" title="是" {if condition="$item.frontend_show eq 1"}checked="checked" {/if}/>
<input type="radio" name="item[frontend_show]" value="0" title="否" {if condition="$item.frontend_show eq 0"}checked="checked"{/if}/>
</div>
</div>
<div class="layui-form-item layui-hide">
<label class="layui-form-label">前台底部显示</label>
<div class="layui-input-block">
<input type="radio" checked="checked" name="item[foot_show]" value="1" title="是" {if condition="$item.foot_show eq 1"}checked="checked" {/if}/>
<input type="radio" name="item[foot_show]" value="0" title="否" {if condition="$item.foot_show eq 0"}checked="checked"{/if}/>
</div>
</div>
{if $groupId == 1}
<div class="layui-form-item">
<label class="layui-form-label">是否首页</label>
<div class="layui-input-block">
<input type="radio" {if $item['is_index'] == 1}checked="checked"{/if} name="item[is_index]" value="1" title="是" />
<input type="radio" {if $item['is_index'] == 0}checked="checked"{/if} name="item[is_index]" value="0" title="否" />
</div>
</div>
{/if}
<div class="layui-form-item layui-hide">
<label class="layui-form-label">汇总查看</label>
<div class="layui-input-block">
<input type="radio" {if $item['parent_show'] == 1}checked="checked"{/if} name="item[parent_show]" value="1" title="是" />
<input type="radio" {if $item['parent_show'] == 0}checked="checked"{/if} name="item[parent_show]" value="0" title="否" />
</div>
<div class="layui-input-block">
<div class="layui-form-mid layui-word-aux">注:只对文章模型有效</div>
</div>
</div>
<div class="layui-form-item layui-form-text">
<label class="layui-form-label" >列表模板</label>
<div class="layui-input-block">
<input class="layui-input" type="text" name="item[template_list]" value="{$item.template_list}" placeholder="栏目列表模板,没有可不填" />
</div>
</div>
<div class="layui-form-item layui-form-text">
<label class="layui-form-label" >详情模板</label>
<div class="layui-input-block">
<input class="layui-input" type="text" name="item[template_detail]" value="{$item.template_detail}" placeholder="栏目详情模板,没有可不填" />
</div>
</div>
<div class="layui-form-item layui-form-text layui-hide">
<label class="layui-form-label">标语</label>
<div class="layui-input-block">
<input class="layui-input" type="text" name="item[slogan]" value="{$item.slogan}" placeholder="栏目标语,选填项" />
</div>
</div>
<div class="layui-form-item layui-form-text">
<label class="layui-form-label">简介</label>
<div class="layui-input-block">
<input class="layui-input" type="text" name="item[summary]" value="{$item.summary}" placeholder="栏目简介,选填项" />
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label" >描述</label>
<div class="layui-input-block">
<textarea placeholder="栏目描述,选填项" name="item[description]" class="layui-textarea">{$item.description}</textarea>
</div>
</div>
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">缩略图尺寸</label>
<div class="layui-form-mid layui-word-aux">宽:</div>
<div class="layui-input-inline" >
<input class="layui-input" type="text" name="item[img_width]" value="{$item.img_width}" style="width:100%"/>
</div>
<div class="layui-form-mid layui-word-aux">px</div>
<div class="layui-form-mid">X</div>
<div class="layui-form-mid layui-word-aux">高:</div>
<div class="layui-input-inline" >
<input class="layui-input" type="text" name="item[img_height]" value="{$item.img_height}" style="width:100%"/>
</div>
<div class="layui-form-mid layui-word-aux">px</div>
</div>
</div>
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">图片最佳尺寸</label>
<div class="layui-form-mid layui-word-aux">宽:</div>
<div class="layui-input-inline" >
<input class="layui-input" type="text" name="item[width]" value="{$item.width}" style="width:100%" />
</div>
<div class="layui-form-mid layui-word-aux">px</div>
<div class="layui-form-mid">X</div>
<div class="layui-form-mid layui-word-aux">高:</div>
<div class="layui-input-inline" >
<input class="layui-input" type="text" name="item[height]" value="{$item.height}" style="width:100%"/>
</div>
<div class="layui-form-mid layui-word-aux">px</div>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">列表页数量</label>
<div class="layui-input-block">
<input class="layui-input" type="text" name="item[number]" placeholder="列表页数量默认20" value="{$item.number??20}" />
</div>
</div>
<div class="layui-form-item layui-form-text layui-hide">
<label class="layui-form-label">前台导航层级</label>
<div class="layui-input-block">
<input class="layui-input" type="number" name="item[front_nav_level]" value="{$item.front_nav_level ?? 1}"/>
</div>
</div>
<div class="layui-clear"></div>
<div class="system_title">SEO信息</div>
<div class="layui-form-itemBox2">
<div class="layui-form-item">
<label class="layui-form-label">seo_title</label>
<div class="layui-input-block">
<input class="layui-input" type="text" name="item[seo_title]" value="{$item['seo_title']?$item['seo_title']:''}"/>
</div>
</div>
</div>
<div class="layui-form-itemBox2">
<div class="layui-form-item">
<label class="layui-form-label">seo_keywords</label>
<div class="layui-input-block">
<textarea class="layui-textarea" name="item[seo_keywords]">{$item['seo_keywords']?$item['seo_keywords']:''}</textarea>
</div>
</div>
<div class="layui-form-item"></div>
</div>
<div class="layui-form-itemBox2">
<div class="layui-form-item">
<label class="layui-form-label">seo_description</label>
<div class="layui-input-block">
<textarea class="layui-textarea" name="item[seo_description]">{$item['seo_description']?$item['seo_description']:''}</textarea>
</div>
</div>
</div>
<hr style="margin: 30px 0;">
<div class="layui-form-item">
<div class="text-center">
<button type="button" class="layui-btn layui-btn-normal" lay-submit lay-filter="submitAll">保存</button>
</div>
</div>
<input type="hidden" name="id" value="{$item.id}" />
</form>
{/empty}
</div>
</div>