dl_uniapp/components/navigation/navigationBar.vue

76 lines
1.3 KiB
Vue
Raw Normal View History

2025-04-02 11:34:12 +08:00
<template>
<!-- header -->
2025-04-03 16:46:51 +08:00
<view :style="{ backgroundColor:backgroundColor }" class="navigationBar">
<template>
2025-04-02 11:34:12 +08:00
<view class="navigationBarBack" @click="back">
2025-04-03 16:46:51 +08:00
<uni-icons size="24" type="left" :color="titleColor"></uni-icons>
2025-04-02 11:34:12 +08:00
</view>
<view class="navigationBarTitle" :style="{ color: titleColor }">
{{ title }}
</view>
2025-04-03 16:46:51 +08:00
<view class="navigationBarIcon" :style="{ color: titleColor }">
2025-04-02 11:34:12 +08:00
</view>
</template>
</view>
</template>
<script>
/* 计算标题位置 */
import {
getWXStatusHeight
} from "@/utils/common.js";
export default {
props: {
backgroundColor: {
type: String,
default: '#317DFA'
},
title: String,
titleColor: {
type: String,
default: '#fff'
},
},
data() {
return {
2025-04-03 16:46:51 +08:00
2025-04-02 11:34:12 +08:00
}
},
methods: {
back() {
uni.navigateBack()
},
clearNoReadFun() {
this.$emit('clearNoRead')
}
}
}
</script>
<style lang="scss" scoped>
.navigationBar {
2025-04-03 16:46:51 +08:00
position: absolute;
top: var(--status-bar-height);
height: 90rpx;
width: 100%;
2025-04-02 11:34:12 +08:00
display: flex;
align-items: center;
2025-04-03 16:46:51 +08:00
font-size: 30rpx;
2025-04-02 11:34:12 +08:00
justify-content: center;
2025-04-09 15:00:38 +08:00
z-index: 9;
2025-04-02 11:34:12 +08:00
.navigationBarBack {
2025-04-03 16:46:51 +08:00
width: 200rpx;
2025-04-02 11:34:12 +08:00
}
.navigationBarTitle {
2025-04-03 16:46:51 +08:00
flex: 1;
text-align: center;
2025-04-02 11:34:12 +08:00
}
.navigationBarIcon {
2025-04-03 16:46:51 +08:00
width: 200rpx;
2025-04-02 11:34:12 +08:00
}
}
</style>