From 00bf17838b496e6fcfed2e521f9c27f8f0e3e3c7 Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期一, 05 八月 2024 18:38:20 +0800
Subject: [PATCH] ‘’
---
wechat_jiaxuan/components/disProduct/index.js | 48 +++++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 43 insertions(+), 5 deletions(-)
diff --git a/wechat_jiaxuan/components/disProduct/index.js b/wechat_jiaxuan/components/disProduct/index.js
index 396306d..36c966b 100644
--- a/wechat_jiaxuan/components/disProduct/index.js
+++ b/wechat_jiaxuan/components/disProduct/index.js
@@ -1,5 +1,6 @@
import { getCatalogList, getCataLogTagList, getZhongTaiProductPage } from '../../api/index'
import { eventBus } from '../../utils/eventBus'
+let touchDot = 0
Component({
/**
* 缁勪欢鐨勫睘鎬у垪琛�
@@ -12,6 +13,10 @@
* 缁勪欢鐨勫垵濮嬫暟鎹�
*/
data: {
+ // 鍔ㄧ敾
+ showTouch: true,
+ animationData: {},
+
activeIndex: -1,
activeParam: [],
tagCodes: [],
@@ -24,7 +29,8 @@
total: 0,
query: '',
sortType: '',
- catalogCode: ""
+ catalogCode: "",
+ scrollTop: 0
},
pageLifetimes: {
show: function() {
@@ -61,8 +67,44 @@
getApp().globalData.catalogCode = ''
}, 2000)
}
+ 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() {
getCatalogList({
catalogCode: 'product_intro'
@@ -120,10 +162,6 @@
icon: 'none'
})
}
- },
- scrolltoupper() {
- this.setData({ pageNum: 1, datalist: [], total: 0 })
- this.getList()
},
cateClick(e) {
var {isLoading} = this.data
--
Gitblit v1.9.3