|
|
<template>
|
|
|
<div class="layout-header" :class="{[`theme-${theme}`]: theme}">
|
|
|
<div class="back flex hover-opacity" @touchend.stop.prevent="onBack">
|
|
|
<slot name="back" v-if="back">
|
|
|
<i class="iconfont icon-left"></i>
|
|
|
</slot>
|
|
|
</div>
|
|
|
<div class="title flex" :style="{opacity}">
|
|
|
<slot>
|
|
|
<span class="title-inner">{{title}}</span>
|
|
|
</slot>
|
|
|
</div>
|
|
|
<div class="opts flex" :style="{opacity}">
|
|
|
<slot name="opts"></slot>
|
|
|
<div class="layout-header-wrap" :class="{[`theme-${theme}`]: theme}" :style="statusBarHeight">
|
|
|
<div class="layout-header">
|
|
|
<div class="back flex hover-opacity" @touchend.stop.prevent="onBack">
|
|
|
<slot name="back" v-if="back">
|
|
|
<i class="iconfont icon-left"></i>
|
|
|
</slot>
|
|
|
</div>
|
|
|
<div class="title flex" :style="{opacity}">
|
|
|
<slot>
|
|
|
<span class="title-inner">{{title}}</span>
|
|
|
</slot>
|
|
|
</div>
|
|
|
<div class="opts flex" :style="{opacity}">
|
|
|
<slot name="opts"></slot>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
...
|
...
|
@@ -36,7 +38,14 @@ export default { |
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
...mapState(['yoho'])
|
|
|
...mapState(['yoho']),
|
|
|
statusBarHeight() {
|
|
|
if (this.yoho.window && this.yoho.window.statusBarHeight) {
|
|
|
return {paddingTop: this.yoho.window.statusBarHeight + 'px'}
|
|
|
}
|
|
|
|
|
|
return {};
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
|
transparentSeek(value) {
|
...
|
...
|
@@ -68,26 +77,33 @@ export default { |
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
.layout-header {
|
|
|
.layout-header-wrap {
|
|
|
width: 100%;
|
|
|
height: 44PX;
|
|
|
background-color: #444;
|
|
|
color: #fff;
|
|
|
overflow: hidden;
|
|
|
display: flex;
|
|
|
align-items: stretch;
|
|
|
box-sizing: border-box;
|
|
|
|
|
|
&.theme-white {
|
|
|
background-color: #fff;
|
|
|
color: #222;
|
|
|
border-bottom: solid 1px #efefef;
|
|
|
|
|
|
.layout-header {
|
|
|
border-bottom: solid 1px #efefef;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
&.theme-transparent {
|
|
|
background-color: initial;
|
|
|
color: #fff;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
.layout-header {
|
|
|
width: 100%;
|
|
|
height: 44PX;
|
|
|
overflow: hidden;
|
|
|
display: flex;
|
|
|
align-items: stretch;
|
|
|
box-sizing: border-box;
|
|
|
|
|
|
> * {
|
|
|
position: relative;
|
...
|
...
|
|