Browse Source

Merge remote-tracking branch 'origin/feature-201820-wangcz' into feature-201820-wangcz

Administrator 7 năm trước cách đây
mục cha
commit
b4d81325fa

+ 14 - 3
components/mobile/brand/ComponentDetail.vue

@@ -305,9 +305,20 @@
       collectComponent: function () {
         if (this.user.logged) {
           if (!this.isCollect) {
-            this.$store.dispatch('product/saveEntity', {componentid: this.component.id, kind: 2})
-            this.collectResult = '收藏成功'
-            this.timeoutCount++
+            this.$http.post('/trade/collection/save', {componentid: this.component.id, kind: 2})
+              .then(res => {
+                if (res.data.code === 1) {
+                  this.collectResult = '收藏成功'
+                  this.$store.dispatch('product/saveStores')
+                } else {
+                  this.collectResult = res.data.data || '收藏失败'
+                }
+                this.timeoutCount++
+              }, err => {
+                this.collectResult = err.response.data || '收藏失败'
+                this.timeoutCount++
+                console.log(err)
+              })
           } else {
             this.$http.post('/trade/collection/delete/cmpId', [this.component.id]).then(response => {
               this.collectResult = '取消成功'

+ 1 - 1
components/mobile/supplier/List.vue

@@ -181,7 +181,7 @@
           }
           span {
             color: #333;
-            width: 4.65rem;
+            width: 5.5rem;
             overflow: hidden;
             text-overflow: ellipsis;
             white-space: nowrap;