|
@@ -199,17 +199,21 @@ var productList = new Vue({
|
|
|
});
|
|
|
},
|
|
|
choiceBrandHref: function (brand, index) {// PC端跳转链接
|
|
|
- if(this.isShowAllBrandsButton){
|
|
|
+ if(this.isShowAllBrandsButton){// 如果多选的情况下
|
|
|
var _self = this;
|
|
|
brand.isChecked = !brand.isChecked;
|
|
|
if (brand.isChecked) {
|
|
|
_self.checkedBrandList.push(brand.id);
|
|
|
} else {
|
|
|
- _self.checkedBrandList.splice(index, 1);
|
|
|
+ for (var i = 0; i < _self.checkedBrandList.length; i++){
|
|
|
+ // 删除掉未勾选中的元素
|
|
|
+ if(_self.checkedBrandList[i] === brand.id) {
|
|
|
+ _self.checkedBrandList.splice(i, 1);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
_self.isAllcheckedBrand = false;
|
|
|
_self.checkedBrandLength = _self.checkedBrandList.length;
|
|
|
- _self.params.brandIds = this.checkedBrandList.join(',');
|
|
|
}else{
|
|
|
window.location.href = '/product/list.html?keyword=' + encodeURIComponent(this.params.keyword) +
|
|
|
'&bpn=' + brand.id + '&pro=' + this.params.promotionFlag +
|
|
@@ -227,7 +231,13 @@ var productList = new Vue({
|
|
|
if (brand.isChecked) {
|
|
|
_self.checkedBrandList.push(brand.id);
|
|
|
} else {
|
|
|
- _self.checkedBrandList.splice(index, 1);
|
|
|
+ for (var i = 0; i < _self.checkedBrandList.length; i++){
|
|
|
+ // 删除掉未勾选中的元素
|
|
|
+ if(_self.checkedBrandList[i] === brand.id) {
|
|
|
+ _self.checkedBrandList.splice(i, 1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ _self.params.brandIds = this.checkedBrandList.join(',');
|
|
|
}
|
|
|
_self.isAllcheckedBrand = false;
|
|
|
_self.checkedBrandLength = _self.checkedBrandList.length;
|