From 2aab00f91bd4cda4715f1a141f4d26a3667a91b6 Mon Sep 17 00:00:00 2001
From: yiming <m13691596795@163.com>
Date: 星期五, 12 四月 2024 12:01:20 +0800
Subject: [PATCH] 视频详情bug

---
 pages/home/home.js |   31 ++++++++++++++++++++-----------
 1 files changed, 20 insertions(+), 11 deletions(-)

diff --git a/pages/home/home.js b/pages/home/home.js
index 063db05..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: [], //鐩綍
@@ -36,7 +37,8 @@
     shoppingCartGetId: [],
     baseRefresh: {
       value: false
-    }
+    },
+    loading: true
   },
   onShow() {
     this.loadHomePage();
@@ -111,11 +113,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 +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