Authored by 杨延青

Merge branch 'feature/0430' into 'release/6.9.2'

fix share



See merge request !69
... ... @@ -93,10 +93,21 @@ export default {
this.title = `@${first.authorName} 在有货逛上发了一篇笔记,快点开看看!`;
if (!this.$yoho.isApp) {
let shareImage = '';
let shareIntro = '';
get(first, 'blockList', []).forEach(block => {
if (block.templateKey === 'image') {
!shareImage && (shareImage = (block.contentData || '').split('?')[0]);
} else if (block.templateKey === 'text') {
!shareIntro && (shareIntro = block.contentData);
}
});
Share.setShareInfo({
title: this.title,
imgUrl: first.shareImage,
desc: first.intro
imgUrl: shareImage,
desc: shareIntro
});
}
}
... ...
... ... @@ -82,7 +82,7 @@ export default {
this.$yoho.share({
title: this.data.topicName,
imgUrl: this.data.topicImageUrl,
link: `${location.origin}/grass/topic/share/${this.data.topicId}/${this.data.topicName}`,
link: `${location.origin}/grass/topic/share/${this.data.topicId}`,
desc: '我在有货的社区发现一个热门话题。' + this.data.topicDesc,
hideType: ['7', '8', '9']
});
... ...
... ... @@ -31,6 +31,14 @@ export default [{
keepAlive: true
}
}, {
path: '/topic/share/:topicId',
alias: '/topic/share/:topicId',
name: 'topic.share',
component: () => import(/* webpackChunkName: "article" */ './topic'),
meta: {
keepAlive: true
}
}, {
path: '/topic/:topicId/:topicName',
alias: '/topic/:topicId/:topicName',
name: 'topic',
... ... @@ -40,14 +48,6 @@ export default [{
statusBarColor: 'white'
}
}, {
path: '/topic/share/:topicId/:topicName',
alias: '/topic/share/:topicId/:topicName',
name: 'topic.share',
component: () => import(/* webpackChunkName: "article" */ './topic'),
meta: {
keepAlive: true
}
}, {
path: '/article/:articleId/comment',
alias: '/article/:articleId/comment',
name: 'article.comment',
... ...
... ... @@ -113,9 +113,10 @@ function init(qs) {
export default {
init,
setShareInfo(data) {
Object.assign(shareData, data);
shareData.link = shareData.link || location.href;
shareData.title = data.title;
shareData.desc = data.desc || '逛';
shareData.link = data.link || location.href;
shareData.imgUrl = data.imgUrl || shareData.imgUrl;
if (window.wx) {
setWxShareData();
... ...