From 096b85b73ccc2b225bc6c4e71ed3294adae719b0 Mon Sep 17 00:00:00 2001 From: sws <1141121512@qq.com> Date: Thu, 26 Dec 2024 16:31:56 +0800 Subject: [PATCH] =?UTF-8?q?1.diy=E6=BB=9A=E5=8A=A8=E7=9B=91=E5=90=AC?= =?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/diy.vue | 4 +++- components/diy/header.vue | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/components/diy/diy.vue b/components/diy/diy.vue index d6b8015f..4d46634f 100644 --- a/components/diy/diy.vue +++ b/components/diy/diy.vue @@ -567,9 +567,11 @@ // 页面滚动事件 on_scroll_event(e) { const scroll_num = e.detail.scrollTop; - if ((scroll_num - 20) / (this.sticky_top + 33) <= 1) { + if (scroll_num / (this.sticky_top + 33) <= 1) { // 更新数据的逻辑 this.scroll_top = scroll_num; + } else { + this.scroll_top = this.sticky_top + 100; } this.scroll_timer_compute(scroll_num); }, diff --git a/components/diy/header.vue b/components/diy/header.vue index c6003a48..e5f348c9 100644 --- a/components/diy/header.vue +++ b/components/diy/header.vue @@ -209,10 +209,10 @@ const gradient = { color_list: up_slide_background_color_list, direction: up_slide_background_direction }; // 背景图 const back = { background_img: up_slide_background_img, background_img_style: up_slide_background_img_style }; - const up_slide_opacity = 'opacity:' + ((newVal - 20) / (this.header_top + 33) > 1 ? 1 : ((newVal - 20) / (this.header_top + 33)).toFixed(2)) + ';'; + const up_slide_opacity = 'opacity:' + ((newVal - 20) / this.header_top > 1 ? 1 : ((newVal - 20) / this.header_top).toFixed(2)) + ';'; this.up_slide_opacity = up_slide_opacity; // 来的logo要比新的隐藏的快,所以要比原来的logo快一点 - this.up_slide_old_logo_style = 'opacity:' + ((newVal - 5) / (this.header_top + 33) > 1 ? 0 : (1 - (newVal - 5) / (this.header_top + 33)).toFixed(2)) + ';'; + this.up_slide_old_logo_style = 'opacity:' + ((newVal - 5) / this.header_top > 1 ? 0 : (1 - (newVal - 5) / this.header_top).toFixed(2)) + ';'; // =0是大小误差 this.up_slide_style = gradient_computer(gradient) + up_slide_opacity; this.up_slide_img_style = background_computer(back);