{{include file="public/header" /}}

<!-- header top nav -->
{{include file="public/header_top_nav" /}}

<!-- search -->
{{include file="public/nav_search" /}}

<!-- header nav -->
{{include file="public/header_nav" /}}

<!-- goods category -->
{{include file="public/goods_category" /}}

<!-- 搜索页面顶部钩子 -->
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}}
    <div class="plugins-tag">
        <span>plugins_view_search_top</span>
    </div>
{{/if}}
{{if !empty($plugins_view_search_top_data) and is_array($plugins_view_search_top_data)}}
    {{foreach $plugins_view_search_top_data as $hook}}
        {{if is_string($hook) or is_int($hook)}}
            {{$hook|raw}}
        {{/if}}
    {{/foreach}}
{{/if}}

<!-- content -->
<div class="am-container">
    <!-- 搜索页面顶部内部结构里面钩子 -->
    {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}}
        <div class="plugins-tag">
            <span>plugins_view_search_inside_top</span>
        </div>
    {{/if}}
    {{if !empty($plugins_view_search_inside_top_data) and is_array($plugins_view_search_inside_top_data)}}
        {{foreach $plugins_view_search_inside_top_data as $hook}}
            {{if is_string($hook) or is_int($hook)}}
                {{$hook|raw}}
            {{/if}}
        {{/foreach}}
    {{/if}}

    <div class="search-container am-u-sm-12 am-u-md-12 am-padding-left-0 am-padding-right-0" data-category-id="{{if !empty($params['category_id'])}}{{$params.category_id}}{{/if}}" data-brand-id="{{if !empty($params['brand_id'])}}{{$params.brand_id}}{{/if}}">
        <!-- 手机模式下基础信息+搜索条件按钮 -->
        <div class="map-base-tips am-nbfc am-padding-horizontal-xs am-padding-vertical-sm am-show-sm">
            <p class="am-fl">
                <span>筛选出</span>
                <strong class="map-result-count am-text-danger">...</strong>
                <span>条数据</span>
            </p>
            <button class="am-btn am-btn-primary am-icon-filter map-offcanvas-submit" data-am-offcanvas="{target: '#search-map'}"></button>
        </div>

        <!-- 搜索条件顶部钩子 -->
        {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}}
            <div class="plugins-tag">
                <span>plugins_view_search_map_top</span>
            </div>
        {{/if}}
        {{if !empty($plugins_view_search_map_top_data) and is_array($plugins_view_search_map_top_data)}}
            {{foreach $plugins_view_search_map_top_data as $hook}}
                {{if is_string($hook) or is_int($hook)}}
                    {{$hook|raw}}
                {{/if}}
            {{/foreach}}
        {{/if}}

        <!-- 搜索条件内容、侧边栏内容 -->
        <div id="search-map" class="am-offcanvas">
            <div class="am-offcanvas-bar">
                <div class="am-offcanvas-content">
                    <ul class="map-item am-list am-list-border am-margin-top-sm am-margin-bottom-0">
                        <!-- 搜索页面筛选条件内前面钩子 -->
                        {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}}
                            <div class="plugins-tag">
                                <span>plugins_view_search_map_inside_begin</span>
                            </div>
                        {{/if}}
                        {{if !empty($plugins_view_search_map_inside_begin_data) and is_array($plugins_view_search_map_inside_begin_data)}}
                            {{foreach $plugins_view_search_map_inside_begin_data as $hook}}
                                {{if is_string($hook) or is_int($hook)}}
                                    {{$hook|raw}}
                                {{/if}}
                            {{/foreach}}
                        {{/if}}

                        <!-- 基础数据 -->
                        <li class="am-nbfc">
                            <p class="am-fl am-margin-left-sm">
                                <span>筛选出</span>
                                <strong class="map-result-count am-text-danger">...</strong>
                                <span>条数据</span>
                            </p>
                            <span class="map-remove-submit am-fr am-margin-right-sm am-hide">清除</span>
                        </li>

                        <!-- 搜索页面筛选条件内基础底部钩子 -->
                        {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}}
                            <div class="plugins-tag">
                                <span>plugins_view_search_map_inside_base_bottom</span>
                            </div>
                        {{/if}}
                        {{if !empty($plugins_view_search_map_inside_base_bottom_data) and is_array($plugins_view_search_map_inside_base_bottom_data)}}
                            {{foreach $plugins_view_search_map_inside_base_bottom_data as $hook}}
                                {{if is_string($hook) or is_int($hook)}}
                                    {{$hook|raw}}
                                {{/if}}
                            {{/foreach}}
                        {{/if}}

                        <!-- 品牌 -->
                        {{if !empty($brand_list)}}
                            <li class="am-nbfc map-brand-container" data-field="brand_ids">
                                {{if empty($search_map_info['brand'])}}
                                    <div class="map-left am-text-center am-fl">品牌</div>
                                    <div class="map-right map-images-text-items am-fr am-nbfc">
                                        <ul class="am-nbfc">
                                            {{foreach $brand_list as $v}}
                                                <li data-value="{{$v.id}}" title="{{$v.name}}" {{if isset($params['brand_id']) and $params['brand_id'] eq $v['id']}}class="active disabled"{{/if}}>
                                                    {{if empty($v['logo'])}}
                                                        {{$v.name}}
                                                    {{else /}}
                                                        <img src="{{$v.logo}}" alt="{{$v.name}}" />
                                                    {{/if}}
                                                </li>
                                            {{/foreach}}
                                        </ul>
                                        <div class="map-more-submit am-hide">
                                            <span>更多</span>
                                            <i class="am-icon-angle-down"></i>
                                        </div>
                                    </div>
                                {{else /}}
                                    <div class="brand-info">
                                        <div class="map-left am-text-center am-fl">品牌</div>
                                        <div class="map-right map-images-text-items am-fr am-nbfc">
                                            <a {{if empty($search_map_info['brand']['website_url'])}}href="javascript:;"{{else /}}href="{{$search_map_info.brand.website_url}}" target="_blank"{{/if}} title="{{$search_map_info.brand.name}}">
                                                {{if empty($search_map_info['brand']['logo'])}}
                                                    <p class="info-logo-empty am-fl am-text-center">{{$search_map_info.brand.name}}</p>
                                                {{else /}}
                                                    <img src="{{$search_map_info.brand.logo}}" alt="{{$search_map_info.brand.name}}" class="info-logo am-img-thumbnail am-fl" />
                                                {{/if}}
                                            </a>
                                            <div class="am-fr info-right">
                                                <!-- logo为空则不显示名称、无logo会使用名称当做logo展示 -->
                                                {{if !empty($search_map_info['brand']['logo'])}}
                                                    <p class="info-name am-margin-bottom-xs">{{$search_map_info.brand.name}}</p>
                                                {{/if}}
                                                <p class="info-desc am-text-truncate-2">{{$search_map_info.brand.describe}}</p>
                                            </div>
                                        </div>
                                    </div>
                                {{/if}}
                            </li>
                        {{/if}}

                        <!-- 分类 -->
                        {{if !empty($category_list)}}
                            <li class="am-nbfc map-category-container" data-field="category_ids">
                                <div class="map-left am-text-center am-fl">分类</div>
                                <div class="map-right map-text-items am-fr am-nbfc">
                                    <ul class="am-nbfc">
                                        {{foreach $category_list as $v}}
                                            <li data-value="{{$v.id}}" title="{{$v.name}}">{{$v.name}}</li>
                                        {{/foreach}}
                                    </ul>
                                    <div class="map-more-submit am-hide">
                                        <span>更多</span>
                                        <i class="am-icon-angle-down"></i>
                                    </div>
                                </div>
                            </li>
                        {{/if}}

                        <!-- 价格 -->
                        {{if !empty($screening_price_list)}}
                            <li class="am-nbfc screening-price-container" data-field="screening_price_values">
                                <div class="map-left am-text-center am-fl">价格</div>
                                <div class="map-right map-text-items am-fr am-nbfc">
                                    <ul class="am-nbfc">
                                        {{foreach $screening_price_list as $v}}
                                            <li data-value="{{$v.min_price}}-{{$v.max_price}}" title="{{$v.name}}">{{$v.name}}</li>
                                        {{/foreach}}
                                    </ul>
                                    <div class="map-more-submit am-hide">
                                        <span>更多</span>
                                        <i class="am-icon-angle-down"></i>
                                    </div>
                                </div>
                            </li>
                        {{/if}}

                        <!-- 属性 -->
                        {{if !empty($goods_params_list)}}
                            <li class="am-nbfc goods-params-container" data-field="goods_params_values">
                                <div class="map-left am-text-center am-fl">属性</div>
                                <div class="map-right map-text-items am-fr am-nbfc">
                                    <ul class="am-nbfc">
                                        {{foreach $goods_params_list as $v}}
                                            <li data-value="{{$v.value}}" title="{{$v.value}}">{{$v.value}}</li>
                                        {{/foreach}}
                                    </ul>
                                    <div class="map-more-submit am-hide">
                                        <span>更多</span>
                                        <i class="am-icon-angle-down"></i>
                                    </div>
                                </div>
                            </li>
                        {{/if}}

                        <!-- 规格 -->
                        {{if !empty($goods_spec_list)}}
                            <li class="am-nbfc goods-spec-container" data-field="goods_spec_values">
                                <div class="map-left am-text-center am-fl">规格</div>
                                <div class="map-right map-text-items am-fr am-nbfc">
                                    <ul class="am-nbfc">
                                        {{foreach $goods_spec_list as $v}}
                                            <li data-value="{{$v.value}}" title="{{$v.value}}">{{$v.value}}</li>
                                        {{/foreach}}
                                    </ul>
                                    <div class="map-more-submit am-hide">
                                        <span>更多</span>
                                        <i class="am-icon-angle-down"></i>
                                    </div>
                                </div>
                            </li>
                        {{/if}}

                        <!-- 搜索页面筛选条件内尾部钩子 -->
                        {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}}
                            <div class="plugins-tag">
                                <span>plugins_view_search_map_inside_end</span>
                            </div>
                        {{/if}}
                        {{if !empty($plugins_view_search_map_inside_end_data) and is_array($plugins_view_search_map_inside_end_data)}}
                            {{foreach $plugins_view_search_map_inside_end_data as $hook}}
                                {{if is_string($hook) or is_int($hook)}}
                                    {{$hook|raw}}
                                {{/if}}
                            {{/foreach}}
                        {{/if}}
                    </ul>
                </div>
            </div>
        </div>

        <!-- 搜索页面搜索导航条顶部钩子 -->
        {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}}
            <div class="plugins-tag">
                <span>plugins_view_search_nav_top</span>
            </div>
        {{/if}}
        {{if !empty($plugins_view_search_nav_top_data) and is_array($plugins_view_search_nav_top_data)}}
            {{foreach $plugins_view_search_nav_top_data as $hook}}
                {{if is_string($hook) or is_int($hook)}}
                    {{$hook|raw}}
                {{/if}}
            {{/foreach}}
        {{/if}}

        <!-- 排序方式 -->
        <div class="search-nav am-margin-top-sm">
            <ul class="sort-nav" data-am-sticky="{animation: 'slide-top'}">
                <!-- 搜索页面搜索导航条内前面钩子 -->
                {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}}
                    <div class="plugins-tag">
                        <span>plugins_view_search_nav_inside_begin</span>
                    </div>
                {{/if}}
                {{if !empty($plugins_view_search_nav_inside_begin_data) and is_array($plugins_view_search_nav_inside_begin_data)}}
                    {{foreach $plugins_view_search_nav_inside_begin_data as $hook}}
                        {{if is_string($hook) or is_int($hook)}}
                            {{$hook|raw}}
                        {{/if}}
                    {{/foreach}}
                {{/if}}

                <li class="active" data-field="default" data-type="desc">
                    <a href="javascript:;" title="综合">
                        <span>综合</span>
                    </a>
                </li>
                <li data-field="sales_count" data-type="desc">
                    <a href="javascript:;" title="销量">
                        <span>销量</span>
                        <i class="am-icon-long-arrow-down"></i>
                    </a>
                </li>
                <li data-field="access_count" data-type="desc">
                    <a href="javascript:;" title="热度">
                        <span>热度</span>
                        <i class="am-icon-long-arrow-down"></i>
                    </a>
                </li>
                <li data-field="min_price" data-type="desc">
                    <a href="javascript:;" title="价格">
                        <span>价格</span>
                        <i class="am-icon-long-arrow-down"></i>
                    </a>
                </li>
                <li data-field="id" data-type="desc">
                    <a href="javascript:;" title="最新">
                        <span>最新</span>
                        <i class="am-icon-long-arrow-down"></i>
                    </a>
                </li>

                <!-- 搜索页面排序导航条内尾部钩子 -->
                {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}}
                    <div class="plugins-tag">
                        <span>plugins_view_search_nav_inside_end</span>
                    </div>
                {{/if}}
                {{if !empty($plugins_view_search_nav_inside_end_data) and is_array($plugins_view_search_nav_inside_end_data)}}
                    {{foreach $plugins_view_search_nav_inside_end_data as $hook}}
                        {{if is_string($hook) or is_int($hook)}}
                            {{$hook|raw}}
                        {{/if}}
                    {{/foreach}}
                {{/if}}
            </ul>
        </div>

        <!-- 搜索页面数据容器顶部钩子 -->
        {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}}
            <div class="plugins-tag">
                <span>plugins_view_search_data_top</span>
            </div>
        {{/if}}
        {{if !empty($plugins_view_search_data_top_data) and is_array($plugins_view_search_data_top_data)}}
            {{foreach $plugins_view_search_data_top_data as $hook}}
                {{if is_string($hook) or is_int($hook)}}
                    {{$hook|raw}}
                {{/if}}
            {{/foreach}}
        {{/if}}

        <!-- 数据容器 -->
        <ul class="am-avg-sm-2 am-avg-md-3 am-avg-lg-5 am-margin-top-sm search-list"></ul>

        <!-- 搜索页面数据容器底部钩子 -->
        {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}}
            <div class="plugins-tag">
                <span>plugins_view_search_data_bottom</span>
            </div>
        {{/if}}
        {{if !empty($plugins_view_search_data_bottom_data) and is_array($plugins_view_search_data_bottom_data)}}
            {{foreach $plugins_view_search_data_bottom_data as $hook}}
                {{if is_string($hook) or is_int($hook)}}
                    {{$hook|raw}}
                {{/if}}
            {{/foreach}}
        {{/if}}

        <!-- 加载数据 -->
        <div class="loding-view">
            <i class="am-icon-spinner am-icon-pulse"></i>
            <span>加载中...</span>
        </div>

        <!-- 没有数据 -->
        <div class="table-no" style="display:none;"><i class="am-icon-warning"></i> 没有相关数据</div>

        <!-- 分页 -->
        <button type="button" class="am-btn am-btn-default am-btn-block am-margin-vertical-sm search-pages-submit" data-url="{{:MyUrl('index/search/goodslist')}}" style="display:none;">加载更多 <i class="am-icon-angle-double-down"></i></button>
    </div>

    <!-- 搜索页面顶部内部结构里面钩子 -->
    {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}}
        <div class="plugins-tag">
            <span>plugins_view_search_inside_bottom</span>
        </div>
    {{/if}}
    {{if !empty($plugins_view_search_inside_bottom_data) and is_array($plugins_view_search_inside_bottom_data)}}
        {{foreach $plugins_view_search_inside_bottom_data as $hook}}
            {{if is_string($hook) or is_int($hook)}}
                {{$hook|raw}}
            {{/if}}
        {{/foreach}}
    {{/if}}
</div>

<!-- 搜索页面底部钩子 -->
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}}
    <div class="plugins-tag">
        <span>plugins_view_search_bottom</span>
    </div>
{{/if}}
{{if !empty($plugins_view_search_bottom_data) and is_array($plugins_view_search_bottom_data)}}
    {{foreach $plugins_view_search_bottom_data as $hook}}
        {{if is_string($hook) or is_int($hook)}}
            {{$hook|raw}}
        {{/if}}
    {{/foreach}}
{{/if}}

<!-- 罩层 -->
<div class="theme-popover-mask" style="display:none;"></div>


{{include file="public/footer" /}}