From b2d360d9113b6955287108ca9e90d76a1f3c1419 Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期日, 29 九月 2024 15:05:11 +0800
Subject: [PATCH] Merge branch 'master' of http://139.186.142.91:10010/r/productDev/zbomyoujia
---
wechat_staff/pages/consult/consult.js | 53 +++++++++++++++++++++++++++++++++++++++--------------
1 files changed, 39 insertions(+), 14 deletions(-)
diff --git a/wechat_staff/pages/consult/consult.js b/wechat_staff/pages/consult/consult.js
index b1f84a0..86f3eb6 100644
--- a/wechat_staff/pages/consult/consult.js
+++ b/wechat_staff/pages/consult/consult.js
@@ -9,6 +9,7 @@
category: [],
secondCategory: [],
showCate: true,
+ animationData: {},
catalogCode: '',
tagCode: '',
@@ -24,13 +25,17 @@
},
onLoad(options) {
this.getCate()
+ this.animation = wx.createAnimation({
+ duration: 500,
+ timingFunction: 'ease',
+ });
},
bindscrolltolower() {
console.log('瑙﹀簳浜嬩欢');
const { total, dataList, pageNum } = this.data
if(total > dataList.length){
this.setData({ pageNum: pageNum + 1 })
- this.getList(false)
+ this.getList()
}else{
wx.showToast({
title: '鏆傛棤鏇村鏁版嵁',
@@ -83,7 +88,7 @@
})
}
},
- getList(showCate = true) {
+ getList() {
const { pageNum, pageSize, catalogCode, tagCode, query } = this.data
getZhongTaiProductNewsPage({
pageNum, pageSize, query, catalogCode: tagCode || catalogCode
@@ -91,8 +96,7 @@
if(res.data){
this.setData({
dataList: [ ...this.data.dataList, ...res.data.records ],
- total: res.data.total,
- showCate
+ total: res.data.total
})
}
@@ -123,19 +127,40 @@
onReady() {
},
+ bindscrolltoupper() {
+ this.setData({ showCate: true })
+ this.fadeIn();
+ },
touchstart(e){
- // touchDot = e.touches[0].pageY;
- console.log('寮�濮�', e);
+ touchDot = e.detail.scrollTop;
},
touchmove(e) {
- // var touchMove = e.touches[0].pageY;
- console.log('touchMove', e);
- // if(touchDot - touchMove > 60){
- // this.setData({ showCate: false })
- // }
- // if(touchMove - touchDot > 60){
- // this.setData({ showCate: true })
- // }
+ 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