{{if MyC('home_main_top_header_status', 1) eq 1}}
    <!-- 顶部导航条 start -->
    <div class="header-top">
        <div class="am-container header">
            <ul class="top-nav-left top-nav-left-content am-hide-sm-only">
                <div class="top-nav-items">
                    <div class="menu-hd">
                        <!-- 公共顶部小导航钩子-左侧前面 -->
                        {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
                            <div class="plugins-tag">
                                <span>plugins_view_header_navigation_top_left_begin</span>
                            </div>
                        {{/if}}
                        {{if !empty($plugins_view_header_navigation_top_left_begin_data) and is_array($plugins_view_header_navigation_top_left_begin_data)}}
                            {{foreach $plugins_view_header_navigation_top_left_begin_data as $hook}}
                                {{if is_string($hook) or is_int($hook)}}
                                    {{$hook|raw}}
                                {{/if}}
                            {{/foreach}}
                        {{/if}}

                        {{if empty($user)}}
                            <em class="first am-vertical-align-middle">{{:MyLang('common.header_top_nav_left_not_login_first')}}</em>
                            <em class="site-name">{{$home_site_name}}</em>
                            {{if !empty($home_user_login_type)}}
                                [<a href="{{:MyUrl('index/user/logininfo')}}">{{:MyLang('common.login_title')}}</a>]
                            {{/if}}
                            {{if !empty($home_user_reg_type)}}
                                [<a href="{{:MyUrl('index/user/reginfo')}}">{{:MyLang('common.register_title')}}</a>]
                            {{/if}}
                        {{else /}}
                            <em class="first am-vertical-align-middle">{{:MyLang('common.header_top_nav_left_login_first')}}</em>
                            {{if !empty($user['icon'])}}
                                <img src="{{$user.icon}}" class="common-user-icon am-vertical-align-middle am-radius" {{if !empty($user['icon_title'])}}title="{{$user.icon_title}}"{{/if}} />
                            {{/if}}
                            {{if !empty($user['user_name_view'])}}
                                <em class="user">{{$user.user_name_view}}</em>
                            {{/if}}
                            <em class="last">{{:MyLang('common.header_top_nav_left_login_last')}}</em>
                            <em class="site-name">{{$home_site_name}}</em>
                            <em class="logout"><a href="{{:MyUrl('index/user/logout')}}">[{{:MyLang('common.logout_title')}}]</a></em>
                        {{/if}}

                        <!-- 公共顶部小导航钩子-左侧后面 -->
                        {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
                            <div class="plugins-tag">
                                <span>plugins_view_header_navigation_top_left_end</span>
                            </div>
                        {{/if}}
                        {{if !empty($plugins_view_header_navigation_top_left_end_data) and is_array($plugins_view_header_navigation_top_left_end_data)}}
                            {{foreach $plugins_view_header_navigation_top_left_end_data as $hook}}
                                {{if is_string($hook) or is_int($hook)}}
                                    {{$hook|raw}}
                                {{/if}}
                            {{/foreach}}
                        {{/if}}
                    </div>
                </div>
            </ul>

            <div class="top-nav-left top-nav-left-site-logo am-show-sm-only">
                <a href="{{if empty($module_data['url'])}}{{$home_url}}{{else /}}{{$module_data.url}}{{/if}}">
                    <img class="am-height" src="{{if empty($module_data['logo'])}}{{$home_site_logo_wap}}{{else /}}{{$module_data.logo}}{{/if}}" alt="{{if empty($module_data['name'])}}{{$home_site_name}}{{else /}}{{$module_data.name}}{{/if}}" />
                </a>
            </div>

            <ul class="top-nav-right">
                <!-- 公共顶部小导航钩子-右侧前面 -->
                {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
                    <div class="plugins-tag">
                        <span>plugins_view_header_navigation_top_right_begin</span>
                    </div>
                {{/if}}
                {{if !empty($plugins_view_header_navigation_top_right_begin_data) and is_array($plugins_view_header_navigation_top_right_begin_data)}}
                    {{foreach $plugins_view_header_navigation_top_right_begin_data as $hook}}
                        {{if is_string($hook) or is_int($hook)}}
                            {{$hook|raw}}
                        {{/if}}
                    {{/foreach}}
                {{/if}}

                <!-- 非首页则展示首页入口 -->
                {{if MyC('home_header_top_is_home', 0) eq 1 and $module_name.$controller_name.$action_name neq 'indexindexindex'}}
                    <div class="top-nav-items top-nav-items-home">
                        <div class="menu-hd">
                            <a href="{{$home_url}}">
                                <i class="iconfont icon-index"></i>
                                <span>{{:MyLang('common.shop_home_title')}}</span>
                            </a>
                        </div>
                    </div>
                {{/if}}

                <!-- 右侧导航 -->
                {{if !empty($common_nav_top_right_list) and is_array($common_nav_top_right_list)}}
                    {{foreach $common_nav_top_right_list as $nav}}
                        {{if empty($nav['items'])}}
                            <div class="top-nav-items {{if !empty($nav['type'])}}top-nav-items-{{$nav.type}}{{/if}}">
                                <div class="menu-hd {{if isset($nav['is_login']) and $nav['is_login'] eq 1 and empty($user)}}login-event{{/if}}">
                                    <a href="{{if empty($user)}}javascript:;{{else /}}{{if !empty($nav['url'])}}{{$nav.url}}{{/if}}{{/if}}" {{if !empty($nav['class'])}}class="{{$nav.class}}"{{/if}} {{if !empty($nav['attr_data'])}}{{$nav.attr_data|raw}}{{/if}}>
                                        {{if IsUrl($nav['icon'])}}
                                            <img src="{{$nav.icon}}" class="nav-icon am-vertical-align-middle" />
                                        {{else /}}
                                            <i class="iconfont {{$nav.icon}} am-vertical-align-middle"></i>
                                        {{/if}}
                                        <span class="am-vertical-align-middle">{{$nav.name}}</span>
                                        {{if isset($nav['badge']) and $nav['badge'] gt -1}}
                                            {{if $nav['badge'] gt 0}}
                                                <strong class="am-badge am-badge-danger am-round am-badge-tips {{if isset($nav['type']) and $nav['type'] eq 'cart'}}common-cart-total{{/if}}">{{$nav.badge}}</strong>
                                            {{else /}}
                                                <strong class="am-round {{if isset($nav['type']) and $nav['type'] eq 'cart'}}common-cart-total{{/if}}">{{$nav.badge}}</strong>
                                            {{/if}}
                                        {{/if}}
                                    </a>
                                </div>
                            </div>
                        {{else /}}
                            <div class="top-nav-items {{if !empty($nav['type'])}}top-nav-items-{{$nav.type}}{{/if}}">
                                <div class="am-dropdown menu-hd" data-am-dropdown>
                                    <a class="am-dropdown-toggle" href="javascript:;" data-am-dropdown-toggle>
                                        {{if IsUrl($nav['icon'])}}
                                            <img src="{{$nav.icon}}" class="nav-icon am-vertical-align-middle" />
                                        {{else /}}
                                            <i class="iconfont {{$nav.icon}} am-vertical-align-middle"></i>
                                        {{/if}}
                                        <span class="am-vertical-align-middle">{{$nav.name}}</span>
                                        <i class="am-icon-angle-down am-vertical-align-middle"></i>
                                    </a>
                                    <ul class="am-dropdown-content am-radius">
                                        {{foreach $nav.items as $navs}}
                                            <!-- 是否为事件类型和事件值数据格式 -->
                                            {{if isset($navs['event_type']) and isset($navs['event_value'])}}
                                                <li class="nav-event-item" {{if !empty($navs['data_value'])}}data-value="{{$navs.data_value}}"{{/if}}>
                                                    {{if isset($navs['event_type']) and isset($navs['event_value']) and in_array($navs['event_type'], [3,4])}}
                                                        {{switch navs.event_type}}
                                                            {{case 3}}
                                                                <!-- 地图 -->
                                                                <a href="javascript:;" {{if !empty($navs['event_value_data']) and isset($navs['event_value_data'][2]) and isset($navs['event_value_data'][3]) and $navs['event_value_data'][2] neq 0 and $navs['event_value_data'][3] neq 0}}class="submit-map-popup am-flex am-flex-items-center" data-lng="{{$navs['event_value_data'][2]}}" data-lat="{{$navs['event_value_data'][3]}}"{{/if}}>
                                                                    <p class="nav-images am-margin-right-xs" style="{{if !empty($navs['bg_color'])}}background:{{$navs.bg_color}};{{/if}}">
                                                                        {{if (!empty($navs['icon']) or !empty($navs['images_url'])) and !empty($navs['name'])}}
                                                                            <img src="{{if !empty($navs['icon'])}}{{$navs.icon}}{{else /}}{{$navs.images_url}}{{/if}}" alt="{{$navs.name}}" class="am-width am-block" />
                                                                        {{/if}}
                                                                    </p>
                                                            {{/case}}
                                                            {{case 4}}
                                                                <!-- 电话 -->
                                                                <a {{if !empty($navs['event_value'])}}href="tel:{{$navs.event_value}}"{{else /}}href="javascript:;"{{/if}} class="am-flex am-flex-items-center">
                                                                    <p class="nav-images am-margin-right-xs" style="{{if !empty($navs['bg_color'])}}background:{{$navs.bg_color}};{{/if}}">
                                                                    {{if (!empty($navs['icon']) or !empty($navs['images_url'])) and !empty($navs['name'])}}
                                                                        <img src="{{if !empty($navs['icon'])}}{{$navs.icon}}{{else /}}{{$navs.images_url}}{{/if}}" alt="{{$navs.name}}" class="am-width am-block" />
                                                                    {{/if}}
                                                                </p>
                                                            {{/case}}
                                                        {{/switch}}
                                                    {{else /}}
                                                        <!-- 默认url地址 -->
                                                        <a {{if !empty($navs['event_value'])}}href="{{$navs.event_value}}"{{else /}}href="javascript:;"{{/if}} class="am-flex am-flex-items-center">
                                                            <p class="nav-images am-margin-right-xs" style="{{if !empty($navs['bg_color'])}}background:{{$navs.bg_color}};{{/if}}">
                                                                {{if (!empty($navs['icon']) or !empty($navs['images_url'])) and !empty($navs['name'])}}
                                                                    <img src="{{if !empty($navs['icon'])}}{{$navs.icon}}{{else /}}{{$navs.images_url}}{{/if}}" alt="{{$navs.name}}" class="am-width am-block" />
                                                                {{/if}}
                                                            </p>
                                                    {{/if}}
                                                    <p class="am-text-truncate">{{$navs.name}}</p>
                                                    </a>
                                                </li>
                                            {{else /}}
                                                <!-- 默认为标准名称和url格式 -->
                                                {{if !empty($navs['name'])}}
                                                    <li class="{{if ((isset($nav['is_login']) and $nav['is_login'] eq 1) or (isset($navs['is_login']) and $navs['is_login'] eq 1)) and empty($user)}}login-event{{/if}}">
                                                        <a class="am-flex am-flex-items-center {{if !empty($navs['class'])}}{{$navs.class}}{{/if}}" href="{{if ((isset($nav['is_login']) and $nav['is_login'] eq 1) or (isset($navs['is_login']) and $navs['is_login'] eq 1)) and empty($user)}}javascript:;{{else /}}{{if !empty($navs['url'])}}{{$navs.url}}{{/if}}{{/if}}" {{if !empty($navs['attr_data'])}}{{$navs.attr_data|raw}}{{/if}}>
                                                            {{if !empty($navs['icon']) or !empty($navs['images_url'])}}
                                                                <p class="nav-images am-margin-right-xs" >
                                                                <img src="{{if !empty($navs['icon'])}}{{$navs.icon}}{{else /}}{{$navs.images_url}}{{/if}}" alt="{{$navs.name}}" class="am-width am-block" />
                                                                </p>
                                                            {{/if}}
                                                            <p class="am-text-truncate">{{$navs.name}}</p>
                                                        </a>
                                                    </li>
                                                {{/if}}
                                            {{/if}}
                                        {{/foreach}}
                                    </ul>
                                </div>
                            </div>
                        {{/if}}
                    {{/foreach}}
                {{/if}}

                <!-- 公共顶部小导航钩子-右侧后面 -->
                {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
                    <div class="plugins-tag">
                        <span>plugins_view_header_navigation_top_right_end</span>
                    </div>
                {{/if}}
                {{if !empty($plugins_view_header_navigation_top_right_end_data) and is_array($plugins_view_header_navigation_top_right_end_data)}}
                    {{foreach $plugins_view_header_navigation_top_right_end_data as $hook}}
                        {{if is_string($hook) or is_int($hook)}}
                            {{$hook|raw}}
                        {{/if}}
                    {{/foreach}}
                {{/if}}
            </ul>
        </div>
    </div>
    <!-- 顶部导航条 end -->
{{/if}}