From efc24e95ad2aa0222acc5f41442ddc12cae3e91b Mon Sep 17 00:00:00 2001 From: Devil Date: Mon, 11 Jan 2021 12:06:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=93=81=E7=89=8C=E6=96=B0=E5=A2=9E=E4=BB=8B?= =?UTF-8?q?=E7=BB=8D=EF=BC=8C=E6=90=9C=E7=B4=A2=E5=A2=9E=E5=BC=BA=E5=93=81?= =?UTF-8?q?=E7=89=8C=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/form/Brand.php | 11 ++ .../admin/view/default/brand/save_info.html | 11 +- application/api/controller/Search.php | 20 +- application/index/controller/Search.php | 62 +++--- .../index/view/default/search/index.html | 53 +++-- application/service/BrandService.php | 34 +++- application/service/SearchService.php | 72 +++++-- application/tags.php | 184 +++++++++--------- changelog.txt | 1 + public/static/admin/default/css/brand.css | 4 + public/static/index/default/css/search.css | 32 +++ public/static/index/default/js/search.js | 14 +- route/route.config | 1 + 13 files changed, 337 insertions(+), 162 deletions(-) create mode 100644 public/static/admin/default/css/brand.css diff --git a/application/admin/form/Brand.php b/application/admin/form/Brand.php index 19399ea18..0e543cf33 100644 --- a/application/admin/form/Brand.php +++ b/application/admin/form/Brand.php @@ -70,6 +70,17 @@ class Brand 'where_type' => 'like', ], ], + [ + 'label' => '描述', + 'view_type' => 'field', + 'view_key' => 'describe', + 'grid_size' => 'lg', + 'is_sort' => 1, + 'search_config' => [ + 'form_type' => 'input', + 'where_type' => 'like', + ], + ], [ 'label' => 'LOGO', 'view_type' => 'module', diff --git a/application/admin/view/default/brand/save_info.html b/application/admin/view/default/brand/save_info.html index 8ce3c60b4..94bcc0599 100755 --- a/application/admin/view/default/brand/save_info.html +++ b/application/admin/view/default/brand/save_info.html @@ -11,7 +11,7 @@
- +
@@ -24,11 +24,16 @@
- + +
+ +
+ +
- +
    {{if !empty($data['logo'])}}
  • diff --git a/application/api/controller/Search.php b/application/api/controller/Search.php index 90a1cbfe4..c6c936014 100755 --- a/application/api/controller/Search.php +++ b/application/api/controller/Search.php @@ -12,7 +12,6 @@ namespace app\api\controller; use app\service\BaseService; use app\service\SearchService; -use app\service\GoodsService; /** * 商品搜索 @@ -54,8 +53,23 @@ class Search extends Common $ret = SearchService::GoodsList($this->data_post); $result = $ret['data']; - // 分类 - $result['category'] = empty($this->data_post['category_id']) ? [] : GoodsService::GoodsCategoryRow(['id'=>$this->data_post['category_id']]); + // 品牌列表 + $result['brand_list'] = SearchService::CategoryBrandList($this->data_request); + + // 指定数据 + $result['search_map_info'] = SearchService::SearchMapInfo($this->data_request); + + // 商品分类 + $result['category_list'] = SearchService::GoodsCategoryList($this->data_request); + + // 筛选价格区间 + $result['screening_price_list'] = SearchService::ScreeningPriceList($this->data_request); + + // 商品参数 + $result['goods_params_list'] = SearchService::SearchGoodsParamsValueList($this->data_request); + + // 商品规格 + $result['goods_spec_list'] = SearchService::SearchGoodsSpecValueList($this->data_request); return BaseService::DataReturn($result); } diff --git a/application/index/controller/Search.php b/application/index/controller/Search.php index cf165d81f..4eeb1d212 100755 --- a/application/index/controller/Search.php +++ b/application/index/controller/Search.php @@ -13,7 +13,6 @@ namespace app\index\controller; use think\facade\Hook; use app\service\SeoService; use app\service\SearchService; -use app\service\GoodsService; /** * 搜索 @@ -35,9 +34,6 @@ class Search extends Common public function __construct() { parent::__construct(); - - // 参数初始化 - $this->ParamsInit(); } /** @@ -70,10 +66,17 @@ class Search extends Common { return redirect(MyUrl('index/search/index', ['wd'=>StrToAscii($keywords)])); } else { + // 参数初始化 + $this->ParamsInit(); + // 品牌列表 $brand_list = SearchService::CategoryBrandList($this->data_request); $this->assign('brand_list', $brand_list); + // 指定数据 + $search_map_info = SearchService::SearchMapInfo($this->data_request); + $this->assign('search_map_info', $search_map_info); + // 商品分类 $category_list = SearchService::GoodsCategoryList($this->data_request); $this->assign('category_list', $category_list); @@ -94,7 +97,7 @@ class Search extends Common $this->assign('params', $this->data_request); // seo - $this->SetSeo(); + $this->SetSeo($search_map_info); // 钩子 $this->PluginsHook(); @@ -105,31 +108,33 @@ class Search extends Common /** * seo设置 - * @author Devil - * @blog http://gong.gg/ - * @version 1.0.0 - * @datetime 2019-06-02T21:29:04+0800 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2021-01-11 + * @desc description + * @param [array] $data [条件基础数据] */ - private function SetSeo() + private function SetSeo($data = []) { - $seo_title = $this->data_request['wd']; - if(!empty($this->data_request['category_id'])) - { - $category = GoodsService::GoodsCategoryRow(['id'=>$this->data_request['category_id'], 'field'=>'name,seo_title,seo_keywords,seo_desc']); - if(!empty($category)) - { - $seo_title = empty($category['seo_title']) ? $category['name'] : $category['seo_title']; + // 默认关键字 + $seo_title = empty($this->data_request['wd']) ? '' : $this->data_request['wd']; - // 关键字和描述 - if(!empty($category['seo_keywords'])) - { - $this->assign('home_seo_site_keywords', $category['seo_keywords']); - } - if(!empty($category['seo_desc'])) - { - $this->assign('home_seo_site_description', $category['seo_desc']); - } - } + // 分类、品牌 + $seo_data = empty($data['category']) ? (empty($data['brand']) ? [] : $data['brand']) : $data['category']; + if(!empty($seo_data)) + { + $seo_title = empty($seo_data['seo_title']) ? $seo_data['name'] : $seo_data['seo_title']; + + // 关键字和描述 + if(!empty($seo_data['seo_keywords'])) + { + $this->assign('home_seo_site_keywords', $seo_data['seo_keywords']); + } + if(!empty($seo_data['seo_desc'])) + { + $this->assign('home_seo_site_description', $seo_data['seo_desc']); + } } $this->assign('home_seo_site_title', SeoService::BrowserSeoTitle(empty($seo_title) ? '商品搜索' : $seo_title, 1)); } @@ -150,6 +155,9 @@ class Search extends Common $this->error('非法访问'); } + // 参数初始化 + $this->ParamsInit(); + // 获取商品列表 $ret = SearchService::GoodsList($this->data_request); diff --git a/application/index/view/default/search/index.html b/application/index/view/default/search/index.html index a7f183977..3ba7f2350 100755 --- a/application/index/view/default/search/index.html +++ b/application/index/view/default/search/index.html @@ -42,7 +42,7 @@ {{/foreach}} {{/if}} -
    +

    @@ -113,24 +113,41 @@ {{if !empty($brand_list)}}

  • -
    品牌
    -
    -
      - {{foreach $brand_list as $v}} -
    • - {{if empty($v['logo'])}} - {{$v.name}} - {{else /}} - {{$v.name}} - {{/if}} -
    • - {{/foreach}} -
    -
    - 更多 - + {{if empty($search_map_info['brand'])}} +
    品牌
    +
    +
      + {{foreach $brand_list as $v}} +
    • + {{if empty($v['logo'])}} + {{$v.name}} + {{else /}} + {{$v.name}} + {{/if}} +
    • + {{/foreach}} +
    +
    + 更多 + +
    -
    + {{else /}} +
    +
    品牌
    +
    + {{if empty($search_map_info['brand']['logo'])}} +

    {{$search_map_info.brand.name}}

    + {{else /}} + + {{/if}} +
    +

    {{$search_map_info.brand.name}}

    +

    {{$search_map_info.brand.describe}}

    +
    +
    +
    + {{/if}}
  • {{/if}} diff --git a/application/service/BrandService.php b/application/service/BrandService.php index 99912f095..297146e60 100755 --- a/application/service/BrandService.php +++ b/application/service/BrandService.php @@ -41,7 +41,22 @@ class BrandService $n = isset($params['n']) ? intval($params['n']) : 10; // 获取列表 - $data = Db::name('Brand')->where($where)->order($order_by)->limit($m, $n)->select(); + $data = self::DataHandle(Db::name('Brand')->where($where)->field($field)->order($order_by)->limit($m, $n)->select()); + + return DataReturn('处理成功', 0, $data); + } + + /** + * 数据处理 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2021-01-11 + * @desc description + * @param [array] $data [列表数据] + */ + public static function DataHandle($data) + { if(!empty($data)) { // 分类名称 @@ -64,10 +79,15 @@ class BrandService // logo if(isset($v['logo'])) { - $v['logo_old'] = $v['logo']; $v['logo'] = ResourcesService::AttachmentPathViewHandle($v['logo']); } + // 品牌官方地址 + if(isset($v['website_url'])) + { + $v['website_url'] = empty($v['website_url']) ? null : $v['website_url']; + } + // 时间 if(isset($v['add_time'])) { @@ -79,7 +99,7 @@ class BrandService } } } - return DataReturn('处理成功', 0, $data); + return $data; } /** @@ -141,6 +161,13 @@ class BrandService 'checked_data' => '2,30', 'error_msg' => '名称格式 2~30 个字符', ], + [ + 'checked_type' => 'length', + 'key_name' => 'describe', + 'checked_data' => '230', + 'is_checked' => 1, + 'error_msg' => '描述最多200个字符', + ], [ 'checked_type' => 'unique', 'key_name' => 'name', @@ -201,6 +228,7 @@ class BrandService // 数据 $data = [ 'name' => $params['name'], + 'describe' => $params['describe'], 'logo' => $attachment['data']['logo'], 'website_url' => empty($params['website_url']) ? '' : $params['website_url'], 'sort' => intval($params['sort']), diff --git a/application/service/SearchService.php b/application/service/SearchService.php index 0896383e2..cd3247f36 100755 --- a/application/service/SearchService.php +++ b/application/service/SearchService.php @@ -13,6 +13,7 @@ namespace app\service; use think\Db; use think\facade\Hook; use app\service\GoodsService; +use app\service\BrandService; use app\service\ResourcesService; /** @@ -134,9 +135,22 @@ class SearchService } // 品牌 + $brand_ids = []; + if(!empty($params['brand_id'])) + { + $brand_ids[] = intval($params['brand_id']); + } if(!empty($params['brand_ids'])) { - $where_base[] = ['g.brand_id', 'in', $params['brand_ids']]; + if(!is_array($params['brand_ids'])) + { + $params['brand_ids'] = explode(',', $params['brand_ids']); + } + $brand_ids = array_merge($brand_ids, $params['brand_ids']); + } + if(!empty($brand_ids)) + { + $where_base[] = ['g.brand_id', 'in', array_unique($brand_ids)]; } // 分类id @@ -326,16 +340,14 @@ class SearchService } // 获取品牌列表 - $brand = Db::name('Brand')->where($brand_where)->field('id,name,logo,website_url')->select(); - if(!empty($brand)) - { - foreach($brand as &$v) - { - $v['logo'] = ResourcesService::AttachmentPathViewHandle($v['logo']); - $v['website_url'] = empty($v['website_url']) ? null : $v['website_url']; - } - } - return $brand; + $data_params = [ + 'field' => 'id,name,logo,website_url', + 'where' => $brand_where, + 'm' => 0, + 'n' => 0, + ]; + $ret = BrandService::BrandList($data_params); + return $ret['data']; } /** @@ -416,5 +428,43 @@ class SearchService $query->whereOr($where_screening_price); })->group('gsv.value')->column('gsv.value'); } + + /** + * 搜索条件基础数据 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2021-01-11 + * @desc description + * @param [array] $params [输入参数] + */ + public static function SearchMapInfo($params = []) + { + // 分类 + $category = empty($params['category_id']) ? [] : GoodsService::GoodsCategoryRow(['id'=>intval($params['category_id']), 'field'=>'name,vice_name,describe,seo_title,seo_keywords,seo_desc']); + + // 品牌 + $brand = []; + if(!empty($params['brand_id'])) + { + $data_params = [ + 'field' => 'id,name,describe,logo,website_url', + 'where' => ['id'=>intval($params['brand_id'])], + 'm' => 0, + 'n' => 1, + ]; + $ret = BrandService::BrandList($data_params); + if(!empty($ret['data']) && !empty($ret['data'][0])) + { + $brand = $ret['data'][0]; + } + } + + return [ + 'category' => $category, + 'brand' => $brand, + ]; + + } } ?> \ No newline at end of file diff --git a/application/tags.php b/application/tags.php index c8f9c828a..e0bb544e5 100755 --- a/application/tags.php +++ b/application/tags.php @@ -32,54 +32,118 @@ return array ( 'log_write' => array ( ), + 'plugins_css' => + array ( + 0 => 'app\\plugins\\points\\Hook', + 1 => 'app\\plugins\\coupon\\Hook', + 2 => 'app\\plugins\\share\\Hook', + 3 => 'app\\plugins\\membershiplevelvip\\Hook', + 4 => 'app\\plugins\\exchangerate\\Hook', + 5 => 'app\\plugins\\limitedtimediscount\\Hook', + ), + 'plugins_js' => + array ( + 0 => 'app\\plugins\\points\\Hook', + 1 => 'app\\plugins\\coupon\\Hook', + 2 => 'app\\plugins\\share\\Hook', + 3 => 'app\\plugins\\exchangerate\\Hook', + 4 => 'app\\plugins\\limitedtimediscount\\Hook', + ), + 'plugins_service_navigation_header_handle' => + array ( + 0 => 'app\\plugins\\points\\Hook', + 1 => 'app\\plugins\\coupon\\Hook', + 2 => 'app\\plugins\\membershiplevelvip\\Hook', + 3 => 'app\\plugins\\limitedtimediscount\\Hook', + ), 'plugins_service_quick_navigation_pc' => array ( - 0 => 'app\\plugins\\invoice\\Hook', - 1 => 'app\\plugins\\signin\\Hook', - 2 => 'app\\plugins\\exchangerate\\Hook', - 3 => 'app\\plugins\\points\\Hook', + 0 => 'app\\plugins\\points\\Hook', + 1 => 'app\\plugins\\invoice\\Hook', + 2 => 'app\\plugins\\signin\\Hook', + 3 => 'app\\plugins\\exchangerate\\Hook', ), 'plugins_service_quick_navigation_h5' => array ( - 0 => 'app\\plugins\\invoice\\Hook', - 1 => 'app\\plugins\\signin\\Hook', - 2 => 'app\\plugins\\exchangerate\\Hook', - 3 => 'app\\plugins\\points\\Hook', + 0 => 'app\\plugins\\points\\Hook', + 1 => 'app\\plugins\\invoice\\Hook', + 2 => 'app\\plugins\\signin\\Hook', + 3 => 'app\\plugins\\exchangerate\\Hook', ), 'plugins_service_quick_navigation_weixin' => array ( - 0 => 'app\\plugins\\invoice\\Hook', - 1 => 'app\\plugins\\signin\\Hook', - 2 => 'app\\plugins\\exchangerate\\Hook', - 3 => 'app\\plugins\\points\\Hook', + 0 => 'app\\plugins\\points\\Hook', + 1 => 'app\\plugins\\invoice\\Hook', + 2 => 'app\\plugins\\signin\\Hook', + 3 => 'app\\plugins\\exchangerate\\Hook', ), 'plugins_service_quick_navigation_alipay' => array ( - 0 => 'app\\plugins\\invoice\\Hook', - 1 => 'app\\plugins\\signin\\Hook', - 2 => 'app\\plugins\\exchangerate\\Hook', - 3 => 'app\\plugins\\points\\Hook', + 0 => 'app\\plugins\\points\\Hook', + 1 => 'app\\plugins\\invoice\\Hook', + 2 => 'app\\plugins\\signin\\Hook', + 3 => 'app\\plugins\\exchangerate\\Hook', ), 'plugins_service_quick_navigation_baidu' => array ( - 0 => 'app\\plugins\\invoice\\Hook', - 1 => 'app\\plugins\\signin\\Hook', - 2 => 'app\\plugins\\exchangerate\\Hook', - 3 => 'app\\plugins\\points\\Hook', + 0 => 'app\\plugins\\points\\Hook', + 1 => 'app\\plugins\\invoice\\Hook', + 2 => 'app\\plugins\\signin\\Hook', + 3 => 'app\\plugins\\exchangerate\\Hook', ), 'plugins_service_quick_navigation_qq' => array ( - 0 => 'app\\plugins\\invoice\\Hook', - 1 => 'app\\plugins\\signin\\Hook', - 2 => 'app\\plugins\\exchangerate\\Hook', - 3 => 'app\\plugins\\points\\Hook', + 0 => 'app\\plugins\\points\\Hook', + 1 => 'app\\plugins\\invoice\\Hook', + 2 => 'app\\plugins\\signin\\Hook', + 3 => 'app\\plugins\\exchangerate\\Hook', ), 'plugins_service_quick_navigation_toutiao' => array ( - 0 => 'app\\plugins\\invoice\\Hook', - 1 => 'app\\plugins\\signin\\Hook', - 2 => 'app\\plugins\\exchangerate\\Hook', - 3 => 'app\\plugins\\points\\Hook', + 0 => 'app\\plugins\\points\\Hook', + 1 => 'app\\plugins\\invoice\\Hook', + 2 => 'app\\plugins\\signin\\Hook', + 3 => 'app\\plugins\\exchangerate\\Hook', + ), + 'plugins_service_goods_handle_end' => + array ( + 0 => 'app\\plugins\\points\\Hook', + 1 => 'app\\plugins\\distribution\\Hook', + 2 => 'app\\plugins\\membershiplevelvip\\Hook', + 3 => 'app\\plugins\\exchangerate\\Hook', + 4 => 'app\\plugins\\limitedtimediscount\\Hook', + ), + 'plugins_view_buy_form_inside' => + array ( + 0 => 'app\\plugins\\points\\Hook', + 1 => 'app\\plugins\\coupon\\Hook', + ), + 'plugins_view_buy_base_confirm_top' => + array ( + 0 => 'app\\plugins\\points\\Hook', + ), + 'plugins_service_buy_group_goods_handle' => + array ( + 0 => 'app\\plugins\\points\\Hook', + 1 => 'app\\plugins\\coupon\\Hook', + 2 => 'app\\plugins\\membershiplevelvip\\Hook', + ), + 'plugins_service_buy_order_insert_end' => + array ( + 0 => 'app\\plugins\\points\\Hook', + 1 => 'app\\plugins\\distribution\\Hook', + ), + 'plugins_service_order_status_change_history_success_handle' => + array ( + 0 => 'app\\plugins\\points\\Hook', + 1 => 'app\\plugins\\invoice\\Hook', + 2 => 'app\\plugins\\coupon\\Hook', + 3 => 'app\\plugins\\distribution\\Hook', + ), + 'plugins_service_base_data_return_api_buy_index' => + array ( + 0 => 'app\\plugins\\points\\Hook', + 1 => 'app\\plugins\\coupon\\Hook', ), 'plugins_service_users_center_left_menu_handle' => array ( @@ -98,37 +162,6 @@ return array ( 4 => 'app\\plugins\\signin\\Hook', 5 => 'app\\plugins\\exchangerate\\Hook', ), - 'plugins_service_order_status_change_history_success_handle' => - array ( - 0 => 'app\\plugins\\invoice\\Hook', - 1 => 'app\\plugins\\coupon\\Hook', - 2 => 'app\\plugins\\distribution\\Hook', - 3 => 'app\\plugins\\points\\Hook', - ), - 'plugins_css' => - array ( - 0 => 'app\\plugins\\coupon\\Hook', - 1 => 'app\\plugins\\share\\Hook', - 2 => 'app\\plugins\\membershiplevelvip\\Hook', - 3 => 'app\\plugins\\exchangerate\\Hook', - 4 => 'app\\plugins\\limitedtimediscount\\Hook', - 5 => 'app\\plugins\\points\\Hook', - ), - 'plugins_js' => - array ( - 0 => 'app\\plugins\\coupon\\Hook', - 1 => 'app\\plugins\\share\\Hook', - 2 => 'app\\plugins\\exchangerate\\Hook', - 3 => 'app\\plugins\\limitedtimediscount\\Hook', - 4 => 'app\\plugins\\points\\Hook', - ), - 'plugins_service_navigation_header_handle' => - array ( - 0 => 'app\\plugins\\coupon\\Hook', - 1 => 'app\\plugins\\membershiplevelvip\\Hook', - 2 => 'app\\plugins\\limitedtimediscount\\Hook', - 3 => 'app\\plugins\\points\\Hook', - ), 'plugins_view_goods_detail_panel_bottom' => array ( 0 => 'app\\plugins\\coupon\\Hook', @@ -137,17 +170,6 @@ return array ( array ( 0 => 'app\\plugins\\coupon\\Hook', ), - 'plugins_service_buy_group_goods_handle' => - array ( - 0 => 'app\\plugins\\coupon\\Hook', - 1 => 'app\\plugins\\membershiplevelvip\\Hook', - 2 => 'app\\plugins\\points\\Hook', - ), - 'plugins_view_buy_form_inside' => - array ( - 0 => 'app\\plugins\\coupon\\Hook', - 1 => 'app\\plugins\\points\\Hook', - ), 'plugins_service_buy_order_insert_success' => array ( 0 => 'app\\plugins\\coupon\\Hook', @@ -161,11 +183,6 @@ return array ( 0 => 'app\\plugins\\coupon\\Hook', 1 => 'app\\plugins\\limitedtimediscount\\Hook', ), - 'plugins_service_base_data_return_api_buy_index' => - array ( - 0 => 'app\\plugins\\coupon\\Hook', - 1 => 'app\\plugins\\points\\Hook', - ), 'plugins_service_order_aftersale_audit_handle_end' => array ( 0 => 'app\\plugins\\distribution\\Hook', @@ -174,11 +191,6 @@ return array ( array ( 0 => 'app\\plugins\\distribution\\Hook', ), - 'plugins_service_buy_order_insert_end' => - array ( - 0 => 'app\\plugins\\distribution\\Hook', - 1 => 'app\\plugins\\points\\Hook', - ), 'plugins_service_goods_spec_extends_handle' => array ( 0 => 'app\\plugins\\distribution\\Hook', @@ -194,14 +206,6 @@ return array ( 0 => 'app\\plugins\\distribution\\Hook', 1 => 'app\\plugins\\membershiplevelvip\\Hook', ), - 'plugins_service_goods_handle_end' => - array ( - 0 => 'app\\plugins\\distribution\\Hook', - 1 => 'app\\plugins\\membershiplevelvip\\Hook', - 2 => 'app\\plugins\\exchangerate\\Hook', - 3 => 'app\\plugins\\limitedtimediscount\\Hook', - 4 => 'app\\plugins\\points\\Hook', - ), 'plugins_service_goods_spec_base' => array ( 0 => 'app\\plugins\\distribution\\Hook', @@ -273,9 +277,5 @@ return array ( array ( 0 => 'app\\plugins\\limitedtimediscount\\Hook', ), - 'plugins_view_buy_base_confirm_top' => - array ( - 0 => 'app\\plugins\\points\\Hook', - ), ); ?> \ No newline at end of file diff --git a/changelog.txt b/changelog.txt index 9ab945b37..c1aea6af8 100755 --- a/changelog.txt +++ b/changelog.txt @@ -21,6 +21,7 @@ web端 7. 后台插件管理新增排序功能、自定义显示顺序+插件调用顺序 8. 公共接口新增插件配置返回 9. API接口与插件解耦、扩展性更上一层楼 + 10. 搜索页面优化、新增商品属性+规格搜索 小程序 diff --git a/public/static/admin/default/css/brand.css b/public/static/admin/default/css/brand.css new file mode 100644 index 000000000..9d1018fd9 --- /dev/null +++ b/public/static/admin/default/css/brand.css @@ -0,0 +1,4 @@ +ul.brand-logo-images-view li { + width: 160px; + height: 62px; +} \ No newline at end of file diff --git a/public/static/index/default/css/search.css b/public/static/index/default/css/search.css index 1ce78ccda..60702f8bd 100755 --- a/public/static/index/default/css/search.css +++ b/public/static/index/default/css/search.css @@ -177,6 +177,38 @@ } } +/** + * 条件指定品牌信息 + */ +.brand-info .map-images-text-items { + padding: 15px 15px 0 15px; + height: 84px; +} +.brand-info .info-logo, +.brand-info .info-logo-empty { + width: 150px; + height: 54px; + border: 1px solid #eee; +} +.brand-info .info-logo-empty { + line-height: 46px; +} +.brand-info .info-right { + width: calc(100% - 165px); +} +.brand-info .info-name, +.brand-info .info-desc { + line-height: 16px; +} +.brand-info .info-desc { + color: #999; +} +@media only screen and (min-width:641px) { + .brand-info .map-left { + line-height: 84px !important; + } +} + /** * 条件基础信息 */ diff --git a/public/static/index/default/js/search.js b/public/static/index/default/js/search.js index 1683d42bf..daa3094c3 100755 --- a/public/static/index/default/js/search.js +++ b/public/static/index/default/js/search.js @@ -21,6 +21,7 @@ function GetGoodsList(page) var data = { "wd": $('#search-input').val() || '', "category_id": $('.search-container').data('category-id') || 0, + "brand_id": $('.search-container').data('brand-id') || 0, "page": page || parseInt($('.search-pages-submit').attr('data-page')) || 1, "order_by_field": $('.sort-nav li.active').attr('data-field') || 'default', "order_by_type": $('.sort-nav li.active').attr('data-type') == 'asc' ? 'desc' : 'asc', @@ -134,13 +135,16 @@ $(function() // 筛选操作 $(document).on('click', '.map-item>li>.map-right>ul>li', function() { - if($(this).hasClass('active')) + if(!$(this).hasClass('disabled')) { - $(this).removeClass('active'); - } else { - $(this).addClass('active'); + if($(this).hasClass('active')) + { + $(this).removeClass('active'); + } else { + $(this).addClass('active'); + } + GetGoodsList(1); } - GetGoodsList(1); }); // 清除条件 diff --git a/route/route.config b/route/route.config index 445d36648..414922026 100755 --- a/route/route.config +++ b/route/route.config @@ -22,6 +22,7 @@ Route::get('goods'.$ds.':id', 'index/goods/index'); // 搜索 Route::get('search'.$ds.'c'.$ds.':category_id', 'index/search/index'); +Route::get('search'.$ds.'b'.$ds.':brand_id', 'index/search/index'); Route::get('search'.$ds.'k'.$ds.':wd', 'index/search/index'); Route::rule('search', 'index/search/index', 'GET|POST');