<template>
	<view>
		<view class="user-info">
			<view class="left justify-start align-center" @click="openPersonInfo()">
				<!-- <view class="head-img">
					<image :src="user.avatar==null?'/static/images/detault_head.jpg':user.avatar" mode="aspectFill"></image>
				</view> -->
				<u-avatar :src="avatar" ></u-avatar>
				<view class="name-phone ml20">
					<view class="name">{{user.nickname?user.nickname:"游客01"}}</view>
					<!-- <view class="phone" v-if="user.phone!=''">{{utils.parsePhone(user.phone)}}</view> -->
				</view>
			</view>
			<view class="right">
			</view>
		</view>
		<view class="p20">
			<view class="used-tools">
				<view class="title">常用工具</view>
				<view class="tools-list">
					<!-- <view class="item no-marin-bottom" @click="openH5('/web/userAgreement')">
						<u-icon name="order" size="28"></u-icon>
						<text class="text">用户协议</text>
					</view>
					<view class="item no-marin-bottom align-top"  @click="openH5('/web/privacyPolicy')">
						<u-icon name="lock-open" size="28"></u-icon>
						<text class="text">隐私保护</text>
					</view> -->
					<view class="item no-marin-bottom align-top"  @click="nato('')">
						<u-icon name="account" size="28"></u-icon>
						<text class="text">销售管理</text>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				avatar:''
			}
		},
		methods: {
			openH5(type){
				uni.navigateTo({
					url:"/pages/user/userAgreement?type="+type
				})
			},
			nato(urls){
				if(!uni.getStorageSync('ManageToken')){
					uni.navigateTo({
						url:'/pages_manage/login'
					})
				}else{
					uni.navigateTo({
						url:'/pages_manage/index'
					})
				}
				
			}
		}
	}
</script>

<style lang="scss" scoped>
.user-info{
	padding: 40upx 30upx 0 30upx;
	display: flex;
	align-items: center;
	justify-content: space-between;
	.left{
		position: relative;
		display: flex;
		.head-img{
			width: 120upx;
			height: 120upx;
			border-radius: 50%;
			overflow: hidden;
			margin-right: 30upx;
			border: 4upx solid #FFFFFF;
			box-shadow: 0px 5px 15px 2px rgba(0,0,0,0.1);
			image{
				width: 100%;
				height: 100%;
			}
		}
		.name-phone{
			// padding-top: 15upx;
			.name{
				font-size: 40upx;
				font-family: PingFang SC;
				font-weight: bold;
				color: #111111;
				line-height: 1;
			}
			.phone{
				font-size: 28upx;
				font-family: PingFang SC;
				font-weight: 500;
				color: #666666;
				line-height: 1;
				margin-top: 30upx;
			}
		}
	}
	.right{
		display: flex;
		align-items: center;
		justify-content: center;
		.msg-box{
			margin-left: 10upx;
			width: 44upx;
			height: 44upx;
			image{
				width: 100%;
				height: 100%;
			}
		}
		.set{
			
			width: 44upx;
			height: 44upx;
			image{
				width: 100%;
				height: 100%;
			}
		}
	}
	
}
.used-tools{
		box-sizing: border-box;
		background: #FFFFFF;
		border-radius: 16upx;
		padding: 40upx 30upx;
		
		.title{
			font-size: 34upx;
			font-family: PingFang SC;
			font-weight: bold;
			color: #222222;
			line-height: 1;
		}
		.tools-list{
			margin-top: 50upx;
			display: flex;
			flex-wrap: wrap;
			width: 100%;
			.item{
				box-sizing: border-box;
				width: 25%;
				display: flex;
				flex-direction: column;
				align-items: center;
				justify-content: center;
				margin-bottom: 50upx;
				position: relative;
				image{
					width: 50upx;
					height: 50upx;
				}
				.text{
					font-size: 24upx;
					font-family: PingFang SC;
					font-weight: 500;
					color: #111111;
					line-height: 1;
					margin-top: 10upx;
				}
				.contact-btn{
					display: inline-block;
					position: absolute;
					top: 0;
					left: 0;
					width: 100%;
					height: 100%;
					opacity: 0;
				}
			}
		}
	}
</style>
