|
@@ -7,6 +7,7 @@ var productList = new Vue({
|
|
|
noMore: false,
|
|
|
topGoodList: [],
|
|
|
listQuery: {
|
|
|
+ userId:0,
|
|
|
brandID:'',
|
|
|
pageNum:1,
|
|
|
pageSize:10
|
|
@@ -23,17 +24,12 @@ var productList = new Vue({
|
|
|
userIdentity: '',
|
|
|
userToken: '',
|
|
|
addhtml:'<span class="tag">美博会</span>',
|
|
|
- brandParam: {
|
|
|
- keyword: '',
|
|
|
- id: '',
|
|
|
- idType: '',
|
|
|
- identity: 0
|
|
|
- },
|
|
|
hrefBrandId:null,
|
|
|
brandLists: [],
|
|
|
defaultBrandLists:[],
|
|
|
checkedBrandList:[],
|
|
|
checkedBrandLength:0,
|
|
|
+ choiceBrandIndex:100,
|
|
|
isProductScreen:false,
|
|
|
isActiviChecked:false,
|
|
|
isNewsChecked:false,
|
|
@@ -95,14 +91,13 @@ var productList = new Vue({
|
|
|
});
|
|
|
} else {
|
|
|
var swiper = new Swiper('#productHotBanner', {
|
|
|
- loop : true,
|
|
|
+ loop: true,
|
|
|
autoplay: {
|
|
|
delay: 2000,
|
|
|
disableOnInteraction: false
|
|
|
},
|
|
|
pagination: {
|
|
|
- el: '.swiper-pagination',
|
|
|
- clickable :true
|
|
|
+ el: '.swiper-pagination'
|
|
|
}
|
|
|
});
|
|
|
}
|
|
@@ -144,16 +139,40 @@ var productList = new Vue({
|
|
|
el.isChecked = false;
|
|
|
return el;
|
|
|
})
|
|
|
- // _self.brandLists = _self.defaultBrandLists.slice(0,7);
|
|
|
- _self.brandLists = _self.defaultBrandLists;
|
|
|
+ _self.brandLists = _self.defaultBrandLists.slice(0,6);
|
|
|
}else {
|
|
|
console.log('查询品牌列表异常')
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- choiceBrandHref: function (brand, index) {// PC端跳转链接
|
|
|
- if(this.isShowAllBrandsButton){// 如果多选的情况下
|
|
|
- var _self = this;
|
|
|
+ choiceBrandSearchClass:function (brand,index) {
|
|
|
+ var _self = this;
|
|
|
+ if(_self.isShowAllBrandsButton){
|
|
|
+ if(brand.isChecked){
|
|
|
+ return 'checked';
|
|
|
+ }else{
|
|
|
+ return '';
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ if(_self.choiceBrandIndex === index){
|
|
|
+ return 'checked';
|
|
|
+ }else{
|
|
|
+ return '';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ choiceBrandSearchIndex:function (brand, index) {//单选
|
|
|
+ var _self = this;
|
|
|
+ _self.choiceBrandIndex = index;
|
|
|
+ _self.isAllcheckedBrand = false;
|
|
|
+ _self.listQuery.brandID = brand.id;
|
|
|
+ _self.listQuery.pageNum = 1;
|
|
|
+ _self.listData = [];
|
|
|
+ _self.GetHomeNewFloorList();
|
|
|
+ },
|
|
|
+ choiceBrandSearch: function (brand,index) {// PC选择品牌 多选的情况下
|
|
|
+ var _self = this;
|
|
|
+ if(_self.isShowAllBrandsButton){
|
|
|
brand.isChecked = !brand.isChecked;
|
|
|
if (brand.isChecked) {
|
|
|
_self.checkedBrandList.push(brand.id);
|
|
@@ -167,18 +186,15 @@ var productList = new Vue({
|
|
|
}
|
|
|
_self.isAllcheckedBrand = false;
|
|
|
_self.checkedBrandLength = _self.checkedBrandList.length;
|
|
|
- _self.params.brandIds = this.checkedBrandList.join(',');
|
|
|
+ _self.listQuery.brandID = this.checkedBrandList.join(',');
|
|
|
}else{
|
|
|
- window.location.href = '/product/list.html?keyword=' + encodeURIComponent(this.params.keyword) +
|
|
|
- '&bpn=' + brand.id + '&pro=' + this.params.promotionFlag +
|
|
|
- '&newg='+ this.params.newFlag;
|
|
|
+ _self.choiceBrandIndex = index;
|
|
|
+ _self.listQuery.brandID = brand.id;
|
|
|
+ _self.listQuery.pageNum = 1;
|
|
|
+ _self.listData = [];
|
|
|
+ _self.GetHomeNewFloorList();
|
|
|
}
|
|
|
},
|
|
|
- choiceBrandAllHref:function(){// PC全部品牌跳转链接
|
|
|
- window.location.href = '/product/list.html?keyword=' + encodeURIComponent(this.params.keyword) +
|
|
|
- '&bpn=&pro=' + this.params.promotionFlag +
|
|
|
- '&newg='+ this.params.newFlag;
|
|
|
- },
|
|
|
choiceBrand:function(brand,index){// 选择品牌
|
|
|
var _self = this;
|
|
|
brand.isChecked = !brand.isChecked;
|
|
@@ -204,6 +220,9 @@ var productList = new Vue({
|
|
|
this.brandLists.forEach(function(el){
|
|
|
el.isChecked = false;
|
|
|
});
|
|
|
+ this.listQuery.pageNum = 1;
|
|
|
+ this.listData = [];
|
|
|
+ this.GetHomeNewFloorList();
|
|
|
},
|
|
|
showMoreItem:function(){// 点击更多品牌
|
|
|
this.isShowAllBrands = !this.isShowAllBrands;
|
|
@@ -221,42 +240,6 @@ var productList = new Vue({
|
|
|
handleCancel:function () {//取消多选
|
|
|
this.isShowAllBrandsButton = false
|
|
|
},
|
|
|
- handleConfirm:function () {// 确认查询多选
|
|
|
- if(this.checkedBrandList.length == 0){return;}
|
|
|
- window.location.href = '/product/list.html?keyword=' + encodeURIComponent(this.params.keyword) +
|
|
|
- '&bpn=' + this.listQuery.brandID + '&pro=' + this.params.promotionFlag +
|
|
|
- '&newg='+ this.params.newFlag;
|
|
|
- },
|
|
|
- handleDeleteBrands:function () {// 删除选择的品牌
|
|
|
- window.location.href = '/product/list.html?keyword=' + encodeURIComponent(this.params.keyword)+ '&pro=' + this.params.promotionFlag +'&newg='+this.params.newFlag;
|
|
|
- },
|
|
|
- hanldCheckedActivi:function(){// 选择促销商品选项
|
|
|
- this.isActiviChecked = !this.isActiviChecked;
|
|
|
- if(this.isActiviChecked){
|
|
|
- this.params.promotionFlag = 1
|
|
|
- }else{
|
|
|
- this.params.promotionFlag = 0
|
|
|
- }
|
|
|
- },
|
|
|
- hanldCheckedNews:function(){// 选择新品选项
|
|
|
- this.isNewsChecked = !this.isNewsChecked;
|
|
|
- if(this.isNewsChecked){
|
|
|
- this.params.newFlag = 1
|
|
|
- }else{
|
|
|
- this.params.newFlag = 0
|
|
|
- }
|
|
|
- },
|
|
|
- hanldCheckedActiviHref(){// 选择促销商品选项跳转链接(PC专用)
|
|
|
- var promotionFlag = this.isActiviChecked ? 0 : 1;
|
|
|
- window.location.href = '/product/list.html?keyword='+encodeURIComponent(this.params.keyword)+
|
|
|
- '&bpn='+this.hrefBrandId+ '&pro='+promotionFlag+'&newg='+ this.params.newFlag;
|
|
|
- },
|
|
|
- hanldCheckedNewsHref(){// 选择新品选项跳转链接(PC专用)
|
|
|
- var newFlag = this.isNewsChecked ? 0 : 1;
|
|
|
- window.location.href = '/product/list.html?keyword='+encodeURIComponent(this.params.keyword)+
|
|
|
- '&bpn='+this.hrefBrandId+ '&pro=' + this.params.promotionFlag +
|
|
|
- '&newg='+newFlag;
|
|
|
- },
|
|
|
showIsProductScreen:function(){//
|
|
|
this.isProductScreen = true;
|
|
|
},
|
|
@@ -264,14 +247,14 @@ var productList = new Vue({
|
|
|
this.listQuery.pageNum = 1;
|
|
|
this.listData = [];
|
|
|
this.GetHomeNewFloorList();
|
|
|
- this.isProductScreen = false;
|
|
|
+ this.isShowAllBrands = false;
|
|
|
}
|
|
|
},
|
|
|
created: function () {
|
|
|
var _self = this
|
|
|
// this.searchFlag = (this.params.keyword !== "");
|
|
|
if(globalUserData){
|
|
|
- this.userId = globalUserData.userId;
|
|
|
+ this.userId = this.listQuery.userId = globalUserData.userId;
|
|
|
this.userIdentity = globalUserData.identity;
|
|
|
this.userToken = globalUserData.token;
|
|
|
}
|