...
|
...
|
@@ -82,6 +82,8 @@ |
|
|
|
|
|
<script>
|
|
|
import {get} from 'lodash';
|
|
|
import Share from 'plugins/share';
|
|
|
import {getDetailShareData} from 'utils/share-handler';
|
|
|
|
|
|
import YAS from 'utils/yas-constants';
|
|
|
import ArticleDetailHeader from './components/detail/article-header';
|
...
|
...
|
@@ -97,8 +99,7 @@ const {mapState, mapActions, mapMutations} = createNamespacedHelpers('article'); |
|
|
export default {
|
|
|
name: 'ArticleDetailPage',
|
|
|
props: {
|
|
|
share: Boolean,
|
|
|
setShareData: Function
|
|
|
share: Boolean
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
...
|
...
|
@@ -124,6 +125,7 @@ export default { |
|
|
this.id = +this.$route.params.id;
|
|
|
this.init();
|
|
|
} else {
|
|
|
this.setShareData(this.articleInfo);
|
|
|
this.reportProductShow(this.articleInfo);
|
|
|
}
|
|
|
this.$yoho.safetyInterface(() => {
|
...
|
...
|
@@ -286,9 +288,8 @@ export default { |
|
|
const article = get(res, 'data.detailList[0]', this.articleInfo);
|
|
|
|
|
|
this.reportProductShow(article);
|
|
|
if (this.share && this.setShareData) {
|
|
|
this.setShareData(article);
|
|
|
}
|
|
|
|
|
|
this.setShareData(article);
|
|
|
});
|
|
|
},
|
|
|
async onFetch() {
|
...
|
...
|
@@ -367,6 +368,13 @@ export default { |
|
|
this.$refs.detailNote.onComment(comment);
|
|
|
}
|
|
|
},
|
|
|
setShareData(article) {
|
|
|
if (this.$yoho.isApp || !article) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
Share.setShareInfo(getDetailShareData(article));
|
|
|
},
|
|
|
reportArticleShow(items) {
|
|
|
if (!items || !items.length) {
|
|
|
return;
|
...
|
...
|
|