chaoyu/view/article/news.html

106 lines
4.5 KiB
HTML

{layout name="layout" /}
<div class="all_center_box">
{php}
$bgImg = '__IMG__/page_ban1.jpg'; // 默认背景图
if (isset($category) && !empty(trim($category['src'])) && file_exists('.'.$category['src'])) {
$bgImg = $category.src;
}
{/php}
<div class="page_banner wf100">
<div class="bg" style="background-image: url({$bgImg});"></div>
</div>
<div class="news_box w-100">
<div class="crumbs_box w-1500">
{:widget('crumbs/index', ['categoryId' => $categoryId])}
</div>
<div class="news_soso w-1500" aos="fade-up">
<div class="center-block ">
<input type="text" class="text" name="keyword" id="articleKeyword" placeholder="请输入关键字" />
<input type="button" class="btns" value="搜索" id="sosSubmit"/>
</div>
</div>
<div class="news_list w-100" aos="fade-up">
{if isset($childList) && count($childList) > 0}
{foreach $childList as $child}
<hr/>
<div class="news-child-title">{$child['category']['title'] ?? ''}</div>
{if count($child['items']) > 0}
<ul class="w-1500">
{foreach $child['items'] as $item}
{php}
if (!empty($item['link'])){
$url = $item['link'];
$target = 'target="_blank"';
} else {
$url = url('article/detail', ['id'=>$item['id']]);
$target = '';
}
$imgSrc = '__IMG__/article_bg.jpg';
if (!empty(trim($item['src'])) && file_exists('.'.$item['src'])) {
$imgSrc = $item['src'];
}
{/php}
<li>
<a href="{$url}" {$target}>
<div class="imgs wf100">
<img src="{$imgSrc}" alt="{$item['title']}" />
<span><i {if $item['hot']}class="active"{/if}></i></span>
</div>
<div class="info w-100">
<div class="box1">
<span>{$item.create_time|date='Y.m.d'}</span>
<span>{$item['category_title'] ?? ''}</span>
</div>
<div class="box2 w-100">
<span>{$item['title']}</span>
<p>{$item['summary']}</p>
</div>
</div>
</a>
</li>
{/foreach}
</ul>
{/if}
{/foreach}
{elseif isset($items) && count($items) > 0 /}
<ul class="w-1500">
{foreach $items as $item}
{php}
if (!empty($item['link'])){
$url = $item['link'];
$target = 'target="_blank"';
} else {
$url = url('article/detail', ['id'=>$item['id']]);
$target = '';
}
$imgSrc = '__IMG__/article_bg.jpg';
if (!empty(trim($item['src'])) && file_exists('.'.$item['src'])) {
$imgSrc = $item['src'];
}
{/php}
<li>
<a href="{$url}" {$target}>
<div class="imgs wf100">
<img src="{$imgSrc}" alt="{$item['title']}" />
<span><i {if $item['hot']}class="active"{/if}></i></span>
</div>
<div class="info w-100">
<div class="box1">
<span>{$item.create_time|date='Y.m.d'}</span>
<span>{$item['category_title'] ?? ''}</span>
</div>
<div class="box2 w-100">
<span>{$item['title']}</span>
<p>{$item['summary']}</p>
</div>
</div>
</a>
</li>
{/foreach}
</ul>
{/if}
</div>
</div>
</div>