20 lines
538 B
JavaScript
20 lines
538 B
JavaScript
const { platform } = uni.getSystemInfoSync()
|
|
|
|
export function setFullScreen(isFullScreen) {
|
|
const ori = isFullScreen ? 'landscape-primary' : 'portrait-primary';
|
|
plus.screen.unlockOrientation();
|
|
if (platform === 'android') {
|
|
setTimeout(() => {
|
|
plus.screen.lockOrientation(ori);
|
|
}, 500)
|
|
} else {
|
|
plus.screen.lockOrientation(ori);
|
|
}
|
|
// 控制顶部状态栏展示
|
|
plus.navigator.setFullscreen(isFullScreen);
|
|
if (isFullScreen) {
|
|
plus.navigator.hideSystemNavigation();
|
|
} else {
|
|
plus.navigator.showSystemNavigation();
|
|
}
|
|
} |