diff --git a/application/index/controller/Search.php b/application/index/controller/Search.php index 878f42f2a..9f94f7cf9 100755 --- a/application/index/controller/Search.php +++ b/application/index/controller/Search.php @@ -155,15 +155,78 @@ class Search extends Common SearchService::SearchAdd($this->params); // 无数据直接返回 - if(empty($ret['data']) || $ret['code'] != 0) + if(empty($ret['data']['data']) || $ret['code'] != 0) { - return DataReturn('没有相关数据', -100); + return DataReturn('没有更多数据啦', -100); } + // 钩子 + $this->PluginsHook(); + // 返回数据html $this->assign('data', $ret['data']['data']); $ret['data']['data'] = $this->fetch('content'); return $ret; } + + /** + * 钩子处理 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2019-04-22 + * @desc description + */ + private function PluginsHook() + { + // 搜索页面顶部钩子 + $this->assign('plugins_view_search_top_data', Hook::listen('plugins_view_search_top', + [ + 'hook_name' => 'plugins_view_search_top', + 'is_backend' => false, + ])); + + // 搜索页面底部钩子 + $this->assign('plugins_view_search_bottom_data', Hook::listen('plugins_view_search_top', + [ + 'hook_name' => 'plugins_view_search_bottom', + 'is_backend' => false, + ])); + + // 搜索页面顶部内部结构里面钩子 + $this->assign('plugins_view_search_inside_top_data', Hook::listen('plugins_view_search_inside_top', + [ + 'hook_name' => 'plugins_view_search_inside_top', + 'is_backend' => false, + ])); + + // 搜索页面底部内部结构里面钩子 + $this->assign('plugins_view_search_inside_bottom_data', Hook::listen('plugins_view_search_inside_bottom', + [ + 'hook_name' => 'plugins_view_search_inside_bottom', + 'is_backend' => false, + ])); + + // 搜索页面数据容器顶部钩子 + $this->assign('plugins_view_search_data_top_data', Hook::listen('plugins_view_search_data_top', + [ + 'hook_name' => 'plugins_view_search_data_top', + 'is_backend' => false, + ])); + + // 搜索页面数据容器底部钩子 + $this->assign('plugins_view_search_data_bottom_data', Hook::listen('plugins_view_search_data_bottom', + [ + 'hook_name' => 'plugins_view_search_data_bottom', + 'is_backend' => false, + ])); + + // 搜索页面搜索导航条顶部钩子 + $this->assign('plugins_view_search_nav_top_data', Hook::listen('plugins_view_search_nav_top', + [ + 'hook_name' => 'plugins_view_search_nav_top', + 'is_backend' => false, + ])); + } } ?> \ No newline at end of file diff --git a/application/index/view/default/search/index.html b/application/index/view/default/search/index.html index dfe479f55..2e4692d2a 100755 --- a/application/index/view/default/search/index.html +++ b/application/index/view/default/search/index.html @@ -12,111 +12,210 @@ {{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)}} +
+ plugins_view_search_top +
+{{/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}} +
-
-
-
-
    -

    - 筛选出 - ... - 条数据 -

    -
  • -
    -
    已选
    -
    -

    清除

    -
    -
  • -
  • -
    -
    品牌
    -
    -
    不限
    - {{if !empty($brand_list)}} - {{foreach $brand_list as $brand}} -
    {{$brand.name}}
    - {{/foreach}} - {{else /}} - 没有相关品牌 - {{/if}} -
    -
    -
  • -
  • -
    -
    分类
    -
    -
    不限
    - {{if !empty($category_list)}} - {{foreach $category_list as $category}} -
    {{$category.name}}
    - {{/foreach}} - {{else /}} - 没有相关分类 - {{/if}} -
    -
    -
  • -
  • -
    -
    价格
    -
    -
    不限
    - {{if !empty($screening_price_list)}} - {{foreach $screening_price_list as $screening_price}} -
    {{$screening_price.name}}
    - {{/foreach}} - {{else /}} - 没有相关价格 - {{/if}} -
    -
    -
  • -
-
-
- - - -
- - 加载中... -
- - - - - - + + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} +
+ plugins_view_search_inside_top
+ {{/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}} + +
+
+
    +

    + 筛选出 + ... + 条数据 +

    +
  • +
    +
    已选
    +
    +

    清除

    +
    +
  • +
  • +
    +
    品牌
    +
    +
    不限
    + {{if !empty($brand_list)}} + {{foreach $brand_list as $brand}} +
    {{$brand.name}}
    + {{/foreach}} + {{else /}} + 没有相关品牌 + {{/if}} +
    +
    +
  • +
  • +
    +
    分类
    +
    +
    不限
    + {{if !empty($category_list)}} + {{foreach $category_list as $category}} +
    {{$category.name}}
    + {{/foreach}} + {{else /}} + 没有相关分类 + {{/if}} +
    +
    +
  • +
  • +
    +
    价格
    +
    +
    不限
    + {{if !empty($screening_price_list)}} + {{foreach $screening_price_list as $screening_price}} +
    {{$screening_price.name}}
    + {{/foreach}} + {{else /}} + 没有相关价格 + {{/if}} +
    +
    +
  • +
+
+
+ + + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} +
+ plugins_view_search_nav_top +
+ {{/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}} + + + + + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} +
+ plugins_view_search_data_top +
+ {{/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}} + + +
    + + + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} +
    + plugins_view_search_data_bottom +
    + {{/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}} + + +
    + + 加载中... +
    + + + + + +
    + + + {{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} +
    + plugins_view_search_inside_bottom +
    + {{/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}}
    + +{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true and (!isset($is_footer) or $is_footer eq 1)}} +
    + plugins_view_search_bottom +
    +{{/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}} + diff --git a/public/static/index/default/css/search.css b/public/static/index/default/css/search.css index 8ba56c883..506c041c9 100755 --- a/public/static/index/default/css/search.css +++ b/public/static/index/default/css/search.css @@ -1,3 +1,4 @@ +.search-list { float: none; } .items img{ width:100%;} .items .price strong{ font-size: 14px; } .theme-popover {z-index: 1011;overflow:visible;background:#fff; width: 100%; } @@ -53,7 +54,6 @@ dl#select3 .dd-conent{ left:-200%; right:0px;} /*分页*/ .am-pagination li{ float:none;} - .search-side{display: none;} .search-pages-submit { margin: 10px 0; }