更新 'view/page/history.html'

master
Lee 2022-12-15 07:20:05 +00:00
parent 1369a76722
commit 76eb8cd4df
1 changed files with 103 additions and 103 deletions

View File

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