<template >
	<view class="jp-work-item"   @click="ckBtn">
		<view class="jp-work-name">
			<h3>{{item.title}}</h3>
			<span>{{item.wageTypeN}}</span>
		</view>
		<view class="jp-work-tag" v-if="item.requirements">
			<u-tag  v-for="(text,index) in spiltItem(item.requirements)" :key="index"  :text="text" mode="dark" bg-color="#f1f1f7" color="#999" size="mini"/>
			 
		</view>
		<view class="jp-work-info">
			<view class="u-flex">
				<u-avatar :src="item.logo" size="40"></u-avatar>
				<p>{{item.name}} {{item.scaleName}}</p>
			</view>
			<p>{{item.cityName}}</p>
		</view>
	</view>	
</template>

<script>
  	
 	
 	export default {
		name:"Common",
		props:{
			item: {
				require: true,
				default: {},
			},
			ck:{
				require: false,
				default:true
			},
			obj:{
				require: false,
				default:null
			}
		},
		data() {
			return {
				 
			};
			
		},methods:{
			ckBtn(){
				if(this.ck){
					this.gotoUrl('pages/job/index/recruitInfo/recruitInfo?id='+this.item.id)
				}else{
					this.$emit("ckItem",this.item.id)
				}
			},
			 spiltItem(text){
			 	if(text){
			 		return text.split(",")
			 		
			 	}else{
			 		return []
			 	}
			 },
			  
		},mounted(){
			 if(this.obj){
				 var sz=this.obj.split(",");
				 for(var i in sz ){
					 var string1 = sz[i].split("=")[0];
					 var string2 = sz[i].split("=")[1];
					 this.item[string2]=this.item[string1];
					 
				 }
				this.$forceUpdate()
			 }
				
		},destroyed(){
			
		}
		
	}
</script>

<style scoped lang="scss">
	.jp-work-item{
		padding:30rpx;
		background-color: #fff;
		border-bottom: 1px solid #f7f7f7;
		&:last-child{
			border-bottom:none;
		}
		.jp-work-name{
			display: flex;
			justify-content: space-between;
			align-items: center;
			h3{
				font-size: 36rpx;
			}
			span{
				font-size: 32rpx;
				color:#FF1700
			}
		}
		.jp-work-tag{
			display: flex;
			align-items: center;
			margin-top: 10rpx;
			*{
				margin-right: 10rpx;
			}
		}
		.jp-work-info{
			display: flex;
			justify-content: space-between;
			align-items: center;
			margin-top: 10rpx;
			p{
				color:#999;
				font-size: 24rpx;
				margin-left: 10rpx;
			}
		}
	}
</style>
