zhengjinyi 3 years ago
parent
commit
35ddfbcaa3

+ 1 - 1
src/main/resources/static/css/product/instruement-list.css

@@ -27,7 +27,7 @@
     .product-brand-list .brand-list.checked a:hover{color: #E15621;}
     .product-brand-button{width: 100%;height: 32px;float: left;}
     .product-brand-button .brand-button{width: 160px;height: 32px;margin: 0 auto;}
-    .product-brand-button .brand-button .btn{width: 64px;height: 32px;float: left;margin: 0 8px;border-radius: 2px; line-height: 32px;text-align: center;font-size: 14px;box-sizing: border-box;color: #FFFFFF;}
+    .product-brand-button .brand-button .btn{width: 64px;height: 32px;cursor: pointer;float: left;margin: 0 8px;border-radius: 2px; line-height: 32px;text-align: center;font-size: 14px;box-sizing: border-box;color: #FFFFFF;}
     .product-brand-button .brand-button .btn.confirm.disabled{background-color: #E2E7EF;}
     .product-brand-button .brand-button .btn.confirm{background-color: #E15621;}
     .product-brand-button .brand-button .btn.cancel{background-color: #FFFFFF;border: 1px solid #E2E7EF;color: #4A4F58;}

+ 1 - 1
src/main/resources/static/css/product/list.css

@@ -26,7 +26,7 @@ li{list-style:none}
     .product-brand-list .brand-list.checked a:hover{color: #E15621;}
     .product-brand-button{width: 100%;height: 32px;float: left;}
     .product-brand-button .brand-button{width: 160px;height: 32px;margin: 0 auto;}
-    .product-brand-button .brand-button .btn{width: 64px;height: 32px;float: left;margin: 0 8px;border-radius: 2px; line-height: 32px;text-align: center;font-size: 14px;box-sizing: border-box;color: #FFFFFF;}
+    .product-brand-button .brand-button .btn{width: 64px;height: 32px;cursor: pointer;float: left;margin: 0 8px;border-radius: 2px; line-height: 32px;text-align: center;font-size: 14px;box-sizing: border-box;color: #FFFFFF;}
     .product-brand-button .brand-button .btn.confirm.disabled{background-color: #E2E7EF;}
     .product-brand-button .brand-button .btn.confirm{background-color: #E15621;}
     .product-brand-button .brand-button .btn.cancel{background-color: #FFFFFF;border: 1px solid #E2E7EF;color: #4A4F58;}

+ 14 - 4
src/main/resources/static/js/product/list.js

@@ -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;

+ 12 - 2
src/main/resources/static/js/product/produce-list.js

@@ -180,7 +180,12 @@ 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.isAllcheckedBrand = false;
                 _self.checkedBrandLength = _self.checkedBrandList.length;
@@ -200,7 +205,12 @@ 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.isAllcheckedBrand = false;
             _self.checkedBrandLength = _self.checkedBrandList.length;