Browse Source

品牌搜索回显

zhengjinyi 3 years ago
parent
commit
4357771fdf

+ 1 - 1
src/main/resources/config/dev/application-dev.yml

@@ -54,7 +54,7 @@ logging:
 caimei:
   siteEnv: 0 #网站环境,(2:正式环境,1:测试环境,0:开发环境)
   #spiServer: http://192.168.2.68:8008
-  coreServer: https://core-b.caimei365.com
+  coreServer: https://core.caimei365.com
   #coreServer: http://192.168.2.68:18002
   #coreServer: http://192.168.2.75:18002
   imageDomain: https://img-b.caimei365.com

+ 15 - 10
src/main/resources/static/js/product/list.js

@@ -175,6 +175,7 @@ var productList = new Vue({
                         return el;
                     })
                     _self.brandLists = _self.defaultBrandLists.slice(0,6)
+                    console.log('defaultBrandLists',_self.defaultBrandLists)
                 }else {
                     console.log('查询品牌列表异常')
                 }
@@ -340,16 +341,20 @@ var productList = new Vue({
         // 获取对应品牌列表
         this.getCommoditySearchQUeryBrand();
         // 设置选中的品牌
-        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.brandId === item*1)
-                return find && find.name
-            })
-            this.choiceBrandText = names.join(',').slice(0,15)
-        }
+        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)
+        },500)
+
     },
     mounted: function () {
         var _self = this;

+ 13 - 11
src/main/resources/static/js/product/produce-list.js

@@ -149,7 +149,7 @@ var productList = new Vue({
                         }
                         return el;
                     })
-                    _self.brandLists = _self.defaultBrandLists.slice(0,7)
+                    _self.brandLists = _self.defaultBrandLists.slice(0,6)
                 }else {
                     console.log('查询品牌列表异常')
                 }
@@ -325,16 +325,18 @@ var productList = new Vue({
         // 获取对应品牌列表
         this.getCommoditySearchQUeryBrand();
         // 设置选中的品牌
-        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.brandId === item*1)
-                return find && find.name
-            })
-            this.choiceBrandText = names.join(',').slice(0,15)
-        }
+        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)
+            }
+        },500)
         if(!isPC){
             $('footer').addClass("noneImportant");
             //移动端上垃加载更多