提交 aba2f75c 编写于 作者: Yuanzhao.dai's avatar Yuanzhao.dai

兼容ios唤起app后,电池栏取不到值的问题

上级 717de455
......@@ -105,10 +105,15 @@
setHeaderHeight(){
this.$rocNative.getStatusBarHeight().then(res=>{
const dpr = window.devicePixelRatio;
if(this.$rocNative.isIOS && res.homeIndicatorHeight && res.statusBarHeight===0){
this.statusBarHeight = 44;
}else{
this.statusBarHeight = this.$rocNative.isIOS ? res.statusBarHeight: res.statusBarHeight / dpr;
if (this.$rocNative.isIOS ) {
if (res.statusBarHeight===0) {
this.statusBarHeight = res.homeIndicatorHeight ? 44:20
} else {
this.statusBarHeight = res.statusBarHeight
}
} else {
this.statusBarHeight = res.statusBarHeight / dpr;
}
this.$emit('getHeaderHeight', this.statusBarHeight + 44);
})
......
......@@ -17,10 +17,15 @@ const mixins = {
// resolve(data)
let height;
if(_this.$rocNative.isIOS && res.homeIndicatorHeight && res.statusBarHeight===0){
height = 44;
if(_this.$rocNative.isIOS ){
if(res.statusBarHeight===0) {
height = res.homeIndicatorHeight ? 44:20
} else {
height = res.statusBarHeight
}
}else{
height = _this.$rocNative.isIOS ? res.statusBarHeight : res.statusBarHeight / window.devicePixelRatio;
height = res.statusBarHeight / window.devicePixelRatio;
}
// let height = _this.$rocNative.isIOS ? res.statusBarHeight : res.statusBarHeight / window.devicePixelRatio;
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册