From 27501b7b3ab1d78835e6f3c09da69a61c5f327a1 Mon Sep 17 00:00:00 2001 From: XHY Date: Mon, 30 Sep 2024 17:39:37 +0800 Subject: [PATCH] =?UTF-8?q?touch-events-bubbles=20=E7=A4=BA=E4=BE=8B?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=9D=90=E6=A0=87=E7=82=B9=EF=BC=8C=E9=80=82?= =?UTF-8?q?=E9=85=8D=20iOS16=E6=9C=BA=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../touch-events-bubbles.test.js | 8 +++--- .../global-events/touch-events-bubbles.uvue | 28 +++++++++++++++---- 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/pages/component/global-events/touch-events-bubbles.test.js b/pages/component/global-events/touch-events-bubbles.test.js index 709f68b7..aaad7b62 100644 --- a/pages/component/global-events/touch-events-bubbles.test.js +++ b/pages/component/global-events/touch-events-bubbles.test.js @@ -28,12 +28,12 @@ describe('touch-events-test', () => { let iconRect = await page.data('iconRect') let x = iconRect.x + iconRect.width / 2.0 - let y = iconRect.y + 5 + let y = iconRect.y + 25 // 滑动事件 await program.swipe({ startPoint: {x: x, y: y}, - endPoint: {x: x,y: y+35}, + endPoint: {x: x,y: y+15}, duration: 200 }) @@ -47,12 +47,12 @@ describe('touch-events-test', () => { let viewEleRect = await page.data('viewEleRect') let x = viewEleRect.x + viewEleRect.width / 2.0 - let y = viewEleRect.y + 5 + let y = viewEleRect.y + 25 // 滑动事件 await program.swipe({ startPoint: {x: x, y: y}, - endPoint: {x: x,y: y+35}, + endPoint: {x: x,y: y+15}, duration: 200 }) diff --git a/pages/component/global-events/touch-events-bubbles.uvue b/pages/component/global-events/touch-events-bubbles.uvue index 40279098..92cd145f 100644 --- a/pages/component/global-events/touch-events-bubbles.uvue +++ b/pages/component/global-events/touch-events-bubbles.uvue @@ -52,17 +52,33 @@ this.touchendValue = [] }, isPassTest1() { - let result = this.touchstartValue.join("") == "view1-3view1-2view1" && - this.touchmoveValue.join("") == "view1-3view1-2view1" && - this.touchendValue.join("") == "view1-3view1-2view1" + + let touchStart = this.touchstartValue.join("") + let touchMove = this.touchmoveValue.join("") + let touchEnd = this.touchendValue.join("") + console.log("touchStart: ", touchStart) + console.log("touchMove: ", touchMove) + console.log("touchEnd: ", touchEnd) + + let result = touchStart == "view1-3view1-2view1" && + touchMove == "view1-3view1-2view1" && + touchEnd == "view1-3view1-2view1" console.log('isPassTest1', result) this.ret1 = result this.clearValue() }, isPassTest2() { - let result = this.touchstartValue.join("") == "view2-3view2" && - this.touchmoveValue.join("") == "view2" && - this.touchendValue.join("") == "view2-3view2-2view2" + + let touchStart = this.touchstartValue.join("") + let touchMove = this.touchmoveValue.join("") + let touchEnd = this.touchendValue.join("") + console.log("touchStart: ", touchStart) + console.log("touchMove: ", touchMove) + console.log("touchEnd: ", touchEnd) + + let result = touchStart == "view2-3view2" && + touchMove == "view2" && + touchEnd == "view2-3view2-2view2" console.log('isPassTest2', result) this.ret2 = result this.clearValue() -- GitLab