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

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

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