Authored by TaoHuang

fix video

... ... @@ -88,6 +88,7 @@ export default {
methods: {
onBack() {
if (this.yoho.homePage) {
this.$bus.$emit('beforeFinishPage');
this.$yoho.safetyInterface(() => {
this.$yoho.finishPage({});
});
... ...
... ... @@ -155,6 +155,16 @@ export default {
return;
},
beforeRouteEnter(to, from, next) {
next();
},
beforeRouteUpdate(to, from, next) {
this.$bus.$emit('beforeRouteUpdate');
next();
},
beforeRouteLeave(to, from, next) {
next();
},
mounted() {
this.colWidthForTwo = Math.floor(this.$el.offsetWidth / 2);
this.loadPreData(+this.$route.params.id);
... ...
... ... @@ -153,6 +153,7 @@ export default {
return;
}
this.$bus.$emit('beforeFinishPage');
this.reportClickArticle();
const url = `${window.location.origin}/grass/article/${this.data.articleId}`;
const query = {
... ...
... ... @@ -81,18 +81,10 @@ export default {
isRegister: false
};
},
activated() {
if (!this.isRegister) {
this.isRegister = true;
document.addEventListener('visibilitychange', () => {
if (document.hidden) {
this.refs.video && this.refs.video.pausePlayer();
}
});
}
},
deactivated() {
this.refs.video && this.refs.video.pausePlayer();
mounted() {
this.$bus.$once('beforeFinishPage', () => {
this.$refs.video && this.$refs.video.pausePlayer();
});
},
computed: {
...mapState(['articleStates', 'authorStates']),
... ...