File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
packages/uni-mp-core/src/runtime Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -88,19 +88,19 @@ export function initPageInstance(mpPageInstance: MPComponentInstance) {
8888 if ( __X__ ) {
8989 Object . assign ( mpPageInstance , {
9090 get width ( ) : number {
91- if ( __PLATFORM__ === 'mp-toutiao' ) {
91+ if ( __PLATFORM__ === 'mp-toutiao' || __PLATFORM__ === 'mp-xhs' ) {
9292 return __GLOBAL__ . getSystemInfoSync ( ) . windowWidth
9393 }
9494 return __GLOBAL__ . getWindowInfo ( ) . windowWidth
9595 } ,
9696 get height ( ) : number {
9797 const windowInfo = __GLOBAL__ . getWindowInfo ( )
9898 // 某些版本的微信小程序开发工具获取tabBar页面的screenTop不对,其数值包含了tabBar高度及底部安全区,如果有开发者问起让他使用真机测试即可。
99- // TODO 抖音小程序没有 getWindowInfo 方法,暂时无法获取 screenTop
99+ // TODO 抖音小程序、小红书小程序没有 getWindowInfo 方法,暂时无法获取 screenTop
100100 return windowInfo . windowHeight + windowInfo . screenTop
101101 } ,
102102 get statusBarHeight ( ) : number {
103- if ( __PLATFORM__ === 'mp-toutiao' ) {
103+ if ( __PLATFORM__ === 'mp-toutiao' || __PLATFORM__ === 'mp-xhs' ) {
104104 return __GLOBAL__ . getSystemInfoSync ( ) . statusBarHeight
105105 }
106106 return __GLOBAL__ . getWindowInfo ( ) . statusBarHeight
You can’t perform that action at this time.
0 commit comments