diff --git a/pages/API/get-system-info/get-system-info.uvue b/pages/API/get-system-info/get-system-info.uvue index 89647276a19275d6d5512e666267e9ec3cd4d2ca..0cc6bd415a91be22aca5b720cb7de46f69132c5d 100644 --- a/pages/API/get-system-info/get-system-info.uvue +++ b/pages/API/get-system-info/get-system-info.uvue @@ -40,14 +40,8 @@ } let globalScreenHeight = 0 - try { - // #ifdef MP-WEIXIN - globalScreenHeight = uni.getWindowInfo().screenHeight - // #endif - // #ifndef MP-WEIXIN - globalScreenHeight = uni.getSystemInfoSync().screenHeight - // #endif - + try { + globalScreenHeight = uni.getWindowInfo().screenHeight } catch (e) { // 兼容本地测试 console.error(e) @@ -129,4 +123,4 @@ .uni-pd { padding-left: 15px; } - + diff --git a/pages/API/websocket/socketTask.uvue b/pages/API/websocket/socketTask.uvue index 969530a49199a4403f09583b325f228d43b8656d..5797ccf8975b3db693a9a4cf1b946dbf582e046e 100644 --- a/pages/API/websocket/socketTask.uvue +++ b/pages/API/websocket/socketTask.uvue @@ -44,12 +44,7 @@ }, }, onLoad() { - // #ifdef MP-WEIXIN - this.platform = uni.getDeviceInfo().platform - // #endif - // #ifndef MP-WEIXIN - this.platform = uni.getSystemInfoSync().platform - // #endif + this.platform = uni.getDeviceInfo().platform as string }, onUnload() { uni.hideLoading() diff --git a/pages/API/websocket/websocket.uvue b/pages/API/websocket/websocket.uvue index 5caf4ab39b2fa9ce662c96b314ee3bbef877e87d..41409ad35f048a51c87b66b4d401b148e1bc136a 100644 --- a/pages/API/websocket/websocket.uvue +++ b/pages/API/websocket/websocket.uvue @@ -45,12 +45,7 @@ }, }, onLoad() { - // #ifdef MP-WEIXIN - this.platform = uni.getDeviceInfo().platform - // #endif - // #ifndef MP-WEIXIN - this.platform = uni.getSystemInfoSync().platform - // #endif + this.platform = uni.getDeviceInfo().platform as string }, onUnload() { uni.closeSocket({ diff --git a/pages/tabBar/API.uvue b/pages/tabBar/API.uvue index 69132b6c48de74e2c92e63fe6752996dc3a6cdb9..2d778b206927169fdcb1c59501e22c96f850b6e3 100644 --- a/pages/tabBar/API.uvue +++ b/pages/tabBar/API.uvue @@ -71,15 +71,8 @@ leftWinActive() : string { return state.leftWinActive.slice(1) }, - windowWidth() : number { - let windowWidth = 0 - // #ifdef MP-WEIXIN - windowWidth = uni.getWindowInfo().windowWidth - // #endif - // #ifndef MP-WEIXIN - windowWidth = uni.getSystemInfoSync().windowWidth - // #endif - return windowWidth + windowWidth() : number { + return uni.getWindowInfo().windowWidth } }, methods: { diff --git a/pages/template/drop-card/card/card.uvue b/pages/template/drop-card/card/card.uvue index 056d0f38ea9efa07c7a9164987c4a0bd100a7486..e37bfd98fe53fe777cb60fbcf8b4252536e870be 100644 --- a/pages/template/drop-card/card/card.uvue +++ b/pages/template/drop-card/card/card.uvue @@ -53,18 +53,8 @@ } }, mounted() { - // #ifdef MP-WEIXIN screenWidth = uni.getWindowInfo().screenWidth screenHeight = uni.getWindowInfo().screenHeight; - // #endif - // #ifndef MP-WEIXIN - uni.getSystemInfo({ - success: (e) => { - screenWidth = e.screenWidth; - screenHeight = e.screenHeight; - } - }) - // #endif // TODO 需要延迟设置才能生效 setTimeout(() => { diff --git a/pages/template/scroll-fold-nav/scroll-fold-nav.uvue b/pages/template/scroll-fold-nav/scroll-fold-nav.uvue index 158b2b28c846e5d82952967568c7800390d3eacb..383f282742cc5c1ce4877ebdef7fb4849848fbcb 100644 --- a/pages/template/scroll-fold-nav/scroll-fold-nav.uvue +++ b/pages/template/scroll-fold-nav/scroll-fold-nav.uvue @@ -49,11 +49,8 @@ } }, onLoad() { - // #ifdef MP-WEIXIN - this.statusBarHeight = uni.getWindowInfo().statusBarHeight; - // #endif - // #ifndef MP-WEIXIN || WEB - this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight; + // #ifdef APP || MP + this.statusBarHeight = uni.getWindowInfo().statusBarHeight; // #endif this.nviBarHeight = NAVIBARHEIGHT + this.statusBarHeight; diff --git a/pages/template/swiper-vertical-video/swiper-vertical-video.uvue b/pages/template/swiper-vertical-video/swiper-vertical-video.uvue index d03132c8bc01859e3c367d6337804c79c5a51258..856b8542ba61813ab79fb99601da45b3e5bc8d28 100644 --- a/pages/template/swiper-vertical-video/swiper-vertical-video.uvue +++ b/pages/template/swiper-vertical-video/swiper-vertical-video.uvue @@ -92,15 +92,8 @@ this.doPlay(0); //App端适配不同状态栏高度 let backElement = this.$refs['back'] as UniElement; - // #endif - - // #ifdef MP-WEIXIN backElement.style.setProperty('top', uni.getWindowInfo().statusBarHeight+'px'); // #endif - // #ifndef MP-WEIXIN || WEB - backElement.style.setProperty('top', uni.getSystemInfoSync().statusBarHeight+'px'); - // #endif - }, onShow() { currentPageIsShow = true diff --git a/uni_modules/uni-pay-x/components/uni-pay/uni-pay.uvue b/uni_modules/uni-pay-x/components/uni-pay/uni-pay.uvue index 467e1ed6c781ae9d59e214e0a16fb6615b3549be..2224b3dd70cd46e0c2b3416fc1fe0d0ae9ff6ddb 100644 --- a/uni_modules/uni-pay-x/components/uni-pay/uni-pay.uvue +++ b/uni_modules/uni-pay-x/components/uni-pay/uni-pay.uvue @@ -832,12 +832,7 @@ modeCom() : string { let mode = this.mode as string; if (mode != "") return mode; - // #ifdef MP-WEIXIN let systemInfo = uni.getDeviceInfo(); - // #endif - // #ifndef MP-WEIXIN - let systemInfo = uni.getSystemInfoSync(); - // #endif return systemInfo.deviceType == "pc" ? "pc" : "mobile"; }, totalFeeCom() : number {