<link rel="stylesheet" href="{yun:}$wap_style{/yun}/hb/reset.css?v={yun:}$config.cachecode{/yun}" type="text/css"/>
|
<section class='zhongxin'>
|
<div>
|
<ul class="poster-list-a pdb10 overflow ">
|
{yun:}foreach from=$comHb item=v{/yun}
|
<li class="">
|
<div class="hb_listbox">
|
<div class="poster_pic"><img src="{yun:}$v.pic_n{/yun}"></div>
|
<div class="hb_listbox_name" style="background:#fff;">
|
<div class="hb_cz">
|
<a href="javascript:;" onclick="showWhb('{yun:}$comid{/yun}', '{yun:}$v.style{/yun}');">预览</a>
|
<a href="javascript:;" onclick="downWhb('{yun:}$comid{/yun}', '{yun:}$v.style{/yun}');">下载</a>
|
</div>
|
</div>
|
</div>
|
</li>
|
{yun:}/foreach{/yun}
|
</ul>
|
</div>
|
</section>
|
|
<div style="display: none;" id="imgDiv">
|
<img id="showImg" class="important" />
|
</div>
|
|
<script type="text/javascript" src="{yun:}$config.sy_weburl{/yun}/js/jquery-1.8.1.min.js?v={yun:}$config.cachecode{/yun}"></script>
|
<link href="{yun:}$config.sy_weburl{/yun}/js/layui/css/layui.css?v={yun:}$config.cachecode{/yun}" rel="stylesheet" type="text/css"/>
|
<script src="{yun:}$config.sy_weburl{/yun}/js/layui/layui.js?v={yun:}$config.cachecode{/yun}"></script>
|
<script src="{yun:}$config.sy_weburl{/yun}/js/layui/custom_layer.js?v={yun:}$config.cachecode{/yun}"></script>
|
|
<script>
|
|
var weburl = '{yun:}$config.sy_weburl{/yun}';
|
|
function showWhb(id, style) {
|
|
const url = weburl + '/index.php?m=ajax&c=getComHb&uid=' + id + '&style=' + style
|
|
const loading = parent.layer.load();
|
|
setTimeout(function () {
|
|
parent.layer.closeAll();
|
|
layer.open({
|
type: 1,
|
title: false,
|
content: '<div><img src="' + url + '" style="max-width: 100%;"></div>',
|
area: ['360px', 'auto'],
|
offset: '55px',
|
closeBtn: 0,
|
shadeClose: true
|
});
|
}, 1000);
|
}
|
|
function downWhb(id, style) {
|
const url = weburl + '/index.php?m=ajax&c=getComHb&uid=' + id + '&style=' + style
|
setTimeout(function () {
|
var a = document.createElement('a'); // 创建一个a节点插入的document
|
var event = new MouseEvent('click') // 模拟鼠标click点击事件
|
a.download = 'whb' + style; // 设置a节点的download属性值
|
a.href = url; // 将图片的src赋值给a节点的href
|
a.dispatchEvent(event);
|
}, 1000);
|
}
|
|
</script>
|
</html>
|