From 66fbb1ea7c1ee4bf4353d0ffa16ff14a1a718c8f Mon Sep 17 00:00:00 2001
From: yiming <m13691596795@163.com>
Date: 星期四, 06 六月 2024 18:39:56 +0800
Subject: [PATCH] 数字教材icon

---
 pages/home/home.js |   28 +++++++++++++++++++---------
 1 files changed, 19 insertions(+), 9 deletions(-)

diff --git a/pages/home/home.js b/pages/home/home.js
index 1522c7c..0feef1c 100644
--- a/pages/home/home.js
+++ b/pages/home/home.js
@@ -11,6 +11,7 @@
     barHeight: '',
     navBarHeight: '',
     searchVal: '',
+    scoll: false,
     isWhite: false,
     userInfo: {},
     tabList: [], //鐩綍
@@ -40,6 +41,10 @@
     loading: true
   },
   onShow() {
+    this.setData({
+      searchVal: "",
+    });
+    console.log(this.data.searchVal)
     this.loadHomePage();
     this.getBannerList()
 
@@ -146,6 +151,7 @@
   //鐐瑰嚮鐩綍
   toPages(item) {
     let info = item.target.dataset.info
+    console.log(info);
     if (info.url) {
       if (info.text == "鍥句功鏈嶅姟") {
         wx.switchTab({
@@ -589,17 +595,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