<template>
	<view class="myIndex">
		<!-- 个人信息 -->
		<view class="myIndex_header">
			<view class="myIndex_header_icon">
				<image src="../../static/header.png" class="header_icon"></image>
			</view>
			<view class="myIndex_header_info">
				<view class="myIndex_header_name">
					<view class="myIndex_header_name_text">{{pageData.userName}}</view>
					<!-- <image :src="eyeIcon.nowIcon" class="myIndex_header_eyeIcon"></image> -->
				</view>
				<view class="myIndex_header_address">{{pageData.address}}</view>
			</view>
		</view>
		<!-- 菜单列表 -->
		<view>
			<uni-list>
				<uni-list-item thumb="/static/user_info.png" showArrow title="个人信息"/>
				<uni-list-item thumb="/static/about.png" showArrow title="关于我们"/>
			</uni-list>
		</view>
	</view>
</template>

<script setup>
import http from '@/utils/request';
import { ref,reactive } from "vue";
import {onLoad,onShow,onUnload,onPullDownRefresh} from "@dcloudio/uni-app";
	
const pageData=reactive({
	userName:'',
	address:''
})	

const eyeIcon=reactive({
	nowIcon:'',
	showIcon:'/static/whiteDisplay.png',
	hideIcon:'/static/whiteHide.png',
})

// 获取用户信息
const getUserInfo=()=>{
	try{
		const value=uni.getStorageSync("userInfo")
		console.log(value);
		pageData.userName = value.nickname
		pageData.address=value.deptName
	}catch(e){
		//TODO handle the exception
	}
}

onShow(()=>{
	getUserInfo()
	eyeIcon.nowIcon=eyeIcon.hideIcon
})

</script>

<style lang="scss" scoped>
@import './index.scss'
</style>
