From 0e8294d54cac0bf774be22ed61c5238fd29fc558 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8E=E8=82=96=E7=A3=8A?= <18851179580@163.com> Date: Wed, 22 Jan 2025 14:20:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=A4=B4=E9=83=A8=E8=83=B6?= =?UTF-8?q?=E5=9B=8A=E5=A4=84=E7=90=86=E7=9A=84=E6=98=BE=E7=A4=BA=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/diy/header.vue | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/components/diy/header.vue b/components/diy/header.vue index 98c31dbb..cfa6415b 100644 --- a/components/diy/header.vue +++ b/components/diy/header.vue @@ -255,9 +255,14 @@ let new_text_style = `font-weight:${new_style.header_background_title_typeface}; font-size: ${new_style.header_background_title_size * 2}rpx; color: ${new_style.header_background_title_color};`; // #ifndef MP-TOUTIAO // #ifdef MP - const custom = uni.getMenuButtonBoundingClientRect(); - menu_button_info = `max-width:calc(100% - ${custom.width + 10}px);`; - new_text_style += `right:-${custom.width + 10}px;`; + // 判断是否有胶囊 + const is_current_single_page = app.globalData.is_current_single_page(); + // 如果有胶囊的时候,做处理 + if (is_current_single_page == 0) { + const custom = uni.getMenuButtonBoundingClientRect(); + menu_button_info = `max-width:calc(100% - ${custom.width + 10}px);`; + new_text_style += `right:-${custom.width + 10}px;`; + } // #endif // #endif const { location_margin = this.old_margin } = new_style;