作者 jinglong
1 个管道 的构建 通过 耗费 0 秒

增加后台画廊相册

... ... @@ -42,6 +42,7 @@ class AdminRegionGalleryController extends AdminBaseController
$categoryTree = $portalCategoryModel->adminCategoryTree($categoryId);
$this->assign('start_time', isset($param['start_time']) ? $param['start_time'] : '');
$this->assign('end_time', isset($param['end_time']) ? $param['end_time'] : '');
$this->assign('post_title', isset($param['post_title']) ? $param['post_title'] : '');
$this->assign('articles', $articles);
$this->assign('category_tree', $categoryTree);
$this->assign('category', $categoryId);
... ...
... ... @@ -15,8 +15,10 @@ use think\Validate;
class AdminRegionGalleryValidate extends Validate
{
protected $rule = [
'post_title' => 'require',
];
protected $message = [
'post_title.require' => '文章标题不能为空!',
];
protected $scene = [
... ...
... ... @@ -38,8 +38,23 @@
<table class="table table-bordered">
<input class="form-control" type="hidden" value="{$categories}" name="post[categories]"
id="js-categories-id-input"/>
<tr width="100">
<th width="100">标题<span class="form-required">*</span></th>
<td>
<input class="form-control" type="text" name="post[post_title]"
id="title" required value="" placeholder="请输入标题"/>
</td>
</tr>
<tr>
<th>相册<span class="form-required">*</span></th>
<td>
<ul id="photos" class="pic-list list-unstyled form-inline"></ul>
<a href="javascript:uploadMultiImage('图片上传','#photos','photos-item-tpl');"
class="btn btn-default btn-sm">选择图片</a>
</td>
</tr>
<tr>
<th width="100">权重</th>
<th>权重</th>
<td>
<input class="form-control" type="number" name="post[weigh]" value="0">
</td>
... ...
... ... @@ -43,7 +43,41 @@
<input class="form-control" type="hidden" value="{$categories}" name="post[categories]"
id="js-categories-id-input"/>
<tr>
<th width="100">权重</th>
<th width="100">标题<span class="form-required">*</span></th>
<td>
<input class="form-control" type="text" name="post[post_title]"
required value="{$post.post_title}" placeholder="请输入标题"/>
</td>
</tr>
<tr>
<th>相册<span class="form-required">*</span></th>
<td>
<ul id="photos" class="pic-list list-unstyled form-inline">
<notempty name="post.more.photos">
<foreach name="post.more.photos" item="vo">
<php>$img_url=cmf_get_image_preview_url($vo['url']);</php>
<li id="saved-image{$key}">
<input id="photo-{$key}" type="hidden" name="photo_urls[]"
value="{$vo.url}">
<input class="form-control" id="photo-{$key}-name" type="text"
name="photo_names[]"
value="{$vo.name|default=''}" style="width: 200px;" title="图片名称">
<img id="photo-{$key}-preview"
src="{:cmf_get_image_preview_url($vo['url'])}"
style="height:36px;width: 36px;"
onclick="parent.imagePreviewDialog(this.src);">
<a href="javascript:uploadOneImage('图片上传','#photo-{$key}');">替换</a>
<a href="javascript:(function(){$('#saved-image{$key}').remove();})();">移除</a>
</li>
</foreach>
</notempty>
</ul>
<a href="javascript:uploadMultiImage('图片上传','#photos','photos-item-tpl');"
class="btn btn-sm btn-default">选择图片</a>
</td>
</tr>
<tr>
<th>权重</th>
<td>
<input class="form-control" type="number" name="post[weigh]" value="{$post.weigh}">
</td>
... ...
... ... @@ -12,6 +12,10 @@
<!--<option value='0'>全部</option>-->
<!--{$category_tree|default=''}-->
<!--</select> &nbsp;&nbsp;-->
标题:
<input type="text" class="form-control" name="post_title"
value="{$post_title|default=''}"
style="width: 140px;">&nbsp;&nbsp;
时间:
<input type="text" class="form-control js-bootstrap-datetime" name="start_time"
value="{$start_time|default=''}"
... ... @@ -37,6 +41,7 @@
<!--<th width="50">{:lang('SORT')}</th>-->
<!--</notempty>-->
<th width="50">ID</th>
<th width="200">标题</th>
<th width="100">缩略图</th>
<th width="65">点击量</th>
<th width="130">创建时间</th>
... ... @@ -59,6 +64,13 @@
<!--</notempty>-->
<td><b>{$vo.id}</b></td>
<td>
<notempty name="category">
{$vo.post_title}
<else/>
{$vo.post_title}
</notempty>
</td>
<td>
<notempty name="vo.more.thumbnail">
<a href="javascript:parent.imagePreviewDialog('{:cmf_get_image_preview_url($vo.more.thumbnail)}');">
<i class="fa fa-photo fa-fw"></i>
... ...