|
|
@@ -22,15 +22,15 @@
|
|
|
<ul>
|
|
|
<li class="clearfix" :key="comp.componentid" v-for="comp in compList" @click="goUrl('/mobile/brand/componentDetail/' + comp.componentinfo.uuid)">
|
|
|
<div class="fl">
|
|
|
- <p>品牌:<span v-text="comp.brand || '-'"></span></p>
|
|
|
- <p>物料名称:<span v-text="comp.kind || '-'"></span></p>
|
|
|
- <p>型号:<span v-text="comp.cmpCode || '-'"></span></p>
|
|
|
+ <p>品牌:<span v-text="comp.brand.nameEn || '-'"></span></p>
|
|
|
+ <p>物料名称:<span v-text="comp.kind.nameCn || '-'"></span></p>
|
|
|
+ <p>型号:<span v-text="comp.code || '-'"></span></p>
|
|
|
<p>规格:<span v-text="comp.spec || '-'"></span></p>
|
|
|
<p>产品描述:<span v-text="comp.description || '-'"></span></p>
|
|
|
</div>
|
|
|
<div class="vir"></div>
|
|
|
<div class="fr">
|
|
|
- <i class="iconfont icon-shoucang" :style="comp.isFocus === 'true'?'color:#ff7800':'color: #ddd'" @click="cancelFocus(comp, $event)"></i>
|
|
|
+ <i class="iconfont icon-shoucang" :style="comp.isFocus?'color:#ff7800':'color: #ddd'" @click="cancelFocus(comp, $event)"></i>
|
|
|
<a class="sa-pub" @click="compInquiry(comp, $event)">立即询价</a>
|
|
|
</div>
|
|
|
</li>
|
|
|
@@ -73,12 +73,12 @@
|
|
|
watch: {
|
|
|
'compCollectList.data': {
|
|
|
handler: function (val) {
|
|
|
- if (val.content) {
|
|
|
+ if (val.components) {
|
|
|
if (this.isChange) {
|
|
|
- this.compList = val.content
|
|
|
+ this.compList = this.baseUtils.deepCopy(val.components)
|
|
|
this.isChange = false
|
|
|
} else {
|
|
|
- this.compList = [...this.compList, ...val.content]
|
|
|
+ this.compList = [...this.compList, ...this.baseUtils.deepCopy(val.components)]
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
@@ -87,7 +87,7 @@
|
|
|
},
|
|
|
created () {
|
|
|
this.keyword = this.$route.params.key
|
|
|
- this.$store.dispatch('searchData/searchForListInMobile', { page: 1, count: 10, type: 'component', keyword: this.$route.params.key })
|
|
|
+ this.$store.dispatch('searchData/searchForListInMobile', { page: 1, count: 10, w: this.$route.params.key })
|
|
|
},
|
|
|
computed: {
|
|
|
compCollectList () {
|
|
|
@@ -163,37 +163,35 @@
|
|
|
},
|
|
|
cancelFocus: function (item, event) {
|
|
|
event.stopPropagation()
|
|
|
- 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('取消收藏成功')
|
|
|
+ if (!item.isFocus) {
|
|
|
+ this.$http.post('/trade/collection/save', {componentid: item.id, kind: 2})
|
|
|
+ .then(res => {
|
|
|
+ if (res.data.code === 1) {
|
|
|
+ this.onRemind('收藏成功')
|
|
|
+ item.isFocus = true
|
|
|
} else {
|
|
|
- this.onRemind('取消收藏失败')
|
|
|
+ this.onRemind(res.data.message || '收藏失败')
|
|
|
}
|
|
|
}, err => {
|
|
|
+ this.onRemind(err.response.data || '收藏失败')
|
|
|
console.log(err)
|
|
|
- this.onRemind(err.response.data || '取消收藏失败')
|
|
|
})
|
|
|
- }
|
|
|
} else {
|
|
|
- this.onRemind('非标物料暂不可收藏')
|
|
|
+ this.$http.post('/trade/collection/delete/cmpId', [item.id]).then(response => {
|
|
|
+ if (response.data === 'success') {
|
|
|
+ this.onRemind('取消收藏成功')
|
|
|
+ item.isFocus = false
|
|
|
+ } else {
|
|
|
+ this.onRemind('取消收藏失败')
|
|
|
+ }
|
|
|
+ }, err => {
|
|
|
+ console.log(err)
|
|
|
+ this.onRemind(err.response.data || '取消收藏失败')
|
|
|
+ })
|
|
|
}
|
|
|
},
|
|
|
reloadList: function () {
|
|
|
- this.$store.dispatch('searchData/searchForListInMobile', { page: this.page, count: this.count, type: 'component', keyword: this.keyword })
|
|
|
+ this.$store.dispatch('searchData/searchForListInMobile', { page: this.page, count: this.count, w: this.keyword })
|
|
|
},
|
|
|
onPullUpAction: function () {
|
|
|
this.page++
|
|
|
@@ -203,10 +201,10 @@
|
|
|
if (e) {
|
|
|
e.stopPropagation()
|
|
|
}
|
|
|
- this.componentSeekObj.cmpCode = item.cmpCode ? item.cmpCode : ''
|
|
|
- this.componentSeekObj.pbranden = item.brand ? item.brand : ''
|
|
|
- this.componentSeekObj.spec = item.spec ? item.spec : ''
|
|
|
- this.componentSeekObj.kind = item.kind ? item.kind : ''
|
|
|
+ this.componentSeekObj.cmpCode = item.code
|
|
|
+ this.componentSeekObj.pbranden = item.brand.nameEn
|
|
|
+ this.componentSeekObj.spec = item.spec
|
|
|
+ this.componentSeekObj.kind = item.kind.nameCn
|
|
|
this.componentSeekObj = JSON.parse(JSON.stringify(this.componentSeekObj))
|
|
|
this.showPublishBox = true
|
|
|
},
|