<template>
	<view class="userInfo">
		<headers :showBack="true">
			<view class="headerName">
				个人中心
			</view>
		</headers>
		<view class="userBox">
			<image class="userImg" src="@/static/userImg.png"></image>
			<text v-if="uid">{{userInfo.realName}}</text>
			<text v-else>{{userInfo.account}}</text>
		</view>
		<view class="userInfo-boxs">
			<view class="userInfo-box">
				<view>账号名称</view>
				<view>{{uid ? userInfo.realName : userInfo.account}}</view>
			</view>
			<view class="userInfo-box">
				<view>电子邮箱</view>
				<view>{{userInfo.personMail ? userInfo.personMail : '暂无邮箱'}}</view>
			</view>
			<view class="userInfo-box" @click="goChangePassword()">
				<view>修改密码</view>
				<view><uni-icons2 class="arrowright" type="arrowright" size="20"></uni-icons2></view>
			</view>
		</view>
	</view>
</template>

<script>
	import headers from '../../../components/headers/headers.vue'
	export default {
		components: {
			headers
		},
		data() {
			return {
				userInfo:{},
				ui:"",
			}
		},
		onLoad() {
			this.uid = uni.getStorageSync('UID');
			this.userInfo = JSON.parse(uni.getStorageSync('userInfo'));
			console.log(this.userInfo);
		},
		methods: {
			goChangePassword() {
				console.log(11);
				uni.navigateTo({
					url: '/pages/my/changePassword/changePassword',
				})
			},
		}
	}
</script>

<style scoped>
	.userInfo{
		background-color: #F4F5FE;
		height: 100vh;
	}

	.userBox {
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
		padding: 80rpx 40rpx;
		font-size: 40rpx;
		background-color: white;
	}
	
	.userImg {
		width: 100rpx;
		height: 100rpx;
		border-radius: 50%;
		/* margin-right: 10px; */
	}
	
	.userInfo-boxs {
		display: flex;
		flex-direction: column;
		margin-top: 20rpx;
		background-color: white;
	}
	
	.userInfo-box {
		height:116rpx;
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 0 30rpx;
	}
	
	.userInfo-boxs>.userInfo-box:nth-child(:last-child) {
		border-bottom: 2rpx solid #F4F5FE;
	}
</style>
