Kaynağa Gözat

岗位介绍优化

wkw 6 ay önce
ebeveyn
işleme
bfcc38ca4f

+ 1 - 1
src/components/resume/resume.vue

@@ -68,7 +68,7 @@
 					page: 1,
 					limit: 5,
 					postType: '', //求职类型
-					skillName: '', //岗位名称
+					expectedPosition: '', //岗位名称
 					screen: 1, //1推荐 2最新
 					city: this.city ? this.city : localStorage.getItem('city'), //城市
 					salaryRange: '', //薪资范围

+ 10 - 1
src/views/enterprise/enterprise.vue

@@ -314,7 +314,10 @@
 									{{item.salaryRange}}
 								</span>
 							</div>
-							<div class="postPushList-con-item-con">{{ item.positionDetails }}</div>
+							<div class="postPushList-con-item-con" style="white-space: pre-wrap;">
+								<div v-if="isHtml(item.positionDetails)" v-html="formatHtml(item.positionDetails)"></div>
+								<template v-else>{{ item.positionDetails }}</template>
+							</div>
 							<div class="postPushList-con-item-tag flex algin-center flex-wrap">
 								<div class="postPushList-con-item-tag-i">
 									{{ item.city }}-{{ item.county }}
@@ -583,6 +586,12 @@
 			}
 		},
 		methods: {
+			formatHtml(html) {
+				return html.replace(/<p>/g, '<p style="margin:0;padding:0;">')
+			},
+			isHtml(str) {
+				return /<\/?[a-z][\s\S]*>/i.test(str)
+			},
 			//删除主营业务介绍标签
 			handleClose(index) {
 				this.companyInfo.companyScope.splice(index, 1)

+ 10 - 1
src/views/myPostPush/myPostPush.vue

@@ -43,7 +43,9 @@
 								<div class="list-box-l-item-tag-i">{{ item.experience }}</div>
 							</div>
 						</div>
-						<div class="list-box-l-item-con" style="color: #000;" v-html="item.positionDetails">
+						<div class="list-box-l-item-con">
+							<div v-if="isHtml(item.positionDetails)" v-html="formatHtml(item.positionDetails)"></div>
+							<template v-else>{{ item.positionDetails }}</template>
 						</div>
 						<div class="list-box-l-item-bom flex align-center justify-between">
 							<div class="list-box-l-item-tag flex algin-center" v-if="item.welfareTag">
@@ -139,6 +141,12 @@
 			this.getlist()
 		},
 		methods: {
+			formatHtml(html) {
+				return html.replace(/<p>/g, '<p style="margin:0;padding:0;">')
+			},
+			isHtml(str) {
+				return /<\/?[a-z][\s\S]*>/i.test(str)
+			},
 			//关闭发布岗位组件的回调
 			closePostPush(data) {
 				//关闭组件
@@ -436,6 +444,7 @@
 				font-size: 13px;
 				color: #999999;
 				padding: 0 20px 10px 20px;
+				white-space: pre-wrap;
 			}
 
 			.list-box-l-item-bom {