<template>
	<div class="user">
		<u-cell title="我的简历" isLink @click="toResume"/>
		<u-cell title="投递记录" isLink @click="toDeliverLog"/>
		<u-cell title="收藏记录" isLink @click="toCollectLog"/>
		<u-cell title="清空缓存" isLink @click="clean"/>
		<LoginOpen v-if="loginShow" @close="loginShow = false"/>
	</div>
</template>
<script>
export default {
	data() {
		return {
			loginShow: false
		};
	},
	methods: {
		toResume() {
			const token = uni.getStorageSync('jy-recruit-token');
			if (token) {
				uni.navigateTo({
					url: '/pages/user/resume/index'
				})
			} else {
				this.loginShow = true
			}
		},
		toDeliverLog() {
			const token = uni.getStorageSync('jy-recruit-token');
			if (token) {
				uni.navigateTo({
					url: '/pages/user/deliverLog'
				})
			} else {
				this.loginShow = true
			}
		},
		toCollectLog() {
			const token = uni.getStorageSync('jy-recruit-token');
			if (token) {
				uni.navigateTo({
					url: '/pages/user/collectLog'
				})
			} else {
				this.loginShow = true
			}
		},
		clean() {
			uni.clearStorageSync()
			uni.showToast({
				title: '清理成功',
				icon: 'none'
			})
		}
	}
};
</script>
<style lang="scss">
	.user{
		.u-cell{
			margin-top: 30rpx;
		}
	}
</style>