From 1928fc7015d326d006fe97992c7445e8b335a52c Mon Sep 17 00:00:00 2001 From: devil Date: Thu, 26 Dec 2019 17:34:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=86=E7=B1=BB=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../index/view/default/category/index.html | 72 +++++++++++-------- public/static/index/default/js/category.js | 15 +++- 2 files changed, 54 insertions(+), 33 deletions(-) diff --git a/application/index/view/default/category/index.html b/application/index/view/default/category/index.html index 179751050..bc0803500 100755 --- a/application/index/view/default/category/index.html +++ b/application/index/view/default/category/index.html @@ -21,47 +21,57 @@ {{if !empty($goods_category_list)}} {{foreach $goods_category_list as $k=>$v}}
- {{foreach $v.items as $vs}} -
-
-
- {{if !empty($vs['icon'])}} - - {{$vs.name}} - - {{/if}} -

- {{$vs.name}} -

+ {{if !empty($v['items'])}} + {{foreach $v.items as $vs}} +
+
+
+ {{if !empty($vs['icon'])}} + + {{$vs.name}} + + {{/if}} +

+ {{$vs.name}} +

+
+ {{if !empty($vs['items'])}} +
    + {{foreach $vs.items as $kss=>$vss}} +
  • + {{if !empty($vss['icon'])}} + + {{$vss.name}} + + {{/if}} +

    + {{$vss.name}} +

    +
  • + {{/foreach}} +
+ {{/if}}
- {{if !empty($vs['items'])}} -
    - {{foreach $vs.items as $kss=>$vss}} -
  • - {{if !empty($vss['icon'])}} - - {{$vss.name}} - - {{/if}} -

    - {{$vss.name}} -

    -
  • - {{/foreach}} -
- {{/if}} + {{/foreach}} + {{else /}} +
+ + 没有分类数据 +

+ 查看分类下商品 >> +

- {{/foreach}} + {{/if}}
{{/foreach}} {{else /}} -
没有相关数据
+
没有分类数据
{{/if}}
diff --git a/public/static/index/default/js/category.js b/public/static/index/default/js/category.js index e4bcd1c38..5442e80e4 100644 --- a/public/static/index/default/js/category.js +++ b/public/static/index/default/js/category.js @@ -1,11 +1,22 @@ $(function() { - // 分类显/隐 - $('.category-list ul.category-nav li').on('mouseover', function(){ + // 一级分类显/隐操作 + $('.category-list ul.category-nav li').on('mouseover', function() + { var index = $(this).index(); $('.category-list ul.category-nav li').removeClass('active'); $(this).addClass('active'); $('.category-content').addClass('none'); $('.category-content-'+index).removeClass('none'); }); + + // 一级分类双击进入商品搜索页 + $('.category-list ul.category-nav li').on('dblclick', function() + { + var url = $(this).data('url') || null; + if(url != null) + { + window.location.href = url; + } + }); }); \ No newline at end of file -- GitLab