Commit 532c27cb authored by 郭志伟's avatar 郭志伟

fix: 问题调试

parent 6f1502a7
......@@ -78,7 +78,12 @@ export default class Activity extends Mixins(TransformStyleMixin, SaMixin) {
mounted() {
this.targetEle = document.querySelector('body');
this.showBackTop = true;
isApp && setAppTitleColor(this.pageData.props.titleBgColor);
this.pageVisibilityChange();
if (isApp) {
this.$nextTick(() => {
setAppTitleColor(this.pageData.props.titleBgColor);
});
}
}
fetchApi(options) {
const { store, route } = options;
......@@ -121,7 +126,28 @@ export default class Activity extends Mixins(TransformStyleMixin, SaMixin) {
hideBottomBtns(state) {
this.showBackTop = state;
}
pageVisibilityChange() {
if (EASY_ENV_IS_NODE) return;
let hidden = 'hidden';
let visibilityChange = 'visibilitychange';
if (typeof document.hidden !== 'undefined') {
hidden = 'hidden';
visibilityChange = 'visibilitychange';
} else if (typeof document.webkitHidden !== 'undefined') {
hidden = 'webkitHidden';
visibilityChange = 'webkitvisibilitychange';
}
window.addEventListener(visibilityChange, () => {
this.handleChange(document[hidden]);
}, false);
}
handleChange(state) {
if (!state) {
if (isApp) {
setAppTitleColor(this.pageData.props.titleBgColor);
}
}
}
modfiTabsStyle() {
const tabsEle = document.querySelector('.tabs');
// console.log('tabsEle', tabsEle);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment