Authored by TaoHuang

fix

... ... @@ -43,6 +43,7 @@ import ArticleItemTopics from '../article/article-item-topics';
import ArticleDetailFooter from './article-footer';
import ArticleItemSlideImage from '../article/article-item-slide-image';
import ArticleDetailHeader from './article-header';
import YAS from 'utils/yas-constants';
import {mapState, mapMutations, createNamespacedHelpers} from 'vuex';
const {mapState: mapArticleState} = createNamespacedHelpers('article');
... ... @@ -77,7 +78,7 @@ export default {
this.downgrade = true;
}
this.handleRechText();
this.handleRichText();
},
computed: {
...mapState(['yoho']),
... ... @@ -141,7 +142,7 @@ export default {
},
watch: {
'data.richText': function() {
this.handleRechText();
this.handleRichText();
}
},
methods: {
... ... @@ -168,11 +169,25 @@ export default {
},
onActionComment() {
},
handleRechText() {
handleRichText() {
let vm = this;
this.$nextTick(() => {
this.$refs.richText && this.$refs.richText.querySelectorAll('a').forEach(ele => {
if (ele.querySelector('img')) {
ele.classList.add('yoho-img-link');
ele.addEventListener('click', function() {
vm.$store.dispatch('reportYas', {
params: {
appop: YAS.eventName.articleImageClick,
param: {
ARTICLE_ID: vm.data.articleId,
URL: ele.getAttribute('href')
}
}
});
});
}
});
});
... ...
... ... @@ -21,6 +21,7 @@ export default {
productFav: 'YB_STROLL_ARC_RLT_PRD_COL_C',
labelClick: 'YB_STROLL_ACT_LBL_C',
topicFollow: 'YB_STROLL_TOPIC_ATT_C',
detailShow: 'YB_STROLL_CONT'
detailShow: 'YB_STROLL_CONT',
articleImageClick: 'YB_ARTICLE_IMAGE_CLICK'
}
};
... ...