From ebc6e7ee67f13e7aa311e737dfcb4c5caed112ee Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期四, 15 八月 2024 18:23:57 +0800
Subject: [PATCH] ll

---
 wechat_staff/pages/consult/consult.js |   49 ++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 44 insertions(+), 5 deletions(-)

diff --git a/wechat_staff/pages/consult/consult.js b/wechat_staff/pages/consult/consult.js
index 26539bb..86f3eb6 100644
--- a/wechat_staff/pages/consult/consult.js
+++ b/wechat_staff/pages/consult/consult.js
@@ -1,4 +1,5 @@
 import { getZhongTaiProductNewsPage, getCatalogList,actionDo,refreshEnjoy } from '../../api/index'
+let touchDot = 0
 Page({
 
   /**
@@ -7,6 +8,8 @@
   data: {
     category: [],
     secondCategory: [],
+    showCate: true,
+    animationData: {},
 
     catalogCode: '',
     tagCode: '',
@@ -15,14 +18,19 @@
     total: 0,
     pageNum: 1,
     pageSize: 10,
+    scrollTop: 0
 
     // height: 0,
     // top: 0,
   },
   onLoad(options) {
     this.getCate()
+    this.animation = wx.createAnimation({
+      duration: 500,
+      timingFunction: 'ease',
+    });
   },
-  onReachBottom() {
+  bindscrolltolower() {
     console.log('瑙﹀簳浜嬩欢');
     const { total, dataList, pageNum } = this.data
     if(total > dataList.length){
@@ -119,10 +127,41 @@
   onReady() {
 
   },
-
-  /**
-   * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鏄剧ず
-   */
+  bindscrolltoupper() {
+    this.setData({ showCate: true })
+    this.fadeIn();
+  },
+  touchstart(e){
+    touchDot = e.detail.scrollTop;
+  },
+  touchmove(e) {
+    var touchMove = e.detail.scrollTop;
+    if(touchMove - touchDot > 24){
+      touchDot = touchMove
+      this.fadeOut();
+    }
+    if(touchDot - touchMove > 24){
+      setTimeout(() => {
+        this.setData({ showCate: true })
+        this.fadeIn();
+      },200)
+    }
+  },
+  fadeIn: function () {
+    this.animation.opacity(1).step();
+    this.setData({
+      animationData: this.animation.export()
+    });
+  },
+  fadeOut: function () {
+    this.animation.opacity(0).step();
+    this.setData({
+      animationData: this.animation.export()
+    });
+    setTimeout(() => {
+      this.setData({ showCate: false });
+    }, 200); // 鍔ㄧ敾鎸佺画鏃堕棿
+  },
   onShow() {
     refreshEnjoy(this) 
   },

--
Gitblit v1.9.3