提交 6d64a6d0 编写于 作者: tao.wu's avatar tao.wu

修改IOS 刘海屏系列的电池栏高度为零问题

上级 48966203
......@@ -92,18 +92,17 @@
methods: {
// 从APP获取电池栏高度并设置高度
setHeaderHeight(){
setTimeout(()=>{
this.$rocNative.getStatusBarHeight().then(res=>{
const dpr = window.devicePixelRatio;
this.statusBarHeight = this.$rocNative.isIOS ? res.statusBarHeight: res.statusBarHeight / dpr;
// alert(this.$rocNative.isIOS)
// alert(res.homeIndicatorHeight)
// alert(res.statusBarHeight)
if(this.$rocNative.isIOS && res.homeIndicatorHeight && res.statusBarHeight===0){
this.statusBarHeight = 44;
}else{
this.statusBarHeight = this.$rocNative.isIOS ? res.statusBarHeight: res.statusBarHeight / dpr;
}
// alert(this.statusBarHeight)
this.$emit('getHeaderHeight', this.statusBarHeight + 44);
})
},300)
},
goBack(){
if(this.isStageTwoHomePage){
......
......@@ -61,8 +61,8 @@
return {
statusTxt: '',
// showMask: false,
// path: getShareUrl() + 'year_end_ssr/activityPage',
path: 'http://10.177.11.228:3009/year_end_ssr/activityPage'
path: getShareUrl() + 'year_end_ssr/activityPage',
// path: 'http://10.177.11.228:3009/year_end_ssr/activityPage'
}
},
mounted(){
......
......@@ -15,7 +15,15 @@ const mixins = {
_this.statusBarColor = _this.$rocNative.isAndroid?'#5C5C5C':'#fff'
_this.$rocNative.getStatusBarHeight().then(res => {
// resolve(data)
let height = _this.$rocNative.isIOS ? res.statusBarHeight : res.statusBarHeight / window.devicePixelRatio;
let height;
if(_this.$rocNative.isIOS && res.homeIndicatorHeight && res.statusBarHeight===0){
height = 44;
}else{
height = _this.$rocNative.isIOS ? res.statusBarHeight : res.statusBarHeight / window.devicePixelRatio;
}
// let height = _this.$rocNative.isIOS ? res.statusBarHeight : res.statusBarHeight / window.devicePixelRatio;
_this.statusBarHeight = height;
// 刘海屏底部高度
if(res.homeIndicatorHeight) {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册