Authored by yyq

Merge remote-tracking branch 'origin/release/6.9.6' into feature/detailHeader

<template>
<div class="avatar-wrap">
<ImageFormat class="img-avatar" :lazy="lazy" :src="imageSrc" :width="width" :height="height" @error="errorHandle"></ImageFormat>
<ImageFormat class="img-avatar" :lazy="true" :src="imageSrc" :width="width" :height="height" @error="errorHandle"></ImageFormat>
<span v-if="identityClass" class="identity-icon" :class="identityClass"></span>
</div>
</template>
... ...
... ... @@ -30,7 +30,8 @@ export default {
code: 200,
data: {
detailList: [utils.processArticleListData(preData.value)]
}
},
local
};
} else {
return;
... ... @@ -57,14 +58,16 @@ export default {
commit(Types[`FETCH_${commitType}_SUCCESS`], {
data: result.data.detailList,
thumb,
articleId
articleId,
local: result.local
});
} else {
commit(Types[`FETCH_${commitType}_FAILD`], {
articleId,
thumb,
code: result.code,
message: result.message
message: result.message,
local: result.local
});
}
return result;
... ...
... ... @@ -291,7 +291,7 @@ export default {
[Types.FETCH_ARTICLE_SINGLE_DETAIL_REQUEST](state, topicId) {
state.fetchArticleSingleDetail = true;
},
[Types.FETCH_ARTICLE_SINGLE_DETAIL_SUCCESS](state, {data, thumb, articleId, result}) {
[Types.FETCH_ARTICLE_SINGLE_DETAIL_SUCCESS](state, {data, thumb, local, articleId, result}) {
state.fetchArticleSingleDetail = false;
let article = data[0] || {
... ... @@ -310,6 +310,11 @@ export default {
article.favoriteCount = 0;
article.praiseCount = 0;
}
article.local = local;
if (local) {
article.authorHeadIco = article.authorHeadIco.replace(/^https?:/, '');
}
if (article.sort === 2) {
let {width, height} = getArticleImageSize({
... ... @@ -321,7 +326,7 @@ export default {
article.imageWidth = parseInt(width, 10);
article.imageHeight = parseInt(height, 10);
if (thumb) {
if (local) {
article.coverImage = (article.coverImage || '').replace(/^https?:/, '');
}
} else {
... ... @@ -334,7 +339,7 @@ export default {
minScale: inx === 0 ? (3 / 4) : 0
});
if (thumb) {
if (local) {
img.contentData = img.contentData.replace(/^https?:/, '');
}
... ... @@ -345,7 +350,7 @@ export default {
const thumbArticle = state.articleSingleDetail[article.articleId];
if (thumbArticle && thumbArticle.thumb) {
if (thumbArticle && thumbArticle.local) {
if (article.sort === 2) {
article.bigImage = article.coverImage;
article.coverImage = thumbArticle.coverImage;
... ...