...
|
...
|
@@ -23,8 +23,6 @@ var $brandDefault = $('.brand .default'), |
|
|
|
|
|
var $brandMoreTxt, $brandMoreIcon;
|
|
|
|
|
|
// var uriLoc = require('./uri');
|
|
|
|
|
|
//清除checkbox选中状态
|
|
|
function clearChecked($checkbox) {
|
|
|
$checkbox.removeClass('checked').html(checkUnicode.unchecked);
|
...
|
...
|
@@ -67,30 +65,7 @@ $('.filter-box').on('selectstart', '.attr, .brands-index span', function() { |
|
|
return false;
|
|
|
});
|
|
|
|
|
|
//checkbox
|
|
|
$('.check-container').on('click', '.attr', function() {
|
|
|
var $this = $(this),
|
|
|
$check = $this.find('.checkbox'),
|
|
|
$btnOk = $this.parent('.check-container').next('.btns').find('.multi-select-ok');
|
|
|
|
|
|
$check.toggleClass('checked');
|
|
|
|
|
|
if ($check.hasClass('checked')) {
|
|
|
$check.html(checkUnicode.checked);
|
|
|
} else {
|
|
|
$check.html(checkUnicode.unchecked);
|
|
|
}
|
|
|
|
|
|
//更新按钮状态
|
|
|
if ($check.hasClass('checked') ||
|
|
|
$this.siblings('.attr').find('.checked').length > 0) {
|
|
|
$btnOk.removeClass('dis');
|
|
|
} else {
|
|
|
$btnOk.addClass('dis');
|
|
|
}
|
|
|
});
|
|
|
|
|
|
//品牌多选
|
|
|
//【品牌】多选
|
|
|
$brandMulti.click(function() {
|
|
|
if ($brandPanel.css('display') === 'none') {
|
|
|
|
...
|
...
|
@@ -102,6 +77,7 @@ $brandMulti.click(function() { |
|
|
$(this).addClass('hide');
|
|
|
});
|
|
|
|
|
|
//【品牌】更多
|
|
|
$brandMore.click(function() {
|
|
|
var $this = $(this);
|
|
|
|
...
|
...
|
@@ -120,7 +96,7 @@ $brandMore.click(function() { |
|
|
$(this).toggleClass('more');
|
|
|
});
|
|
|
|
|
|
//品牌索引
|
|
|
//【品牌】索引
|
|
|
$('.brands-index').on('click', 'span', function() {
|
|
|
var $this = $(this),
|
|
|
index = $this.data('index');
|
...
|
...
|
@@ -134,7 +110,7 @@ $('.brands-index').on('click', 'span', function() { |
|
|
}
|
|
|
});
|
|
|
|
|
|
//品牌搜索
|
|
|
//【品牌】搜索
|
|
|
$('#brand-search-input').keyup(function() {
|
|
|
var val = $(this).val().toLowerCase();
|
|
|
|
...
|
...
|
@@ -145,6 +121,7 @@ $('#brand-search-input').keyup(function() { |
|
|
}
|
|
|
});
|
|
|
|
|
|
//【品牌】多选确定
|
|
|
$('#brand-multi-ok').click(function() {
|
|
|
var val = '';
|
|
|
|
...
|
...
|
@@ -161,7 +138,7 @@ $('#brand-multi-ok').click(function() { |
|
|
uriLoc('brand', val);
|
|
|
});
|
|
|
|
|
|
//多选取消(品牌/高级选项)
|
|
|
//【品牌/高级选项】多选取消
|
|
|
$('.multi-select-cancel').click(function() {
|
|
|
var $panel = $(this).closest('.multi');
|
|
|
|
...
|
...
|
@@ -175,7 +152,37 @@ $('.multi-select-cancel').click(function() { |
|
|
clearChecked($panel.find('.checkbox.checked')); //清除选中状态
|
|
|
});
|
|
|
|
|
|
//用户定义价格处理
|
|
|
//【品牌/高级选项】checkbox
|
|
|
$('.check-container').on('click', '.attr', function() {
|
|
|
var $this = $(this),
|
|
|
$check = $this.find('.checkbox'),
|
|
|
$btnOk = $this.parent('.check-container').next('.btns').find('.multi-select-ok');
|
|
|
|
|
|
$check.toggleClass('checked');
|
|
|
|
|
|
if ($check.hasClass('checked')) {
|
|
|
$check.html(checkUnicode.checked);
|
|
|
} else {
|
|
|
$check.html(checkUnicode.unchecked);
|
|
|
}
|
|
|
|
|
|
//更新按钮状态
|
|
|
if ($check.hasClass('checked') ||
|
|
|
$this.siblings('.attr').find('.checked').length > 0) {
|
|
|
$btnOk.removeClass('dis');
|
|
|
} else {
|
|
|
$btnOk.addClass('dis');
|
|
|
}
|
|
|
});
|
|
|
|
|
|
//【品牌/高级选项】当多选时阻止链接默认跳转
|
|
|
$('.brand, .senior').on('click', '.attr > a', function(e) {
|
|
|
if ($(this).closest('.multi').length > 0) {
|
|
|
e.preventDefault();
|
|
|
}
|
|
|
});
|
|
|
|
|
|
//【价格】用户定义价格处理
|
|
|
(function() {
|
|
|
var $udPrice = $('.ud-price-range'),
|
|
|
interReg = /^\d+$/,
|
...
|
...
|
@@ -222,14 +229,14 @@ $('.multi-select-cancel').click(function() { |
|
|
});
|
|
|
}());
|
|
|
|
|
|
//高级选项
|
|
|
//【高级选项】鼠标移入显示子项
|
|
|
$('.senior-attr-wrap').on('mouseenter', '.attr', function() {
|
|
|
$(this).children('.sub').removeClass('hide');
|
|
|
}).on('mouseleave', '.attr', function() {
|
|
|
$(this).children('.sub').addClass('hide');
|
|
|
});
|
|
|
|
|
|
//高级选项多选
|
|
|
//【高级选项】多选
|
|
|
$('.sub').on('click', '.multi-select', function() {
|
|
|
$(this).closest('.sub').addClass('multi');
|
|
|
}).on('click', '.multi-select-ok', function() {
|
...
|
...
|
@@ -249,10 +256,3 @@ $('.sub').on('click', '.multi-select', function() { |
|
|
|
|
|
uriLoc($sub.data('attr'), val);
|
|
|
}); |
|
|
\ No newline at end of file |
|
|
|
|
|
//当多选时阻止品牌和高级选项的默认跳转
|
|
|
$('.brand, .senior').on('click', '.attr > a', function(e) {
|
|
|
if ($(this).closest('.multi').length > 0) {
|
|
|
e.preventDefault();
|
|
|
}
|
|
|
}); |
|
|
\ No newline at end of file |
...
|
...
|
|