|
@@ -38,13 +38,32 @@ var productList = new Vue({
|
|
|
},
|
|
|
hrefBrandId:null,
|
|
|
brandLists: [],
|
|
|
- defaultBrandLists:[],
|
|
|
+ defaultBrandLists:[
|
|
|
+ {isChecked:false,name:'测试',id:21},
|
|
|
+ {isChecked:false,name:'测试',id:22},
|
|
|
+ {isChecked:false,name:'测试',id:23},
|
|
|
+ {isChecked:false,name:'测试',id:24},
|
|
|
+ {isChecked:false,name:'测试',id:25},
|
|
|
+ {isChecked:false,name:'测试',id:26},
|
|
|
+ {isChecked:false,name:'测试',id:27},
|
|
|
+ {isChecked:false,name:'测试',id:28},
|
|
|
+ {isChecked:false,name:'测试',id:29},
|
|
|
+ {isChecked:false,name:'测试',id:30},
|
|
|
+ {isChecked:false,name:'测试',id:31},
|
|
|
+ {isChecked:false,name:'测试',id:32},
|
|
|
+ {isChecked:false,name:'测试',id:33},
|
|
|
+ {isChecked:false,name:'测试',id:34},
|
|
|
+ {isChecked:false,name:'测试',id:35},
|
|
|
+ {isChecked:false,name:'测试',id:36},
|
|
|
+ {isChecked:false,name:'测试',id:37},
|
|
|
+ ],
|
|
|
checkedBrandList:[],
|
|
|
checkedBrandLength:0,
|
|
|
isProductScreen:false,
|
|
|
isActiviChecked:false,
|
|
|
isNewsChecked:false,
|
|
|
isShowAllBrands:false,
|
|
|
+ isShowAllBrandsButton:false,
|
|
|
isAllcheckedBrand:false,
|
|
|
isListEmpty:false,
|
|
|
},
|
|
@@ -178,9 +197,25 @@ var productList = new Vue({
|
|
|
});
|
|
|
},
|
|
|
choiceBrandHref: function (brand, index) {// PC端跳转链接
|
|
|
- window.location.href = '/product/list.html?keyword=' + encodeURIComponent(this.params.keyword) +
|
|
|
- '&bpn=' + brand.id + '&pro=' + this.params.promotionFlag +
|
|
|
- '&newg='+ this.params.newFlag;
|
|
|
+ if(this.isShowAllBrandsButton){
|
|
|
+ console.log('brand',brand)
|
|
|
+ var _self = this;
|
|
|
+ brand.isChecked = !brand.isChecked;
|
|
|
+ if (brand.isChecked) {
|
|
|
+ _self.checkedBrandList.push(brand.id);
|
|
|
+ } else {
|
|
|
+ _self.checkedBrandList.splice(index, 1);
|
|
|
+ }
|
|
|
+ _self.isAllcheckedBrand = false;
|
|
|
+ _self.checkedBrandLength = _self.checkedBrandList.length;
|
|
|
+ console.log('=======>', _self.checkedBrandList)
|
|
|
+ _self.params.brandIds = this.checkedBrandList.join(',');
|
|
|
+ console.log('=========>',_self.params.brandIds)
|
|
|
+ }else{
|
|
|
+ window.location.href = '/product/list.html?keyword=' + encodeURIComponent(this.params.keyword) +
|
|
|
+ '&bpn=' + brand.id + '&pro=' + this.params.promotionFlag +
|
|
|
+ '&newg='+ this.params.newFlag;
|
|
|
+ }
|
|
|
},
|
|
|
choiceBrandAllHref:function(){// PC全部品牌跳转链接
|
|
|
window.location.href = '/product/list.html?keyword=' + encodeURIComponent(this.params.keyword) +
|
|
@@ -212,9 +247,22 @@ var productList = new Vue({
|
|
|
if( this.isShowAllBrands){
|
|
|
this.brandLists = this.defaultBrandLists;
|
|
|
}else{
|
|
|
- this.brandLists = this.defaultBrandLists.slice(0,7)
|
|
|
+ this.brandLists = this.defaultBrandLists.slice(0,6)
|
|
|
}
|
|
|
},
|
|
|
+ showMoreItemCheckedAll:function () {//点击多选按钮
|
|
|
+ this.isShowAllBrands = true;
|
|
|
+ this.isShowAllBrandsButton = true
|
|
|
+ this.brandLists = this.defaultBrandLists;
|
|
|
+ },
|
|
|
+ handleCancel:function () {//取消多选
|
|
|
+ this.isShowAllBrandsButton = false
|
|
|
+ },
|
|
|
+ handleConfirm:function () {// 确认查询多选
|
|
|
+ window.location.href = '/product/list.html?keyword=' + encodeURIComponent(this.params.keyword) +
|
|
|
+ '&bpn=' + this.params.brandIds + '&pro=' + this.params.promotionFlag +
|
|
|
+ '&newg='+ this.params.newFlag;
|
|
|
+ },
|
|
|
hanldCheckedActivi:function(){// 选择促销商品选项
|
|
|
this.isActiviChecked = !this.isActiviChecked;
|
|
|
if(this.isActiviChecked){
|
|
@@ -261,6 +309,7 @@ var productList = new Vue({
|
|
|
this.params.newFlag = getUrlParam("newg") ? getUrlParam("newg")*1 : 0; // newg 新品链接参数
|
|
|
if(this.hrefBrandId){
|
|
|
this.params.brandIds = this.hrefBrandId +',';
|
|
|
+ console.log('brandIds',this.params.brandIds)
|
|
|
}
|
|
|
if(this.params.promotionFlag == 1){
|
|
|
this.isActiviChecked = true;
|
|
@@ -297,7 +346,9 @@ var productList = new Vue({
|
|
|
// 获取列表数据
|
|
|
this.getListByKeyword();
|
|
|
// 获取对应品牌列表
|
|
|
- this.getCommoditySearchQUeryBrand();
|
|
|
+ // this.getCommoditySearchQUeryBrand();
|
|
|
+ this.brandLists = this.defaultBrandLists.slice(0,6)
|
|
|
+ console.log('this.brandLists==>',this.brandLists)
|
|
|
},
|
|
|
mounted: function () {
|
|
|
var _self = this;
|