<template>
	<view class="content">
		<view class="content1 flex-all-center relative">
			<view class="user">
				<image :src="userInfo.head" mode="widthFix" class="img"></image>
				<view class="name">
					{{userInfo.nickname}}
				</view>
			</view>
			<view class="position">
				<u-icon name="share-square" color="#2979ff" size="28"></u-icon>
				<u-icon name="grid-fill" color="#2979ff" size="28"></u-icon>
			</view>
		</view>
		<view class="content2">
			<view class="row" v-for="item in menuList" @click="menuClick(item.type)">
				<button class="left" v-if='item.type=="contactCustomer"' open-type='contact'>{{item.name}}</button>
					<span class="left" v-else>{{item.name}}</span>
				<span class="right">></span>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				userInfo:{},
				menuList:[
					{
					name:"我的名片",
					type:'myInfo'
				},
				{
					name:"我的主页",
					type:'myHome'
				},
				{
					name:"名片分类",
					type:"cardType"
				},
				{
					name:"我的证件",
					type:"myCard"
				},
				{
					name:"帮助说明",
					type:"help"
				},
				{
					name:"联系客服",
					type:"contactCustomer"
				},
				{
					name:"设置",
					type:'set'
				},
				]
			};
		},
		onShow() {
			this.userInfo = uni.getStorageSync("userInfo")
			console.log(this.userInfo)
		},
		methods:{
			menuClick(typeName){
				let _url = '/pages/mySet/'+typeName
				console.log(_url)
				uni.navigateTo({
					url:_url
				})
			}
		}
	
	}
</script>

<style lang="scss" scoped>
	.content1{
		
		.img{
			width: 100rpx;
			border-radius: 50%;
		}
	}
</style>
