|
@@ -20,7 +20,10 @@ var productList = new Vue({
|
|
sortType: 1, // 上传0,下传1 綜合1
|
|
sortType: 1, // 上传0,下传1 綜合1
|
|
pageSize: 24,
|
|
pageSize: 24,
|
|
pageNum: 1,
|
|
pageNum: 1,
|
|
- idType:1
|
|
|
|
|
|
+ idType:1,
|
|
|
|
+ brandIds: '', // 品牌Id
|
|
|
|
+ newFlag: 0, // 查询新品标记,默认0,新品1
|
|
|
|
+ promotionFlag: 0, // 查询促销标记,默认0,促销1
|
|
},
|
|
},
|
|
addhtml:'<span class="tag">美博会</span>',
|
|
addhtml:'<span class="tag">美博会</span>',
|
|
brandParam: {
|
|
brandParam: {
|
|
@@ -29,6 +32,7 @@ var productList = new Vue({
|
|
idType: '',
|
|
idType: '',
|
|
identity: 0
|
|
identity: 0
|
|
},
|
|
},
|
|
|
|
+ hrefBrandId:'',
|
|
brandLists: [],
|
|
brandLists: [],
|
|
defaultBrandLists:[],
|
|
defaultBrandLists:[],
|
|
checkedBrandList:[],
|
|
checkedBrandList:[],
|
|
@@ -69,12 +73,12 @@ var productList = new Vue({
|
|
$("img[data-original]").lazyload();
|
|
$("img[data-original]").lazyload();
|
|
},500);
|
|
},500);
|
|
});
|
|
});
|
|
- console.log(resultData);
|
|
|
|
if(isPC){
|
|
if(isPC){
|
|
_self.listData = resultData;
|
|
_self.listData = resultData;
|
|
}else{
|
|
}else{
|
|
_self.listData = _self.listData.concat(resultData);
|
|
_self.listData = _self.listData.concat(resultData);
|
|
}
|
|
}
|
|
|
|
+ console.log('listData',_self.listData);
|
|
}else {
|
|
}else {
|
|
console.log('暂无数据')
|
|
console.log('暂无数据')
|
|
}
|
|
}
|
|
@@ -94,15 +98,15 @@ var productList = new Vue({
|
|
this.params.pageNum = pageNum*1;
|
|
this.params.pageNum = pageNum*1;
|
|
var url = '/product/classify-'+this.typeSort+'-'+this.bigTypeId+'-'+this.smallTypeId+'-'+this.tinyTypeId+'-'+this.params.pageNum+'-'+this.params.pageSize;
|
|
var url = '/product/classify-'+this.typeSort+'-'+this.bigTypeId+'-'+this.smallTypeId+'-'+this.tinyTypeId+'-'+this.params.pageNum+'-'+this.params.pageSize;
|
|
if (this.params.sortField) {
|
|
if (this.params.sortField) {
|
|
- url += '-'+this.params.sortField+'-'+this.params.sortType+'.html';
|
|
|
|
|
|
+ url += '-'+this.params.sortField+'-'+this.params.sortType+'.html?bpn=' + this.hrefBrandId + '&pro=' + this.params.promotionFlag +'&newg='+ this.params.newFlag;
|
|
} else {
|
|
} else {
|
|
- url += '.html';
|
|
|
|
|
|
+ url += '.html?bpn=' + this.hrefBrandId + '&pro=' + this.params.promotionFlag +'&newg='+ this.params.newFlag;
|
|
}
|
|
}
|
|
window.location.href = url;
|
|
window.location.href = url;
|
|
}
|
|
}
|
|
},
|
|
},
|
|
toSortList: function (sortField, sortType) {
|
|
toSortList: function (sortField, sortType) {
|
|
- var url = '/product/classify-'+this.typeSort+'-'+this.bigTypeId+'-'+this.smallTypeId+'-'+this.tinyTypeId+'-1-'+this.params.pageSize+'-'+sortField+'-'+sortType+'.html';
|
|
|
|
|
|
+ var url = '/product/classify-'+this.typeSort+'-'+this.bigTypeId+'-'+this.smallTypeId+'-'+this.tinyTypeId+'-1-'+this.params.pageSize+'-'+sortField+'-'+sortType+'.html?bpn=' + this.hrefBrandId + '&pro=' + this.params.promotionFlag +'&newg='+ this.params.newFlag;
|
|
this.params.sortField= sortField;
|
|
this.params.sortField= sortField;
|
|
this.params.sortType = sortType;
|
|
this.params.sortType = sortType;
|
|
this.params.pageNum = 1;
|
|
this.params.pageNum = 1;
|
|
@@ -125,53 +129,80 @@ var productList = new Vue({
|
|
if (response.code === 0 && response.data ) {
|
|
if (response.code === 0 && response.data ) {
|
|
var data = response.data;
|
|
var data = response.data;
|
|
_self.defaultBrandLists = data.map((el, index) => {
|
|
_self.defaultBrandLists = data.map((el, index) => {
|
|
- el.isChecked = false;
|
|
|
|
|
|
+ if(_self.hrefBrandId && _self.hrefBrandId == el.id){
|
|
|
|
+ el.isChecked = true;
|
|
|
|
+ }else{
|
|
|
|
+ el.isChecked = false;
|
|
|
|
+ }
|
|
return el;
|
|
return el;
|
|
})
|
|
})
|
|
_self.brandLists = _self.defaultBrandLists.slice(0,8)
|
|
_self.brandLists = _self.defaultBrandLists.slice(0,8)
|
|
- console.log('品牌=============>', this.brandLists)
|
|
|
|
}else {
|
|
}else {
|
|
console.log('查询品牌列表异常')
|
|
console.log('查询品牌列表异常')
|
|
}
|
|
}
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
+ 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;
|
|
|
|
+ },
|
|
choiceBrand:function(brand,index){// 选择品牌
|
|
choiceBrand:function(brand,index){// 选择品牌
|
|
var _self = this;
|
|
var _self = this;
|
|
brand.isChecked = !brand.isChecked
|
|
brand.isChecked = !brand.isChecked
|
|
if (brand.isChecked) {
|
|
if (brand.isChecked) {
|
|
- _self.checkedBrandList.push(brand)
|
|
|
|
|
|
+ _self.checkedBrandList.push(brand.id)
|
|
} else {
|
|
} else {
|
|
_self.checkedBrandList.splice(index, 1)
|
|
_self.checkedBrandList.splice(index, 1)
|
|
}
|
|
}
|
|
_self.checkedBrandLength = _self.checkedBrandList.length
|
|
_self.checkedBrandLength = _self.checkedBrandList.length
|
|
- console.log('checkedBrandList', _self.checkedBrandList)
|
|
|
|
|
|
+ _self.params.brandIds = this.checkedBrandList.join(',')
|
|
},
|
|
},
|
|
showMoreItem:function(){// 点击更多品牌
|
|
showMoreItem:function(){// 点击更多品牌
|
|
this.isShowAllBrands = !this.isShowAllBrands;
|
|
this.isShowAllBrands = !this.isShowAllBrands;
|
|
|
|
+ this.brandLists = this.defaultBrandLists;
|
|
},
|
|
},
|
|
hanldCheckedActivi:function(){// 选择促销商品选项
|
|
hanldCheckedActivi:function(){// 选择促销商品选项
|
|
this.isActiviChecked = !this.isActiviChecked;
|
|
this.isActiviChecked = !this.isActiviChecked;
|
|
if(this.isActiviChecked){
|
|
if(this.isActiviChecked){
|
|
- this.listQuery.promotionFlag = 1
|
|
|
|
|
|
+ this.params.promotionFlag = 1
|
|
}else{
|
|
}else{
|
|
- this.listQuery.promotionFlag = 0
|
|
|
|
|
|
+ this.params.promotionFlag = 0
|
|
}
|
|
}
|
|
},
|
|
},
|
|
hanldCheckedNews:function(){// 选择新品选项
|
|
hanldCheckedNews:function(){// 选择新品选项
|
|
this.isNewsChecked = !this.isNewsChecked;
|
|
this.isNewsChecked = !this.isNewsChecked;
|
|
if(this.isNewsChecked){
|
|
if(this.isNewsChecked){
|
|
- this.listQuery.newFlag = 1
|
|
|
|
|
|
+ this.params.newFlag = 1
|
|
}else{
|
|
}else{
|
|
- this.listQuery.newFlag = 0
|
|
|
|
|
|
+ this.params.newFlag = 0
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ hanldCheckedActiviHref(){// 选择促销商品选项跳转链接(PC专用)
|
|
|
|
+ var promotionFlag = this.isActiviChecked ? 0 : 1;
|
|
|
|
+ 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.hrefBrandId+ '&pro='+promotionFlag+'&newg='+ this.params.newFlag;
|
|
|
|
+ console.log('url==========>',url)
|
|
|
|
+ window.location.href = url;
|
|
|
|
+ },
|
|
|
|
+ hanldCheckedNewsHref(){// 选择新品选项跳转链接(PC专用)
|
|
|
|
+ var newFlag = this.isNewsChecked ? 0 : 1;
|
|
|
|
+ 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.hrefBrandId+ '&pro=' + this.params.promotionFlag+'&newg='+newFlag;
|
|
|
|
+ console.log('url==========>',url)
|
|
|
|
+ window.location.href = url;
|
|
|
|
+ },
|
|
showIsProductScreen:function(){//
|
|
showIsProductScreen:function(){//
|
|
this.isProductScreen = true;
|
|
this.isProductScreen = true;
|
|
},
|
|
},
|
|
handleConfirmScreen:function(){// 确定筛选项
|
|
handleConfirmScreen:function(){// 确定筛选项
|
|
- this.isProductScreen = false;
|
|
|
|
- this.params.pageNum = 1;
|
|
|
|
- this.getListByKeyword();
|
|
|
|
|
|
+ if (GLOBAL_USER_ID && GLOBAL_USER_ID>0) {
|
|
|
|
+ this.params.pageNum = 1;
|
|
|
|
+ this.listData = [];
|
|
|
|
+ this.getproductList();
|
|
|
|
+ this.isProductScreen = false;
|
|
|
|
+ }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='+this.params.brandIds+ '&pro=' + this.params.promotionFlag+'&newg='+this.params.newFlag;
|
|
|
|
+ console.log('url============>',url)
|
|
|
|
+ window.location.href = url;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
},
|
|
},
|
|
created:function () {
|
|
created:function () {
|
|
@@ -187,19 +218,35 @@ var productList = new Vue({
|
|
this.params.pageNum = paramsArr.length>=6 ? paramsArr[5]*1 : 1;
|
|
this.params.pageNum = paramsArr.length>=6 ? paramsArr[5]*1 : 1;
|
|
this.params.sortField= paramsArr.length>=8 ? paramsArr[7] : "";
|
|
this.params.sortField= paramsArr.length>=8 ? paramsArr[7] : "";
|
|
this.params.sortType = paramsArr.length>=9 ? paramsArr[8]*1 : 1;
|
|
this.params.sortType = paramsArr.length>=9 ? paramsArr[8]*1 : 1;
|
|
|
|
+ this.hrefBrandId = getUrlParam("bpn") ? getUrlParam("bpn") : null; //bpn 品牌链接参数
|
|
|
|
+ this.params.promotionFlag = getUrlParam("pro") ? getUrlParam("pro")*1 : 0; // pro 促销商品链接参数
|
|
|
|
+ this.params.newFlag = getUrlParam("newg") ? getUrlParam("newg")*1 : 0; // newg 新品链接参数
|
|
|
|
+ if(this.hrefBrandId){
|
|
|
|
+ this.params.brandIds = this.hrefBrandId +',';
|
|
|
|
+ }
|
|
|
|
+ if(this.params.promotionFlag == 1){
|
|
|
|
+ this.isActiviChecked = true;
|
|
|
|
+ }else{
|
|
|
|
+ this.isActiviChecked = false;
|
|
|
|
+ }
|
|
|
|
+ if(this.params.newFlag == 1){
|
|
|
|
+ this.isNewsChecked = true;
|
|
|
|
+ }else{
|
|
|
|
+ this.isNewsChecked = false;
|
|
|
|
+ }
|
|
},
|
|
},
|
|
mounted:function () {
|
|
mounted:function () {
|
|
var _self = this;
|
|
var _self = this;
|
|
this.listRecord = $('#productCount').val() ? $('#productCount').val()*1 : 0;
|
|
this.listRecord = $('#productCount').val() ? $('#productCount').val()*1 : 0;
|
|
if (this.bigTypeId && this.smallTypeId && this.tinyTypeId) {
|
|
if (this.bigTypeId && this.smallTypeId && this.tinyTypeId) {
|
|
- this.params.id=this.tinyTypeId;
|
|
|
|
- this.params.idType = 3;
|
|
|
|
|
|
+ this.params.id= this.brandParam.id = this.tinyTypeId;
|
|
|
|
+ this.params.idType = this.brandParam.idType = 3;
|
|
} else if (this.bigTypeId && this.smallTypeId) {
|
|
} else if (this.bigTypeId && this.smallTypeId) {
|
|
- this.params.id=this.smallTypeId;
|
|
|
|
- this.params.idType = 2;
|
|
|
|
|
|
+ this.params.id= this.brandParam.id = this.smallTypeId;
|
|
|
|
+ this.params.idType = this.brandParam.idType = 2;
|
|
} else {
|
|
} else {
|
|
- this.params.id=this.bigTypeId;
|
|
|
|
- this.params.idType = 1;
|
|
|
|
|
|
+ this.params.id= this.brandParam.id = this.bigTypeId;
|
|
|
|
+ this.params.idType = this.brandParam.idType = 1;
|
|
}
|
|
}
|
|
if (GLOBAL_USER_ID && GLOBAL_USER_ID>0) {
|
|
if (GLOBAL_USER_ID && GLOBAL_USER_ID>0) {
|
|
_self.getproductList();
|
|
_self.getproductList();
|
|
@@ -210,6 +257,8 @@ var productList = new Vue({
|
|
$("img[data-original]").lazyload();
|
|
$("img[data-original]").lazyload();
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
+ // 获取对应品牌列表
|
|
|
|
+ this.getCommoditySearchQUeryBrand();
|
|
if(!isPC){
|
|
if(!isPC){
|
|
$('footer').addClass("noneImportant");
|
|
$('footer').addClass("noneImportant");
|
|
//移动端上垃加载更多
|
|
//移动端上垃加载更多
|