mirror of
https://gitee.com/zongzhige/shopxo.git
synced 2024-12-02 11:59:16 +08:00
分类优化
This commit is contained in:
parent
ef0e6ab2d6
commit
1928fc7015
@ -21,11 +21,12 @@
|
||||
{{if !empty($goods_category_list)}}
|
||||
<ul class="category-nav am-fl">
|
||||
{{foreach $goods_category_list as $k=>$v}}
|
||||
<li class="am-text-break am-padding-horizontal-sm {{if $k eq 0}} active{{/if}}">{{$v.name}}</li>
|
||||
<li class="am-text-break am-padding-horizontal-sm {{if $k eq 0}} active{{/if}}" data-url="{{:MyUrl('index/search/index', ['category_id'=>$v['id']])}}">{{$v.name}}</li>
|
||||
{{/foreach}}
|
||||
</ul>
|
||||
{{foreach $goods_category_list as $k=>$v}}
|
||||
<div class="category-content category-content-{{$k}} am-fr am-padding-vertical-xs {{if $k neq 0}} none{{/if}}">
|
||||
{{if !empty($v['items'])}}
|
||||
{{foreach $v.items as $vs}}
|
||||
<div class="category-item am-padding-sm">
|
||||
<div class="title">
|
||||
@ -58,10 +59,19 @@
|
||||
{{/if}}
|
||||
</div>
|
||||
{{/foreach}}
|
||||
{{else /}}
|
||||
<div class="table-no">
|
||||
<i class="am-icon-warning"></i>
|
||||
<span>没有分类数据</span>
|
||||
<p class="am-margin-top-lg am-text-center">
|
||||
<a href="{{:MyUrl('index/search/index', ['category_id'=>$v['id']])}}" class="am-text-secondary" title="查看分类下商品">查看分类下商品 >></a>
|
||||
</p>
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
{{/foreach}}
|
||||
{{else /}}
|
||||
<div class="table-no"><i class="am-icon-warning"></i> 没有相关数据</div>
|
||||
<div class="table-no"><i class="am-icon-warning"></i> 没有分类数据</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue
Block a user