暖心人
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

86 lines
1.6 KiB

<template>
<view class="header" :class="{top:isTop}" :style="{
paddingTop:navPaddingTop+'px',
}">
<view class="header-container" :style="{
height:navHeight+'px',
paddingTop:headerPadding+'px',
paddingBottom:headerPadding+'px',
justifyContent: (isBack?'space-between':'center')
}">
<view v-show="isBack" class="header-back-button" @click="navBack()">
<u-icon name="arrow-leftward"></u-icon>
</view>
<view class="header-title">
{{title}}
</view>
<view v-show="isBack" class="header-back-button" style="opacity: 0;">
<u-icon name="arrow-rightward"></u-icon>
</view>
</view>
</view>
</template>
<script>
import {
imghost
} from '@/config/host.js';
import api from '@/utils/functions.js';
export default {
props:{
title:{
type:String,
default:'汪汪行天下'
},
isBack:{
type:Boolean,
default:false
},
},
data() {
return {
loading: true,
navHeight: 32,
navPaddingTop: 47,
headerPadding:4,
isTop:true
}
},
onShow() {
},
onLoad() {
},
methods: {
init() {
this.navPaddingTop = api.navHeight().navPaddingTop,
this.navHeight = api.navHeight().navHeight,
this.headerPadding = api.navHeight().headerPadding
},
navBack(){
wx.navigateBack({
delta:1
});
}
},
created() {
this.init()
// onPageScroll:function(e){
// console.log(1);
// }
},
updated() {},
mounted() {
var that = this;
uni.$on('isTop', function(data) {
that.isTop = data;
});
}
}
</script>
<style lang="scss">
@import '@/components/HeaderNav/components/index.scss';
</style>