- 小程序打款验证提示客户账户已被监管?
[图片]
2023-04-27 - 自定义导航栏高度偶尔会出问题,重新多进几次就会好,如何保证每次获取的值都一样?
[图片][图片] navbar_height: function () { var _this = this; let menuButtonObject = wx.getMenuButtonBoundingClientRect(); wx.getSystemInfo({ success: res => { //屏幕高度,单位px 可使用窗口高度,单位px 状态栏的高度,单位px if(res.screenHeight - res.windowHeight - res.statusBarHeight - 32 > 72 > 40) {// 处理相关逻辑 self.globalData.isFullSucreen=true; console.log("是全面屏") } console.log(res); //导航高度 let statusBarHeight = res.statusBarHeight, navTop = menuButtonObject.top, navHeight = statusBarHeight + menuButtonObject.height + (menuButtonObject.top - statusBarHeight) * 2; let systemInfo = wx.getSystemInfoSync() console.log(systemInfo); // px转换到rpx的比例 let pxToRpxScale = 750 / systemInfo.windowWidth; // 状态栏的高度 let ktxStatusHeight = systemInfo.statusBarHeight * pxToRpxScale // 导航栏的高度 let navigationHeight = 44 * pxToRpxScale // window的宽度 let ktxWindowWidth = systemInfo.windowWidth * pxToRpxScale // window的高度 let ktxWindowHeight = systemInfo.windowHeight * pxToRpxScale // 屏幕的高度 let ktxScreentHeight = systemInfo.screenHeight * pxToRpxScale // 底部tabBar的高度 let tabBarHeight = ktxScreentHeight - ktxWindowHeight let iosSABottom = Number(systemInfo.screenHeight - systemInfo.safeArea.bottom); this.globalData.navHeight = navHeight; this.globalData.navTop = navTop; //navTop this.globalData.windowHeight = ktxWindowHeight; this.globalData.tabBarHeight = tabBarHeight; this.globalData.navigationHeight = navigationHeight; this.globalData.iosSABottom = iosSABottom; console.log("navHeight"+navHeight) console.log("ktxScreentHeight"+ktxScreentHeight) console.log("ktxWindowHeight"+ktxWindowHeight) console.log("ktxStatusHeight"+ktxStatusHeight) console.log("navigationHeight"+navigationHeight) console.log("tabBarHeight"+tabBarHeight) console.log("iosSABottom"+iosSABottom) }, fail(err) { console.log(err); } }) }, 以上是我获取各种高度 [图片]
2023-03-09