提交 9d825065 编写于 作者: tao.wu's avatar tao.wu

修改安卓电池栏的背景颜色,兼容滚动时透明

上级 0bc34bdb
......@@ -30,4 +30,7 @@ header{
.bgfff{
background: #fff;
}
.bg5c5c5c{
background: #5C5C5C;
}
}
\ No newline at end of file
<template>
<header>
<div class="status" :class="{'bgfff': isScroll}" :style="{height: statusBarHeight + 'Px', background: bgColor}"></div>
<div class="status" :class="[barClass]" :style="{height: statusBarHeight + 'Px'}"></div>
<!-- <div class="head-wrap" :class="{'bgfff': isScroll}" :style="{height: titleHeight + 'px'}"> -->
<div class="head-wrap" :class="{'bgfff': isScroll}">
<img @click="goBack" :src="leftIcon">
......@@ -59,7 +59,8 @@
},
data(){
return {
bgColor: '',
barClass: '',
// bgColor: '',
leftIcon: leftimg1,
rightIcon: rightimg1,
isScroll: false,
......@@ -82,6 +83,9 @@
if(val){
this.leftIcon = leftimg2;
this.rightIcon = rightimg2;
this.barClass = this.$rocNative.isIOS ? 'bgfff' : 'bg5c5c5c';
}else{
this.barClass = this.isOpacity ? '' : 'bg5c5c5c';
}
}
},
......@@ -90,14 +94,7 @@
setHeaderHeight(){
this.$rocNative.getStatusBarHeight().then(res=>{
const dpr = window.devicePixelRatio;
if(this.$rocNative.isIOS){
// this.statusBarHeight = res.statusBarHeight * dpr;
// this.titleHeight = this.titleHeight * dpr;
this.statusBarHeight = res.statusBarHeight;
}else{
this.bgColor = '#ccc';
this.statusBarHeight = res.statusBarHeight / dpr;
}
this.statusBarHeight = this.$rocNative.isIOS ? res.statusBarHeight: res.statusBarHeight / dpr;
this.$emit('getHeaderHeight', this.statusBarHeight + 44);
})
},
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册