diff --git a/application/index/view/default/category/index.html b/application/index/view/default/category/index.html index 1797510502d54c7f9b55e0e561739b80ebb4c4d8..bc08035006f8425dd6c49d06cc856def512f7771 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 e4bcd1c389983456ca6da42519929f84d096b3d5..5442e80e4c7f17dcad116bbad40e25d47d335428 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