提交 27501b7b 编写于 作者: DCloud_iOS_XHY's avatar DCloud_iOS_XHY

touch-events-bubbles 示例调整坐标点,适配 iOS16机型

上级 635ecbac
...@@ -28,12 +28,12 @@ describe('touch-events-test', () => { ...@@ -28,12 +28,12 @@ describe('touch-events-test', () => {
let iconRect = await page.data('iconRect') let iconRect = await page.data('iconRect')
let x = iconRect.x + iconRect.width / 2.0 let x = iconRect.x + iconRect.width / 2.0
let y = iconRect.y + 5 let y = iconRect.y + 25
// 滑动事件 // 滑动事件
await program.swipe({ await program.swipe({
startPoint: {x: x, y: y}, startPoint: {x: x, y: y},
endPoint: {x: x,y: y+35}, endPoint: {x: x,y: y+15},
duration: 200 duration: 200
}) })
...@@ -47,12 +47,12 @@ describe('touch-events-test', () => { ...@@ -47,12 +47,12 @@ describe('touch-events-test', () => {
let viewEleRect = await page.data('viewEleRect') let viewEleRect = await page.data('viewEleRect')
let x = viewEleRect.x + viewEleRect.width / 2.0 let x = viewEleRect.x + viewEleRect.width / 2.0
let y = viewEleRect.y + 5 let y = viewEleRect.y + 25
// 滑动事件 // 滑动事件
await program.swipe({ await program.swipe({
startPoint: {x: x, y: y}, startPoint: {x: x, y: y},
endPoint: {x: x,y: y+35}, endPoint: {x: x,y: y+15},
duration: 200 duration: 200
}) })
......
...@@ -52,17 +52,33 @@ ...@@ -52,17 +52,33 @@
this.touchendValue = [] this.touchendValue = []
}, },
isPassTest1() { isPassTest1() {
let result = this.touchstartValue.join("") == "view1-3view1-2view1" &&
this.touchmoveValue.join("") == "view1-3view1-2view1" && let touchStart = this.touchstartValue.join("")
this.touchendValue.join("") == "view1-3view1-2view1" 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) console.log('isPassTest1', result)
this.ret1 = result this.ret1 = result
this.clearValue() this.clearValue()
}, },
isPassTest2() { isPassTest2() {
let result = this.touchstartValue.join("") == "view2-3view2" &&
this.touchmoveValue.join("") == "view2" && let touchStart = this.touchstartValue.join("")
this.touchendValue.join("") == "view2-3view2-2view2" 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) console.log('isPassTest2', result)
this.ret2 = result this.ret2 = result
this.clearValue() this.clearValue()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册