提交 742aa9e5 编写于 作者: taohebin@dcloud.io's avatar taohebin@dcloud.io

update: overflow-visible-event.uvue 自动化测试例获取位置的辅助方法

# Conflicts:
#	pages/CSS/overflow/overflow-visible-event.uvue
上级 5a79fd22
...@@ -104,8 +104,10 @@ ...@@ -104,8 +104,10 @@
if (uni.getSystemInfoSync().platform == 'android'){ if (uni.getSystemInfoSync().platform == 'android'){
ratio = uni.getSystemInfoSync().devicePixelRatio ratio = uni.getSystemInfoSync().devicePixelRatio
} }
this.jest_click_x = rect.x * ratio + 10 const systemInfo = uni.getSystemInfoSync()
this.jest_click_y = rect.bottom * ratio - 10 const titleBarHeight = systemInfo.screenHeight - systemInfo.windowHeight
this.jest_click_x = rect.x * ratio + 30
this.jest_click_y = rect.bottom * ratio - 30
} }
}, },
jest_getParentRect() { jest_getParentRect() {
...@@ -129,8 +131,8 @@ ...@@ -129,8 +131,8 @@
if (uni.getSystemInfoSync().platform == 'android'){ if (uni.getSystemInfoSync().platform == 'android'){
ratio = uni.getSystemInfoSync().devicePixelRatio ratio = uni.getSystemInfoSync().devicePixelRatio
} }
this.jest_click_x = rect.x * ratio + 10 this.jest_click_x = rect.x * ratio + 30
this.jest_click_y = (rect.top + titleBarHeight + 10) * ratio this.jest_click_y = (rect.top + titleBarHeight) * ratio + 30
} }
}, },
jest_scrollToDeepOverflow() { jest_scrollToDeepOverflow() {
...@@ -147,8 +149,8 @@ ...@@ -147,8 +149,8 @@
const titleBarHeight = systemInfo.screenHeight - systemInfo.windowHeight const titleBarHeight = systemInfo.screenHeight - systemInfo.windowHeight
const afterRect = uni.getElementById('deep-overflow')?.getBoundingClientRect() const afterRect = uni.getElementById('deep-overflow')?.getBoundingClientRect()
if (afterRect != null) { if (afterRect != null) {
this.jest_click_x = afterRect.x * ratio + 10 this.jest_click_x = afterRect.x * ratio + 30
this.jest_click_y = (afterRect.top + titleBarHeight + 10) * ratio this.jest_click_y = (afterRect.top + titleBarHeight) * ratio + 30
} }
}, 200) }, 200)
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册