Update select.html

This commit is contained in:
Anyon 2020-09-22 15:37:53 +08:00
parent 299dc5e762
commit fba4c6be5a

View File

@ -2,19 +2,17 @@
{block name='style'} {block name='style'}
<style> <style>
body {
min-width: 500px
}
.news-container { .news-container {
position: relative overflow: auto;
position: relative;
max-height: 480px;
} }
.news-container .news-item { .news-container .news-item {
top: 0; top: 0;
left: 0; left: 0;
width: 228px; width: 228px;
margin: 20px 0 20px 20px; margin: 0 0 20px 20px;
padding: 5px; padding: 5px;
cursor: pointer; cursor: pointer;
position: relative; position: relative;
@ -82,49 +80,37 @@
margin: 6px 0 1px 0 margin: 6px 0 1px 0
} }
.page-style {
bottom: 0;
width: 100%;
height: 50px;
padding: 0 10px;
position: fixed;
background: #fff
}
.pagination-container { .pagination-container {
left: 0; left: 0;
right: 0; right: 0;
bottom: 0; bottom: 0;
padding: 5px 20px;
position: fixed; position: fixed;
background: #fff; background: #fff;
text-indent: 20px; border-top: 1px solid #dedede;
} }
</style> </style>
{/block} {/block}
{block name="body"} {block name="body"}
<div class="layui-clear news-container layui-hide"> <div class="layui-clear news-container layui-hide padding-top-20">
{foreach $list as $vo} {foreach $list as $vo}
<div class="news-item" data-news-id="{$vo.id}"> <div class="news-item shadow-mini" data-news-id="{$vo.id}">
{foreach $vo.articles as $k => $v} {foreach $vo.articles as $k => $v}{if $k < 1}
{if $k < 1} <div class='news-articel-item' data-lazy-src="{$v.local_url}">
<div class='news-articel-item' style='background-image:url("{$v.local_url}")'>
{if $v.title}<p>{$v.title}</p>{/if} {if $v.title}<p>{$v.title}</p>{/if}
</div> </div>
<div class="hr-line-dashed"></div> <div class="hr-line-dashed"></div>
{else} {else}
<div class='news-articel-item other'> <div class='news-articel-item other'>
<div class='right-text'>{$v.title}</div> <div class='right-text'>{$v.title}</div>
<div class='left-image' style='background-image:url("{$v.local_url}");'></div> <div class='left-image' data-lazy-src="{$v.local_url}"></div>
</div> </div>
<div class="hr-line-dashed"></div> <div class="hr-line-dashed"></div>
{/if} {/if}{/foreach}
{/foreach}
</div> </div>
{/foreach} {/foreach}
{if empty($list)}<p class="notdata">没有记录哦!</p>{/if}
</div> </div>
<div class="padding-10"></div>
{empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty} {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
{/block} {/block}
@ -132,23 +118,23 @@
<script> <script>
require(['jquery.masonry'], function (Masonry) { require(['jquery.masonry'], function (Masonry) {
$('.news-container.layui-hide').removeClass('layui-hide'); $('.news-container.layui-hide').removeClass('layui-hide');
var msnry = new Masonry($('.news-container').get(0), {itemSelector: '.news-item', columnWidth: 0}); var msnry = new Masonry($('.news-container').get(0), {
itemSelector: '.news-item', columnWidth: 0
});
msnry.layout(); msnry.layout();
// 事件处理 /*! 事件处理 */
$('.news-item').on('mouseenter', '.news-container', function () { $('.news-item').on('mouseenter', '.news-container', function () {
$(this).addClass('active'); $(this).addClass('active');
}).on('mouseleave', '.news-container', function () { }).on('mouseleave', '.news-container', function () {
$(this).removeClass('active'); $(this).removeClass('active');
}); });
// 外部选择器 /*! 外部选择器 */
var seletor = '[name="{:decode(input("get.field","0"))}"]'; var seletor = '[name="{:decode(input("get.field","0"))}"]';
if (seletor) { $('[data-news-id]').on('click', function () {
$('[data-news-id]').on('click', function () { window.top.$(seletor).val($(this).attr('data-news-id')).trigger('change');
window.top.$(seletor).val($(this).attr('data-news-id')).trigger('change'); parent.layer.close(parent.layer.getFrameIndex(window.name))
parent.layer.close(parent.layer.getFrameIndex(window.name)) });
}); /*! 分页事件处理 */
}
// 分页事件处理
$('body').off('change', '.pagination-trigger select').on('change', '.pagination-trigger select', function () { $('body').off('change', '.pagination-trigger select').on('change', '.pagination-trigger select', function () {
var urls = this.options[this.selectedIndex].getAttribute('data-url').split('#'); var urls = this.options[this.selectedIndex].getAttribute('data-url').split('#');
urls.shift(), window.location.href = urls.join('#'); urls.shift(), window.location.href = urls.join('#');