uniapp APP项目启动页面全屏显示去除导航栏和下巴
<template>
<view>
<!-- 启动图 -->
<view class="start-item" >
<image :src="startImg" mode="" class="pic" @click="jump(startUrl)"></image>
</view>
</view>
</template>
<script>
export default {
data() {
return {
startImg:'',
startUrl:'',
}
},
onLoad(param) {
const that = this;
that.getStartImg();
setTimeout(()=>{
that.switchTab('/pages/index/index')
},3000)
},
onShow() {
plus.navigator.setFullscreen(true);
plus.navigator.hideSystemNavigation();
},
onUnload() {
plus.navigator.setFullscreen(false);
plus.navigator.showSystemNavigation();
},
methods: {
getStartImg() {
const that = this;
that.$http.get('api/index_start').then(res => {
console.log("启动图", res);
if (res.status_code == 200) {
that.startImg = res.data.img;
that.startUrl = res.data.img_url;
} else {
that.$tool.toast(res.message)
}
})
},
jump(url) {
console.log(url);
if (plus.os.name == 'Android') {
plus.runtime.openURL(encodeURI(url),
function(res) {
console.log('安卓手机点击了跳转',res)
},
)
} else if (plus.os.name == 'iOS') {
plus.runtime.openURL(encodeURI(url),
function(res) {
console.log('苹果手机点击了跳转',res)
}
)
}
window.location.href = url;
},
}
}
</script>
<style lang="scss">
.start-item{
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 10000;
background-color: #FFFFFF;
}
</style>