From f2357b6bb06c9f6c947645289a3d56278fb74fe9 Mon Sep 17 00:00:00 2001 From: sws <1141121512@qq.com> Date: Thu, 17 Oct 2024 17:28:36 +0800 Subject: [PATCH 1/2] =?UTF-8?q?1.=E9=A1=B6=E9=83=A8=E5=AF=BC=E8=88=AA?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/diy/article-tabs.vue | 8 ++++++-- components/diy/diy.vue | 15 ++++++++------- components/diy/goods-tabs.vue | 6 ++++-- components/diy/header.vue | 8 +++++--- components/diy/tabs.vue | 4 ++-- 5 files changed, 25 insertions(+), 16 deletions(-) diff --git a/components/diy/article-tabs.vue b/components/diy/article-tabs.vue index b64d9b06..f13a9793 100644 --- a/components/diy/article-tabs.vue +++ b/components/diy/article-tabs.vue @@ -68,7 +68,7 @@ }, watch: { propScrollTop(newVal) { - if (newVal + this.propTop + this.custom_nav_height >= this.tabs_top && this.top_up == '1') { + if (newVal + this.propTop + this.custom_nav_height > this.tabs_top && this.top_up == '1') { let new_style = this.propValue.style || {}; let tabs_bg = new_style.common_style.color_list; let new_tabs_background = ''; @@ -82,8 +82,12 @@ this.setData({ tabs_background: (new_tabs_background.length > 0 ? new_tabs_background : 'background:#fff;') + new_tabs_background_img, }); + console.log(1); } else { - this.tabs_background = 'background:transparent'; + this.setData({ + tabs_background: 'background:transparent', + }); + console.log(2); } }, propkey(val) { diff --git a/components/diy/diy.vue b/components/diy/diy.vue index dbbdace2..1245263b 100644 --- a/components/diy/diy.vue +++ b/components/diy/diy.vue @@ -289,14 +289,15 @@ // 判断顶部导航是否置顶 is_header_top: parseInt(this.propValue.header.com_data.style.up_slide_display) == 1 ? true : false, temp_sticky_top: this.sticky_top, - // temp_header_top: `calc(${this.sticky_top}px + 66rpx + ${parseInt(this.propValue.header.com_data.style.data_alone_row_space || 5) * 2}rpx + ${this.propValue.header.com_data.content.data_alone_row_value.length > 0 ? '66rpx' : '0rpx'});`, - temp_header_top: `calc(${this.sticky_top}px + 66rpx + 40rpx + 66rpx);`, - header_top: `calc(${this.sticky_top}px + 66rpx + 40rpx + 66rpx);`, + temp_header_top: `calc(${this.sticky_top}px + 66rpx + ${parseInt(this.propValue.header.com_data.style.data_alone_row_space || 5) * 2}rpx + ${this.propValue.header.com_data.content.data_alone_row_value.length > 0 ? '66rpx' : '0rpx'});`, + header_top: `calc(${this.sticky_top}px + 66rpx + ${parseInt(this.propValue.header.com_data.style.data_alone_row_space || 5) * 2}rpx + ${this.propValue.header.com_data.content.data_alone_row_value.length > 0 ? '66rpx' : '0rpx'});`, + // temp_header_top: `calc(${this.sticky_top}px + 66rpx + 40rpx + 66rpx);`, + // header_top: `calc(${this.sticky_top}px + 66rpx + 40rpx + 66rpx);`, // 顶部导航高度是否变化-------------------------------------------------- - // is_search_alone_row: this.propValue.header.com_data.content.data_alone_row_value.length > 0 ? true : false, - // data_alone_row_space: parseInt(this.propValue.header.com_data.style.data_alone_row_space || 5), - is_search_alone_row: true, - data_alone_row_space: 20, + is_search_alone_row: this.propValue.header.com_data.content.data_alone_row_value.length > 0 ? true : false, + data_alone_row_space: parseInt(this.propValue.header.com_data.style.data_alone_row_space || 5), + // is_search_alone_row: true, + // data_alone_row_space: 20, }); // 缓存数据 diff --git a/components/diy/goods-tabs.vue b/components/diy/goods-tabs.vue index 4a08f7fe..59cec5a3 100644 --- a/components/diy/goods-tabs.vue +++ b/components/diy/goods-tabs.vue @@ -71,7 +71,7 @@ }, watch: { propScrollTop(newVal) { - if (newVal + this.propTop + this.custom_nav_height >= this.tabs_top && this.top_up == '1') { + if (newVal + this.propTop + this.custom_nav_height > this.tabs_top && this.top_up == '1') { let new_style = this.propValue.style || {}; let tabs_bg = new_style.common_style.color_list; let new_tabs_background = ''; @@ -86,7 +86,9 @@ tabs_background: (new_tabs_background.length > 0 ? new_tabs_background : 'background:#fff;') + new_tabs_background_img, }); } else { - this.tabs_background = 'background:transparent'; + this.setData({ + tabs_background: 'background:transparent', + }); } }, propkey(val) { diff --git a/components/diy/header.vue b/components/diy/header.vue index fc577c33..88adf007 100644 --- a/components/diy/header.vue +++ b/components/diy/header.vue @@ -72,13 +72,13 @@ - + - + @@ -155,6 +155,7 @@ // 判断header的查询是否独行 is_search_alone_row: false, is_icon_alone_row: false, + data_alone_row_space: 0, }; }, watch: { @@ -219,7 +220,8 @@ header_background_type: header_background_type, is_immersion_model: header_background_type !== 'color_image' && immersive_style == '1', is_search_alone_row: new_content.data_alone_row_value.includes('search'), - is_icon_alone_row: new_content.data_alone_row_value.includes('icon') + is_icon_alone_row: new_content.data_alone_row_value.includes('icon'), + data_alone_row_space: new_style.data_alone_row_space, }); this.$emit('immersion-model-call-back', this.is_immersion_model); }, diff --git a/components/diy/tabs.vue b/components/diy/tabs.vue index 5c2a5d0f..6bc8f307 100644 --- a/components/diy/tabs.vue +++ b/components/diy/tabs.vue @@ -29,8 +29,8 @@ }, // 置顶距离顶部高度 propTop: { - type: Number, - default: 0, + type: String, + default: '0', }, // 是否导航栏置顶 propNavIsTop: { From 3066154e5eb8df87f6dbf18fc8bc7568030e6077 Mon Sep 17 00:00:00 2001 From: sws <1141121512@qq.com> Date: Thu, 17 Oct 2024 18:01:19 +0800 Subject: [PATCH 2/2] =?UTF-8?q?1.=E9=A1=B6=E9=83=A8=E5=AF=BC=E8=88=AA?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/diy/article-tabs.vue | 11 ++++++++++- components/diy/goods-tabs.vue | 11 ++++++++++- components/diy/header.vue | 3 +++ 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/components/diy/article-tabs.vue b/components/diy/article-tabs.vue index f13a9793..2c5ba72f 100644 --- a/components/diy/article-tabs.vue +++ b/components/diy/article-tabs.vue @@ -64,11 +64,20 @@ tabs_background: 'background:transparent', custom_nav_height: 33, diy_key: '', + // #ifdef MP + nav_safe_space: bar_height + 5, + // #endif + // #ifdef H5 || MP-TOUTIAO + nav_safe_space: bar_height + 7, + // #endif + // #ifdef APP + nav_safe_space: bar_height + 0, + // #endif }; }, watch: { propScrollTop(newVal) { - if (newVal + this.propTop + this.custom_nav_height > this.tabs_top && this.top_up == '1') { + if (newVal + this.propTop + this.custom_nav_height > this.tabs_top + this.nav_safe_space && this.top_up == '1') { let new_style = this.propValue.style || {}; let tabs_bg = new_style.common_style.color_list; let new_tabs_background = ''; diff --git a/components/diy/goods-tabs.vue b/components/diy/goods-tabs.vue index 59cec5a3..05e7687a 100644 --- a/components/diy/goods-tabs.vue +++ b/components/diy/goods-tabs.vue @@ -67,11 +67,20 @@ tabs_background: 'background:transparent', custom_nav_height: 33, diy_key: '', + // #ifdef MP + nav_safe_space: bar_height + 5, + // #endif + // #ifdef H5 || MP-TOUTIAO + nav_safe_space: bar_height + 7, + // #endif + // #ifdef APP + nav_safe_space: bar_height + 0, + // #endif }; }, watch: { propScrollTop(newVal) { - if (newVal + this.propTop + this.custom_nav_height > this.tabs_top && this.top_up == '1') { + if (newVal + this.propTop + this.custom_nav_height > this.tabs_top + this.nav_safe_space && this.top_up == '1') { let new_style = this.propValue.style || {}; let tabs_bg = new_style.common_style.color_list; let new_tabs_background = ''; diff --git a/components/diy/header.vue b/components/diy/header.vue index 1964fe1b..a048e79b 100644 --- a/components/diy/header.vue +++ b/components/diy/header.vue @@ -125,6 +125,7 @@ text_style: '', header_style: 'max-width:100%', common_app_is_header_nav_fixed: 0, + // 5,7,0 是误差,, 12 是下边距,66是高度,bar_height是不同小程序下的导航栏距离顶部的高度 // #ifdef MP top_content_style: 'padding-top:' + (bar_height + 5) + 'px;padding-bottom:12px;', // #endif @@ -138,9 +139,11 @@ // 顶部背景样式类别 header_background_type: 'color_image', // #ifdef MP + sticky_top: bar_height + 5, header_top: bar_height + 5 + 12 + 33, // #endif // #ifdef H5 || MP-TOUTIAO + sticky_top: bar_height + 7 + 12, header_top: bar_height + 7 + 12 + 33, // #endif // #ifdef APP