<template>
	<view class="zd-row header">
		<view class="zd-col-8 home_title">{{title}}</view>
		<view class="zd-col-8 zd-row jcflexend home_userinfo">
			<view v-if="type === '1'" class="exit_text" @tap="Quit">退出</view>
			<view v-if="type === '2'" class="exit_text" @tap="toHome">返回</view>
			<view v-if="type === '3'" class="exit_text" @tap="toBack">返回</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
			};
		},
		props: {
			title: String,
			type: {
				type: String,
				default: '1'
			}
		},
		methods: {
			Quit () {
				this.$store.dispatch('delUserInfo', '')
				uni.redirectTo({
					url: '/pages/login/login'
				})
			},
			toHome () {
				uni.redirectTo({
					url: '/pages/home/home'
				})
			},
			toBack () {
				uni.navigateBack()
			}
		}
	}
</script>

<style lang="stylus">
@import '@/common/style/mixin.styl';
.header
	position fixed
	top 0
	left 0
	_wh(100%, .77rem)
	padding 0 0.4rem
	align-items flex-start
	justify-content flex-end
	_bis(,'../static/images/bg_header.png', 100%, 100%,bottom)
.home_title
	_font(0.4rem,.77rem, #8DBFEE, bold, center)
	font-family 'SourceHanSansCN-Bold'
	font-style italic
	background linear-gradient(0deg, #A2C3E3 0%, #5E9ED9 11.9140625%, #A2C3E3 100%)
	-webkit-background-clip text
	-webkit-text-fill-color transparent
	border-bottom 0
	padding 0
.home_userinfo
	height 100%
.exit_text
	height .43rem
	padding 0 .14rem
	border 1px solid #68AFF4
	background linear-gradient(to bottom, #152B56, #1B4181)
	_font(.2rem,.43rem, #fff,,)
</style>
