From af37e0f005a8c45f80ec368f87b6950146706669 Mon Sep 17 00:00:00 2001 From: gongfuxiang Date: Thu, 21 Apr 2022 00:46:05 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E6=90=9C=E7=B4=A2=E5=92=8C?= =?UTF-8?q?=E5=AF=BC=E8=88=AA=E5=9B=BA=E5=AE=9A=E6=8E=A7=E5=88=B6=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/index/index.vue | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/pages/index/index.vue b/pages/index/index.vue index fc41918e..8cd7fd71 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -9,7 +9,7 @@ - + @@ -451,24 +451,26 @@ }, // 页面滚动监听 - onPageScroll(e) { - var top = e.scrollTop > 35 ? 35 : e.scrollTop; - var num = top*7; - var base = 230; - // #ifdef MP-ALIPAY - base = 235 - // #endif - // #ifdef H5 || APP - var len = (this.right_icon_list || []).length; - base = (len <= 0) ? 0 : 66*len; - // #endif - // 开启哀悼插件的时候不需要浮动导航并且搜索框也不需要缩短、开启站点灰度会导致浮动失效 - if((this.plugins_mourning_data || 0) != 1) { - var val = (num > base) ? base : num; - this.setData({ - search_style: 'width: calc(100% - '+val+'rpx);', - search_is_fixed: (top >= 35) ? 1 : 0, - }); + onPageScroll(e) { + if(this.common_app_is_header_nav_fixed == 1 && this.common_app_is_enable_search == 1) { + var top = e.scrollTop > 35 ? 35 : e.scrollTop; + var num = top*7; + var base = 230; + // #ifdef MP-ALIPAY + base = 235 + // #endif + // #ifdef H5 || APP + var len = (this.right_icon_list || []).length; + base = (len <= 0) ? 0 : 66*len; + // #endif + // 开启哀悼插件的时候不需要浮动导航并且搜索框也不需要缩短、开启站点灰度会导致浮动失效 + if((this.plugins_mourning_data || 0) != 1) { + var val = (num > base) ? base : num; + this.setData({ + search_style: 'width: calc(100% - '+val+'rpx);', + search_is_fixed: (top >= 35) ? 1 : 0, + }); + } } },