<template>
	<view>
		<u-navbar autoBack placeholder bgColor="transparent"
			style="background: linear-gradient(91deg, #FDEDEE 0%, #FFFFFF 100%);">
			<view class="flex"  slot="left">
				<u-icon name="arrow-left" size="19"></u-icon>
				<text >个人信息</text>
			</view>
		</u-navbar>
		<view class="main">
			<view class="bgMian">
				<view class="info">
					<view class="name">
						姓名
					</view>
					<view class="userName">
						<view class="value">{{userInfo.userName}}</view>
					</view>

				</view>
				<view class="info">
					<view class="name">
						性别
					</view>
					<view class="userName">
						<view class="value">
							<text v-if="userInfo.sex == 0">男</text>
							<text v-else-if="userInfo.sex == 1">女</text>
							<text v-else-if="userInfo.sex == 2">未知</text>
						</view>
					</view>
				
				</view>
				<view class="info">
					<view class="name">
						手机号码
					</view>
					<view class="userName">
						<view class="value">{{userInfo.mobile}}</view>
					</view>


				</view>
				<view class="info">
					<view class="name">
						身份证
					</view>
					<view class="userName">
						<view class="value">{{userInfo.identityCard}}</view>
					</view>

				</view>

			</view>
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				userInfo: {
					userName: '',
					sex: '',
					mobile: '',
					identityCard: '',
				}
			}
		},
		onShow() {
			const params = {
				url: '/getInfo',
				data: {},
				method: 'GET',
			}
			this.$request(params).then(res => {
				this.userInfo.userName = res.user.userName
				this.userInfo.sex = res.user.sex
				this.userInfo.identityCard = res.user.identityCard
				this.userInfo.mobile = res.user.phonenumber
			})
		},
		methods: {

		}
	}
</script>

<style lang="scss">
	page {
		background-color: #F8F4F4;
	}

	.main {
		padding:0 24rpx;
	}

	.bgMian {
		background: #FFFFFF;
		padding: 24rpx;
		margin-top: 20rpx;
		border-radius: 14rpx 14rpx 14rpx 14rpx;

		.info {
			padding: 20rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;
			;

			.userName {
				display: flex;

				.value {
					font-size: 28rpx;
					color: #999999;
				}

				.left {
					width: 8rpx;
					height: 16rpx;
					padding-left: 30rpx;
					align-items: center;
				}
			}

		}
	}
</style>