<style lang="scss">
	.container{
		min-height:100%;
		background:#F6F6F6;
		&>.head{
			width:100%;
			padding-top:var(--status-bar-height);
			background:#10C176;
			margin-bottom:-190rpx;
		}
		&>.card{
			position:relative;
			min-height:900rpx;
			justify-content: flex-start;
			z-index: 10;
			margin:0;
			display: flex;
			flex-direction: column;
			.u-transition{
				margin:-120rpx auto 10rpx auto;
			}
			.name{
				font-weight: bold;
				font-size:32rpx;
				margin:0 auto;
			}
			.phone{
				font-size:26rpx;
				color:#333;
				margin: 10rpx auto 30rpx auto;
			}
			.item{
				height:90rpx;
				display:flex;
				align-items: center;
				border-bottom:2rpx solid rgba(216, 216, 216, 0.2);
				text{
					&:first-child{
						color:#10C176;
						font-size:36rpx;
						margin-right:32rpx;
					}
					&:nth-child(3){
						margin-left:auto;
					}
				}
			}
		}
	}
</style>
<template>
	<view class="container">
		<image class="head" src="@/static/my_head.png" mode="aspectFit"/>
		<view class="card">
			<u-image radius="50%" width="140rpx" height="140rpx" :src="`${host('imgUrl')}/${$store.getters['userInfo'].avatar}`" mode="aspectFill">
				<image slot="error" style="width:140rpx;height:140rpx;border-radius:50%;" src="@/static/userHeader.png" mode="aspectFill"/>
			</u-image>
			<text class="name">{{$store.getters.userInfo.realname}}</text>
			<text class="phone">{{$store.getters.userInfo.phone}}</text>
			
			<view class="item" @click="$u.route({url:'pages/home/personalInfo'})">
				<text class="plant-gerenzhongxinwode"/> <text>个人信息</text> <text class="plant-youbian"/>
			</view>
			<view class="item" @click="$u.route({url:'pages/home/rePassword'})">
				<text class="plant-icon2"/> <text>修改密码</text> <text class="plant-youbian"/>
			</view>
			<view class="item" @click="$u.route({url:'/pages/purchase/record'})">
				<text class="plant-liulanjilu-tianchong"/> <text>采购记录</text> <text class="plant-youbian"/>
			</view>
			<view class="item" @click="$u.route({url:'/pages/stock/already'})">
				<text class="plant-kufangguanli-lingyongguihuan"/> <text>领用记录</text> <text class="plant-youbian"/>
			</view>
			<view class="item">
				<text class="plant-xitongxiaoxi"/> <text>系统消息</text> <text class="plant-youbian"/>
			</view>
			<view class="item" @click="$store.commit('outLogin')">
				<text class="plant-tuichu"/> <text>退出</text> <text class="plant-youbian"/>
			</view>
		</view>
	</view>
</template>
<script>
import {host} from '@/common/request'
	export default{
		data(){
			return{
				host,
			}
		},
		onLoad(options){
			console.log('--my-----onLoad-----------')
			this.$nextTick(()=>{
				if(options.toPage){
					uni.navigateTo({url:`/pages/purchase/${options.toPage}`})
				}
			})
		},
		onShow(){
			console.log('------my-----onShow---------------')
			// uni.setTabBarBadge({ index:2, text:'' })//底部标签显示数字
			uni.hideTabBarRedDot({index:2})
		},
		methods:{
			
		}
	}
</script>