2022-11-05 15:35:58 +00:00
|
|
|
{php}
|
|
|
|
use app\model\Category;
|
|
|
|
// 一级栏目的banner
|
|
|
|
$firstCategoryId = Category::firstGradeId($category['path'], $category['id']);
|
|
|
|
|
|
|
|
if ($firstCategoryId == $category['id']) {
|
|
|
|
$bg_pc = $category['bg'];
|
|
|
|
$bg_mobile = $category['bg_mobile'];
|
|
|
|
} else {
|
|
|
|
$firstCategory = Category::where('id', $firstCategoryId)->field('id,title,bg,bg_mobile')->find();
|
|
|
|
$bg_pc = $firstCategory['bg'];
|
|
|
|
$bg_mobile = $firstCategory['bg_mobile'];
|
|
|
|
}
|
|
|
|
|
|
|
|
$bgImg = $isMobile? $bg_mobile : $bg_pc;
|
|
|
|
$bgImg = trim($bgImg);
|
2022-11-05 15:41:59 +00:00
|
|
|
$defaultBg = request()->controller() == 'Index' ? '' : '/static/web/images/public/header-bg.jpg';
|
|
|
|
$bgImg = $bgImg ?: $defaultBg;
|
2022-11-05 15:35:58 +00:00
|
|
|
{/php}
|
2022-10-11 02:23:21 +00:00
|
|
|
<!-- 头部 -->
|
2022-11-05 15:35:58 +00:00
|
|
|
<div class="header {$Request.controller == 'Index' ? 'no-background' : ''} w100" style="background-image:url({$bgImg})">
|
2022-10-11 02:23:21 +00:00
|
|
|
<!-- logo&导航 -->
|
|
|
|
<div class="head flex w1360">
|
2022-11-05 15:35:58 +00:00
|
|
|
<div class="logo"><a href="/"><img src="{$system['img_logo']}" alt="{$system['company_name']}"></a></div>
|
2022-10-11 02:23:21 +00:00
|
|
|
<div class="nav flex">
|
2022-11-05 15:35:58 +00:00
|
|
|
<span><img src="{$system['img_logo']}" alt="{$system['company_name']}"></span>
|
2022-10-11 02:23:21 +00:00
|
|
|
{foreach $menus as $menusitem}
|
2022-11-03 09:21:38 +00:00
|
|
|
<div class="nav-item {if $topCategoryId == $menusitem['id']} active {/if}">
|
|
|
|
<a href="{:getUri($menusitem)}">{$menusitem['title']}</a>
|
2022-11-04 06:06:03 +00:00
|
|
|
{if !empty($menusitem['children'])}
|
2022-11-03 09:21:38 +00:00
|
|
|
<div class="sub-nav-item">
|
2022-11-04 06:06:03 +00:00
|
|
|
{foreach $menusitem['children'] as $child}
|
|
|
|
<a href="{$child['url'] ?: $child['route']}">{$child.title ?? ''}</a>
|
|
|
|
{/foreach}
|
2022-11-03 09:21:38 +00:00
|
|
|
</div>
|
2022-11-04 06:06:03 +00:00
|
|
|
{/if}
|
2022-11-03 09:21:38 +00:00
|
|
|
</div>
|
2022-10-11 02:23:21 +00:00
|
|
|
{/foreach}
|
|
|
|
<!-- 电话 -->
|
|
|
|
<a href="tel:400-852-1199" class="pull-call color-white flex">
|
|
|
|
<span class="bg-col-white flex"><img src="__STATIC__/web/images/icon/icon-call-head.png" alt="电话"></span>
|
|
|
|
<span>{$system['landline']}</span>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
<!-- 导航按钮 -->
|
|
|
|
<div class="nav-bg"></div>
|
|
|
|
<div class="head-btn">
|
|
|
|
<i class="bar-top"></i>
|
|
|
|
<i class="bar-cen"></i>
|
|
|
|
<i class="bar-bom"></i>
|
2022-10-08 09:31:39 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2022-10-11 02:23:21 +00:00
|
|
|
</div>
|