diff --git a/pages/component/global-events/touch-events.uvue b/pages/component/global-events/touch-events.uvue index 15b675a2dba44bef99addb4ed99fac62a0037f7c..87fef376970b5d1995c88febff97596c023ec1cc 100644 --- a/pages/component/global-events/touch-events.uvue +++ b/pages/component/global-events/touch-events.uvue @@ -39,10 +39,11 @@ }, onReady() { this.icon = uni.getElementById("icon") - this.iconRect = this.icon.getBoundingClientRect() - + // #ifdef APP-IOS + this.iconRect = this.icon?.getBoundingClientRect() // 加上导航栏及状态栏高度 - this.iconRect.y += uni.getSystemInfoSync().safeArea.top + 44 + this.iconRect.y += uni.getSystemInfoSync().safeArea.top + 44 + // #endif }, methods: { onViewTouchStart(e : TouchEvent) {