<template>
	<view class="reminderWrapper" v-show="!authStatus">
		<view class="reminderTitle">
			<image src="/static/reminderAvatar.png" mode="aspectFit" class="reminderAvatar"></image>
			<text>{{ $t('home.reminder.title') }}</text>
		</view>
		<view class="reminderButtonWrapper">
			<DetailModal>
				<template v-slot="{ showDetailDialog }">
					<view class="reminderButton primaryButton" @click="showDetailDialog">{{ $t('home.reminder.detailBtn') }}</view>
				</template>
			</DetailModal>
			<view class="reminderButton secondaryButton" @click="toComplete">{{ $t('home.reminder.completeBtn') }}</view>
		</view>
	</view>
</template>

<script>
import DetailModal from './detailModal/index.vue';
import { getPersonalAuthStatus } from '@/services/user.ts';
export default {
	name: 'CompleteInfoReminder',
	data() {
		return {
			authStatus: true
		};
	},
	methods: {
		toComplete() {
			uni.navigateTo({ url: '/pages/user/index' });
		},
		async getAuthStatus() {
			const res = await getPersonalAuthStatus();
			if (res && res.code === 0) {
				this.authStatus = res.data.address == 1 && res.data.identity == 1 && res.data.email == 1;
			}
		}
	},
	created() {
		this.getAuthStatus();
	},
	components: {
		DetailModal
	}
};
</script>

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