{{:ModuleInclude('public/header')}}

<!-- nav start -->
{{:ModuleInclude('public/nav')}}
<!-- nav end -->

<!-- header top nav -->
{{:ModuleInclude('public/header_top_nav')}}

<!-- search -->
{{:ModuleInclude('public/nav_search')}}

<!-- header nav -->
{{:ModuleInclude('public/header_nav')}}

<!-- goods category -->
{{:ModuleInclude('public/goods_category')}}

<!-- banner -->
{{:ModuleInclude('public/home_banner')}}

<!-- 轮播-聚合内容 -->
{{if MyC('home_index_banner_right_status', 1) eq 1}}
    <div class="am-container slideall">
        <div class="banner-mixed am-radius-lg">
            <div class="mod-vip">
                <div class="m-baseinfo am-flex {{if empty($user)}}am-flex-col{{/if}} am-flex-items-center">
                    <a {{if !empty($user)}}href="{{:MyUrl('index/user/index')}}" target="_blank"{{else /}}href="javascript:;"{{/if}} class="am-inline-block">
                        <img src="{{if !empty($user['avatar'])}}{{$user.avatar}}{{else /}}{{:UserDefaultAvatar()}}{{/if}}" class="user-avatar" />
                    </a>
                    <div class="am-flex am-flex-col am-flex-1 am-padding-left-sm am-margin-top-sm">
                        <span class="s-name am-text-truncate am-text-xs">
                            {{if !empty($user)}}
                                <em>{{:MyLang('index.banner_right_already_login_first')}}</em>
                                {{if !empty($user['icon'])}}
                                    <img src="{{$user.icon}}" class="common-user-icon" {{if !empty($user['icon_title'])}}title="{{$user.icon_title}}"{{/if}} />
                                {{/if}}
                                {{if !empty($user['user_name_view'])}}
                                    <em>{{$user.user_name_view}}</em>
                                {{/if}}
                            {{else /}}
                                <em>{{:MyLang('index.banner_right_not_login_first')}}</em>
                                <em>{{$home_site_name}}</em>
                            {{/if}}
                        </span>
                        {{if !empty($user)}}
                            <a href="{{:MyUrl('index/user/logout')}}" class="member-logout am-margin-top-xs">{{:MyLang('common.logout_title')}}
                                <i class="am-icon-angle-double-right"></i>
                            </a>
                        {{/if}}
                    </div>
                </div>
                {{if empty($user) and (!empty($home_user_login_type) or !empty($home_user_reg_type))}}
                    <div class="member-login">
                        {{if !empty($home_user_login_type)}}
                            <a class="am-btn-primary btn am-fl am-radius" href="{{:MyUrl('index/user/loginInfo')}}">{{:MyLang('common.login_title')}}</a>
                        {{/if}}
                        {{if !empty($home_user_reg_type)}}
                            <a class="am-btn-warning btn am-fr am-radius" href="{{:MyUrl('index/user/regInfo')}}">{{:MyLang('common.register_title')}}</a>
                        {{/if}}
                    </div>
                {{/if}}
                {{if !empty($user)}}
                    <div class="member-center">
                        {{if !empty($user_order_status)}}
                            {{foreach $user_order_status as $v}}
                                {{if in_array($v['status'], [1,2,3])}}
                                    <a href="{{:MyUrl('index/order/index', ['is_more'=>1, 'status'=>$v['status']])}}" class="am-text-truncate am-color-grey-dark" target="_blank"><strong>{{$v.count}}</strong>{{$v.name}}</a>
                                {{elseif in_array($v['status'], [100]) /}}
                                    <a href="{{:MyUrl('index/order/index', ['is_more'=>1, 'is_comments'=>0, 'status'=>4])}}" class="am-text-truncate am-color-grey-dark" target="_blank"><strong>{{$v.count}}</strong>{{$v.name}}</a>
                                {{/if}}
                            {{/foreach}}
                        {{/if}}
                    </div>
                {{/if}}
            </div>
            {{if !empty($article_list)}}
                <div class="banner-news theme-data-edit-event" data-module="article_list">
                    <p class="banner-news-title am-text-truncate">{{:MyLang('index.banner_right_article_title')}}</p>
                    <ul>
                        {{foreach $article_list as $article}}
                            <li class="am-text-truncate">
                                <a href="{{$article.url}}" {{if !empty($article.title_color)}}style="color:{{$article.title_color}};"{{/if}}><strong class="am-padding-right-xs">·</strong>{{$article.title}}</a>
                            </li>
                        {{/foreach}}
                    </ul>
                </div>
            {{/if}}

            <!-- 轮播混合数据底部钩子 -->
            {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
                <div class="plugins-tag">
                    <span>plugins_view_home_banner_mixed_bottom</span>
                </div>
            {{/if}}
            {{if !empty($plugins_view_home_banner_mixed_bottom_data) and is_array($plugins_view_home_banner_mixed_bottom_data)}}
                {{foreach $plugins_view_home_banner_mixed_bottom_data as $hook}}
                    {{if is_string($hook) or is_int($hook)}}
                        {{$hook|raw}}
                    {{/if}}
                {{/foreach}}
            {{/if}}
        </div>
    </div>
{{/if}}

<!-- 轮播-手机导航 -->
{{:ModuleInclude('public/home_nav')}}

<!-- 楼层数据顶部钩子 -->
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
    <div class="plugins-tag">
        <span>plugins_view_home_floor_top</span>
    </div>
{{/if}}
{{if !empty($plugins_view_home_floor_top_data) and is_array($plugins_view_home_floor_top_data)}}
    {{foreach $plugins_view_home_floor_top_data as $hook}}
        {{if is_string($hook) or is_int($hook)}}
            {{$hook|raw}}
        {{/if}}
    {{/foreach}}
{{/if}}

<!-- 楼层-主内容 -->
{{if isset($floor_data_type) and $floor_data_type eq 2}}
    <!-- 是否设计模式 -->
    {{if isset($is_design) and $is_design eq 1}}
        <div class="am-padding-sm am-background-white am-margin-top-sm">
            <div class="layout-operate-container am-fr" data-save-url="{{$layout_save_url}}">
                <a href="{{$home_url}}" class="am-btn am-btn-warning am-btn-xs am-radius">
                    <i class="am-icon-close"></i>
                    <span>{{:MyLang('cancel_title')}}</span>
                </a>
                <button type="button" class="am-btn am-btn-success am-btn-xs am-radius am-margin-left-sm" data-am-loading="{spinner: 'circle-o-notch', loadingText:'{{:MyLang('save_title')}}'}">
                    <i class="am-icon-check"></i>
                    <span>{{:MyLang('save_title')}}</span>
                </button>
            </div>
            {{:ModuleInclude('../../../module/view/layout/base')}}
        </div>
    {{else /}}
        {{:ModuleInclude('../../../module/view/layout/view')}}
    {{/if}}
{{else /}}
    <div class="home-floor">
        <!-- 楼层 -->
        {{if !empty($goods_floor_list) and is_array($goods_floor_list)}}
            {{foreach $goods_floor_list as $key=>$floor}}
                <!-- 首页楼层顶部钩子 -->
                {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
                    <div class="plugins-tag">
                        <span>plugins_view_home_floor_top_{{$key+1}}</span>
                    </div>
                {{/if}}
                {{php}}
                    $hook_name = 'plugins_view_home_floor_top_'.($key+1);
                    $hook_data = MyEventTrigger($hook_name, ['hook_name'=>$hook_name, 'is_backend'=>false, 'floor_id'=>$key+1, 'floor'=>$floor]);
                    if(!empty($hook_data) && is_array($hook_data))
                    {
                        foreach($hook_data as $hook)
                        {
                            if(is_string($hook) || is_int($hook))
                            {
                                echo htmlspecialchars_decode($hook);
                            }
                        }
                    }
                {{/php}}

                <!-- 楼层数据 -->
                <div id="floor{{$key+1}}">
                    <div class="am-container">
                        <div class="items-nav-title">
                            <p class="floor-title am-title-left-border">{{$floor.name}}</p>
                            <p class="floor-desc">{{$floor.vice_name}}</p>
                            <div class="today-brands ">
                                {{if !empty($floor['config_keywords']) and is_array($floor['config_keywords'])}}
                                    {{foreach $floor.config_keywords as $wd}}
                                        <a href="{{:MyUrl('index/search/index', ['wd'=>StrToAscii($wd)])}}" target="_blank">{{$wd}}</a>
                                    {{/foreach}}
                                {{/if}}
                            </div>
                            <span class="more">
                                <a href="{{:MyUrl('index/search/index', ['cid'=>$floor['id']])}}" target="_blank">{{:MyLang('common.more_text')}} <i class="iconfont icon-angle-right"></i></a>
                            </span>
                        </div>
                    </div>
                    
                    <div class="am-g am-container floor floor-flex">
                        <!-- 首页楼层内部顶部钩子 -->
                        {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
                            <div class="plugins-tag">
                                <span>plugins_view_home_floor_inside_top</span>
                            </div>
                        {{/if}}
                        {{php}}
                            $hook_name = 'plugins_view_home_floor_inside_top';
                            $hook_data = MyEventTrigger($hook_name, ['hook_name'=>$hook_name, 'is_backend'=>false, 'floor_id'=>$key+1, 'floor'=>$floor]);
                            if(!empty($hook_data) && is_array($hook_data))
                            {
                                foreach($hook_data as $hook)
                                {
                                    if(is_string($hook) || is_int($hook))
                                    {
                                        echo htmlspecialchars_decode($hook);
                                    }
                                }
                            }
                        {{/php}}
                        <div class="am-u-sm-3 aggregation-container">
                            <div class="aggregation am-radius" {{if !empty($floor['bg_color'])}}style="background-color:{{$floor.bg_color}};"{{else /}}style="background-color:#eaeaea;"{{/if}}>
                                {{if !empty($floor['big_images'])}}
                                    <a href="{{:MyUrl('index/search/index', ['cid'=>$floor['id']])}}" target="_blank" class="category-bg-images" {{if !empty($floor['bg_color'])}}style="background-color:{{$floor.bg_color}};"{{/if}}>
                                        <img src="{{$floor.big_images}}" class="scale-sm" />
                                    </a>
                                {{/if}}
                                {{if !empty($floor['items']) and is_array($floor['items'])}}
                                    <div class="word am-radius">
                                        {{foreach $floor.items as $category_key=>$category}}
                                            <a href="{{:MyUrl('index/search/index', ['cid'=>$category['id']])}}" class="outer am-radius" target="_blank">{{:mb_substr($category['name'], 0, 4, 'utf-8')}}</a>
                                        {{/foreach}}
                                    </div>
                                {{/if}}

                                <!-- 首页楼层内部底部钩子 -->
                                {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
                                    <div class="plugins-tag">
                                        <span>plugins_view_home_aggregation_inside_bottom</span>
                                    </div>
                                {{/if}}
                                {{php}}
                                    $hook_name = 'plugins_view_home_aggregation_inside_bottom';
                                    $hook_data = MyEventTrigger($hook_name, ['hook_name'=>$hook_name, 'is_backend'=>false, 'floor_id'=>$key+1, 'floor'=>$floor]);
                                    if(!empty($hook_data) && is_array($hook_data))
                                    {
                                        foreach($hook_data as $hook)
                                        {
                                            if(is_string($hook) || is_int($hook))
                                            {
                                                echo htmlspecialchars_decode($hook);
                                            }
                                        }
                                    }
                                {{/php}}
                            </div>
                        </div>
                        <div class="goods-list">
                            {{if !empty($floor['goods']) and is_array($floor['goods'])}}
                                {{:ModuleInclude('module/goods/grid/base', [
                                    'goods_list'  => $floor.goods,
                                    'type'        => 'index',
                                    'lg'          => '4',
                                    'md'          => '4',
                                ])}}
                            {{/if}}
                        </div>

                        <!-- 首页楼层内部底部钩子 -->
                        {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
                            <div class="plugins-tag">
                                <span>plugins_view_home_floor_inside_bottom</span>
                            </div>
                        {{/if}}
                        {{php}}
                            $hook_name = 'plugins_view_home_floor_inside_bottom';
                            $hook_data = MyEventTrigger($hook_name, ['hook_name'=>$hook_name, 'is_backend'=>false, 'floor_id'=>$key+1, 'floor'=>$floor]);
                            if(!empty($hook_data) && is_array($hook_data))
                            {
                                foreach($hook_data as $hook)
                                {
                                    if(is_string($hook) || is_int($hook))
                                    {
                                        echo htmlspecialchars_decode($hook);
                                    }
                                }
                            }
                        {{/php}}
                    </div>
                </div>

                <!-- 首页楼层底部钩子 -->
                {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
                    <div class="plugins-tag">
                        <span>plugins_view_home_floor_bottom_{{$key+1}}</span>
                    </div>
                {{/if}}
                {{php}}
                    $hook_name = 'plugins_view_home_floor_bottom_'.($key+1);
                    $hook_data = MyEventTrigger($hook_name, ['hook_name'=>$hook_name, 'is_backend'=>false, 'floor_id'=>$key+1, 'floor'=>$floor]);
                    if(!empty($hook_data) && is_array($hook_data))
                    {
                        foreach($hook_data as $hook)
                        {
                            if(is_string($hook) || is_int($hook))
                            {
                                echo htmlspecialchars_decode($hook);
                            }
                        }
                    }
                {{/php}}
            {{/foreach}}
        {{/if}}
    </div>
{{/if}}

<!-- 楼层数据底部钩子 -->
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
    <div class="plugins-tag">
        <span>plugins_view_home_floor_bottom</span>
    </div>
{{/if}}
{{if !empty($plugins_view_home_floor_bottom_data) and is_array($plugins_view_home_floor_bottom_data)}}
    {{foreach $plugins_view_home_floor_bottom_data as $hook}}
        {{if is_string($hook) or is_int($hook)}}
            {{$hook|raw}}
        {{/if}}
    {{/foreach}}
{{/if}}

{{:ModuleInclude('public/footer')}}

{{if isset($is_design) and $is_design eq 1}}
    <!-- layout formback -->
    {{:ModuleInclude('../../../module/view/layout/form_back')}}
{{/if}}