<template>
	<view class="index-page">
		<view class="index-navbar">
			<view style="position: relative;height: 352rpx;">
				<image class="index-bg" src="../../static/images/index-header.png" mode=""></image>
				<u-navbar bgColor='rgba(0,0,0,0)'>
					<view id="height" class="index-header  u-flex u-row-between" slot="left"
						style="position: relative;">
						<!-- 						<view class="u-nav-slot u-flex index-tabs u-col-center">
							<view class="" style="margin-right: 48rpx;">
								<text>职位</text>
							</view>
							<view class="">
								<text>校招</text>
							</view>
						</view> -->
						<view class="" style="margin-left: -11rpx;">
							<u-tabs
							:list="list4"
							lineWidth="28"
							lineHeight="5"
							:lineColor="`url(${require('../../static/images/juxing.png')}) 100% 100%`"
							:activeStyle="{
							    color: '#303133',
							    fontWeight: 'bold',
							}"
							:inactiveStyle="{
							    color: '#606266',
							}"
							itemStyle=" padding-right: 15px; height: 34px;"
							@click="TabsTop"
							>
							</u-tabs>
						</view>

						<view class="" style="">
							<view class="index-search u-flex" slot="center">
								<u-icon name="search" color="#444444" size="28"></u-icon>
								<input type="text" class="text1" placeholder="搜索职位" :disabled="true">
							</view>
						</view>
					</view>
				</u-navbar>
				<view class="header-down " :style="{marginTop:height+'rpx'}">
					<view class="u-flex u-row-between u-row-center">
						<view class="font">
							UX交互设计师
						</view>
						<view class="font" style="font-size: 42rpx;">
							+
						</view>
					</view>

					<view class="u-flex u-row-between" style="margin-left: -11rpx;margin-top: 14rpx;">
						<view class="down-left u-flex u-row-center" @click="showpaixu = true">
							<u-tabs :list="list1" @click="click"></u-tabs>
						</view>
						<view class="u-flex">
							<view class="right-item u-flex u-row-center" @click="opencity = true">
								<text class="text">{{city.name || '北京'}}</text>
								<u-icon name="arrow-down-fill" size="20"></u-icon>
							</view>
							<view class="right-item u-flex u-row-center" @click="openshaixuan">
								<text class="text">筛选</text>
								<u-icon name="arrow-down-fill" size="20"></u-icon>
							</view>
						</view>
					</view>
				</view>
			</view>
			<view class="" style="padding:0rpx 24rpx;background-color: #F3F3F3 ;height: 100%;">
				<view class="content">
					<view class="u-flex u-row-between">
						<view class="u-flex">
							<view class="font">平面设计师初级初级初级初级</view>
							<view class="back">急聘</view>
						</view>
						<view class="money">10-13K</view>
					</view>
					<view class="u-flex" style="margin: 16rpx 0 14rpx 0;">
						<text class="introduce">信众传媒</text>
						<text class="introduce">未融资</text>
						<text class="introduce">20-99人</text>
					</view>
					<view class="u-flex" style="margin-bottom: 24rpx;">
						<view class="tabs">
							本科
						</view>
						<view class="tabs">
							1-3年
						</view>
						<view class="tabs">
							创意
						</view>
					</view>
					<view class="u-flex u-row-between u-col-center">
						<view class=" u-flex u-col-center">
							<image src="../../static/images/nan.png" mode="" style="width: 50rpx;height: 50rpx;">
							</image>
							<text style="margin-left: 16rpx;">魏如晓·项目经理</text>
						</view>
						<view class="u-flex u-col-center">
							<view class="">北京</view>
							<view class="">朝阳区</view>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {getList} from "../../units/inquire.js"
	export default {
		data() {
			return {
				height: "",
				list1: [{
						name: "推荐"
					},
					{
						name: "附近"
					},
					{
						name: "最新"
					},
				],
				list4: [{
						name: "职位"
					},
					{
						name: "校招"
					}
				],
				page:5
			}
		},
		onLoad() {
			this.getHeight()
			this.getlist()
		},
		onReachBottom() {
			
		},
		methods: {
			getHeight() {
				const query = uni.createSelectorQuery().in(this);
				query.select('#height').boundingClientRect(data => {
					console.log(data)
					this.height = (data.height + 54) * 2
					console.log(this.height);
				}).exec();
			},
			click(item) {
				console.log('item', item);
			},
			TabsTop(item){
				console.log('item', item);
			},
			//获取职位列表
			getlist() {
				getList({
					page: this.page,
					type:""
				}).then(res => {
					console.log(res);
				})
			}
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #F3F3F3;
	}

	.index-page {

		.content {
			padding: 24rpx 20rpx;
			margin-top: 20rpx;
			background-color: #fff;
			border-radius: 16rpx;

			.font {
				font-size: 32rpx;
				font-family: PingFangSC-Medium, PingFang SC;
				font-weight: 500;
				color: #222222;
				line-height: 44rpx;
				max-width: 326rpx;
				overflow: hidden; //超出隐藏
				white-space: nowrap; //不换行，同一行展示
				text-overflow: ellipsis; //设置超出部分以省略号展示
			}

			.back {
				width: 58rpx;
				height: 32rpx;
				background: #FF5335;
				border-radius: 6rpx;
				font-size: 22rpx;
				font-family: PingFangSC-Regular, PingFang SC;
				font-weight: 400;
				color: #FFFFFF;
				line-height: 32rpx;
				text-align: center;
				margin-left: 16rpx;
			}

			.money {
				font-size: 32rpx;
				font-family: JDZhengHT-Regular, JDZhengHT;
				font-weight: 400;
				color: #0C66C2;
			}

			.introduce {
				height: 40rpx;
				font-size: 28rpx;
				font-family: PingFangSC-Regular, PingFang SC;
				font-weight: 400;
				color: #555555;
				line-height: 40rpx;
				margin-right: 16rpx;
			}

			.tabs {
				background: #F3F3F3;
				border-radius: 4rpx;
				padding: 6rpx 14rpx;
				margin-right: 16rpx;
				font-size: 24rpx;
				font-family: PingFangSC-Regular, PingFang SC;
				font-weight: 400;
				color: #5F5F5F;
				height: 34rpx;
				line-height: 34rpx;
			}
		}




		.index-item {
			// width: 702rpx;
			// background: #FFFFFF;
			// border-radius: 20rpx;
			// margin: 20rpx auto;
			// padding: 0 20rpx 24rpx 10rpx;

			.item-down {
				text:first-child {
					font-size: 22rpx;
					font-family: SFPro-Regular, SFPro;
					font-weight: 400;
					color: #666666;
				}

				text:last-child {
					font-size: 22rpx;
					font-family: PingFangSC-Regular, PingFang SC;
					font-weight: 400;
					color: #666666;
				}
			}

			.item-gongsi {
				margin-bottom: 16rpx;

				.text2 {
					font-size: 24rpx;
					font-family: SFPro-Regular, SFPro;
					font-weight: 400;
					color: #666666;
				}

				.logo {
					width: 42rpx;
					height: 42rpx;
					border-radius: 10rpx;
					margin-right: 16rpx;
				}

				.text1 {
					max-width: 192rpx;
					font-size: 24rpx;
					font-family: PingFangSC-Regular, PingFang SC;
					font-weight: 400;
					color: #444444;
					margin-right: 12rpx;
				}
			}

			.item-label {
				margin-bottom: 20rpx;

				text {
					margin-right: 16rpx;
					line-height: 46rpx;
					background: #F7F7F7;
					border-radius: 4rpx;
					padding: 0 14rpx;
					font-size: 24rpx;
					font-family: PingFangSC-Regular, PingFang SC;
					font-weight: 400;
					color: #5F5F5F;
				}
			}

			.item-top {
				height: 88rpx;

				.text1 {
					font-size: 32rpx;
					font-family: PingFangSC-Medium, PingFang SC;
					font-weight: 500;
					color: #222222;
					margin-right: 16rpx;
				}

				.text2 {
					width: 50rpx;
					line-height: 32rpx;
					background: rgba(255, 83, 53, 0.1);
					border-radius: 4rpx;
					text-align: center;
					font-size: 20rpx;
					font-family: PingFangSC-Regular, PingFang SC;
					font-weight: 400;
					color: #FF5335;
					margin-right: 12rpx;
				}

				.text3 {
					width: 90rpx;
					line-height: 32rpx;
					background: #FFF2E8;
					border-radius: 4rpx;
					text-align: center;
					font-size: 20rpx;
					font-family: PingFangSC-Regular, PingFang SC;
					font-weight: 400;
					color: #FF8620;
					margin-right: 12rpx;
				}

				.text4 {
					line-height: 32rpx;
					background: #E6EFF8;
					border-radius: 4rpx;
					padding: 0 4rpx;
					text-align: center;
					font-size: 20rpx;
					font-family: SFPro-Regular, SFPro;
					font-weight: 400;
					color: #0C66C2;
				}

				.text5 {
					font-size: 32rpx;
					font-family: JDZhengHT-Regular, JDZhengHT;
					font-weight: 400;
					color: #0C66C2;
				}
			}
		}

		.index-navbar {
			position: sticky;
			top: 0;
			left: 0;
			width: 750rpx;
			z-index: 100;





			.header-down {
				height: 92rpx;
				padding: 20rpx 24rpx;
				box-sizing: border-box;

				.font {
					font-size: 40rpx;
					font-family: PingFangSC-Medium, PingFang SC;
					font-weight: 500;
					color: #222222;
				}

				.right-item {
					padding: 0 16rpx;
					height: 52rpx;
					background: #F3F3F3;
					border-radius: 4rpx;
					margin-left: 20rpx;

					.text {
						margin-right: 4rpx;
						font-size: 26rpx;
						font-family: PingFangSC-Regular, PingFang SC;
						font-weight: 400;
						color: #666666;
					}
				}

				.down-left {
					.text {
						margin-right: 4rpx;
						font-size: 26rpx;
						font-family: PingFangSC-Medium, PingFang SC;
						font-weight: 500;
						color: #222222;
					}
				}
			}

			.index-bg {
				position: absolute;
				top: 0;
				left: 0;
				z-index: -1;
				width: 750rpx;
				height: 352rpx;
			}
		}

		.index-header {
			flex: 1;
			padding: 0 32rpx;
			height: 50rpx;

			.index-search {
				width: 200rpx;
				height: 64rpx;
				background: #FFFFFF;
				border-radius: 20rpx;
				padding: 0 28rpx;

				.text1 {
					font-size: 24rpx;
					font-family: PingFangSC-Regular, PingFang SC;
					font-weight: 400;
					color: #999999;
					margin-left: 16rpx;
				}
			}

			.index-tabs {
				text:first-child {
					font-size: 36rpx;
					font-family: PingFangSC-Medium, PingFang SC;
					font-weight: 500;
					color: #222222;
				}

				text:last-child {
					width: 76rpx;
					height: 12rpx;
					background: linear-gradient(270deg, #208EFF 0%, rgba(28, 159, 227, 0) 100%);
					margin-top: -20rpx;
					border-radius: 100rpx;
				}
			}
		}
	}

	::v-deep .u-navbar__content__left {
		padding: 0 !important;
	}
</style>