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

增加市井漫游缩略图2

... ... @@ -46,16 +46,8 @@ class EnjoyController extends HomeBaseController
//市井漫游
$position['category_id'] = CityCategoryModel::sjmy;
$field = 'id,thumbnail,post_title,post_excerpt,more';
$field = 'id,thumbnail,post_title,post_excerpt,index_thumbnail2';
$res_sjmy = $this->getChildArticle($position,$field,$this->index_limit);
foreach($res_sjmy as &$value){
$more = json_decode($value['more'],true);
if(isset($more['photos']) && !empty($more['photos'])){
$value['photos'] = $more['photos'][0]['url'];
}else{
$value['photos'] = '';
}
}
$this->assign('res_sjmy',$res_sjmy);
//视听盛宴
... ...
... ... @@ -144,6 +144,25 @@
</td>
</tr>
<tr>
<th><b>列表页缩略图2</b></th>
</tr>
<tr>
<td>
<div style="text-align: center;">
<input type="hidden" name="post[index_thumbnail2]" id="index_thumbnail2" value="">
<a href="javascript:uploadOneImage('图片上传','#index_thumbnail2');">
<img src="__TMPL__/public/assets/images/default-thumbnail.png"
id="index_thumbnail2-preview"
width="135" style="cursor: pointer"/>
</a>
<input type="button" class="btn btn-sm btn-cancel-index_thumbnail2" value="取消图片">
</div>
<div style="margin-top:30px;">
<span class="form-required">图片参考尺寸:600*600</span>
</div>
</td>
</tr>
<tr>
<th><b>发布时间</b></th>
</tr>
<tr>
... ... @@ -186,6 +205,12 @@
$('#thumbnail').val('');
});
//列表页缩略图2
$('.btn-cancel-index_thumbnail2').click(function () {
$('#index_thumbnail2-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
$('#index_thumbnail2').val('');
});
});
function doSelectCategory() {
... ...
... ... @@ -177,6 +177,32 @@
</td>
</tr>
<tr>
<th>列表页缩略图2</th>
</tr>
<tr>
<td>
<div style="text-align: center;">
<input type="hidden" name="post[index_thumbnail2]" id="index_thumbnail2"
value="{$post.index_thumbnail2|default=''}">
<a href="javascript:uploadOneImage('图片上传','#index_thumbnail2');">
<if condition="empty($post.index_thumbnail2)">
<img src="__TMPL__/public/assets/images/default-thumbnail.png"
id="index_thumbnail2-preview"
width="135" style="cursor: pointer"/>
<else/>
<img src="{:cmf_get_image_preview_url($post.index_thumbnail2)}"
id="index_thumbnail2-preview"
width="135" style="cursor: pointer"/>
</if>
</a>
<input type="button" class="btn btn-sm btn-cancel-index_thumbnail2" value="取消图片">
</div>
<div style="margin-top:30px;">
<span class="form-required">图片参考尺寸:600*600</span>
</div>
</td>
</tr>
<tr>
<th>发布时间</th>
</tr>
<tr>
... ... @@ -225,6 +251,12 @@
$('#thumbnail').val('');
});
//列表页缩略图2
$('.btn-cancel-index_thumbnail2').click(function () {
$('#index_thumbnail2-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
$('#index_thumbnail2').val('');
});
$('#more-template-select').val("{$post.more.template|default=''}");
});
... ...
... ... @@ -133,7 +133,7 @@
<div class="Walker_item clearfix">
<a href="/portal/enjoy/getEnjoyDetail?id={$vo.id}">
<div class="Walker_item_left fl">
<img src="{:cmf_get_image_url($vo.photos)}" alt="">
<img src="{:cmf_get_image_url($vo.index_thumbnail2)}" alt="">
</div>
<div class="Walker_item_right fr">
<div class="Walker_item_right_top">
... ...