<template>
	<view>
		<view class="top" :style="'padding-top:' + top + 'px'"></view>
		<view style="display: flex;">
			<view class="nav" :class="color==0?'white':color==1?'black':''">
				<view class="iconfont icon-WeUIjichuyangshiku" @click="goTo(-1)"></view>
				<view class="iconfont" @click="goTo(1)">&#xe015</view>
			</view>
			<view class="pageName" :class="color==0?'white':''" v-if="page">{{page}}</view>
		</view>
	</view>
</template>

<script>
	export default {
		props:['top','page','color'],
		name:"navs",
		data() {
			return {
				
			};
		},
		methods:{
			goTo(i){
				if(i==-1){
					uni.navigateBack()
				}else{
					uni.reLaunch({
						url:'/pages/index/index'
					})
				}
			}
		}
	}
</script>

<style lang="scss">
	.nav{
		width: 141rpx;
		height: 62rpx;
		margin-left: 30rpx;
		border-radius: 40rpx;
		display: flex;
		align-items: center;
		.iconfont{
			flex: 1;
			text-align: center;
			font-size: 32rpx;
			font-weight: 400;
		}
	}
	.nav.white{
		color: #fff;
		background-color: rgba(0,0,0,.3); 
	}
	.nav.black{
		color: #000;
		border: 1px solid #f7f7f7;
		.iconfont:first-child{
			position: relative;
		}
		.iconfont:first-child::after{
			content: '';
			width: 0;
			height: 32rpx;
			border: 1rpx solid #f7f7f7;
			position: absolute;
			right: 0;
			top: 0;
		}
	}
	.pageName{
		width: 402rpx;
		text-align: center;
		line-height: 62rpx;
		font-size: 32rpx;
		color: #000;
		font-weight: 400;
	}
	.pageName.white{
		color: #fff;
	}
</style>