This commit is contained in:
2026-07-23 14:05:47 +08:00
parent c7e71a6219
commit f992db5738
+2 -49
View File
@@ -1,6 +1,6 @@
<template> <template>
<view class="mine_warp" :class="platformType ? '' : 'iosplatformType'"> <view class="mine_warp" :class="platformType ? '' : 'iosplatformType'">
<view class="mine_header" :style="headerStyle"> <view class="mine_header">
<view class="mine_login_data" v-if="currentUserData && Object.keys(currentUserData).length !== 0"> <view class="mine_login_data" v-if="currentUserData && Object.keys(currentUserData).length !== 0">
<view class="mine_data"> <view class="mine_data">
<up-image <up-image
@@ -414,14 +414,9 @@ export default {
platformType: true, platformType: true,
kefuUnreadCount: 0, kefuUnreadCount: 0,
kefuUnreadTimer: null, kefuUnreadTimer: null,
headerStyle: {},
}; };
}, },
created() {
this.headerStyle = this.calcHeaderStyle();
},
onShow() { onShow() {
this.headerStyle = this.calcHeaderStyle();
this.userData = getStorageFun(USER_DATA); this.userData = getStorageFun(USER_DATA);
/*#ifdef APP-PLUS*/ /*#ifdef APP-PLUS*/
uni.hideTabBar({ uni.hideTabBar({
@@ -441,50 +436,8 @@ export default {
onUnload() { onUnload() {
this.stopKefuUnreadPolling(); this.stopKefuUnreadPolling();
}, },
mounted() { mounted() { },
this.headerStyle = this.calcHeaderStyle();
},
methods: { methods: {
calcHeaderStyle() {
let paddingTop = '90rpx';
let paddingRight = '30rpx';
// #ifdef MP-WEIXIN || MP
try {
const menuButton = uni.getMenuButtonBoundingClientRect();
const sysInfo = uni.getSystemInfoSync();
if (menuButton && menuButton.top && menuButton.top > 0) {
paddingTop = (menuButton.top + 2) + 'px';
if (sysInfo && sysInfo.windowWidth && menuButton.left) {
paddingRight = (sysInfo.windowWidth - menuButton.left + 10) + 'px';
}
} else {
const statusBarHeight = (sysInfo && sysInfo.statusBarHeight) || 20;
paddingTop = (statusBarHeight + 10) + 'px';
paddingRight = '96px';
}
} catch (e) {
paddingTop = '90rpx';
paddingRight = '96px';
}
// #endif
// #ifdef APP-PLUS
try {
const sysInfo = uni.getSystemInfoSync();
if (sysInfo && sysInfo.statusBarHeight) {
paddingTop = (sysInfo.statusBarHeight + 10) + 'px';
}
} catch (e) {
paddingTop = '90rpx';
}
// #endif
return {
paddingTop,
paddingRight
};
},
copyData, copyData,
async refreshKefuUnreadCount() { async refreshKefuUnreadCount() {
const userId = this.currentUserData && this.currentUserData.id; const userId = this.currentUserData && this.currentUserData.id;