|
|
|
@ -1,8 +1,11 @@ |
|
|
|
<template> |
|
|
|
<view class="header" :style="{top: height}"> |
|
|
|
<label v-if="isBack" class="back" @click="back()"></label> |
|
|
|
<label v-else class="noback"></label> |
|
|
|
<view class="title">{{title}}</view> |
|
|
|
<view :style="{height: sumHeight}"> |
|
|
|
<view class="stabar" :style="{height: height}"></view> |
|
|
|
<view class="header" :style="{top: height, height: navHeight}"> |
|
|
|
<label v-if="isBack" class="back" @click="back()"></label> |
|
|
|
<label v-else class="noback"></label> |
|
|
|
<view class="title">{{title}}</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</template> |
|
|
|
|
|
|
|
@ -12,6 +15,8 @@ |
|
|
|
data() { |
|
|
|
return { |
|
|
|
height: 0, |
|
|
|
navHeight: 0, |
|
|
|
sumHeight: 0, |
|
|
|
}; |
|
|
|
}, |
|
|
|
props: { |
|
|
|
@ -39,7 +44,9 @@ |
|
|
|
const headerHeight = statusBarHeight + navBarHeightWechat |
|
|
|
//计算导航内容距离顶部高度= 状态栏高度/2 |
|
|
|
const topHeight = statusBarHeight / 2 |
|
|
|
this.height = headerHeight - (topHeight/2) +"rpx" |
|
|
|
this.height = menu.top + "px" |
|
|
|
this.navHeight = menu.height + "px" |
|
|
|
this.sumHeight = (menu.top + menu.height) + "px" |
|
|
|
}, |
|
|
|
back(){ |
|
|
|
uni.navigateBack({ |
|
|
|
@ -51,6 +58,10 @@ |
|
|
|
</script> |
|
|
|
|
|
|
|
<style> |
|
|
|
navigation { |
|
|
|
background-color: #bac6fc; |
|
|
|
} |
|
|
|
|
|
|
|
.header { |
|
|
|
position: relative; |
|
|
|
z-index: 99; |
|
|
|
@ -63,7 +74,7 @@ |
|
|
|
label.back { |
|
|
|
display: inline-block; |
|
|
|
position: relative; |
|
|
|
top: 16rpx; |
|
|
|
top: 0; |
|
|
|
left: 4%; |
|
|
|
padding-left: 1.25rem; |
|
|
|
width: 60rpx; |
|
|
|
@ -84,7 +95,7 @@ label.noback { |
|
|
|
} |
|
|
|
|
|
|
|
.title { |
|
|
|
margin: -54rpx 0 50rpx; |
|
|
|
margin: -64rpx 0 50rpx; |
|
|
|
color: #333; |
|
|
|
font-size: 36rpx; |
|
|
|
font-weight: bold; |
|
|
|
|