From 69a1b05bf19d29c91f190873a842391b0c9be370 Mon Sep 17 00:00:00 2001 From: 闫增涛 <1829501689@qq.com> Date: 星期五, 12 四月 2024 09:42:10 +0800 Subject: [PATCH] 答题器听力题播放完善,样式优化 --- pages/home/home.js | 22 ++++++++++++++-------- 1 files changed, 14 insertions(+), 8 deletions(-) diff --git a/pages/home/home.js b/pages/home/home.js index 1522c7c..4b721d9 100644 --- a/pages/home/home.js +++ b/pages/home/home.js @@ -11,6 +11,7 @@ barHeight: '', navBarHeight: '', searchVal: '', + scoll: false, isWhite: false, userInfo: {}, tabList: [], //鐩綍 @@ -589,17 +590,22 @@ // 鐩戝惉婊氬姩鏉� onScroll(e) { - this.setData({ - isWhite: true - }) - this.setData({ - isWhite: e.detail.scrollTop > 20 ? true : false - }) + if (this.data.scoll) { + if (e.detail.scrollTop < 20) { + this.data.scoll = false + this.isChange(false); + } + } else { + if (e.detail.scrollTop > 20) { + this.data.scoll = true + this.isChange(true); + } + } }, - onScrollToTop(e) { + isChange(data) { this.setData({ - isWhite: e.detail.scrollTop > 50 ? true : false + isWhite: data }) }, -- Gitblit v1.9.1