<template>
	<view class="header">
		<span @tap="goBack" class="iconfont icon_back">&#xe6db;</span>
		<span class="page_name">{{title}}</span>
		<span @tap="backHome" class="iconfont icon_home" :class="{'vhide': show1 === false}">&#xe69b;</span>
	</view>
</template>

<script>
	export default {
		data() {
			return {
			};
		},
		props: {
			title: String,
			inner: {
				type: Boolean,
				default: false
			},
			inner2: {
				type: Boolean,
				default: false
			},
			show1: {
				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'
					})
					// uni.navigateBack()
				}
			},
			backHome () {
				uni.redirectTo({
					url: '/pages/home/home'
				})
				// uni.navigateBack()
			}
		}
	}
</script>

<style lang="stylus">
@import '@/common/style/mixin.styl';
.header
	_fj()
	_wh(100%, 30px)
	background-color #fff
	z-index 200
	padding 0 10px
.page_name
	_font(22px, 30px, #0f0f0f,,center)
.icon_back {
	font-size: 26px;
	line-height: 30px;
	color: #666;
}
.icon_home {
	font-size: 26px;
	line-height: 30px;
	color: #666;
}
</style>
