<template>
	<view class="headInfo">
		<uni-icons class="icon" type="back" size="24" @click="toBack" />
		{{title}}
		<uni-icons class="bottom" type="bottom" size="18" v-if="type" />
	</view>
</template>

<script>
	export default {
		name: "headView",
		props: {
			title: {
				type: String
			},
			type: {
				type: Boolean,
				default: () => false
			},
			special: {
				type: String,
				default: () => ""
			},
			url: {
				type: String,
				default: () => ""
			},
		},
		methods: {
			toBack() {
				if (this.url != "") {
					uni.navigateTo({
						url: `${this.url}`
					})
				} else {
					uni.navigateBack('-1')
				}
				if (this.special == 1) {
					uni.setStorageSync('tabsType', 0);
				}
			}
		}
	}
</script>

<style lang="less" scoped>
	.headInfo {
		position: relative;
		background-color: #fff;
		border-bottom: 1px solid #999999;
		height: 68px;
		line-height: 68px;
		font-size: 20px;
		color: #23262E;
		text-align: center;
		font-weight: bold;
		box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 0.10);

		.icon {
			position: absolute;
			left: 10px;
		}

		.bottom {
			margin-left: 6px;
		}
	}
</style>