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

修改移动端图片路径

... ... @@ -26,7 +26,7 @@ class IndexController extends RestBaseController
* @param name:language type:string require:0 default: other desc:语言切换(英文传递此字段(en),中文无需传递)
*
* @return rotation:轮播图@
* @rotation id:轮播图id thumbnail:图片路径 link:立即查看链接
* @rotation id:轮播图id thumbnail:图片路径 thumbnail_mobile:移动图片路径 link:立即查看链接
*
* @return about:关于我们@!
* @about id:关于我们id thumbnail:图片路径 introduce:简介
... ... @@ -45,7 +45,7 @@ class IndexController extends RestBaseController
$arr = [];
//轮播图
$res_rotation = CommonController::selectNoPositionData('rotation','id,thumbnail,link');
$res_rotation = CommonController::selectNoPositionData('rotation','id,thumbnail,thumbnail_mobile,link');
$arr['rotation'] = $res_rotation;
//关于我们
... ...
... ... @@ -69,7 +69,27 @@
</td>
</tr>
</table>
<table class="table table-bordered">
<tr>
<th>移动轮播图<span class="form-required">*</span></th>
</tr>
<tr>
<td>
<div style="text-align: center;">
<input type="hidden" name="thumbnail_mobile" id="thumbnail_mobile">
<a href="javascript:uploadOneImage('图片上传','#thumbnail_mobile');">
<img src="__TMPL__/public/assets/images/default-thumbnail.png"
id="thumbnail_mobile-preview"
width="135" style="cursor: pointer"/>
</a>
<input type="button" class="btn btn-sm btn-cancel-thumbnail_mobile" value="取消图片">
</div>
</td>
</tr>
</table>
</div>
</div>
</form>
</div>
... ... @@ -95,6 +115,12 @@
$('#thumbnail').val('');
});
//移动轮播图
$('.btn-cancel-thumbnail_mobile').click(function () {
$('#thumbnail_mobile-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
$('#thumbnail_mobile').val('');
});
});
</script>
</body>
... ...
... ... @@ -66,6 +66,27 @@
</td>
</tr>
</table>
<table class="table table-bordered">
<tr>
<th>移动轮播图<span class="form-required">*</span></th>
</tr>
<tr>
<td>
<div style="text-align: center;">
<input type="hidden" name="thumbnail_mobile" id="thumbnail_mobile" value="{$post.thumbnail_mobile|default=''}">
<a href="javascript:uploadOneImage('图片上传','#thumbnail_mobile');">
<if condition="empty($post.thumbnail_mobile)">
<img src="__TMPL__/public/assets/images/default-thumbnail.png" id="thumbnail_mobile-preview" width="135" style="cursor: pointer"/>
<else/>
<img src="{:cmf_get_image_preview_url($post.thumbnail_mobile)}" id="thumbnail_mobile-preview" width="135" style="cursor: pointer"/>
</if>
</a>
<input type="button" class="btn btn-sm btn-cancel-thumbnail_mobile" value="取消图片">
</div>
</td>
</tr>
</table>
</div>
</div>
<div class="form-group">
... ... @@ -97,6 +118,13 @@
$('#thumbnail-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
$('#thumbnail').val('');
});
//移动轮播图
$('.btn-cancel-thumbnail_mobile').click(function () {
$('#thumbnail_mobile-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
$('#thumbnail_mobile').val('');
});
});
</script>
</body>
... ...
... ... @@ -31,6 +31,7 @@
</th>
<th>ID</th>
<th>轮播图</th>
<th>移动轮播图</th>
<th>链接</th>
<th>创建时间</th>
<th>操作</th>
... ... @@ -53,6 +54,15 @@
</notempty>
</td>
<td>
<notempty name="vo.thumbnail_mobile">
<a href="javascript:parent.imagePreviewDialog('{:cmf_get_image_preview_url($vo.thumbnail_mobile)}');">
<i class="fa fa-photo fa-fw"></i>
</a>
<else/>
<i class="fa fa-close fa-fw"></i>
</notempty>
</td>
<td>
{$vo.link}
</td>
<td>
... ...