From 558845242a07b68f42fa1802c45ab2769395d8b8 Mon Sep 17 00:00:00 2001 From: 闫增涛 <1829501689@qq.com> Date: 星期一, 29 四月 2024 14:31:30 +0800 Subject: [PATCH] 合并代码 --- pages/home/home.js | 36 ++++++++++++++++++++++++------------ 1 files changed, 24 insertions(+), 12 deletions(-) diff --git a/pages/home/home.js b/pages/home/home.js index 063db05..54de09d 100644 --- a/pages/home/home.js +++ b/pages/home/home.js @@ -11,6 +11,7 @@ barHeight: '', navBarHeight: '', searchVal: '', + scoll: false, isWhite: false, userInfo: {}, tabList: [], //鐩綍 @@ -36,9 +37,14 @@ shoppingCartGetId: [], baseRefresh: { value: false - } + }, + loading: true }, onShow() { + this.setData({ + searchVal: "", + }); + console.log(this.data.searchVal) this.loadHomePage(); this.getBannerList() @@ -111,11 +117,13 @@ const item = res.datas[i] list.push({ value: item.icon, - link: item.jsek_link + link: item.jsek_link, + }) } this.setData({ - bannerList: list + bannerList: list, + loading: false }) }) }, @@ -586,17 +594,21 @@ // 鐩戝惉婊氬姩鏉� 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