|
@@ -34,14 +34,35 @@ var productList = new Vue({
|
|
|
},
|
|
|
hrefBrandId:'',
|
|
|
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,
|
|
|
- isAllcheckedBrand:false
|
|
|
+ isShowAllBrandsButton:false,
|
|
|
+ isAllcheckedBrand:false,
|
|
|
+ isChoiceBrandText:false,
|
|
|
+ choiceBrandText:''
|
|
|
},
|
|
|
filters:{
|
|
|
NumFormat:function(value) {//处理金额
|
|
@@ -153,8 +174,21 @@ var productList = new Vue({
|
|
|
});
|
|
|
},
|
|
|
choiceBrandHref: function (brand, index) {// PC端品牌跳转链接
|
|
|
- var url = '/product/classify-'+this.typeSort+'-'+this.bigTypeId+'-'+this.smallTypeId+'-'+this.tinyTypeId+'-1-'+this.params.pageSize+'-'+this.params.sortField+'-'+this.params.sortType+'.html?bpn=' + brand.id + '&pro=' + this.params.promotionFlag +'&newg='+ this.params.newFlag;
|
|
|
- window.location.href = url;
|
|
|
+ if(this.isShowAllBrandsButton){
|
|
|
+ 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;
|
|
|
+ _self.params.brandIds = this.checkedBrandList.join(',');
|
|
|
+ }else {
|
|
|
+ var url = '/product/classify-' + this.typeSort + '-' + this.bigTypeId + '-' + this.smallTypeId + '-' + this.tinyTypeId + '-1-' + this.params.pageSize + '-' + this.params.sortField + '-' + this.params.sortType + '.html?bpn=' + brand.id + '&pro=' + this.params.promotionFlag + '&newg=' + this.params.newFlag;
|
|
|
+ window.location.href = url;
|
|
|
+ }
|
|
|
},
|
|
|
choiceBrandAllHref:function(){// PC全部品牌跳转链接
|
|
|
var url = '/product/classify-'+this.typeSort+'-'+this.bigTypeId+'-'+this.smallTypeId+'-'+this.tinyTypeId+'-1-'+this.params.pageSize+'-'+this.params.sortField+'-'+this.params.sortType+'.html?bpn=&pro=' + this.params.promotionFlag +'&newg='+ this.params.newFlag;
|
|
@@ -184,9 +218,26 @@ 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 () {// 确认查询多选
|
|
|
+ if(this.checkedBrandList.length == 0){return;}
|
|
|
+ var url = '/product/classify-'+this.typeSort+'-'+this.bigTypeId+'-'+this.smallTypeId+'-'+this.tinyTypeId+'-1-'+this.params.pageSize+'-'+this.params.sortField+'-'+this.params.sortType+'.html?bpn='+this.params.brandIds+ '&pro='+ this.params.promotionFlag +'&newg='+ this.params.newFlag;
|
|
|
+ window.location.href = url;
|
|
|
+ },
|
|
|
+ handleDeleteBrands:function () {// 删除选择的品牌
|
|
|
+ var url = '/product/classify-'+this.typeSort+'-'+this.bigTypeId+'-'+this.smallTypeId+'-'+this.tinyTypeId+'-1-'+this.params.pageSize+'-'+this.params.sortField+'-'+this.params.sortType+'.html?pro='+ this.params.promotionFlag +'&newg='+ this.params.newFlag;
|
|
|
+ window.location.href = url;
|
|
|
+ },
|
|
|
hanldCheckedActivi:function(){// 选择促销商品选项
|
|
|
this.isActiviChecked = !this.isActiviChecked;
|
|
|
if(this.isActiviChecked){
|
|
@@ -230,6 +281,7 @@ var productList = new Vue({
|
|
|
}
|
|
|
},
|
|
|
created:function () {
|
|
|
+ var _self = this;
|
|
|
var userInfo = localStorage.getItem('userInfo');
|
|
|
if(userInfo){
|
|
|
this.userId = JSON.parse(userInfo).userId;
|
|
@@ -246,7 +298,14 @@ var productList = new Vue({
|
|
|
this.params.promotionFlag = getUrlParam("pro") ? getUrlParam("pro")*1 : 0; // pro 促销商品链接参数
|
|
|
this.params.newFlag = getUrlParam("newg") ? getUrlParam("newg")*1 : 0; // newg 新品链接参数
|
|
|
if(this.hrefBrandId){
|
|
|
+ const brandIdsArray = this.hrefBrandId.split(',')
|
|
|
this.params.brandIds = this.hrefBrandId +',';
|
|
|
+ this.isChoiceBrandText = true
|
|
|
+ const names = brandIdsArray.map(function (item) {
|
|
|
+ const find = _self.defaultBrandLists.find(el => el.id === item*1)
|
|
|
+ return find && find.name
|
|
|
+ })
|
|
|
+ this.choiceBrandText = names.join(',').slice(0,15)
|
|
|
}
|
|
|
if(this.params.promotionFlag == 1){
|
|
|
this.isActiviChecked = true;
|
|
@@ -282,7 +341,8 @@ var productList = new Vue({
|
|
|
});
|
|
|
}
|
|
|
// 获取对应品牌列表
|
|
|
- this.getCommoditySearchQUeryBrand();
|
|
|
+ // this.getCommoditySearchQUeryBrand();
|
|
|
+ this.brandLists = this.defaultBrandLists.slice(0,6)
|
|
|
if(!isPC){
|
|
|
$('footer').addClass("noneImportant");
|
|
|
//移动端上垃加载更多
|