zzwy2/view/page/history.html

104 lines
3.3 KiB
HTML
Raw Normal View History

2022-10-11 02:23:21 +00:00
{layout name="layout"/}
{php}
use app\model\Article;
use app\model\Category;
$childrenMenu = Category::getChildrenByParentId(Category::CATEGORY_COMPANY);
$items = Article::getList(Category::CATEGORY_COMPANY_EVENT, 1000);
2022-11-04 11:06:14 +00:00
$items = $items->toArray();
$items = $items['data'];
$years = array_unique(array_column($items, 'title'));
rsort($years);
$yearList = [];
foreach ($items as $item) {
foreach($years as $year) {
if (!isset($yearList[$item['title']])) {
$yearList[$item['title']] = [];
}
if (!isset($yearList[$item['title']][$item['sub_title']])) {
$yearList[$item['title']][$item['sub_title']] = [];
}
$yearList[$item['title']][$item['sub_title']] = $item;
}
}
//dd($yearList[2022]);exit;
2022-10-11 02:23:21 +00:00
{/php}
{include file="public/about_second" /}
<!-- 内容 -->
<div class="pull-section pull-content-bg content-bg-white wow fadeInUp" data-wow-duration="0.8s" data-wow-delay="0">
<div class="profile-title history-title history-title-wap w1360">
<p class="capitalize font-helvetica color-blue wow fadeInUp" data-wow-duration="0.8s" data-wow-delay="0">{$blocks['company_event']['value']}</p>
<strong class="wow fadeInUp" data-wow-duration="0.8s" data-wow-delay="0.2s">{$blocks['company_event']['title']}</strong>
<span class="color-blue pc-show wow fadeInUp" data-wow-duration="0.8s" data-wow-delay="0.4s">
{$blocks['company_event_desc']['value']|raw}
</span>
</div>
<div class="history flex w1360">
<div class="txt">
<div class="history-swiper-bg">
<!-- 向前 -->
<div class="swiper-button-prev">
<span class="bg-col-white flex"><img src="__STATIC__/web/images/icon/icon-arrow-prev.png" alt="向前"></span>
</div>
<div class="history-swiper swiper">
<div class="swiper-wrapper">
2022-11-04 11:06:14 +00:00
{foreach $yearList as $year => $months}
<div class="swiper-slide1 flex">
2022-10-11 02:23:21 +00:00
<div class="history-time">
2022-11-04 11:06:14 +00:00
<p class="bg-col-blue color-white">{$year ?? ''}</p>
2022-10-11 02:23:21 +00:00
<span><em></em></span>
</div>
<div class="history-txt">
2022-11-04 11:06:14 +00:00
{foreach $months as $month => $info}
<p>
<strong>{$month ?? ''}月</strong>
<span>
{php}
$eventList = json_decode($info['imgs'], true);
{/php}
{foreach $eventList as $event}
<span style="cursor: pointer" data-src="{$event.src ?? ''}" class="show-event-img">
{$event.title ??''}
</span><br>
{/foreach}
</span>
</p>
2022-10-11 02:23:21 +00:00
{/foreach}
</div>
</div>
{/foreach}
</div>
</div>
<!-- 向后 -->
<div class="swiper-button-next">
<span class="bg-col-white flex"><img src="__STATIC__/web/images/icon/icon-arrow-next.png" alt="向后"></span>
</div>
</div>
</div>
<div class="img">
2022-11-04 11:06:14 +00:00
{foreach $yearList as $year => $months}
{foreach $months as $month => $info}
{php}
$eventList = json_decode($info['imgs'], true);
{/php}
{foreach $eventList as $k => $event}
{if ($k == 0) }
2022-11-14 07:09:55 +00:00
<span><img id="event-img" src="{$event.src ?? ''}" alt="{$event.title ?? ''}"></span>
2022-11-04 11:06:14 +00:00
{php}break;{/php}
2022-10-11 02:23:21 +00:00
{/if}
{/foreach}
2022-11-04 11:06:14 +00:00
{/foreach}
{/foreach}
2022-10-11 02:23:21 +00:00
</div>
</div>
2022-11-04 11:06:14 +00:00
</div>
<script>
$('body').on('click', '.show-event-img',function () {
let src = $(this).attr('data-src');
2022-11-14 07:09:55 +00:00
$('#event-img').attr('src', src);
2022-11-04 11:06:14 +00:00
})
</script>