From a2a1f48d731260453caf5e37afb5abe125f52827 Mon Sep 17 00:00:00 2001 From: iizmg Date: Mon, 25 May 2020 12:03:07 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8B=E6=8B=89=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/src/App.vue | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/admin/src/App.vue b/admin/src/App.vue index bece292..2320b31 100644 --- a/admin/src/App.vue +++ b/admin/src/App.vue @@ -236,7 +236,7 @@ //下拉刷新逻辑 { this.moveDistance = 0; - this.startY = e.targetTouches[0].clientY; + this.startY = 0; } }, //拖拽中 @@ -244,12 +244,20 @@ //下拉刷新逻辑 { let scrollTop = document.getElementsByClassName('el-scrollbar__wrap')[1].scrollTop; - if (scrollTop > 0) return; - let move = e.targetTouches[0].clientY - this.startY; + if (scrollTop > 0) { + return; + } else { + if (this.startY === 0) { + this.startY = e.targetTouches[0].clientY; + } + } + let y = e.targetTouches[0].clientY > window.innerHeight ? window.innerHeight : e.targetTouches[0].clientY; + let move = y - this.startY; if (move > 0) { e.preventDefault(); this.moveDistance = Math.pow(move, 0.8); - if (this.moveDistance > 50) { + // console.log(window.innerHeight, scrollTop, e.targetTouches[0].clientY, y, this.startY, move, this.moveDistance); + if (this.moveDistance > 100) { if (this.moveState === 1) return; this.moveState = 1; } else { @@ -263,8 +271,8 @@ touchEnd(e) { //下拉刷新逻辑 { - if (this.moveDistance > 50) { - this.moveDistance = 50; + if (this.moveDistance > 100) { + this.moveDistance = 100; this.$EventBus.$emit(glob.eventNames.globRefreshEventName); this.moveState = 0; } else {