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_jiaxuan/pages/consult/consult.js |   51 ++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 50 insertions(+), 1 deletions(-)

diff --git a/wechat_jiaxuan/pages/consult/consult.js b/wechat_jiaxuan/pages/consult/consult.js
index 81f1f32..bba30d3 100644
--- a/wechat_jiaxuan/pages/consult/consult.js
+++ b/wechat_jiaxuan/pages/consult/consult.js
@@ -1,4 +1,5 @@
 import { getZhongTaiProductNewsPage, getCatalogList,actionDo } from '../../api/index'
+let touchDot = 0
 Page({
 
   /**
@@ -7,6 +8,8 @@
   data: {
     category: [],
     secondCategory: [],
+    showCate: true,
+    animationData: {},
 
     catalogCode: '',
     tagCode: '',
@@ -21,6 +24,10 @@
   },
   onLoad(options) {
     this.getCate()
+    this.animation = wx.createAnimation({
+      duration: 500,
+      timingFunction: 'ease',
+    });
   },
   onReachBottom() {
     console.log('瑙﹀簳浜嬩欢');
@@ -122,7 +129,43 @@
   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){
+      touchDot = touchMove
+      setTimeout(() => {
+        this.setData({ showCate: true })
+        this.fadeIn();
+      }, 300)
+    }
+  },
+  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 });
+    }, 300); // 鍔ㄧ敾鎸佺画鏃堕棿
+  },
   /**
    * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鏄剧ず
    */
@@ -147,6 +190,12 @@
    * 鐢ㄦ埛鐐瑰嚮鍙充笂瑙掑垎浜�
    */
   onShareAppMessage() {
-
+    let { info } = this.data
+    console.log('鐐瑰嚮浜嗗垎浜�')
+    if(info.users && info.users.userId){
+      return {
+        path: '/pages/detailDis/product?id=' + info.id + '&userId=' + info.users.id
+      }
+    }
   }
 })
\ No newline at end of file

--
Gitblit v1.9.3