<template>
	<view  :style="{paddingBottom:flag?'0':'0rpx',backgroundColor: '#F8F8F8',paddingTop: '2rpx'}">
		<view :class="tabStyle?'workList workList-two':'workList'" style="" v-if="logoding" v-for="(item,index) in inviteList" @click="goNvigeing(item)">
			<view class="work-title" :style="{border: tabStyle?'none':'1upx solid #EEEEEE;'}">
				<view class="dis-il-block work-name">
					{{item.title}}
				</view>
				<view class="dis-il-block wprk-top" v-if="item.is_top != 0">
					顶
				</view>
				<view class="wprk-pay">
					{{item.salary}}
				</view>
			</view>
			<view class="wprk-tag">
				<view class="tags" v-if="item.welfare_list" :style="{height: opentags[index]?'auto':'60rpx'}">
					<view class="tag-item" v-for="(items,indexs) in item.welfare_list" :key="indexs">
						{{items}}
					</view>
					
					<!-- <view class="tag-item">
						爱睡觉的痘豆豆
					</view> -->
				</view>
				<view class="region" v-if="false" @click="isopen(item,index)">
					更多<text style="font-size: 24upx;" :class="opentags[index]?'iconfont icon-fold':'iconfont icon-unfold'"></text>
				</view>
			</view>
			<view class="dis-flex company-profile" v-if="item.release">
				<view style="flex: 0.15;">
					<image class="title-img" :src="item.release.logo" mode=""></image>
				</view>
				<view style="flex: 0.55;padding-left: 10upx;">
					<view>
						<view class="dis-il-block company-name">
							{{item.release.name}}
						</view>
						<view class="dis-il-block company-authentication" v-if="item.release.is_authentication != 0">
							已认证
						</view>
					</view>
					<view class="company-tag" v-if="item.release.nature">
						{{item.release.nature}} · {{item.release.scale}} · {{item.release.industry}}
					</view>
					<view class="company-tag" v-else>
						个人招聘
					</view>
				</view>
				<view style="flex: 0.3;" class="release-data">
					<view >
						<text class="t-r">{{item.region}}</text>
					</view>
					<text :style="{color: item.submit_status_text?'#7BC88B':'#999999'}">{{ item.submit_status_text || item.release_time}}</text>
					
				</view>
			</view>
		</view>
	</view>
	
</template>

<script>
	import App from '@/common/js/app.js';
	export default{
		data(){
			return{
				opentags:{},
				logoding:true
			}
		},
		props:{
			inviteList:{
				type:Array,
				default:null
			},
			tabStyle:{
				type:Boolean,
				default:false
			},
			flag:{
				type:Boolean,
				default:true
			}
		},
		methods:{
			goNvigeing(item){
				App.navigationTo({
					url: "pages/subPages2/hirePlatform/recruitmentDetails/recruitmentDetails?id=" + item.id
				});
			},
			isopen(item,index){
				if(!this.opentags[index]){
					this.opentags[index] = true;
				}else{
					this.opentags[index] = false;
				}
				this.logoding = !this.logoding;
				this.logoding = !this.logoding;
				console.log(this.opentags);
				// debugger
				// this.inviteList[index].open = !this.inviteList[index].open;
				// this.$emit('isopen',index);
			}
		}
	}
</script>

<style lang="scss" scoped>
	.workList-two{
		margin: 30upx!important;
		border-radius: 20upx!important;
		background-color: #FFFFFF!important;
	}
	.workList{
		padding: 0upx 30upx 0upx;
		background-color: #FFFFFF;
		.work-title{
			border-top: 1upx solid #EEEEEE;
			padding-top: 30upx;
			.work-name{
				font-size: 32upx;
				font-family: PingFang SC;
				font-weight: bold;
				color: #333333;
			}
			.wprk-top{
				background: #F1C426;
				border-radius: 4upx;
				font-size: 22upx;
				font-family: PingFang SC;
				font-weight: 500;
				padding: 2upx 5upx;
				margin-left: 20upx;
				color: #FFFFFF;
			}
			.wprk-pay{
				float: right;
				font-size: 32upx;
				font-family: DINPro;
				font-weight: 500;
				color: #FF4444;
				line-height: 52upx;
			}
		}
		.wprk-tag{
			padding-top: 30upx;
			display: flex;
			margin: 0;
			width: 100%;
			.tags{
				flex: 0.8;
				overflow: hidden;
				.tag-item{
					background: #F4F4F4;
					border-radius: 4upx;
					font-size: 24upx;
					font-family: PingFang SC;
					font-weight: 400;
					color: #666666;
					padding: 12upx 24upx;
					display: inline-block;
					margin-right: 20upx;
					margin-bottom: 20upx;
				}
			}
			.region{
				flex: 0.2;
				font-size: 26upx;
				font-family: PingFang SC;
				font-weight: 500;
				color: #999999;
				text-align: right;
				line-height: 50upx;
			}
		}
		.company-profile{
			padding: 40upx 0 0upx;
			.title-img{
				width: 85upx;
				height: 85upx;
				background: #F77996;
				border-radius: 10upx;
			}
			.company-name{
				font-size: 24upx;
				font-family: PingFang SC;
				font-weight: 500;
				color: #333333;
				vertical-align: top;
			}
			.company-authentication{
				font-size: 20upx;
				font-family: PingFang SC;
				font-weight: 500;
				color: #FFFFFF;
				background: #3388FF;
				border-radius: 4upx;
				padding: 2upx 6upx;
				margin-left: 20upx;
				vertical-align: top;
			}
			.company-tag{
				padding-top: 4upx;
				font-size: 26upx;
				font-family: PingFang SC;
				font-weight: 400;
				color: #999999;
			}
			.release-data{
				font-size: 26upx;
				font-family: PingFang SC;
				font-weight: 500;
				color: #999999;
				line-height: 46upx;
				margin-bottom: 50upx;
				text-align: right;
			}
		}
	}
</style>
