<template>
	<view class="client-my-page">
		<view class="my-head-box">
			<img class="head-img-box" :src="myInfoData.userImg">
			<view class="head-content-box">
				<text>{{myInfoData.userName}}</text>
				<view class="idcard-row-box">
					<icon class="idcard-icon"></icon>
					<text class="idcard-text" >{{myInfoData.idcard}}</text>
				</view>
			</view>
		</view>
		
		<view class="my-num-box">
			<view class="num-item-box">
				<uni-badge class="uni-badge-left-margin" text="1" />
				<icon></icon>
				<text></text>
			</view>
			<view class="num-item-box">
				<icon></icon>
				<text></text>
			</view>
			<view class="num-item-box">
				<icon></icon>
				<text></text>
			</view>
		</view>
		
	</view>
</template>

<script setup>
	import {onLoad} from '@dcloudio/uni-app';
	import {getMineUser,getMineInfo} from '@/api/my.js'
	import {reactive,ref} from "vue";
	let myInfoData = reactive({
		userImg: '',
		userName: '',
		idcard: '',
		kaoshiCount: '',
		kechengCount: '',
		lianxiCount: '',
	});
	function getMyInit() {
		getUserInfo();
		getNumInfo();
	}
	function getUserInfo(){
		getMineUser({}).then(res => {
			myInfoData.userImg= res.data.icon;
			myInfoData.userName = res.data.userName;
			myInfoData.idcard = res.data.idcard;
		})
	}
	function getNumInfo(){
		getMineInfo({}).then(res => {
			myInfoData.kaoshiCount = res.data.kaoshiCount;
			myInfoData.kechengCount = res.data.kechengCount;
			myInfoData.lianxiCount = res.data.lianxiCount;
		})
	}
	onLoad(() => {
		getMyInit()
	})
</script>

<style>
</style>