...
|
...
|
@@ -67,8 +67,8 @@ |
|
|
<template v-if="articleInfo.productLink">
|
|
|
<a :href="articleInfo.productLink" class="article-goods"> <span>查看详情</span> </a>
|
|
|
</template>
|
|
|
<div v-else-if="articleInfo.productList && articleInfo.productList.length" class="article-goods">
|
|
|
<WidgetIconBtn class="item" type="car" :text="articleInfo.productList.length"
|
|
|
<div v-else-if="articleProducts && articleProducts.length" class="article-goods">
|
|
|
<WidgetIconBtn class="item" type="cart" :text="articleProducts.length"
|
|
|
:option="{textSelectedColor: 'white', textAutoChange: false, emitName: 'onClick'}"
|
|
|
@onClick="onProductListActionView">
|
|
|
<template v-slot:label>
|
...
|
...
|
@@ -168,10 +168,11 @@ export default { |
|
|
this.colWidthForTwo = Math.floor(this.$el.offsetWidth / 2);
|
|
|
this.loadPreData(+this.$route.params.id);
|
|
|
this.share = !this.$yoho.isApp;
|
|
|
this.initProductList();
|
|
|
},
|
|
|
computed: {
|
|
|
...mapYohoState(['yoho']),
|
|
|
...mapState(['articleSingleDetail', 'articleStates', 'authorStates']),
|
|
|
...mapState(['articleSingleDetail', 'articleStates', 'authorStates', 'fetchNoteProductList']),
|
|
|
|
|
|
articleInfo() {
|
|
|
return this.articleSingleDetail[this.id || this.$route.params.id] || {};
|
...
|
...
|
@@ -377,12 +378,9 @@ export default { |
|
|
this.$refs.footer.onPraise();
|
|
|
},
|
|
|
onComment() {
|
|
|
if (this.articleInfo.sort === 2) {
|
|
|
this.$refs.detailLong.onComment();
|
|
|
} else if (this.articleState.commentCount) {
|
|
|
this.$refs.detailNote.onComment();
|
|
|
} else {
|
|
|
this.$refs.commentInput.$el.click();
|
|
|
if (this.articleState.commentCount) {
|
|
|
this.$refs.detailLong && this.$refs.detailLong.onComment();
|
|
|
this.$refs.detailNote && this.$refs.detailNote.onComment();
|
|
|
}
|
|
|
},
|
|
|
onCommentInput(comment) {
|
...
|
...
|
@@ -496,12 +494,20 @@ export default { |
|
|
this.$links.toDownloadApp();
|
|
|
},
|
|
|
onProductListActionView() {
|
|
|
console.log(this.articleInfo);
|
|
|
if (this.articleInfo.sort === 2) {
|
|
|
this.$refs.detailLong.onProductList();
|
|
|
} else if (this.articleInfo.productList) {
|
|
|
} else {
|
|
|
this.$refs.detailNote.onProductList();
|
|
|
}
|
|
|
},
|
|
|
initProductList() {
|
|
|
if (this.articleInfo.sort === 2) {
|
|
|
this.$watch('fetchNoteProductList', (products) => {
|
|
|
this.articleProducts = products;
|
|
|
});
|
|
|
} else {
|
|
|
this.articleProducts = this.articleInfo.productList;
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
components: {
|
...
|
...
|
|