<template>
	<view style="padding: 10px;">
		<view class="item">
			<view class="form_group hr">
				<view class="lable l">微信头像</view>
				<view class="gg"><image :src="item.avatarUrl" class="header"></image></view>
			</view>
			<view class="form_group hr">
				<view class="lable">微信昵称</view>
				<view class="gg"><text v-text="item.nickName"></text></view>
			</view>
			<view class="form_group">
				<view class="lable">注册时间</view>
				<view class="gg"><text v-text="item.registerTime"></text></view>
			</view>
		</view>
		<button class="btn" @click="exit()">退出登录</button>
	</view>
</template>

<script>
export default {
	data() {
		return {
			item: {}
		};
	},
	onLoad() {
		this.item = this.$getUser();
	},
	methods: {
		exit() {
			uni.showModal({
				title: '提示',
				content: '确定退出登录?',
				success: res => {
					if (res.confirm) {
						uni.removeStorageSync('user');
						uni.navigateBack();
					}
				}
			});
		}
	}
};
</script>

<style lang="scss">
.item {
	background-color: white;
	padding: 10px;
	border-radius: 5px;
	box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
}
.form_group {
	.lable {
		flex: 0.3;
	}
}
.l {
	line-height: 56px;
}
.gg {
	text-align: right;
	color: #868686;
	flex: 1;
}
.header {
	width: 50px;
	height: 50px;
	border-radius: 50%;
}
button {
	margin-top: 30px;
}
</style>
