<template>
	<view>
		<!-- 头部 -->
		<view class="cu-card flex bg-white">
			<view class="flex flex-sub align-center padding-xl">
				<view class="round xl cu-avatar portrait">
					<image class="xl cu-avatar" :src="userInfo.avatarUrl"></image>
				</view>
				<view class="flex-sub padding-left">
					<view class="text-xl">{{ userInfo.nickName }}</view>
					<view class="text-df padding-top-xs">{{ userInfo.classes }}</view>
				</view>
				
				<!-- <image class="healthy-code" :src="healthCode"></image> -->
				<image class="healthy-code" :src="healthCode"></image>
			</view>
		</view>
		<!-- 列表 -->
		<view class="bg-white margin-top">
			<view class="cu-list menu margin-lr">
				<view class="cu-item" hover-class="cc-active" @tap="openPage('/pages/basic-info/basic-info')">
					<text class="text-xl">个人信息</text>
					<view class="iconfont icon-right more"></view>
				</view>
				<view class="cu-item" hover-class="cc-active" @tap="openPage('/pages/my-code/my-code')">
					<text class="text-xl">我的健康打卡</text>
					<view class="iconfont icon-right more"></view>
				</view>
				<view class="cu-item" hover-class="cc-active" @tap="openPage('/pages/my-trips/my-trips')">
					<text class="text-xl">我的行程</text>
					<view class="iconfont icon-right more"></view>
				</view>
				<view class="cu-item" hover-class="cc-active" @tap="openPage('/pages/my-signs/my-signs')">
					<text class="text-xl">我的校园打卡</text>
					<view class="iconfont icon-right more"></view>
				</view>
			</view>
		</view>
	</view>

</template>

<script>
	import { mapState } from 'vuex';
	export default {
		name: 'Mine',
		data() {
			return {
				userInfo: {
					avatarUrl: '../../../static/head-portrait.jpg',
					nickName: '丁菲菲',
					classes: '计算机19级软工二班',
					healthyCodeColor: '#11A20D',
				},
			};
		},
		computed: mapState('user', ['healthCode']),
	};
</script>

<style lang="scss" scoped>
	.portrait {
		overflow: hidden;
	}

	.healthy-code {
		width: 70rpx;
		height: 70rpx;
	}

	.more {
		font-size: 18px;
		color: $grey;
	}
</style>
