<template>
	<view class="intention">
		<view class="title">管理求职意向</view>
		<view class="tips">我们会根据你的求职意向在首页展示合适的职位</view>
		<!-- <u-cell title="求职状态" value="在职-看看机会" :border="false" isLink/> -->
		<view class="module" v-for="(item,index) in list">
			<view class="f_b">
				<view class="name">{{ item.industryName }}</view>
				<u-icon name="edit-pen" size="22" color="#3686DC" @click="edit(item)"/>
			</view>
			<view class="f_s">
				{{ item.salaryMin }} - {{item.salaryMax}}
				<view style="margin: 0 20rpx;">|</view>
				{{ item.city }}
			</view>
		</view>
		<view class="footer">
			<u-button @click="add" type="primary" shape="circle">新增</u-button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				id: '',
				list: []
			}
		},
		onLoad(o) {
			this.id = o.id
		},
		onShow() {
			this.$http.get('/objective/l', {personId: this.id}).then(res => {
				this.list = res.data.list
			})
		},
		methods: {
			add(){
				uni.navigateTo({
					url: `/pages/user/resume/addIntention?id=${this.id}`
				})
			},
			edit(row) {
				uni.navigateTo({
					url: `/pages/user/resume/addIntention?id=${this.id}&objectiveId=${row.id}`
				})
			}
		}
	}
</script>

<style lang="scss">
	.intention{
		height: 100%;
		background-color: #fff;
		padding: 30rpx 0;
		.title{
			font-size: 38rpx;
			font-weight: bold;
			line-height: 1;
			padding: 4rpx 30rpx;
		}
		.tips{
			font-size: 28rpx;
			color: #666;
			padding: 6rpx 30rpx;
		}
		.footer{
			padding: 20rpx 30px calc(env(safe-area-inset-bottom) + 20rpx);
			background: #fff;
			width: 100%;
			position: fixed;
			bottom: 0;
			left: 0;
			border: none;
			box-sizing: border-box;
		}
		.module{
			font-size: 28rpx;
			padding: 30rpx;
			>view{
				margin-bottom: 20rpx;
			}
			.name{
				font-size: 38rpx;
			}
			.time{
				margin: 20rpx 0;
				font-size: 28rpx;
				color: #777;
			}
			.minTitle{
				font-size: 36rpx;
				line-height: 1;
			}
			.tag{
				margin: 16rpx 16rpx 0 0;
			}
			.desc{
				color: #555;
				line-height: 1.7;
			}
		}
	}
</style>
