<template>
	<view class="resume">
		<view class="message _error" v-if="!item.name">
			<text class="icon">&#xec72;</text>
			<text>需要完善简历才能找工作。</text>
		</view>
		<view class="row">
			<!--个人信息-->
			<view class="top" @click="go('/pages/user/resume/edit?item=' + JSON.stringify(item))">
				<view class="sm6">
					<view class="name">
						<text>{{ item.name ? item.name : '姓名' }}</text>
					</view>
					<view class="item">年龄：{{ item.age || '' }}</view>
					<view class="item">性别：{{ item.sex || '' }}</view>
					<view class="item">手机号码：{{ item.phone || '' }}</view>
					<view class="item">电子邮箱：{{ item.email || '' }}</view>
				</view>
				<image :src="item.avatar ? ip + item.avatar : '../../../static/ls.jpg'" mode="widthFix" class="tx" v-if="item.avatar"></image>
			</view>
		</view>
		<!--求职期望-->
		<view class="row">
			<view class="label">
				<text class="title">求职期望</text>
			</view>
			<view class="item">意向工作：{{ item.positionName || '' }}</view>
		</view>
		<button class="btn" @click="go('/pages/user/resume/edit?item=' + JSON.stringify(item))">编辑</button>
	</view>
</template>

<script>
export default {
	data() {
		return {
			ip: this.http.ip,
			item: {}
		};
	},
	onLoad() {
		uni.$on('resume', (res) => {
			setTimeout(() => {
				this.getData();
			}, 500);
		});
		this.getData();
	},
	methods: {
		getData() {
			this.http.request({
				url: '/app/resume/index',
				success: (res) => {
					this.item = res.data.data;
				}
			});
		},
		go(url) {
			uni.navigateTo({ url: url });
		}
	}
};
</script>
<style lang="scss"></style>
