<template>
	<view class="container">
		<!-- 头像 -->
		<view class="touxiang">
			<view class="tou">头像</view>
			<view class="avatar"><image :src=" userInfo.avatar || '../../static/error/missing-face.png' "></image></view>
		</view>
		<!-- 昵称 -->
		<view class="nicheng">
			<view class="text">昵称</view>
				<view class="username">{{ userInfo.nickname || '游客' }}</view>
		</view>
		<view class="yaoqing">
			<view class="ma">邀请码</view>
			<view class="shu">102320</view>
			</view>
			<view class="zhanghu">
				<view class="qq">账户</view>
				<view class="number">13911111111</view>
				</view>
			<view class="btn"><text>退出登录</text></view>
	</view>
</template>

<script>
import { edit } from '@/api/user'
export default {
	data () {
		return {
			userInfo: {}
		}
	},
	created () {
		this.loadUser ()
	},
	methods: {
		nav (url) {
			uni.navigateTo({
				url
			})
		},
		
		async loadUser () {
			const { data } = await edit ()
			console.log(data)
		}
	}
}
</script>

<style lang="scss">
	.container {
		background-color: #F2F3F5;
		width: 750rpx;
		height: 1334rpx;
		.touxiang {
			height: 120rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;
			background-color: #fff;
			.tou {
				font-size: 32rpx;
				font-family: PingFang SC;
				font-weight: 400;
				color: #333333;
				margin-left: 25rpx;
			}
			.avatar {
				image {
					width: 80rpx;
					height: 80rpx;
					border-radius: 50%;
					margin-right: 25rpx;
				}
			}
		}
		.nicheng {
			height: 100rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;
			background-color: #fff;
			border-bottom: 1rpx solid #F0F0F0;
			margin-top: 20rpx;
			.text {
				font-size: 32rpx;
				font-family: PingFang SC;
				font-weight: 400;
				color: #333333;
				margin-left: 25rpx;
			}
			.username {
				font-size: 28rpx;
				font-family: PingFang SC;
				font-weight: 400;
				color: #333333;
				margin-right: 25rpx;
			}
		}
		.yaoqing {
			height: 100rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;
			background-color: #fff;
			border-bottom: 1rpx solid #F0F0F0;
			.ma {
				font-size: 32rpx;
				font-family: PingFang SC;
				font-weight: 400;
				color: #333333;
				margin-left: 25rpx;
			}
			.shu {
				font-size: 28rpx;
				font-family: PingFang SC;
				font-weight: 400;
				color: #333333;
				margin-right: 25rpx;
			}
		}
		.zhanghu {
			height: 100rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;
			background-color: #fff;
			.qq {
				font-size: 32rpx;
				font-family: PingFang SC;
				font-weight: 400;
				color: #333333;
				margin-left: 25rpx;
			}
			.number {
				font-size: 28rpx;
				font-family: PingFang SC;
				font-weight: 400;
				color: #333333;
				margin-right: 25rpx;
			}
		}
		.btn {
			width: 560rpx;
			height: 80rpx;
			background: #6EAB4E;
			border-radius: 40rpx;
			margin-top: 157rpx;
			margin-left: 95rpx;
			display: flex;
			justify-content: center;
			align-items: center;
			text {
				font-size: 30rpx;
				font-family: PingFang SC;
				font-weight: 500;
				color: #FFFFFF;
			}
		}
	}
</style>