<!-- 自我评价和求职意向 -->
<template>
	<view class="evaluate-intention">
		
		<!-- 导航栏 -->
		<u-navbar class="evaluate-intention-bar" back-text="" title="">
			<view class="evaluate-intention-bar-right" slot="right" @click="jumpPage('/pages/index/index')">跳过</view>
		</u-navbar>
		
		<view class="evaluate-intention-explain">
			<view>继续完善加分项</view>
			<view>据平台数据显示，完善后，被HR查看几率更高</view>
		</view>
		
		<!-- tab页 -->
		<view class="evaluate-intention-tabs">
			<view
				class="evaluate-intention-tabs-item"
				v-for="(item, index) in list"
				:key="index"
				:class="{'evaluate-intention-tabs-active': tabCur === index}"
				@click="tabCur = index"
			>
				{{ item.name }}
			</view>
		</view>
		
		<!-- 工作意向 -->
		<view class="evaluate-intention-intention" v-if="tabCur === 0">
			<u-form
				:model="intentionForm"
				ref="intentionForm"
				label-position="top"
			>
				<u-form-item label="工作城市">
					<u-input v-model="intentionForm.city" type="select" @click="cityShow = true" placeholder="请选择工作城市"/>
					<u-select v-model="cityShow" :list="cityList"></u-select>
				</u-form-item>
				<u-form-item label="期望职位">
					<u-input v-model="intentionForm.position" type="select" @click="positionShow = true" placeholder="请选择期望职位"/>
					<u-select v-model="positionShow" :list="positionList"></u-select>
				</u-form-item>
				<u-form-item label="期望行业">
					<u-input v-model="intentionForm.industry" type="select" @click="industryShow = true" placeholder="请选择期望行业"/>
					<u-select v-model="industryShow" :list="industryList"></u-select>
				</u-form-item>
				<u-form-item label="薪资要求">
					<u-input v-model="intentionForm.salary" type="select" @click="salaryShow = true" placeholder="请选择薪资要求"/>
					<u-select v-model="salaryShow" :list="salaryList"></u-select>
				</u-form-item>
			</u-form>
			<view class="evaluate-intention-intention-submit">
				<u-button type="primary" class="btn">开始找工作</u-button>
			</view>
			<view class="evaluate-intention-intention-explain">去完善项目经历，让更多HR看到你</view>
		</view>
		
		<!-- 自我评价 -->
		<view class="evaluate-intention-evaluate" v-else-if="tabCur === 1">
			<u-form
				:model="evaluateForm"
				ref="evaluateForm"
				label-position="top"
			>
				<u-form-item label="自我评价">
					<u-input
						v-model="evaluateForm.content"
						type="textarea"
						:border="true"
						:height="150"
						:auto-height="true"
					/>
				</u-form-item>
			</u-form>
			<view class="evaluate-intention-evaluate-submit">
				<u-button type="primary" class="btn">提交</u-button>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [
					{
						name: '求职意向'
					},
					{
						name: '自我评价'
					}
				],
				tabCur: 0,
				intentionForm: {
					city: '贵阳',
					position: '',
					industry: '不限',
					salary: ''
				},
				// 城市下拉显示
				cityShow: false,
				// 城市列表
				cityList: [
					{
						value: 1,
						label: '贵阳'
					}
				],
				// 职位下拉显示
				positionShow: false,
				// 职位列表
				positionList: [
					{
						value: 1,
						label: '保安'
					}
				],
				// 行业下拉显示
				industryShow: false,
				// 行业列表
				industryList: [
					{
						value: 1,
						label: '不限'
					}
				],
				// 薪资下拉显示
				salaryShow: false,
				// 薪资列表
				salaryList: [
					{
						value: 1,
						label: '3000 ~ 4000'
					},
					{
						value: 2,
						label: '4000 ~ 5000'
					}
				],
				// 自我评价
				evaluateForm: {
					content: ''
				}
			}
		},
		onLoad(page) {
			if (page.tabCur) {
				this.tabCur = Number(page.tabCur)
			}
		},
		methods: {
			/**
			 * 跳转到指定页面
			 */
			jumpPage(url) {
				console.log(url)
				this.$u.route(url)
			}
		}
	}
</script>

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