zzwy2/view/public/menu.html

53 lines
2.1 KiB
HTML
Executable File

{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);
$defaultBg = request()->controller() == 'Index' ? '' : '/static/web/images/public/header-bg.jpg';
$bgImg = $bgImg ?: $defaultBg;
{/php}
<!-- 头部 -->
<div class="header {$Request.controller == 'Index' ? 'no-background' : ''} w100" style="background-image:url({$bgImg})">
<!-- logo&导航 -->
<div class="head flex w1360">
<div class="logo"><a href="/"><img src="{$system['img_logo']}" alt="{$system['company_name']}"></a></div>
<div class="nav flex">
<span><img src="{$system['img_logo']}" alt="{$system['company_name']}"></span>
{foreach $menus as $menusitem}
<div class="nav-item {if $topCategoryId == $menusitem['id']} active {/if}">
<a href="{:getUri($menusitem)}">{$menusitem['title']}</a>
{if !empty($menusitem['children'])}
<div class="sub-nav-item">
{foreach $menusitem['children'] as $child}
<a href="{$child['url'] ?: $child['route']}">{$child.title ?? ''}</a>
{/foreach}
</div>
{/if}
</div>
{/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>
</div>
</div>
</div>