<template>
	<view class="v-page">
		<view class="v-card contain">
			<view class="v-card-box">
				<uni-list>
					<uni-list-item showExtraIcon="true" title="昵称" :rightText="user.nickName" />
					<uni-list-item showExtraIcon="true" title="手机号码" :rightText="user.phonenumber" />
					<uni-list-item showExtraIcon="true" title="邮箱" :rightText="user.email" />
					<uni-list-item showExtraIcon="true" title="岗位" :rightText="postGroup" />
					<uni-list-item showExtraIcon="true" title="角色" :rightText="roleGroup" />
					<uni-list-item showExtraIcon="true" title="创建日期" :rightText="user.createTime" />
				</uni-list>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		getUserProfile
	} from "@/api/system/user"

	export default {
		data() {
			return {
				user: {},
				roleGroup: "",
				postGroup: ""
			}
		},
		onLoad() {
			this.getUser()
		},
		methods: {
			getUser() {
				getUserProfile().then(response => {
					this.user = response.data
					this.roleGroup = response.roleGroup
					this.postGroup = response.postGroup
				})
			}
		}
	}
</script>

<style lang="scss">
</style>