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

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

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