From 2da083225417ef7007842b84e7276242faeb0e35 Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期一, 05 八月 2024 16:18:58 +0800
Subject: [PATCH] lll
---
wechat_jiaxuan/components/disCase/index.js | 41 +++++++++++++++++++++++++++++++++++++++++
1 files changed, 41 insertions(+), 0 deletions(-)
diff --git a/wechat_jiaxuan/components/disCase/index.js b/wechat_jiaxuan/components/disCase/index.js
index f04978a..60a366a 100644
--- a/wechat_jiaxuan/components/disCase/index.js
+++ b/wechat_jiaxuan/components/disCase/index.js
@@ -1,5 +1,6 @@
import { getCataLogTagList, getZhongTaiWholecasePage, actionDo } from '../../api/index'
import { eventBus } from '../../utils/eventBus'
+let touchDot = 0
Component({
/**
* 缁勪欢鐨勫睘鎬у垪琛�
@@ -8,6 +9,10 @@
menuButtonInfo: Object
},
data: {
+ // 鍔ㄧ敾
+ showTouch: true,
+ animationData: {},
+
activeIndex: -1,
activeParam: [],
selParam: '',
@@ -49,8 +54,44 @@
attached() {
this.getCatelist()
this.getList()
+ this.animation = wx.createAnimation({
+ duration: 600,
+ timingFunction: 'ease',
+ });
},
methods: {
+ bindscrolltoupper() {
+ this.setData({ showTouch: true })
+ this.fadeIn();
+ },
+ touchstart(e){
+ touchDot = e.detail.scrollTop;
+ },
+ touchmove(e) {
+ var touchMove = e.detail.scrollTop;
+ if(touchMove - touchDot > 60){
+ this.fadeOut();
+ }
+ if(touchDot - touchMove > 60){
+ this.fadeIn();
+ this.setData({ showTouch: true })
+ }
+ },
+ 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({ showTouch: false });
+ }, 500); // 鍔ㄧ敾鎸佺画鏃堕棿
+ },
getCatelist() {
const { catalogCode } = this.data
getCataLogTagList({
--
Gitblit v1.9.3