<template>
	<view class="content">
		<view class="one">

		</view>
	</view>
</template>

<script setup lang="ts">
	import {
		getCurrentInstance,
		computed,
		ref
	} from 'vue';
	//该依赖已内置不需要单独安装
	import { onPullDownRefresh, onShow } from "@dcloudio/uni-app";
	// 请求接口
	const $api = getCurrentInstance()?.appContext.config.globalProperties.$api;
	// openid
	const openid = computed(() => {
		return uni.getStorageSync('openid');
	})
	// 基本信息
	const config = ref({});
	onShow(() => {
		uni.hideHomeButton();
	})
	// 下拉刷新
	onPullDownRefresh(() => {
		uni.stopPullDownRefresh()
	})
	// 用户信息
	const initUser = async () => {
		const res = await $api(`/system/matchUser/find`, 'GET', {
			openid: openid.value
		});
		if (res.code === 200) {
			if (res.data) console.log(res.data);
		} else {
			uni.showToast({
				title: res.msg || '',
				icon: 'error',
			});
		}
	};
	// config信息
	const searchConfig = async () => {
		config.value = uni.getStorageSync('config');
	};
	initUser();
	searchConfig();
</script>
<style lang="scss" scoped>
	.content {
		display: flex;
		flex-direction: column;

		.one {
			height: 50vw;
			background-color: var(--f12Color);
		}
	}
</style>