zzwy2/view/page/caseslist.html

93 lines
3.6 KiB
HTML
Executable File

{layout name="layout"/}
{php}
use app\model\Category;
use app\model\CasesModel;
$childrenMenu = Category::getChildrenByParentId($topCategoryId);
$items = CasesModel::getByParentId($category['id'],true,$category['number'] ?: 6);
{/php}
{include file="public/about_second" /}
<!-- 简介 -->
<div class="pull-section pull-profile-bg wow fadeInUp">
<div class="company-profile company-culture flex w1360">
<div class="txt">
<div class="profile-title culture-title project-title">
<p class="capitalize font-helvetica color-ashen wow fadeInUp" data-wow-duration="0.8s" data-wow-delay="0">{$blocks['item_title']['value']}</p>
<strong class="wow fadeInUp" data-wow-duration="0.8s" data-wow-delay="0.2s">{$blocks['item_title']['title']}</strong>
</div>
<div class="profile-info culture-info wow fadeInUp" data-wow-duration="0.8s" data-wow-delay="0">
{$blocks['item_info']['value']|raw}
</div>
</div>
<div class="img scale-img wow fadeInUp" data-wow-duration="0.8s" data-wow-delay="0">
<img src="{$isMobile ? $blocks['item_info_img_mobile']['value'] : $blocks['item_info_img_pc']['value']}" alt="{$blocks['item_title']['title']}">
</div>
</div>
</div>
<!-- 内容 -->
<div class="pull-section pull-content-bg bg-col-f5 wow fadeInUp" data-wow-duration="0.8s" data-wow-delay="0">
<div class="profile-title culture-title honor-title project-title">
<p class="capitalize font-helvetica color-ashen wow fadeInUp" data-wow-duration="0.8s" data-wow-delay="0">{$blocks['case_list_title']['value']}</p>
<strong class="wow fadeInUp" data-wow-duration="0.8s" data-wow-delay="0.2s">{$blocks['case_list_title']['title']}</strong>
</div>
<div class="project-case-list red-property-case flex w1360">
{foreach $items as $item}
<a href="/cases/{$item.id}.html" class="wow fadeInUp" data-wow-duration="0.8s" data-wow-delay="0">
<div class="img"><img src="{$isMobile ? $item['image_mobile'] : $item['image']}" alt="{$item.title}"></div>
<div class="info bg-col-ashen">
<div class="txt flex">
<p class="clips1">{$item.title}</p>
</div>
<p class="color-white clips2">{$item.description}</p>
</div>
</a>
{/foreach}
</div>
<div style="text-align: center;margin-top: 15px;display: none" class="show-msg">没有更多了</div>
<!-- 加载更多 -->
<div class="red-property-more w1360">
<div class="get-more-cases load-more-news bg-col-white color-blue" data-href="/cases/getList?category_id={$category['id']}" data-page="2" data-size="{$category['number'] ?? 6}">点击加载更多</div>
</div>
</div>
<script>
$('body').on('click', '.get-more-cases', function () {
let that = $(this);
let url = that.data('href');
let page = that.data('page');
let size = that.data('size');
$.post(url, {page: page, size: size}, function (res) {
if (res.code === 0) {
if (!res.data || res.data.length <= 0) {
$('.show-msg').show();
setTimeout(function () {
$('.show-msg').hide();
}, 2000)
return false;
}
let html = ``;
$.each(res.data, function (index, item) {
html += `
<a href="/cases/${item.id}.html" class="wow fadeInUp" data-wow-duration="0.8s" data-wow-delay="0">
<div class="img"><img src="${item.image}" alt="${item.title}"></div>
<div class="info bg-col-ashen">
<div class="txt flex">
<p class="clips1">${item.title}</p>
<span>+</span>
</div>
<p class="color-white clips2">${item.description}</p>
</div>
</a>
`;
})
page++;
that.data('page', page)
$('.project-case-list').append(html);
return false;
}
})
})
</script>