Authored by yyq

fix

... ... @@ -79,7 +79,8 @@ export default {
page: this.page,
authorUid: this.authorUid,
authorType: this.authorType,
type: this.type
type: this.type,
columnType: 1002
});
if (result.code === 200) {
... ...
... ... @@ -24,6 +24,7 @@ export default {
return {
page: 1,
id: 0,
columnType: 1001,
sceneId: YAS.scene.list,
userUid: -1
};
... ... @@ -32,7 +33,12 @@ export default {
this.id = +this.$route.params.id;
},
activated() {
if (+this.$route.params.id !== this.id) {
let {columnType} = this.$route.query;
columnType = columnType || 1001;
if (+this.$route.params.id !== this.id || this.columnType !== +columnType) {
this.columnType = +columnType;
this.id = +this.$route.params.id;
this.init();
}
... ... @@ -59,16 +65,16 @@ export default {
this.$refs.article.init();
},
async onFetch() {
const {columnType} = this.$route.query;
const articleId = parseInt(this.id, 10);
if (!articleId) {
return;
}
const result = await this.fetchArticleList({
articleId,
page: this.page,
columnType
columnType: this.columnType
});
if (result.code === 200) {
... ...
... ... @@ -246,15 +246,21 @@ export default {
this.headerAnimateStep = 0;
this.fetchTopicSimpleInfo({topicId: this.topicId}).then(res => {
let {topicName, topicImageUrl, topicDesc} = get(res, 'data') || {};
if (this.share) {
document && (document.title = topicName);
}
if (this.share && !this.$yoho.isApp && res.code === 200) {
Share.setShareInfo({
title: res.data.topicName,
imgUrl: res.data.topicImageUrl,
desc: '我在有货的社区发现一个热门话题。' + res.data.topicDesc,
title: topicName,
imgUrl: topicImageUrl,
desc: '我在有货的社区发现一个热门话题。' + topicDesc,
});
}
if (!get(res, 'data.topicImageUrl')) {
if (!topicImageUrl) {
this.headerAnimateStep = 100;
}
... ...
... ... @@ -103,11 +103,13 @@ export default {
setShareInfo(data) {
Object.assign(shareData, data);
window.setShareInfo && window.setShareInfo({
title: shareData.title,
summary: shareData.desc,
pic: shareData.imgUrl,
url: shareData.link || location.href
});
setTimeout(function() {
window.setShareInfo({
title: shareData.title,
summary: shareData.desc,
pic: shareData.imgUrl,
url: shareData.link || location.href
});
}, window.setShareInfo ? 0 : 300);
}
}
... ...