|
@@ -168,7 +168,7 @@ var productList = new Vue({
|
|
|
if (response.code === 0 && response.data ) {
|
|
|
var data = response.data;
|
|
|
_self.defaultBrandLists = data.map((el, index) => {
|
|
|
- if(_self.hrefBrandId && _self.hrefBrandId == el.id){
|
|
|
+ if(_self.hrefBrandId && _self.hrefBrandId === el.id){
|
|
|
el.isChecked = true;
|
|
|
}else{
|
|
|
el.isChecked = false;
|
|
@@ -298,7 +298,7 @@ var productList = new Vue({
|
|
|
}
|
|
|
},
|
|
|
created: function () {
|
|
|
- var _self = this
|
|
|
+ const _self = this;
|
|
|
if(isPC){
|
|
|
this.params.size = getUrlParam("pageSize") ? getUrlParam("pageSize") * 1 : 24;
|
|
|
this.params.num = getUrlParam("pageNum") ? getUrlParam("pageNum") * 1 : 1;
|
|
@@ -341,24 +341,21 @@ var productList = new Vue({
|
|
|
this.userId = JSON.parse(userInfo).userId;
|
|
|
this.shopID = JSON.parse(userInfo).shopId;
|
|
|
}
|
|
|
+ // 获取对应品牌列表
|
|
|
+ this.getCommoditySearchQUeryBrand();
|
|
|
// 设置选中的品牌
|
|
|
- setTimeout(()=>{
|
|
|
- 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)
|
|
|
- }
|
|
|
- console.log('aaaaa',_self.defaultBrandLists)
|
|
|
- // 获取列表数据
|
|
|
- this.getListByKeyword();
|
|
|
- // 获取对应品牌列表
|
|
|
- this.getCommoditySearchQUeryBrand();
|
|
|
- },500)
|
|
|
+ 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)
|
|
|
+ }
|
|
|
+ // 获取列表数据
|
|
|
+ this.getListByKeyword();
|
|
|
},
|
|
|
mounted: function () {
|
|
|
var _self = this;
|