refactor: 首页品牌故事年份显示问题
This commit is contained in:
@@ -19,6 +19,7 @@ class Index extends Common
|
|||||||
*/
|
*/
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
|
|
||||||
// 获取banner数据
|
// 获取banner数据
|
||||||
$banner = $this->getBannerData();
|
$banner = $this->getBannerData();
|
||||||
View::assign('focus_images', $banner['focus_images']);
|
View::assign('focus_images', $banner['focus_images']);
|
||||||
@@ -26,7 +27,14 @@ class Index extends Common
|
|||||||
View::assign('featured_topics', $banner['featured_topics']);
|
View::assign('featured_topics', $banner['featured_topics']);
|
||||||
View::assign('video', array_shift($banner['video']));
|
View::assign('video', array_shift($banner['video']));
|
||||||
View::assign('scenes', $banner['scenes']);
|
View::assign('scenes', $banner['scenes']);
|
||||||
View::assign('brand_story', $banner['brand_story']);
|
View::assign('brand_story', array_map(function($item) {
|
||||||
|
$item['year'] = '';
|
||||||
|
$arr = explode('-', $item['title']);
|
||||||
|
if (count($arr) > 1) {
|
||||||
|
$item['year'] = $arr[0];
|
||||||
|
}
|
||||||
|
return $item;
|
||||||
|
}, $banner['brand_story']??null));
|
||||||
View::assign('data_statistics', $banner['data_statistics']);
|
View::assign('data_statistics', $banner['data_statistics']);
|
||||||
|
|
||||||
// 获取明星产品/热点产品
|
// 获取明星产品/热点产品
|
||||||
|
|||||||
@@ -167,9 +167,9 @@
|
|||||||
<div class="bs_swcontainer">
|
<div class="bs_swcontainer">
|
||||||
<div class="swiper-pagination bs_pagination"></div>
|
<div class="swiper-pagination bs_pagination"></div>
|
||||||
<hr>
|
<hr>
|
||||||
<!-- <span class="time1">2021</span> -->
|
{volist name="brand_story" id="story" key="k"}
|
||||||
<!-- <span class="time2">2022</span> -->
|
<span class="time{$k}">{$story.year}</span>
|
||||||
<!-- <span class="time3">2023</span> -->
|
{/volist}
|
||||||
</div>
|
</div>
|
||||||
<div class="swiper-container bs_bts">
|
<div class="swiper-container bs_bts">
|
||||||
<img class="slideshow-btn swiper-button-next" src="static/index/temp_images/rightcheck.png" alt="" />
|
<img class="slideshow-btn swiper-button-next" src="static/index/temp_images/rightcheck.png" alt="" />
|
||||||
|
|||||||
Reference in New Issue
Block a user