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

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

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