<header class="am-topbar shop-navigation">
    <div class="am-container">
        <button class="am-topbar-btn am-topbar-toggle am-btn am-btn-sm am-btn-default am-show-sm-only switch-submit" data-am-collapse="{target: '#doc-topbar-collapse'}"><span class="am-sr-only">导航切换</span> <span class="am-icon-bars"></span></button>

        <h1 class="am-topbar-brand wap-logo am-show-sm-only">
            <a href="{{$Think.__MY_URL__}}">
                <img src="{{:AttachmentPathViewHandle(MyC('home_site_logo_wap'))}}" alt="{{:MyC('home_seo_site_title')}}" />
            </a>
        </h1>

        <a href="{{:MyUrl('index/category/index')}}" class="am-show-md-only">
            <div class="goods-category-title am-hide-sm-only">
                <span class="all-goods">全部分类</span>
            </div>
        </a>

        <form class="am-topbar-form am-topbar-left am-form-inline am-show-sm-only navigation-search" role="search" action="{{:MyUrl('index/search/index')}}" method="POST">
            <div class="am-input-group am-input-group-sm">
                <input type="text" name="wd" class="am-form-field" placeholder="其实搜索很简单^_^ !" value="{{if !empty($params['wd'])}}{{$params.wd}}{{/if}}" autocomplete="off" />
                <span class="am-input-group-btn">
                    <button class="am-btn am-btn-default" type="submit">
                        <span class="am-icon-search am-icon-xs"></span>
                    </button>
                </span>
            </div>
        </form>

        <div class="am-collapse am-topbar-collapse" id="doc-topbar-collapse">
            {{if empty($user)}}
                <!-- 未登录操作栏 -->
                <div class="navigation-button am-show-sm-only">
                    {{if !empty($home_user_login_type)}}
                        <a href="{{:MyUrl('index/user/logininfo')}}" class="am-btn am-btn-primary am-topbar-btn am-btn-sm">登录</a>
                    {{/if}}
                    {{if !empty($home_user_reg_type)}}
                        <a href="{{:MyUrl('index/user/reginfo')}}" class="am-btn am-btn-success am-topbar-btn am-btn-sm">注册</a>
                    {{/if}}
                </div>
            {{/if}}

            <!-- 主导航 -->
            {{if !empty($nav_header)}}
                <ul class="am-nav am-nav-pills am-topbar-nav">
                    {{foreach $nav_header as $nav}}
                        {{if empty($nav['items'])}}
                            <li>
                                <a href="{{$nav.url}}" {{if $nav['is_new_window_open'] eq 1}}target="_blank"{{/if}} title="{{$nav.name}}" {{if isset($nav['active']) and $nav['active'] eq 1}}class="active"{{/if}}>{{$nav.name}}</a>
                            </li>
                        {{else /}}
                            <li class="am-dropdown" data-am-dropdown>
                                <a class="am-dropdown-toggle {{if isset($nav['active']) and $nav['active'] eq 1}}active{{/if}}" data-am-dropdown-toggle href="javascript:;">
                                    {{$nav.name}} <span class="am-icon-caret-down"></span>
                                </a>
                                <ul class="am-dropdown-content">
                                    {{foreach $nav.items as $navs}}
                                        <li>
                                            <a href="{{$navs.url}}" title="{{$navs.name}}" {{if isset($navs['active']) and $navs['active'] eq 1}}class="active"{{/if}}>{{$navs.name}}</a>
                                        </li>
                                    {{/foreach}}
                                </ul>
                            </li>
                        {{/if}}
                    {{/foreach}}
                </ul>
            {{/if}}

            <!-- 右侧导航 -->
            <div class="am-topbar-right am-hide-sm-only">
                <!-- 快捷百宝箱 -->
                {{if MyC('home_navigation_main_quick_status') eq 1}}
                    <div class="navigation-main-quick">
                        <a href="javascript:;" class="am-block" data-am-modal="{target: '#left-main-quick-popup'}">
                            <span class="am-icon-sliders icon"></span>
                            <b class="am-block"></b>
                            <p class="am-text-truncate name">{{:MyC('home_navigation_main_quick_name', '百宝箱', true)}}</p>
                            <i class="am-icon-angle-down"></i>
                        </a>
                    </div>
                {{/if}}
            </div>
        </div>
    </div>
</header>