64 lines
1.1 KiB
Vue
64 lines
1.1 KiB
Vue
<template>
|
|
<view class="header">
|
|
<span @tap="goBack" class="iconfont icon_back"></span>
|
|
<span class="page_name">{{title}}</span>
|
|
<span @tap="backHome" class="iconfont icon_home" :class="{'vhide': show === false}"></span>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
data() {
|
|
return {
|
|
};
|
|
},
|
|
props: {
|
|
title: String,
|
|
inner: {
|
|
type: Boolean,
|
|
default: false
|
|
},
|
|
inner2: {
|
|
type: Boolean,
|
|
default: false
|
|
},
|
|
show: {
|
|
type: Boolean,
|
|
default: true
|
|
}
|
|
},
|
|
methods: {
|
|
goBack () {
|
|
if (this.inner) {
|
|
uni.navigateBack()
|
|
} else if (this.inner2) {
|
|
this.$emit('goIn')
|
|
} else {
|
|
uni.redirectTo({
|
|
url: '/pages/home/home'
|
|
})
|
|
}
|
|
},
|
|
backHome () {
|
|
uni.redirectTo({
|
|
url: '/pages/home/home'
|
|
})
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="stylus" scoped>
|
|
@import '@/common/style/mixin.styl';
|
|
.header
|
|
_fj()
|
|
position fixed
|
|
_wh(100%, calc(var(--status-bar-height) + 88rpx))
|
|
background-color $red
|
|
background linear-gradient(90deg, $red1, $red2)
|
|
z-index 200
|
|
padding var(--status-bar-height) 20rpx 0 20rpx
|
|
.page_name
|
|
_font(32rpx, 32rpx, #fff,700,center)
|
|
</style>
|