提交 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 @@
if (uni.getSystemInfoSync().platform == 'android'){
ratio = uni.getSystemInfoSync().devicePixelRatio
}
this.jest_click_x = rect.x * ratio + 10
this.jest_click_y = rect.bottom * ratio - 10
const systemInfo = uni.getSystemInfoSync()
const titleBarHeight = systemInfo.screenHeight - systemInfo.windowHeight
this.jest_click_x = rect.x * ratio + 30
this.jest_click_y = rect.bottom * ratio - 30
}
},
jest_getParentRect() {
......@@ -129,8 +131,8 @@
if (uni.getSystemInfoSync().platform == 'android'){
ratio = uni.getSystemInfoSync().devicePixelRatio
}
this.jest_click_x = rect.x * ratio + 10
this.jest_click_y = (rect.top + titleBarHeight + 10) * ratio
this.jest_click_x = rect.x * ratio + 30
this.jest_click_y = (rect.top + titleBarHeight) * ratio + 30
}
},
jest_scrollToDeepOverflow() {
......@@ -147,8 +149,8 @@
const titleBarHeight = systemInfo.screenHeight - systemInfo.windowHeight
const afterRect = uni.getElementById('deep-overflow')?.getBoundingClientRect()
if (afterRect != null) {
this.jest_click_x = afterRect.x * ratio + 10
this.jest_click_y = (afterRect.top + titleBarHeight + 10) * ratio
this.jest_click_x = afterRect.x * ratio + 30
this.jest_click_y = (afterRect.top + titleBarHeight) * ratio + 30
}
}, 200)
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册