|
@@ -49,11 +49,6 @@
|
|
|
export default {
|
|
export default {
|
|
|
middleware: 'authenticated',
|
|
middleware: 'authenticated',
|
|
|
layout: 'mobileNoHeader',
|
|
layout: 'mobileNoHeader',
|
|
|
- fetch ({ store, route }) {
|
|
|
|
|
- return Promise.all([
|
|
|
|
|
- store.dispatch('searchData/searchForListInMobile', { page: 1, count: 10, type: 'component', keyword: route.params.key })
|
|
|
|
|
- ])
|
|
|
|
|
- },
|
|
|
|
|
data () {
|
|
data () {
|
|
|
return {
|
|
return {
|
|
|
keyword: '',
|
|
keyword: '',
|
|
@@ -92,6 +87,12 @@
|
|
|
immediate: true
|
|
immediate: true
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+ fetch ({ store, params }) {
|
|
|
|
|
+ console.log(111)
|
|
|
|
|
+ return Promise.all([
|
|
|
|
|
+ store.dispatch('searchData/searchForListInMobile', { page: 1, count: 10, type: 'component', keyword: params.key })
|
|
|
|
|
+ ])
|
|
|
|
|
+ },
|
|
|
computed: {
|
|
computed: {
|
|
|
compCollectList () {
|
|
compCollectList () {
|
|
|
return this.$store.state.searchData.searchList.lists
|
|
return this.$store.state.searchData.searchList.lists
|
|
@@ -169,15 +170,33 @@
|
|
|
},
|
|
},
|
|
|
cancelFocus: function (item, event) {
|
|
cancelFocus: function (item, event) {
|
|
|
event.stopPropagation()
|
|
event.stopPropagation()
|
|
|
- if (!item.isFocus) {
|
|
|
|
|
- this.$store.dispatch('product/saveEntity', {cmpuuid: item.cmpUuId, kind: 2})
|
|
|
|
|
- this.collectResult = '收藏成功'
|
|
|
|
|
- this.timeoutCount++
|
|
|
|
|
|
|
+ if (item.standard === 1) {
|
|
|
|
|
+ if (!item.isFocus) {
|
|
|
|
|
+ this.$http.post('/trade/collection/save', {cmpuuid: item.cmpUuId, kind: 2})
|
|
|
|
|
+ .then(res => {
|
|
|
|
|
+ if (res.data.code === 1) {
|
|
|
|
|
+ this.onRemind('收藏成功')
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.onRemind(res.data.data || '收藏失败')
|
|
|
|
|
+ }
|
|
|
|
|
+ }, err => {
|
|
|
|
|
+ this.onRemind(err.response.data || '收藏失败')
|
|
|
|
|
+ console.log(err)
|
|
|
|
|
+ })
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$http.post('/trade/collection/delete', [item.focusId]).then(response => {
|
|
|
|
|
+ if (response.data === 'success') {
|
|
|
|
|
+ this.onRemind('取消收藏成功')
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.onRemind('取消收藏失败')
|
|
|
|
|
+ }
|
|
|
|
|
+ }, err => {
|
|
|
|
|
+ console.log(err)
|
|
|
|
|
+ this.onRemind(err.response.data || '取消收藏失败')
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
} else {
|
|
} else {
|
|
|
- this.$http.post('/trade/collection/delete/cmpId', [item.focusId]).then(response => {
|
|
|
|
|
- this.collectResult = '取消成功'
|
|
|
|
|
- this.timeoutCount++
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ this.onRemind('非标物料暂不可收藏')
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
reloadList: function () {
|
|
reloadList: function () {
|